commit 9c3bc64eb730c3d47cc3b725a836200efdb5ebbe Author: tzy Date: Sun May 4 10:52:11 2025 +0800 第一次 diff --git a/evo/.gitignore b/evo/.gitignore new file mode 100644 index 0000000..fd446f4 --- /dev/null +++ b/evo/.gitignore @@ -0,0 +1,43 @@ +###################################################################### +# Build Tools + +.gradle +/build/ +!gradle/wrapper/gradle-wrapper.jar + +target/ +!.mvn/wrapper/maven-wrapper.jar + +###################################################################### +# IDE + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/* +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ + +###################################################################### +# Others +*.log +*.xml.versionsBackup + +!*/build/*.java +!*/build/*.html +!*/build/*.xml \ No newline at end of file diff --git a/evo/bin/clean.bat b/evo/bin/clean.bat new file mode 100644 index 0000000..5c2a3b2 --- /dev/null +++ b/evo/bin/clean.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] · +echo. + +%~d0 +cd %~dp0 + +cd .. +call mvn clean + +pause \ No newline at end of file diff --git a/evo/bin/package.bat b/evo/bin/package.bat new file mode 100644 index 0000000..c693ec0 --- /dev/null +++ b/evo/bin/package.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] Weḅwar/jarļ +echo. + +%~d0 +cd %~dp0 + +cd .. +call mvn clean package -Dmaven.test.skip=true + +pause \ No newline at end of file diff --git a/evo/bin/run-tomcat.bat b/evo/bin/run-tomcat.bat new file mode 100644 index 0000000..598e026 --- /dev/null +++ b/evo/bin/run-tomcat.bat @@ -0,0 +1,14 @@ +@echo off +echo. +echo [Ϣ] ʹ Spring Boot Tomcat Web ̡ +echo. + +%~d0 +cd %~dp0 + +cd .. +title %cd% +set MAVEN_OPTS=%MAVEN_OPTS% -Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m +call mvn clean spring-boot:run -Dmaven.test.skip=true -U + +pause \ No newline at end of file diff --git a/evo/jacob-1.17-x64.dll b/evo/jacob-1.17-x64.dll new file mode 100644 index 0000000..0b25892 Binary files /dev/null and b/evo/jacob-1.17-x64.dll differ diff --git a/evo/jacob-1.18.jar.jar b/evo/jacob-1.18.jar.jar new file mode 100644 index 0000000..d2ab201 Binary files /dev/null and b/evo/jacob-1.18.jar.jar differ diff --git a/evo/pom.xml b/evo/pom.xml new file mode 100644 index 0000000..a47ccc9 --- /dev/null +++ b/evo/pom.xml @@ -0,0 +1,447 @@ + + + 4.0.0 + + com.ruoyi + evo + 2.3.0 + war + + evo + http://www.ruoyi.vip + 伊特管理系统 + + + org.springframework.boot + spring-boot-starter-parent + 2.1.1.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + 1.3.2 + 1.2.5 + 1.2.70 + 1.1.14 + 2.5 + 1.3.3 + 1.19 + 0.9.0 + 2.9.2 + 3.17 + 3.9.1 + 1.7 + + + + + + + + + + com.belerweb + pinyin4j + 2.5.1 + + + + + org.apache.pdfbox + fontbox + + + + + + commons-logging + commons-logging + 1.2 + + + + + com.jacob + jacob + 1.18 + system + ${project.basedir}/src/main/webapp/lib/jacob-1.18.jar.jar + + + + + javax.mail + mail + 1.4.7 + + + + + com.google.zxing + core + 3.5.0 + + + com.google.zxing + javase + 3.5.0 + + + + + org.apache.pdfbox + pdfbox + 2.0.2 + + + org.apache.pdfbox + fontbox + 2.0.2 + + + + + cn.hutool + hutool-all + 5.6.1 + + + com.google.zxing + core + 3.3.3 + + + + + org.springframework.boot + spring-boot-starter-websocket + + + + + com.itextpdf + itextpdf + 5.5.13 + + + + + org.springframework.boot + spring-boot-starter + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + org.springframework.boot + spring-boot-starter-aop + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-devtools + true + + + + + org.springframework.boot + spring-boot-starter-security + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + org.apache.commons + commons-pool2 + + + + + mysql + mysql-connector-java + runtime + + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis.spring.boot.starter.version} + + + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.spring.boot.starter.version} + + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + org.apache.commons + commons-lang3 + + + + + commons-io + commons-io + ${commons.io.version} + + + + + commons-fileupload + commons-fileupload + ${commons.fileupload.version} + + + + + eu.bitwalker + UserAgentUtils + ${bitwalker.version} + + + + + com.alibaba + fastjson + ${fastjson.version} + + + + + org.springframework + spring-context-support + + + + + io.jsonwebtoken + jjwt + ${jwt.version} + + + + + io.springfox + springfox-swagger2 + ${swagger.version} + + + io.swagger + swagger-annotations + + + io.swagger + swagger-models + + + + + + + io.swagger + swagger-annotations + 1.5.21 + + + + io.swagger + swagger-models + 1.5.21 + + + + + io.springfox + springfox-swagger-ui + ${swagger.version} + + + + + com.github.oshi + oshi-core + ${oshi.version} + + + + net.java.dev.jna + jna + + + + net.java.dev.jna + jna-platform + + + + + org.apache.poi + poi-ooxml + ${poi.version} + + + + javax.xml.bind + jaxb-api + + + + + org.apache.velocity + velocity + ${velocity.version} + + + + + org.quartz-scheduler + quartz + + + com.mchange + c3p0 + + + + + + org.lionsoul + ip2region + 1.7 + + + + + com.kingdee.bos + webapi + 8.0.6 + system + ${project.basedir}/src/main/webapp/lib/k3cloud-webapi-sdk8.0.6.jar + + + + com.google.gson + gson + 2.8.0 + system + ${project.basedir}/src/main/webapp/lib/gson-2.8.0.jar + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.5 + + + attach-artifacts + package + + attach-artifact + + + + + jacob-1.18.jar.jar + jar + + + + jacob-1.17-x64.dll + dll + x64 + + + + + + + + + + + + + public + aliyun nexus + http://maven.aliyun.com/nexus/content/groups/public/ + + true + + + + + + + public + aliyun nexus + http://maven.aliyun.com/nexus/content/groups/public/ + + true + + + false + + + + + diff --git a/evo/ry.sh b/evo/ry.sh new file mode 100644 index 0000000..706036c --- /dev/null +++ b/evo/ry.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +AppName=ruoyi.jar + +#JVM参数 +JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" +APP_HOME=`pwd` +LOG_PATH=$APP_HOME/logs/$AppName.log + +if [ "$1" = "" ]; +then + echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m" + exit 1 +fi + +if [ "$AppName" = "" ]; +then + echo -e "\033[0;31m 未输入应用名 \033[0m" + exit 1 +fi + +function start() +{ + PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` + + if [ x"$PID" != x"" ]; then + echo "$AppName is running..." + else + nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 & + echo "Start $AppName success..." + fi +} + +function stop() +{ + echo "Stop $AppName" + + PID="" + query(){ + PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` + } + + query + if [ x"$PID" != x"" ]; then + kill -TERM $PID + echo "$AppName (pid:$PID) exiting..." + while [ x"$PID" != x"" ] + do + sleep 1 + query + done + echo "$AppName exited." + else + echo "$AppName already stopped." + fi +} + +function restart() +{ + stop + sleep 2 + start +} + +function status() +{ + PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` + if [ $PID != 0 ];then + echo "$AppName is running..." + else + echo "$AppName is not running..." + fi +} + +case $1 in + start) + start;; + stop) + stop;; + restart) + restart;; + status) + status;; + *) + +esac diff --git a/evo/sql/quartz.sql b/evo/sql/quartz.sql new file mode 100644 index 0000000..55665e2 --- /dev/null +++ b/evo/sql/quartz.sql @@ -0,0 +1,170 @@ +-- ---------------------------- +-- 1、存储每一个已配置的 jobDetail 的详细信息 +-- ---------------------------- +drop table if exists QRTZ_JOB_DETAILS; +create table QRTZ_JOB_DETAILS ( + sched_name varchar(120) not null, + job_name varchar(200) not null, + job_group varchar(200) not null, + description varchar(250) null, + job_class_name varchar(250) not null, + is_durable varchar(1) not null, + is_nonconcurrent varchar(1) not null, + is_update_data varchar(1) not null, + requests_recovery varchar(1) not null, + job_data blob null, + primary key (sched_name,job_name,job_group) +) engine=innodb; + +-- ---------------------------- +-- 2、 存储已配置的 Trigger 的信息 +-- ---------------------------- +drop table if exists QRTZ_TRIGGERS; +create table QRTZ_TRIGGERS ( + sched_name varchar(120) not null, + trigger_name varchar(200) not null, + trigger_group varchar(200) not null, + job_name varchar(200) not null, + job_group varchar(200) not null, + description varchar(250) null, + next_fire_time bigint(13) null, + prev_fire_time bigint(13) null, + priority integer null, + trigger_state varchar(16) not null, + trigger_type varchar(8) not null, + start_time bigint(13) not null, + end_time bigint(13) null, + calendar_name varchar(200) null, + misfire_instr smallint(2) null, + job_data blob null, + primary key (sched_name,trigger_name,trigger_group), + foreign key (sched_name,job_name,job_group) references QRTZ_JOB_DETAILS(sched_name,job_name,job_group) +) engine=innodb; + +-- ---------------------------- +-- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数 +-- ---------------------------- +drop table if exists QRTZ_SIMPLE_TRIGGERS; +create table QRTZ_SIMPLE_TRIGGERS ( + sched_name varchar(120) not null, + trigger_name varchar(200) not null, + trigger_group varchar(200) not null, + repeat_count bigint(7) not null, + repeat_interval bigint(12) not null, + times_triggered bigint(10) not null, + primary key (sched_name,trigger_name,trigger_group), + foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) +) engine=innodb; + +-- ---------------------------- +-- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息 +-- ---------------------------- +drop table if exists QRTZ_CRON_TRIGGERS; +create table QRTZ_CRON_TRIGGERS ( + sched_name varchar(120) not null, + trigger_name varchar(200) not null, + trigger_group varchar(200) not null, + cron_expression varchar(200) not null, + time_zone_id varchar(80), + primary key (sched_name,trigger_name,trigger_group), + foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) +) engine=innodb; + +-- ---------------------------- +-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候) +-- ---------------------------- +drop table if exists QRTZ_BLOB_TRIGGERS; +create table QRTZ_BLOB_TRIGGERS ( + sched_name varchar(120) not null, + trigger_name varchar(200) not null, + trigger_group varchar(200) not null, + blob_data blob null, + primary key (sched_name,trigger_name,trigger_group), + foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) +) engine=innodb; + +-- ---------------------------- +-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围 +-- ---------------------------- +drop table if exists QRTZ_CALENDARS; +create table QRTZ_CALENDARS ( + sched_name varchar(120) not null, + calendar_name varchar(200) not null, + calendar blob not null, + primary key (sched_name,calendar_name) +) engine=innodb; + +-- ---------------------------- +-- 7、 存储已暂停的 Trigger 组的信息 +-- ---------------------------- +drop table if exists QRTZ_PAUSED_TRIGGER_GRPS; +create table QRTZ_PAUSED_TRIGGER_GRPS ( + sched_name varchar(120) not null, + trigger_group varchar(200) not null, + primary key (sched_name,trigger_group) +) engine=innodb; + +-- ---------------------------- +-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息 +-- ---------------------------- +drop table if exists QRTZ_FIRED_TRIGGERS; +create table QRTZ_FIRED_TRIGGERS ( + sched_name varchar(120) not null, + entry_id varchar(95) not null, + trigger_name varchar(200) not null, + trigger_group varchar(200) not null, + instance_name varchar(200) not null, + fired_time bigint(13) not null, + sched_time bigint(13) not null, + priority integer not null, + state varchar(16) not null, + job_name varchar(200) null, + job_group varchar(200) null, + is_nonconcurrent varchar(1) null, + requests_recovery varchar(1) null, + primary key (sched_name,entry_id) +) engine=innodb; + +-- ---------------------------- +-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例 +-- ---------------------------- +drop table if exists QRTZ_SCHEDULER_STATE; +create table QRTZ_SCHEDULER_STATE ( + sched_name varchar(120) not null, + instance_name varchar(200) not null, + last_checkin_time bigint(13) not null, + checkin_interval bigint(13) not null, + primary key (sched_name,instance_name) +) engine=innodb; + +-- ---------------------------- +-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁) +-- ---------------------------- +drop table if exists QRTZ_LOCKS; +create table QRTZ_LOCKS ( + sched_name varchar(120) not null, + lock_name varchar(40) not null, + primary key (sched_name,lock_name) +) engine=innodb; + +drop table if exists QRTZ_SIMPROP_TRIGGERS; +create table QRTZ_SIMPROP_TRIGGERS ( + sched_name varchar(120) not null, + trigger_name varchar(200) not null, + trigger_group varchar(200) not null, + str_prop_1 varchar(512) null, + str_prop_2 varchar(512) null, + str_prop_3 varchar(512) null, + int_prop_1 int null, + int_prop_2 int null, + long_prop_1 bigint null, + long_prop_2 bigint null, + dec_prop_1 numeric(13,4) null, + dec_prop_2 numeric(13,4) null, + bool_prop_1 varchar(1) null, + bool_prop_2 varchar(1) null, + primary key (sched_name,trigger_name,trigger_group), + foreign key (sched_name,trigger_name,trigger_group) references QRTZ_TRIGGERS(sched_name,trigger_name,trigger_group) +) engine=innodb; + +commit; \ No newline at end of file diff --git a/evo/sql/ry_20200415.sql b/evo/sql/ry_20200415.sql new file mode 100644 index 0000000..3cbc3bd --- /dev/null +++ b/evo/sql/ry_20200415.sql @@ -0,0 +1,676 @@ +-- ---------------------------- +-- 1、部门表 +-- ---------------------------- +drop table if exists sys_dept; +create table sys_dept ( + dept_id bigint(20) not null auto_increment comment '部门id', + parent_id bigint(20) default 0 comment '父部门id', + ancestors varchar(50) default '' comment '祖级列表', + dept_name varchar(30) default '' comment '部门名称', + order_num int(4) default 0 comment '显示顺序', + leader varchar(20) default null comment '负责人', + phone varchar(11) default null comment '联系电话', + email varchar(50) default null comment '邮箱', + status char(1) default '0' comment '部门状态(0正常 1停用)', + del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (dept_id) +) engine=innodb auto_increment=200 comment = '部门表'; + +-- ---------------------------- +-- 初始化-部门表数据 +-- ---------------------------- +insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); +insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00'); + + +-- ---------------------------- +-- 2、用户信息表 +-- ---------------------------- +drop table if exists sys_user; +create table sys_user ( + user_id bigint(20) not null auto_increment comment '用户ID', + dept_id bigint(20) default null comment '部门ID', + user_name varchar(30) not null comment '用户账号', + nick_name varchar(30) not null comment '用户昵称', + user_type varchar(2) default '00' comment '用户类型(00系统用户)', + email varchar(50) default '' comment '用户邮箱', + phonenumber varchar(11) default '' comment '手机号码', + sex char(1) default '0' comment '用户性别(0男 1女 2未知)', + avatar varchar(100) default '' comment '头像地址', + password varchar(100) default '' comment '密码', + status char(1) default '0' comment '帐号状态(0正常 1停用)', + del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', + login_ip varchar(50) default '' comment '最后登陆IP', + login_date datetime comment '最后登陆时间', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (user_id) +) engine=innodb auto_increment=100 comment = '用户信息表'; + +-- ---------------------------- +-- 初始化-用户信息表数据 +-- ---------------------------- +insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); +insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '测试员'); + + +-- ---------------------------- +-- 3、岗位信息表 +-- ---------------------------- +drop table if exists sys_post; +create table sys_post +( + post_id bigint(20) not null auto_increment comment '岗位ID', + post_code varchar(64) not null comment '岗位编码', + post_name varchar(50) not null comment '岗位名称', + post_sort int(4) not null comment '显示顺序', + status char(1) not null comment '状态(0正常 1停用)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (post_id) +) engine=innodb comment = '岗位信息表'; + +-- ---------------------------- +-- 初始化-岗位信息表数据 +-- ---------------------------- +insert into sys_post values(1, 'ceo', '董事长', 1, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_post values(2, 'se', '项目经理', 2, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_post values(3, 'hr', '人力资源', 3, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_post values(4, 'user', '普通员工', 4, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); + + +-- ---------------------------- +-- 4、角色信息表 +-- ---------------------------- +drop table if exists sys_role; +create table sys_role ( + role_id bigint(20) not null auto_increment comment '角色ID', + role_name varchar(30) not null comment '角色名称', + role_key varchar(100) not null comment '角色权限字符串', + role_sort int(4) not null comment '显示顺序', + data_scope char(1) default '1' comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', + status char(1) not null comment '角色状态(0正常 1停用)', + del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (role_id) +) engine=innodb auto_increment=100 comment = '角色信息表'; + +-- ---------------------------- +-- 初始化-角色信息表数据 +-- ---------------------------- +insert into sys_role values('1', '管理员', 'admin', 1, 1, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); +insert into sys_role values('2', '普通角色', 'common', 2, 2, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '普通角色'); + + +-- ---------------------------- +-- 5、菜单权限表 +-- ---------------------------- +drop table if exists sys_menu; +create table sys_menu ( + menu_id bigint(20) not null auto_increment comment '菜单ID', + menu_name varchar(50) not null comment '菜单名称', + parent_id bigint(20) default 0 comment '父菜单ID', + order_num int(4) default 0 comment '显示顺序', + path varchar(200) default '' comment '路由地址', + component varchar(255) default null comment '组件路径', + is_frame int(1) default 1 comment '是否为外链(0是 1否)', + menu_type char(1) default '' comment '菜单类型(M目录 C菜单 F按钮)', + visible char(1) default 0 comment '菜单状态(0显示 1隐藏)', + status char(1) default 0 comment '菜单状态(0正常 1停用)', + perms varchar(100) default null comment '权限标识', + icon varchar(100) default '#' comment '菜单图标', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default '' comment '备注', + primary key (menu_id) +) engine=innodb auto_increment=2000 comment = '菜单权限表'; + +-- ---------------------------- +-- 初始化-菜单信息表数据 +-- ---------------------------- +-- 一级菜单 +insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, 1, 'M', '0', '0', '', 'system', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统管理目录'); +insert into sys_menu values('2', '系统监控', '0', '2', 'monitor', null, 1, 'M', '0', '0', '', 'monitor', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统监控目录'); +insert into sys_menu values('3', '系统工具', '0', '3', 'tool', null, 1, 'M', '0', '0', '', 'tool', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统工具目录'); +insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', null , 0, 'M', '0', '0', '', 'guide', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '若依官网地址'); +-- 二级菜单 +insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', 1, 'C', '0', '0', 'system:user:list', 'user', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '用户管理菜单'); +insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', 1, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '角色管理菜单'); +insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', 1, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单管理菜单'); +insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', 1, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '部门管理菜单'); +insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', 1, 'C', '0', '0', 'system:post:list', 'post', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '岗位管理菜单'); +insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', 1, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '字典管理菜单'); +insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', 1, 'C', '0', '0', 'system:config:list', 'edit', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '参数设置菜单'); +insert into sys_menu values('107', '通知公告', '1', '8', 'notice', 'system/notice/index', 1, 'C', '0', '0', 'system:notice:list', 'message', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知公告菜单'); +insert into sys_menu values('108', '日志管理', '1', '9', 'log', 'system/log/index', 1, 'M', '0', '0', '', 'log', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '日志管理菜单'); +insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', 1, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '在线用户菜单'); +insert into sys_menu values('110', '定时任务', '2', '2', 'job', 'monitor/job/index', 1, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '定时任务菜单'); +insert into sys_menu values('111', '数据监控', '2', '3', 'druid', 'monitor/druid/index', 1, 'C', '0', '0', 'monitor:druid:list', 'druid', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '数据监控菜单'); +insert into sys_menu values('112', '服务监控', '2', '4', 'server', 'monitor/server/index', 1, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '服务监控菜单'); +insert into sys_menu values('113', '表单构建', '3', '1', 'build', 'tool/build/index', 1 ,'C', '0', '0', 'tool:build:list', 'build', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '表单构建菜单'); +insert into sys_menu values('114', '代码生成', '3', '2', 'gen', 'tool/gen/index', 1, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '代码生成菜单'); +insert into sys_menu values('115', '系统接口', '3', '3', 'swagger', 'tool/swagger/index', 1, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统接口菜单'); +-- 三级菜单 +insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', 1, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作日志菜单'); +insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', 1, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录日志菜单'); +-- 用户管理按钮 +insert into sys_menu values('1001', '用户查询', '100', '1', '', '', 1, 'F', '0', '0', 'system:user:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1002', '用户新增', '100', '2', '', '', 1, 'F', '0', '0', 'system:user:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1003', '用户修改', '100', '3', '', '', 1, 'F', '0', '0', 'system:user:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1004', '用户删除', '100', '4', '', '', 1, 'F', '0', '0', 'system:user:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1005', '用户导出', '100', '5', '', '', 1, 'F', '0', '0', 'system:user:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1006', '用户导入', '100', '6', '', '', 1, 'F', '0', '0', 'system:user:import', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1007', '重置密码', '100', '7', '', '', 1, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 角色管理按钮 +insert into sys_menu values('1008', '角色查询', '101', '1', '', '', 1, 'F', '0', '0', 'system:role:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1009', '角色新增', '101', '2', '', '', 1, 'F', '0', '0', 'system:role:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1010', '角色修改', '101', '3', '', '', 1, 'F', '0', '0', 'system:role:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1011', '角色删除', '101', '4', '', '', 1, 'F', '0', '0', 'system:role:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1012', '角色导出', '101', '5', '', '', 1, 'F', '0', '0', 'system:role:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 菜单管理按钮 +insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', 1, 'F', '0', '0', 'system:menu:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', 1, 'F', '0', '0', 'system:menu:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', 1, 'F', '0', '0', 'system:menu:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', 1, 'F', '0', '0', 'system:menu:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 部门管理按钮 +insert into sys_menu values('1017', '部门查询', '103', '1', '', '', 1, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1018', '部门新增', '103', '2', '', '', 1, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1019', '部门修改', '103', '3', '', '', 1, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1020', '部门删除', '103', '4', '', '', 1, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 岗位管理按钮 +insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', 1, 'F', '0', '0', 'system:post:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', 1, 'F', '0', '0', 'system:post:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1023', '岗位修改', '104', '3', '', '', 1, 'F', '0', '0', 'system:post:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1024', '岗位删除', '104', '4', '', '', 1, 'F', '0', '0', 'system:post:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1025', '岗位导出', '104', '5', '', '', 1, 'F', '0', '0', 'system:post:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 字典管理按钮 +insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', 1, 'F', '0', '0', 'system:dict:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', 1, 'F', '0', '0', 'system:dict:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', 1, 'F', '0', '0', 'system:dict:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', 1, 'F', '0', '0', 'system:dict:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', 1, 'F', '0', '0', 'system:dict:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 参数设置按钮 +insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', 1, 'F', '0', '0', 'system:config:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', 1, 'F', '0', '0', 'system:config:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', 1, 'F', '0', '0', 'system:config:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', 1, 'F', '0', '0', 'system:config:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', 1, 'F', '0', '0', 'system:config:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 通知公告按钮 +insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', 1, 'F', '0', '0', 'system:notice:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', 1, 'F', '0', '0', 'system:notice:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', 1, 'F', '0', '0', 'system:notice:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', 1, 'F', '0', '0', 'system:notice:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 操作日志按钮 +insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', 1, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', 1, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', 1, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 登录日志按钮 +insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', 1, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', 1, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', 1, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 在线用户按钮 +insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', 1, 'F', '0', '0', 'monitor:online:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', 1, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', 1, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 定时任务按钮 +insert into sys_menu values('1049', '任务查询', '110', '1', '#', '', 1, 'F', '0', '0', 'monitor:job:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1050', '任务新增', '110', '2', '#', '', 1, 'F', '0', '0', 'monitor:job:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1051', '任务修改', '110', '3', '#', '', 1, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1052', '任务删除', '110', '4', '#', '', 1, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1053', '状态修改', '110', '5', '#', '', 1, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1054', '任务导出', '110', '7', '#', '', 1, 'F', '0', '0', 'monitor:job:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +-- 代码生成按钮 +insert into sys_menu values('1055', '生成查询', '114', '1', '#', '', 1, 'F', '0', '0', 'tool:gen:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1056', '生成修改', '114', '2', '#', '', 1, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1057', '生成删除', '114', '3', '#', '', 1, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1058', '导入代码', '114', '2', '#', '', 1, 'F', '0', '0', 'tool:gen:import', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1059', '预览代码', '114', '4', '#', '', 1, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_menu values('1060', '生成代码', '114', '5', '#', '', 1, 'F', '0', '0', 'tool:gen:code', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); + + +-- ---------------------------- +-- 6、用户和角色关联表 用户N-1角色 +-- ---------------------------- +drop table if exists sys_user_role; +create table sys_user_role ( + user_id bigint(20) not null comment '用户ID', + role_id bigint(20) not null comment '角色ID', + primary key(user_id, role_id) +) engine=innodb comment = '用户和角色关联表'; + +-- ---------------------------- +-- 初始化-用户和角色关联表数据 +-- ---------------------------- +insert into sys_user_role values ('1', '1'); +insert into sys_user_role values ('2', '2'); + + +-- ---------------------------- +-- 7、角色和菜单关联表 角色1-N菜单 +-- ---------------------------- +drop table if exists sys_role_menu; +create table sys_role_menu ( + role_id bigint(20) not null comment '角色ID', + menu_id bigint(20) not null comment '菜单ID', + primary key(role_id, menu_id) +) engine=innodb comment = '角色和菜单关联表'; + +-- ---------------------------- +-- 初始化-角色和菜单关联表数据 +-- ---------------------------- +insert into sys_role_menu values ('2', '1'); +insert into sys_role_menu values ('2', '2'); +insert into sys_role_menu values ('2', '3'); +insert into sys_role_menu values ('2', '4'); +insert into sys_role_menu values ('2', '100'); +insert into sys_role_menu values ('2', '101'); +insert into sys_role_menu values ('2', '102'); +insert into sys_role_menu values ('2', '103'); +insert into sys_role_menu values ('2', '104'); +insert into sys_role_menu values ('2', '105'); +insert into sys_role_menu values ('2', '106'); +insert into sys_role_menu values ('2', '107'); +insert into sys_role_menu values ('2', '108'); +insert into sys_role_menu values ('2', '109'); +insert into sys_role_menu values ('2', '110'); +insert into sys_role_menu values ('2', '111'); +insert into sys_role_menu values ('2', '112'); +insert into sys_role_menu values ('2', '113'); +insert into sys_role_menu values ('2', '114'); +insert into sys_role_menu values ('2', '115'); +insert into sys_role_menu values ('2', '500'); +insert into sys_role_menu values ('2', '501'); +insert into sys_role_menu values ('2', '1000'); +insert into sys_role_menu values ('2', '1001'); +insert into sys_role_menu values ('2', '1002'); +insert into sys_role_menu values ('2', '1003'); +insert into sys_role_menu values ('2', '1004'); +insert into sys_role_menu values ('2', '1005'); +insert into sys_role_menu values ('2', '1006'); +insert into sys_role_menu values ('2', '1007'); +insert into sys_role_menu values ('2', '1008'); +insert into sys_role_menu values ('2', '1009'); +insert into sys_role_menu values ('2', '1010'); +insert into sys_role_menu values ('2', '1011'); +insert into sys_role_menu values ('2', '1012'); +insert into sys_role_menu values ('2', '1013'); +insert into sys_role_menu values ('2', '1014'); +insert into sys_role_menu values ('2', '1015'); +insert into sys_role_menu values ('2', '1016'); +insert into sys_role_menu values ('2', '1017'); +insert into sys_role_menu values ('2', '1018'); +insert into sys_role_menu values ('2', '1019'); +insert into sys_role_menu values ('2', '1020'); +insert into sys_role_menu values ('2', '1021'); +insert into sys_role_menu values ('2', '1022'); +insert into sys_role_menu values ('2', '1023'); +insert into sys_role_menu values ('2', '1024'); +insert into sys_role_menu values ('2', '1025'); +insert into sys_role_menu values ('2', '1026'); +insert into sys_role_menu values ('2', '1027'); +insert into sys_role_menu values ('2', '1028'); +insert into sys_role_menu values ('2', '1029'); +insert into sys_role_menu values ('2', '1030'); +insert into sys_role_menu values ('2', '1031'); +insert into sys_role_menu values ('2', '1032'); +insert into sys_role_menu values ('2', '1033'); +insert into sys_role_menu values ('2', '1034'); +insert into sys_role_menu values ('2', '1035'); +insert into sys_role_menu values ('2', '1036'); +insert into sys_role_menu values ('2', '1037'); +insert into sys_role_menu values ('2', '1038'); +insert into sys_role_menu values ('2', '1039'); +insert into sys_role_menu values ('2', '1040'); +insert into sys_role_menu values ('2', '1041'); +insert into sys_role_menu values ('2', '1042'); +insert into sys_role_menu values ('2', '1043'); +insert into sys_role_menu values ('2', '1044'); +insert into sys_role_menu values ('2', '1045'); +insert into sys_role_menu values ('2', '1046'); +insert into sys_role_menu values ('2', '1047'); +insert into sys_role_menu values ('2', '1048'); +insert into sys_role_menu values ('2', '1049'); +insert into sys_role_menu values ('2', '1050'); +insert into sys_role_menu values ('2', '1051'); +insert into sys_role_menu values ('2', '1052'); +insert into sys_role_menu values ('2', '1053'); +insert into sys_role_menu values ('2', '1054'); +insert into sys_role_menu values ('2', '1055'); +insert into sys_role_menu values ('2', '1056'); +insert into sys_role_menu values ('2', '1057'); +insert into sys_role_menu values ('2', '1058'); +insert into sys_role_menu values ('2', '1059'); +insert into sys_role_menu values ('2', '1060'); + +-- ---------------------------- +-- 8、角色和部门关联表 角色1-N部门 +-- ---------------------------- +drop table if exists sys_role_dept; +create table sys_role_dept ( + role_id bigint(20) not null comment '角色ID', + dept_id bigint(20) not null comment '部门ID', + primary key(role_id, dept_id) +) engine=innodb comment = '角色和部门关联表'; + +-- ---------------------------- +-- 初始化-角色和部门关联表数据 +-- ---------------------------- +insert into sys_role_dept values ('2', '100'); +insert into sys_role_dept values ('2', '101'); +insert into sys_role_dept values ('2', '105'); + + +-- ---------------------------- +-- 9、用户与岗位关联表 用户1-N岗位 +-- ---------------------------- +drop table if exists sys_user_post; +create table sys_user_post +( + user_id bigint(20) not null comment '用户ID', + post_id bigint(20) not null comment '岗位ID', + primary key (user_id, post_id) +) engine=innodb comment = '用户与岗位关联表'; + +-- ---------------------------- +-- 初始化-用户与岗位关联表数据 +-- ---------------------------- +insert into sys_user_post values ('1', '1'); +insert into sys_user_post values ('2', '2'); + + +-- ---------------------------- +-- 10、操作日志记录 +-- ---------------------------- +drop table if exists sys_oper_log; +create table sys_oper_log ( + oper_id bigint(20) not null auto_increment comment '日志主键', + title varchar(50) default '' comment '模块标题', + business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)', + method varchar(100) default '' comment '方法名称', + request_method varchar(10) default '' comment '请求方式', + operator_type int(1) default 0 comment '操作类别(0其它 1后台用户 2手机端用户)', + oper_name varchar(50) default '' comment '操作人员', + dept_name varchar(50) default '' comment '部门名称', + oper_url varchar(255) default '' comment '请求URL', + oper_ip varchar(50) default '' comment '主机地址', + oper_location varchar(255) default '' comment '操作地点', + oper_param varchar(2000) default '' comment '请求参数', + json_result varchar(2000) default '' comment '返回参数', + status int(1) default 0 comment '操作状态(0正常 1异常)', + error_msg varchar(2000) default '' comment '错误消息', + oper_time datetime comment '操作时间', + primary key (oper_id) +) engine=innodb auto_increment=100 comment = '操作日志记录'; + + +-- ---------------------------- +-- 11、字典类型表 +-- ---------------------------- +drop table if exists sys_dict_type; +create table sys_dict_type +( + dict_id bigint(20) not null auto_increment comment '字典主键', + dict_name varchar(100) default '' comment '字典名称', + dict_type varchar(100) default '' comment '字典类型', + status char(1) default '0' comment '状态(0正常 1停用)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (dict_id), + unique (dict_type) +) engine=innodb auto_increment=100 comment = '字典类型表'; + +insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '用户性别列表'); +insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单状态列表'); +insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统开关列表'); +insert into sys_dict_type values(4, '任务状态', 'sys_job_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '任务状态列表'); +insert into sys_dict_type values(5, '任务分组', 'sys_job_group', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '任务分组列表'); +insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统是否列表'); +insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知类型列表'); +insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知状态列表'); +insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作类型列表'); +insert into sys_dict_type values(10, '系统状态', 'sys_common_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录状态列表'); + + +-- ---------------------------- +-- 12、字典数据表 +-- ---------------------------- +drop table if exists sys_dict_data; +create table sys_dict_data +( + dict_code bigint(20) not null auto_increment comment '字典编码', + dict_sort int(4) default 0 comment '字典排序', + dict_label varchar(100) default '' comment '字典标签', + dict_value varchar(100) default '' comment '字典键值', + dict_type varchar(100) default '' comment '字典类型', + css_class varchar(100) default null comment '样式属性(其他样式扩展)', + list_class varchar(100) default null comment '表格回显样式', + is_default char(1) default 'N' comment '是否默认(Y是 N否)', + status char(1) default '0' comment '状态(0正常 1停用)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (dict_code) +) engine=innodb auto_increment=100 comment = '字典数据表'; + +insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别男'); +insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别女'); +insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别未知'); +insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '显示菜单'); +insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '隐藏菜单'); +insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态'); +insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态'); +insert into sys_dict_data values(8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态'); +insert into sys_dict_data values(9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态'); +insert into sys_dict_data values(10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '默认分组'); +insert into sys_dict_data values(11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统分组'); +insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认是'); +insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认否'); +insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知'); +insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '公告'); +insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态'); +insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '关闭状态'); +insert into sys_dict_data values(18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作'); +insert into sys_dict_data values(19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '修改操作'); +insert into sys_dict_data values(20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '删除操作'); +insert into sys_dict_data values(21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '授权操作'); +insert into sys_dict_data values(22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '导出操作'); +insert into sys_dict_data values(23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '导入操作'); +insert into sys_dict_data values(24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '强退操作'); +insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '生成操作'); +insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '清空操作'); +insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态'); +insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态'); + + +-- ---------------------------- +-- 13、参数配置表 +-- ---------------------------- +drop table if exists sys_config; +create table sys_config ( + config_id int(5) not null auto_increment comment '参数主键', + config_name varchar(100) default '' comment '参数名称', + config_key varchar(100) default '' comment '参数键名', + config_value varchar(500) default '' comment '参数键值', + config_type char(1) default 'N' comment '系统内置(Y是 N否)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (config_id) +) engine=innodb auto_increment=100 comment = '参数配置表'; + +insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); +insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '初始化密码 123456' ); +insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '深色主题theme-dark,浅色主题theme-light' ); + + +-- ---------------------------- +-- 14、系统访问记录 +-- ---------------------------- +drop table if exists sys_logininfor; +create table sys_logininfor ( + info_id bigint(20) not null auto_increment comment '访问ID', + user_name varchar(50) default '' comment '用户账号', + ipaddr varchar(50) default '' comment '登录IP地址', + login_location varchar(255) default '' comment '登录地点', + browser varchar(50) default '' comment '浏览器类型', + os varchar(50) default '' comment '操作系统', + status char(1) default '0' comment '登录状态(0成功 1失败)', + msg varchar(255) default '' comment '提示消息', + login_time datetime comment '访问时间', + primary key (info_id) +) engine=innodb auto_increment=100 comment = '系统访问记录'; + + +-- ---------------------------- +-- 15、定时任务调度表 +-- ---------------------------- +drop table if exists sys_job; +create table sys_job ( + job_id bigint(20) not null auto_increment comment '任务ID', + job_name varchar(64) default '' comment '任务名称', + job_group varchar(64) default 'DEFAULT' comment '任务组名', + invoke_target varchar(500) not null comment '调用目标字符串', + cron_expression varchar(255) default '' comment 'cron执行表达式', + misfire_policy varchar(20) default '3' comment '计划执行错误策略(1立即执行 2执行一次 3放弃执行)', + concurrent char(1) default '1' comment '是否并发执行(0允许 1禁止)', + status char(1) default '0' comment '状态(0正常 1暂停)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default '' comment '备注信息', + primary key (job_id, job_name, job_group) +) engine=innodb auto_increment=100 comment = '定时任务调度表'; + +insert into sys_job values(1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_job values(2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); +insert into sys_job values(3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); + + +-- ---------------------------- +-- 16、定时任务调度日志表 +-- ---------------------------- +drop table if exists sys_job_log; +create table sys_job_log ( + job_log_id bigint(20) not null auto_increment comment '任务日志ID', + job_name varchar(64) not null comment '任务名称', + job_group varchar(64) not null comment '任务组名', + invoke_target varchar(500) not null comment '调用目标字符串', + job_message varchar(500) comment '日志信息', + status char(1) default '0' comment '执行状态(0正常 1失败)', + exception_info varchar(2000) default '' comment '异常信息', + create_time datetime comment '创建时间', + primary key (job_log_id) +) engine=innodb comment = '定时任务调度日志表'; + + +-- ---------------------------- +-- 17、通知公告表 +-- ---------------------------- +drop table if exists sys_notice; +create table sys_notice ( + notice_id int(4) not null auto_increment comment '公告ID', + notice_title varchar(50) not null comment '公告标题', + notice_type char(1) not null comment '公告类型(1通知 2公告)', + notice_content varchar(2000) default null comment '公告内容', + status char(1) default '0' comment '公告状态(0正常 1关闭)', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(255) default null comment '备注', + primary key (notice_id) +) engine=innodb auto_increment=10 comment = '通知公告表'; + +-- ---------------------------- +-- 初始化-公告信息表数据 +-- ---------------------------- +insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); +insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员'); + + +-- ---------------------------- +-- 18、代码生成业务表 +-- ---------------------------- +drop table if exists gen_table; +create table gen_table ( + table_id bigint(20) not null auto_increment comment '编号', + table_name varchar(200) default '' comment '表名称', + table_comment varchar(500) default '' comment '表描述', + class_name varchar(100) default '' comment '实体类名称', + tpl_category varchar(200) default 'crud' comment '使用的模板(crud单表操作 tree树表操作)', + package_name varchar(100) comment '生成包路径', + module_name varchar(30) comment '生成模块名', + business_name varchar(30) comment '生成业务名', + function_name varchar(50) comment '生成功能名', + function_author varchar(50) comment '生成功能作者', + options varchar(1000) comment '其它生成选项', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + remark varchar(500) default null comment '备注', + primary key (table_id) +) engine=innodb auto_increment=1 comment = '代码生成业务表'; + + +-- ---------------------------- +-- 19、代码生成业务表字段 +-- ---------------------------- +drop table if exists gen_table_column; +create table gen_table_column ( + column_id bigint(20) not null auto_increment comment '编号', + table_id varchar(64) comment '归属表编号', + column_name varchar(200) comment '列名称', + column_comment varchar(500) comment '列描述', + column_type varchar(100) comment '列类型', + java_type varchar(500) comment 'JAVA类型', + java_field varchar(200) comment 'JAVA字段名', + is_pk char(1) comment '是否主键(1是)', + is_increment char(1) comment '是否自增(1是)', + is_required char(1) comment '是否必填(1是)', + is_insert char(1) comment '是否为插入字段(1是)', + is_edit char(1) comment '是否编辑字段(1是)', + is_list char(1) comment '是否列表字段(1是)', + is_query char(1) comment '是否查询字段(1是)', + query_type varchar(200) default 'EQ' comment '查询方式(等于、不等于、大于、小于、范围)', + html_type varchar(200) comment '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)', + dict_type varchar(200) default '' comment '字典类型', + sort int comment '排序', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (column_id) +) engine=innodb auto_increment=1 comment = '代码生成业务表字段'; \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/RuoYiApplication.java b/evo/src/main/java/com/ruoyi/RuoYiApplication.java new file mode 100644 index 0000000..24f0678 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/RuoYiApplication.java @@ -0,0 +1,30 @@ +package com.ruoyi; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; + +/** + * 启动程序 + * + * @author ruoyi + */ +@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) +public class RuoYiApplication +{ + public static void main(String[] args) + { + System.setProperty("spring.devtools.restart.enabled", "false"); + SpringApplication.run(RuoYiApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/evo/src/main/java/com/ruoyi/RuoYiServletInitializer.java b/evo/src/main/java/com/ruoyi/RuoYiServletInitializer.java new file mode 100644 index 0000000..6de67dc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/RuoYiServletInitializer.java @@ -0,0 +1,18 @@ +package com.ruoyi; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * web容器中进行部署 + * + * @author ruoyi + */ +public class RuoYiServletInitializer extends SpringBootServletInitializer +{ + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) + { + return application.sources(RuoYiApplication.class); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/constant/Constants.java b/evo/src/main/java/com/ruoyi/common/constant/Constants.java new file mode 100644 index 0000000..1f7b996 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/constant/Constants.java @@ -0,0 +1,126 @@ +package com.ruoyi.common.constant; + +import io.jsonwebtoken.Claims; + +/** + * 通用常量信息 + * + * @author ruoyi + */ +public class Constants +{ + /** + * UTF-8 字符集 + */ + public static final String UTF8 = "UTF-8"; + + /** + * GBK 字符集 + */ + public static final String GBK = "GBK"; + + /** + * http请求 + */ + public static final String HTTP = "http://"; + + /** + * https请求 + */ + public static final String HTTPS = "https://"; + + /** + * 通用成功标识 + */ + public static final String SUCCESS = "0"; + + /** + * 通用失败标识 + */ + public static final String FAIL = "1"; + + /** + * 登录成功 + */ + public static final String LOGIN_SUCCESS = "Success"; + + /** + * 注销 + */ + public static final String LOGOUT = "Logout"; + + /** + * 登录失败 + */ + public static final String LOGIN_FAIL = "Error"; + + /** + * 验证码 redis key + */ + public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; + + /** + * 登录用户 redis key + */ + public static final String LOGIN_TOKEN_KEY = "login_tokens:"; + + /** + * 验证码有效期(分钟) + */ + public static final Integer CAPTCHA_EXPIRATION = 2; + + /** + * 令牌 + */ + public static final String TOKEN = "token"; + + /** + * 令牌前缀 + */ + public static final String TOKEN_PREFIX = "Bearer "; + + /** + * 令牌前缀 + */ + public static final String LOGIN_USER_KEY = "login_user_key"; + + /** + * 用户ID + */ + public static final String JWT_USERID = "userid"; + + /** + * 用户名称 + */ + public static final String JWT_USERNAME = Claims.SUBJECT; + + /** + * 用户头像 + */ + public static final String JWT_AVATAR = "avatar"; + + /** + * 创建时间 + */ + public static final String JWT_CREATED = "created"; + + /** + * 用户权限 + */ + public static final String JWT_AUTHORITIES = "authorities"; + + /** + * 参数管理 cache key + */ + public static final String SYS_CONFIG_KEY = "sys_config:"; + + /** + * 字典管理 cache key + */ + public static final String SYS_DICT_KEY = "sys_dict:"; + + /** + * 资源映射路径 前缀 + */ + public static final String RESOURCE_PREFIX = "/profile"; +} diff --git a/evo/src/main/java/com/ruoyi/common/constant/GenConstants.java b/evo/src/main/java/com/ruoyi/common/constant/GenConstants.java new file mode 100644 index 0000000..0e460c5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/constant/GenConstants.java @@ -0,0 +1,94 @@ +package com.ruoyi.common.constant; + +/** + * 代码生成通用常量 + * + * @author ruoyi + */ +public class GenConstants +{ + /** 单表(增删改查) */ + public static final String TPL_CRUD = "crud"; + + /** 树表(增删改查) */ + public static final String TPL_TREE = "tree"; + + /** 树编码字段 */ + public static final String TREE_CODE = "treeCode"; + + /** 树父编码字段 */ + public static final String TREE_PARENT_CODE = "treeParentCode"; + + /** 树名称字段 */ + public static final String TREE_NAME = "treeName"; + + /** 数据库字符串类型 */ + public static final String[] COLUMNTYPE_STR = { "char", "varchar", "narchar", "varchar2", "tinytext", "text", + "mediumtext", "longtext" }; + + /** 数据库时间类型 */ + public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" }; + + /** 数据库数字类型 */ + public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", + "bigint", "float", "float", "double", "decimal" }; + + /** 页面不需要编辑字段 */ + public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; + + /** 页面不需要显示的列表字段 */ + public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", + "update_time" }; + + /** 页面不需要查询字段 */ + public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark" }; + + /** Entity基类字段 */ + public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; + + /** Tree基类字段 */ + public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; + + /** 文本框 */ + public static final String HTML_INPUT = "input"; + + /** 文本域 */ + public static final String HTML_TEXTAREA = "textarea"; + + /** 下拉框 */ + public static final String HTML_SELECT = "select"; + + /** 单选框 */ + public static final String HTML_RADIO = "radio"; + + /** 复选框 */ + public static final String HTML_CHECKBOX = "checkbox"; + + /** 日期控件 */ + public static final String HTML_DATETIME = "datetime"; + + /** 字符串类型 */ + public static final String TYPE_STRING = "String"; + + /** 整型 */ + public static final String TYPE_INTEGER = "Integer"; + + /** 长整型 */ + public static final String TYPE_LONG = "Long"; + + /** 浮点型 */ + public static final String TYPE_DOUBLE = "Double"; + + /** 高精度计算类型 */ + public static final String TYPE_BIGDECIMAL = "BigDecimal"; + + /** 时间类型 */ + public static final String TYPE_DATE = "Date"; + + /** 模糊查询 */ + public static final String QUERY_LIKE = "LIKE"; + + /** 需要 */ + public static final String REQUIRE = "1"; +} diff --git a/evo/src/main/java/com/ruoyi/common/constant/HttpStatus.java b/evo/src/main/java/com/ruoyi/common/constant/HttpStatus.java new file mode 100644 index 0000000..e029d17 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/constant/HttpStatus.java @@ -0,0 +1,89 @@ +package com.ruoyi.common.constant; + +/** + * 返回状态码 + * + * @author ruoyi + */ +public interface HttpStatus +{ + /** + * 操作成功 + */ + public static final int SUCCESS = 200; + + /** + * 对象创建成功 + */ + public static final int CREATED = 201; + + /** + * 请求已经被接受 + */ + public static final int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + public static final int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + public static final int MOVED_PERM = 301; + + /** + * 重定向 + */ + public static final int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + public static final int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + public static final int BAD_REQUEST = 400; + + /** + * 未授权 + */ + public static final int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + public static final int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + public static final int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + public static final int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + public static final int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + public static final int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + public static final int ERROR = 500; + + /** + * 接口未实现 + */ + public static final int NOT_IMPLEMENTED = 501; +} diff --git a/evo/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java b/evo/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java new file mode 100644 index 0000000..005e176 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java @@ -0,0 +1,50 @@ +package com.ruoyi.common.constant; + +/** + * 任务调度通用常量 + * + * @author ruoyi + */ +public interface ScheduleConstants +{ + public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; + + /** 执行目标key */ + public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; + + /** 默认 */ + public static final String MISFIRE_DEFAULT = "0"; + + /** 立即触发执行 */ + public static final String MISFIRE_IGNORE_MISFIRES = "1"; + + /** 触发一次执行 */ + public static final String MISFIRE_FIRE_AND_PROCEED = "2"; + + /** 不触发立即执行 */ + public static final String MISFIRE_DO_NOTHING = "3"; + + public enum Status + { + /** + * 正常 + */ + NORMAL("0"), + /** + * 暂停 + */ + PAUSE("1"); + + private String value; + + private Status(String value) + { + this.value = value; + } + + public String getValue() + { + return value; + } + } +} diff --git a/evo/src/main/java/com/ruoyi/common/constant/UserConstants.java b/evo/src/main/java/com/ruoyi/common/constant/UserConstants.java new file mode 100644 index 0000000..746f4b6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/constant/UserConstants.java @@ -0,0 +1,60 @@ +package com.ruoyi.common.constant; + +/** + * 用户常量信息 + * + * @author ruoyi + */ +public class UserConstants +{ + /** + * 平台内系统用户的唯一标志 + */ + public static final String SYS_USER = "SYS_USER"; + + /** 正常状态 */ + public static final String NORMAL = "0"; + + /** 异常状态 */ + public static final String EXCEPTION = "1"; + + /** 用户封禁状态 */ + public static final String USER_DISABLE = "1"; + + /** 角色封禁状态 */ + public static final String ROLE_DISABLE = "1"; + + /** 部门正常状态 */ + public static final String DEPT_NORMAL = "0"; + + /** 部门停用状态 */ + public static final String DEPT_DISABLE = "1"; + + /** 字典正常状态 */ + public static final String DICT_NORMAL = "0"; + + /** 是否为系统默认(是) */ + public static final String YES = "Y"; + + /** 是否菜单外链(是) */ + public static final String YES_FRAME = "0"; + + /** 是否菜单外链(否) */ + public static final String NO_FRAME = "1"; + + /** 菜单类型(目录) */ + public static final String TYPE_DIR = "M"; + + /** 菜单类型(菜单) */ + public static final String TYPE_MENU = "C"; + + /** 菜单类型(按钮) */ + public static final String TYPE_BUTTON = "F"; + + /** Layout组件标识 */ + public final static String LAYOUT = "Layout"; + + /** 校验返回结果码 */ + public final static String UNIQUE = "0"; + public final static String NOT_UNIQUE = "1"; +} diff --git a/evo/src/main/java/com/ruoyi/common/core/lang/UUID.java b/evo/src/main/java/com/ruoyi/common/core/lang/UUID.java new file mode 100644 index 0000000..3adf3df --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/core/lang/UUID.java @@ -0,0 +1,481 @@ +package com.ruoyi.common.core.lang; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.Random; +import java.util.concurrent.ThreadLocalRandom; +import com.ruoyi.common.exception.UtilException; + +/** + * 提供通用唯一识别码(universally unique identifier)(UUID)实现 + * + * @author ruoyi + */ +public final class UUID implements java.io.Serializable, Comparable +{ + private static final long serialVersionUID = -1185015143654744140L; + + /** + * SecureRandom 的单例 + * + */ + private static class Holder + { + static final SecureRandom numberGenerator = getSecureRandom(); + } + + /** 此UUID的最高64有效位 */ + private final long mostSigBits; + + /** 此UUID的最低64有效位 */ + private final long leastSigBits; + + /** + * 私有构造 + * + * @param data 数据 + */ + private UUID(byte[] data) + { + long msb = 0; + long lsb = 0; + assert data.length == 16 : "data must be 16 bytes in length"; + for (int i = 0; i < 8; i++) + { + msb = (msb << 8) | (data[i] & 0xff); + } + for (int i = 8; i < 16; i++) + { + lsb = (lsb << 8) | (data[i] & 0xff); + } + this.mostSigBits = msb; + this.leastSigBits = lsb; + } + + /** + * 使用指定的数据构造新的 UUID。 + * + * @param mostSigBits 用于 {@code UUID} 的最高有效 64 位 + * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位 + */ + public UUID(long mostSigBits, long leastSigBits) + { + this.mostSigBits = mostSigBits; + this.leastSigBits = leastSigBits; + } + + /** + * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。 + * + * @return 随机生成的 {@code UUID} + */ + public static UUID fastUUID() + { + return randomUUID(false); + } + + /** + * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 + * + * @return 随机生成的 {@code UUID} + */ + public static UUID randomUUID() + { + return randomUUID(true); + } + + /** + * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 + * + * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能 + * @return 随机生成的 {@code UUID} + */ + public static UUID randomUUID(boolean isSecure) + { + final Random ng = isSecure ? Holder.numberGenerator : getRandom(); + + byte[] randomBytes = new byte[16]; + ng.nextBytes(randomBytes); + randomBytes[6] &= 0x0f; /* clear version */ + randomBytes[6] |= 0x40; /* set to version 4 */ + randomBytes[8] &= 0x3f; /* clear variant */ + randomBytes[8] |= 0x80; /* set to IETF variant */ + return new UUID(randomBytes); + } + + /** + * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。 + * + * @param name 用于构造 UUID 的字节数组。 + * + * @return 根据指定数组生成的 {@code UUID} + */ + public static UUID nameUUIDFromBytes(byte[] name) + { + MessageDigest md; + try + { + md = MessageDigest.getInstance("MD5"); + } + catch (NoSuchAlgorithmException nsae) + { + throw new InternalError("MD5 not supported"); + } + byte[] md5Bytes = md.digest(name); + md5Bytes[6] &= 0x0f; /* clear version */ + md5Bytes[6] |= 0x30; /* set to version 3 */ + md5Bytes[8] &= 0x3f; /* clear variant */ + md5Bytes[8] |= 0x80; /* set to IETF variant */ + return new UUID(md5Bytes); + } + + /** + * 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。 + * + * @param name 指定 {@code UUID} 字符串 + * @return 具有指定值的 {@code UUID} + * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常 + * + */ + public static UUID fromString(String name) + { + String[] components = name.split("-"); + if (components.length != 5) + { + throw new IllegalArgumentException("Invalid UUID string: " + name); + } + for (int i = 0; i < 5; i++) + { + components[i] = "0x" + components[i]; + } + + long mostSigBits = Long.decode(components[0]).longValue(); + mostSigBits <<= 16; + mostSigBits |= Long.decode(components[1]).longValue(); + mostSigBits <<= 16; + mostSigBits |= Long.decode(components[2]).longValue(); + + long leastSigBits = Long.decode(components[3]).longValue(); + leastSigBits <<= 48; + leastSigBits |= Long.decode(components[4]).longValue(); + + return new UUID(mostSigBits, leastSigBits); + } + + /** + * 返回此 UUID 的 128 位值中的最低有效 64 位。 + * + * @return 此 UUID 的 128 位值中的最低有效 64 位。 + */ + public long getLeastSignificantBits() + { + return leastSigBits; + } + + /** + * 返回此 UUID 的 128 位值中的最高有效 64 位。 + * + * @return 此 UUID 的 128 位值中最高有效 64 位。 + */ + public long getMostSignificantBits() + { + return mostSigBits; + } + + /** + * 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。 + *

+ * 版本号具有以下含意: + *

+ * + * @return 此 {@code UUID} 的版本号 + */ + public int version() + { + // Version is bits masked by 0x000000000000F000 in MS long + return (int) ((mostSigBits >> 12) & 0x0f); + } + + /** + * 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。 + *

+ * 变体号具有以下含意: + *

+ * + * @return 此 {@code UUID} 相关联的变体号 + */ + public int variant() + { + // This field is composed of a varying number of bits. + // 0 - - Reserved for NCS backward compatibility + // 1 0 - The IETF aka Leach-Salz variant (used by this class) + // 1 1 0 Reserved, Microsoft backward compatibility + // 1 1 1 Reserved for future definition. + return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63)); + } + + /** + * 与此 UUID 相关联的时间戳值。 + * + *

+ * 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。
+ * 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。 + * + *

+ * 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。
+ * 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 + * + * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。 + */ + public long timestamp() throws UnsupportedOperationException + { + checkTimeBase(); + return (mostSigBits & 0x0FFFL) << 48// + | ((mostSigBits >> 16) & 0x0FFFFL) << 32// + | mostSigBits >>> 32; + } + + /** + * 与此 UUID 相关联的时钟序列值。 + * + *

+ * 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。 + *

+ * {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的 UUID,则此方法抛出 + * UnsupportedOperationException。 + * + * @return 此 {@code UUID} 的时钟序列 + * + * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 + */ + public int clockSequence() throws UnsupportedOperationException + { + checkTimeBase(); + return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48); + } + + /** + * 与此 UUID 相关的节点值。 + * + *

+ * 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。 + *

+ * 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。
+ * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 + * + * @return 此 {@code UUID} 的节点值 + * + * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 + */ + public long node() throws UnsupportedOperationException + { + checkTimeBase(); + return leastSigBits & 0x0000FFFFFFFFFFFFL; + } + + /** + * 返回此{@code UUID} 的字符串表现形式。 + * + *

+ * UUID 的字符串表示形式由此 BNF 描述: + * + *

+     * {@code
+     * UUID                   = ----
+     * time_low               = 4*
+     * time_mid               = 2*
+     * time_high_and_version  = 2*
+     * variant_and_sequence   = 2*
+     * node                   = 6*
+     * hexOctet               = 
+     * hexDigit               = [0-9a-fA-F]
+     * }
+     * 
+ * + * + * + * @return 此{@code UUID} 的字符串表现形式 + * @see #toString(boolean) + */ + @Override + public String toString() + { + return toString(false); + } + + /** + * 返回此{@code UUID} 的字符串表现形式。 + * + *

+ * UUID 的字符串表示形式由此 BNF 描述: + * + *

+     * {@code
+     * UUID                   = ----
+     * time_low               = 4*
+     * time_mid               = 2*
+     * time_high_and_version  = 2*
+     * variant_and_sequence   = 2*
+     * node                   = 6*
+     * hexOctet               = 
+     * hexDigit               = [0-9a-fA-F]
+     * }
+     * 
+ * + * + * + * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串 + * @return 此{@code UUID} 的字符串表现形式 + */ + public String toString(boolean isSimple) + { + final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36); + // time_low + builder.append(digits(mostSigBits >> 32, 8)); + if (false == isSimple) + { + builder.append('-'); + } + // time_mid + builder.append(digits(mostSigBits >> 16, 4)); + if (false == isSimple) + { + builder.append('-'); + } + // time_high_and_version + builder.append(digits(mostSigBits, 4)); + if (false == isSimple) + { + builder.append('-'); + } + // variant_and_sequence + builder.append(digits(leastSigBits >> 48, 4)); + if (false == isSimple) + { + builder.append('-'); + } + // node + builder.append(digits(leastSigBits, 12)); + + return builder.toString(); + } + + /** + * 返回此 UUID 的哈希码。 + * + * @return UUID 的哈希码值。 + */ + public int hashCode() + { + long hilo = mostSigBits ^ leastSigBits; + return ((int) (hilo >> 32)) ^ (int) hilo; + } + + /** + * 将此对象与指定对象比较。 + *

+ * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。 + * + * @param obj 要与之比较的对象 + * + * @return 如果对象相同,则返回 {@code true};否则返回 {@code false} + */ + public boolean equals(Object obj) + { + if ((null == obj) || (obj.getClass() != UUID.class)) + { + return false; + } + UUID id = (UUID) obj; + return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits); + } + + // Comparison Operations + + /** + * 将此 UUID 与指定的 UUID 比较。 + * + *

+ * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。 + * + * @param val 与此 UUID 比较的 UUID + * + * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。 + * + */ + public int compareTo(UUID val) + { + // The ordering is intentionally set up so that the UUIDs + // can simply be numerically compared as two numbers + return (this.mostSigBits < val.mostSigBits ? -1 : // + (this.mostSigBits > val.mostSigBits ? 1 : // + (this.leastSigBits < val.leastSigBits ? -1 : // + (this.leastSigBits > val.leastSigBits ? 1 : // + 0)))); + } + + // ------------------------------------------------------------------------------------------------------------------- + // Private method start + /** + * 返回指定数字对应的hex值 + * + * @param val 值 + * @param digits 位 + * @return 值 + */ + private static String digits(long val, int digits) + { + long hi = 1L << (digits * 4); + return Long.toHexString(hi | (val & (hi - 1))).substring(1); + } + + /** + * 检查是否为time-based版本UUID + */ + private void checkTimeBase() + { + if (version() != 1) + { + throw new UnsupportedOperationException("Not a time-based UUID"); + } + } + + /** + * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG) + * + * @return {@link SecureRandom} + */ + public static SecureRandom getSecureRandom() + { + try + { + return SecureRandom.getInstance("SHA1PRNG"); + } + catch (NoSuchAlgorithmException e) + { + throw new UtilException(e); + } + } + + /** + * 获取随机数生成器对象
+ * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。 + * + * @return {@link ThreadLocalRandom} + */ + public static ThreadLocalRandom getRandom() + { + return ThreadLocalRandom.current(); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/core/text/CharsetKit.java b/evo/src/main/java/com/ruoyi/common/core/text/CharsetKit.java new file mode 100644 index 0000000..77b1a79 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/core/text/CharsetKit.java @@ -0,0 +1,86 @@ +package com.ruoyi.common.core.text; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import com.ruoyi.common.utils.StringUtils; + +/** + * 字符集工具类 + * + * @author ruoyi + */ +public class CharsetKit +{ + /** ISO-8859-1 */ + public static final String ISO_8859_1 = "ISO-8859-1"; + /** UTF-8 */ + public static final String UTF_8 = "UTF-8"; + /** GBK */ + public static final String GBK = "GBK"; + + /** ISO-8859-1 */ + public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); + /** UTF-8 */ + public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); + /** GBK */ + public static final Charset CHARSET_GBK = Charset.forName(GBK); + + /** + * 转换为Charset对象 + * + * @param charset 字符集,为空则返回默认字符集 + * @return Charset + */ + public static Charset charset(String charset) + { + return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, String srcCharset, String destCharset) + { + return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, Charset srcCharset, Charset destCharset) + { + if (null == srcCharset) + { + srcCharset = StandardCharsets.ISO_8859_1; + } + + if (null == destCharset) + { + srcCharset = StandardCharsets.UTF_8; + } + + if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) + { + return source; + } + return new String(source.getBytes(srcCharset), destCharset); + } + + /** + * @return 系统字符集编码 + */ + public static String systemCharset() + { + return Charset.defaultCharset().name(); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/core/text/Convert.java b/evo/src/main/java/com/ruoyi/common/core/text/Convert.java new file mode 100644 index 0000000..b17dfdd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/core/text/Convert.java @@ -0,0 +1,999 @@ +package com.ruoyi.common.core.text; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.text.NumberFormat; +import java.util.Set; +import com.ruoyi.common.utils.StringUtils; + +/** + * 类型转换器 + * + * @author ruoyi + */ +public class Convert +{ + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static String toStr(Object value, String defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof String) + { + return (String) value; + } + return value.toString(); + } + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static String toStr(Object value) + { + return toStr(value, null); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Character toChar(Object value, Character defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof Character) + { + return (Character) value; + } + + final String valueStr = toStr(value, null); + return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Character toChar(Object value) + { + return toChar(value, null); + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Byte toByte(Object value, Byte defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Byte) + { + return (Byte) value; + } + if (value instanceof Number) + { + return ((Number) value).byteValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Byte.parseByte(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Byte toByte(Object value) + { + return toByte(value, null); + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Short toShort(Object value, Short defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Short) + { + return (Short) value; + } + if (value instanceof Number) + { + return ((Number) value).shortValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Short.parseShort(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Short toShort(Object value) + { + return toShort(value, null); + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Number toNumber(Object value, Number defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Number) + { + return (Number) value; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return NumberFormat.getInstance().parse(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Number toNumber(Object value) + { + return toNumber(value, null); + } + + /** + * 转换为int
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Integer toInt(Object value, Integer defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Integer) + { + return (Integer) value; + } + if (value instanceof Number) + { + return ((Number) value).intValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Integer.parseInt(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为int
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Integer toInt(Object value) + { + return toInt(value, null); + } + + /** + * 转换为Integer数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String str) + { + return toIntArray(",", str); + } + + /** + * 转换为Long数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String str) + { + return toLongArray(",", str); + } + + /** + * 转换为Integer数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Integer[] {}; + } + String[] arr = str.split(split); + final Integer[] ints = new Integer[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Integer v = toInt(arr[i], 0); + ints[i] = v; + } + return ints; + } + + /** + * 转换为Long数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Long[] {}; + } + String[] arr = str.split(split); + final Long[] longs = new Long[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Long v = toLong(arr[i], null); + longs[i] = v; + } + return longs; + } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String str) + { + return toStrArray(",", str); + } + + /** + * 转换为String数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String split, String str) + { + return str.split(split); + } + + /** + * 转换为long
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Long toLong(Object value, Long defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Long) + { + return (Long) value; + } + if (value instanceof Number) + { + return ((Number) value).longValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).longValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为long
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Long toLong(Object value) + { + return toLong(value, null); + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Double toDouble(Object value, Double defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Double) + { + return (Double) value; + } + if (value instanceof Number) + { + return ((Number) value).doubleValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).doubleValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Double toDouble(Object value) + { + return toDouble(value, null); + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Float toFloat(Object value, Float defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Float) + { + return (Float) value; + } + if (value instanceof Number) + { + return ((Number) value).floatValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Float.parseFloat(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Float toFloat(Object value) + { + return toFloat(value, null); + } + + /** + * 转换为boolean
+ * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Boolean toBool(Object value, Boolean defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Boolean) + { + return (Boolean) value; + } + String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + valueStr = valueStr.trim().toLowerCase(); + switch (valueStr) + { + case "true": + return true; + case "false": + return false; + case "yes": + return true; + case "ok": + return true; + case "no": + return false; + case "1": + return true; + case "0": + return false; + default: + return defaultValue; + } + } + + /** + * 转换为boolean
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Boolean toBool(Object value) + { + return toBool(value, null); + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * + * @param clazz Enum的Class + * @param value 值 + * @param defaultValue 默认值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value, E defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (clazz.isAssignableFrom(value.getClass())) + { + @SuppressWarnings("unchecked") + E myE = (E) value; + return myE; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Enum.valueOf(clazz, valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * + * @param clazz Enum的Class + * @param value 值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value) + { + return toEnum(clazz, value, null); + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigInteger) + { + return (BigInteger) value; + } + if (value instanceof Long) + { + return BigInteger.valueOf((Long) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigInteger(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value) + { + return toBigInteger(value, null); + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigDecimal) + { + return (BigDecimal) value; + } + if (value instanceof Long) + { + return new BigDecimal((Long) value); + } + if (value instanceof Double) + { + return new BigDecimal((Double) value); + } + if (value instanceof Integer) + { + return new BigDecimal((Integer) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigDecimal(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value) + { + return toBigDecimal(value, null); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @return 字符串 + */ + public static String utf8Str(Object obj) + { + return str(obj, CharsetKit.CHARSET_UTF_8); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charsetName 字符集 + * @return 字符串 + */ + public static String str(Object obj, String charsetName) + { + return str(obj, Charset.forName(charsetName)); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(Object obj, Charset charset) + { + if (null == obj) + { + return null; + } + + if (obj instanceof String) + { + return (String) obj; + } + else if (obj instanceof byte[] || obj instanceof Byte[]) + { + return str((Byte[]) obj, charset); + } + else if (obj instanceof ByteBuffer) + { + return str((ByteBuffer) obj, charset); + } + return obj.toString(); + } + + /** + * 将byte数组转为字符串 + * + * @param bytes byte数组 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(byte[] bytes, String charset) + { + return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); + } + + /** + * 解码字节码 + * + * @param data 字符串 + * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 + * @return 解码后的字符串 + */ + public static String str(byte[] data, Charset charset) + { + if (data == null) + { + return null; + } + + if (null == charset) + { + return new String(data); + } + return new String(data, charset); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, String charset) + { + if (data == null) + { + return null; + } + + return str(data, Charset.forName(charset)); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, Charset charset) + { + if (null == charset) + { + charset = Charset.defaultCharset(); + } + return charset.decode(data).toString(); + } + + // ----------------------------------------------------------------------- 全角半角转换 + /** + * 半角转全角 + * + * @param input String. + * @return 全角字符串. + */ + public static String toSBC(String input) + { + return toSBC(input, null); + } + + /** + * 半角转全角 + * + * @param input String + * @param notConvertSet 不替换的字符集合 + * @return 全角字符串. + */ + public static String toSBC(String input, Set notConvertSet) + { + char c[] = input.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == ' ') + { + c[i] = '\u3000'; + } + else if (c[i] < '\177') + { + c[i] = (char) (c[i] + 65248); + + } + } + return new String(c); + } + + /** + * 全角转半角 + * + * @param input String. + * @return 半角字符串 + */ + public static String toDBC(String input) + { + return toDBC(input, null); + } + + /** + * 替换全角为半角 + * + * @param text 文本 + * @param notConvertSet 不替换的字符集合 + * @return 替换后的字符 + */ + public static String toDBC(String text, Set notConvertSet) + { + char c[] = text.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == '\u3000') + { + c[i] = ' '; + } + else if (c[i] > '\uFF00' && c[i] < '\uFF5F') + { + c[i] = (char) (c[i] - 65248); + } + } + String returnString = new String(c); + + return returnString; + } + + /** + * 数字金额大写转换 先写个完整的然后将如零拾替换成零 + * + * @param n 数字 + * @return 中文大写数字 + */ + public static String digitUppercase(double n) + { + String[] fraction = { "角", "分" }; + String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; + String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; + + String head = n < 0 ? "负" : ""; + n = Math.abs(n); + + String s = ""; + for (int i = 0; i < fraction.length; i++) + { + s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + } + if (s.length() < 1) + { + s = "整"; + } + int integerPart = (int) Math.floor(n); + + for (int i = 0; i < unit[0].length && integerPart > 0; i++) + { + String p = ""; + for (int j = 0; j < unit[1].length && n > 0; j++) + { + p = digit[integerPart % 10] + unit[1][j] + p; + integerPart = integerPart / 10; + } + s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; + } + return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/core/text/StrFormatter.java b/evo/src/main/java/com/ruoyi/common/core/text/StrFormatter.java new file mode 100644 index 0000000..c78ac77 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/core/text/StrFormatter.java @@ -0,0 +1,92 @@ +package com.ruoyi.common.core.text; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 字符串格式化 + * + * @author ruoyi + */ +public class StrFormatter +{ + public static final String EMPTY_JSON = "{}"; + public static final char C_BACKSLASH = '\\'; + public static final char C_DELIM_START = '{'; + public static final char C_DELIM_END = '}'; + + /** + * 格式化字符串
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param strPattern 字符串模板 + * @param argArray 参数列表 + * @return 结果 + */ + public static String format(final String strPattern, final Object... argArray) + { + if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) + { + return strPattern; + } + final int strPatternLength = strPattern.length(); + + // 初始化定义好的长度以获得更好的性能 + StringBuilder sbuf = new StringBuilder(strPatternLength + 50); + + int handledPosition = 0; + int delimIndex;// 占位符所在位置 + for (int argIndex = 0; argIndex < argArray.length; argIndex++) + { + delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); + if (delimIndex == -1) + { + if (handledPosition == 0) + { + return strPattern; + } + else + { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 + sbuf.append(strPattern, handledPosition, strPatternLength); + return sbuf.toString(); + } + } + else + { + if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) + { + if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) + { + // 转义符之前还有一个转义符,占位符依旧有效 + sbuf.append(strPattern, handledPosition, delimIndex - 1); + sbuf.append(Convert.utf8Str(argArray[argIndex])); + handledPosition = delimIndex + 2; + } + else + { + // 占位符被转义 + argIndex--; + sbuf.append(strPattern, handledPosition, delimIndex - 1); + sbuf.append(C_DELIM_START); + handledPosition = delimIndex + 1; + } + } + else + { + // 正常占位符 + sbuf.append(strPattern, handledPosition, delimIndex); + sbuf.append(Convert.utf8Str(argArray[argIndex])); + handledPosition = delimIndex + 2; + } + } + } + // 加入最后一个占位符后所有的字符 + sbuf.append(strPattern, handledPosition, strPattern.length()); + + return sbuf.toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/enums/HttpMethod.java b/evo/src/main/java/com/ruoyi/common/enums/HttpMethod.java new file mode 100644 index 0000000..be6f739 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/enums/HttpMethod.java @@ -0,0 +1,36 @@ +package com.ruoyi.common.enums; + +import java.util.HashMap; +import java.util.Map; +import org.springframework.lang.Nullable; + +/** + * 请求方式 + * + * @author ruoyi + */ +public enum HttpMethod +{ + GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; + + private static final Map mappings = new HashMap<>(16); + + static + { + for (HttpMethod httpMethod : values()) + { + mappings.put(httpMethod.name(), httpMethod); + } + } + + @Nullable + public static HttpMethod resolve(@Nullable String method) + { + return (method != null ? mappings.get(method) : null); + } + + public boolean matches(String method) + { + return (this == resolve(method)); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/enums/UserStatus.java b/evo/src/main/java/com/ruoyi/common/enums/UserStatus.java new file mode 100644 index 0000000..d7ff44a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/enums/UserStatus.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.enums; + +/** + * 用户状态 + * + * @author ruoyi + */ +public enum UserStatus +{ + OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); + + private final String code; + private final String info; + + UserStatus(String code, String info) + { + this.code = code; + this.info = info; + } + + public String getCode() + { + return code; + } + + public String getInfo() + { + return info; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/BaseException.java b/evo/src/main/java/com/ruoyi/common/exception/BaseException.java new file mode 100644 index 0000000..92d6ae2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/BaseException.java @@ -0,0 +1,97 @@ +package com.ruoyi.common.exception; + +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.StringUtils; + +/** + * 基础异常 + * + * @author ruoyi + */ +public class BaseException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + /** + * 所属模块 + */ + private String module; + + /** + * 错误码 + */ + private String code; + + /** + * 错误码对应的参数 + */ + private Object[] args; + + /** + * 错误消息 + */ + private String defaultMessage; + + public BaseException(String module, String code, Object[] args, String defaultMessage) + { + this.module = module; + this.code = code; + this.args = args; + this.defaultMessage = defaultMessage; + } + + public BaseException(String module, String code, Object[] args) + { + this(module, code, args, null); + } + + public BaseException(String module, String defaultMessage) + { + this(module, null, null, defaultMessage); + } + + public BaseException(String code, Object[] args) + { + this(null, code, args, null); + } + + public BaseException(String defaultMessage) + { + this(null, null, null, defaultMessage); + } + + @Override + public String getMessage() + { + String message = null; + if (!StringUtils.isEmpty(code)) + { + message = MessageUtils.message(code, args); + } + if (message == null) + { + message = defaultMessage; + } + return message; + } + + public String getModule() + { + return module; + } + + public String getCode() + { + return code; + } + + public Object[] getArgs() + { + return args; + } + + public String getDefaultMessage() + { + return defaultMessage; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/CustomException.java b/evo/src/main/java/com/ruoyi/common/exception/CustomException.java new file mode 100644 index 0000000..d96c7ba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/CustomException.java @@ -0,0 +1,43 @@ +package com.ruoyi.common.exception; + +/** + * 自定义异常 + * + * @author ruoyi + */ +public class CustomException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + private Integer code; + + private String message; + + public CustomException(String message) + { + this.message = message; + } + + public CustomException(String message, Integer code) + { + this.message = message; + this.code = code; + } + + public CustomException(String message, Throwable e) + { + super(message, e); + this.message = message; + } + + @Override + public String getMessage() + { + return message; + } + + public Integer getCode() + { + return code; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/DemoModeException.java b/evo/src/main/java/com/ruoyi/common/exception/DemoModeException.java new file mode 100644 index 0000000..f6ad2ab --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/DemoModeException.java @@ -0,0 +1,15 @@ +package com.ruoyi.common.exception; + +/** + * 演示模式异常 + * + * @author ruoyi + */ +public class DemoModeException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + public DemoModeException() + { + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/UtilException.java b/evo/src/main/java/com/ruoyi/common/exception/UtilException.java new file mode 100644 index 0000000..980fa46 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/UtilException.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.exception; + +/** + * 工具类异常 + * + * @author ruoyi + */ +public class UtilException extends RuntimeException +{ + private static final long serialVersionUID = 8247610319171014183L; + + public UtilException(Throwable e) + { + super(e.getMessage(), e); + } + + public UtilException(String message) + { + super(message); + } + + public UtilException(String message, Throwable throwable) + { + super(message, throwable); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/file/FileException.java b/evo/src/main/java/com/ruoyi/common/exception/file/FileException.java new file mode 100644 index 0000000..75d6dbf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/file/FileException.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.exception.file; + +import com.ruoyi.common.exception.BaseException; + +/** + * 文件信息异常类 + * + * @author ruoyi + */ +public class FileException extends BaseException +{ + private static final long serialVersionUID = 1L; + + public FileException(String code, Object[] args) + { + super("file", code, args, null); + } + +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java b/evo/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java new file mode 100644 index 0000000..70e0ec9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.file; + +/** + * 文件名称超长限制异常类 + * + * @author ruoyi + */ +public class FileNameLengthLimitExceededException extends FileException +{ + private static final long serialVersionUID = 1L; + + public FileNameLengthLimitExceededException(int defaultFileNameLength) + { + super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java b/evo/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java new file mode 100644 index 0000000..ec6ab05 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.file; + +/** + * 文件名大小限制异常类 + * + * @author ruoyi + */ +public class FileSizeLimitExceededException extends FileException +{ + private static final long serialVersionUID = 1L; + + public FileSizeLimitExceededException(long defaultMaxSize) + { + super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java b/evo/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java new file mode 100644 index 0000000..8f63a79 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java @@ -0,0 +1,71 @@ +package com.ruoyi.common.exception.file; + +import java.util.Arrays; +import org.apache.commons.fileupload.FileUploadException; + +/** + * 文件上传 误异常类 + * + * @author ruoyi + */ +public class InvalidExtensionException extends FileUploadException +{ + private static final long serialVersionUID = 1L; + + private String[] allowedExtension; + private String extension; + private String filename; + + public InvalidExtensionException(String[] allowedExtension, String extension, String filename) + { + super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]"); + this.allowedExtension = allowedExtension; + this.extension = extension; + this.filename = filename; + } + + public String[] getAllowedExtension() + { + return allowedExtension; + } + + public String getExtension() + { + return extension; + } + + public String getFilename() + { + return filename; + } + + public static class InvalidImageExtensionException extends InvalidExtensionException + { + private static final long serialVersionUID = 1L; + + public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) + { + super(allowedExtension, extension, filename); + } + } + + public static class InvalidFlashExtensionException extends InvalidExtensionException + { + private static final long serialVersionUID = 1L; + + public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename) + { + super(allowedExtension, extension, filename); + } + } + + public static class InvalidMediaExtensionException extends InvalidExtensionException + { + private static final long serialVersionUID = 1L; + + public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) + { + super(allowedExtension, extension, filename); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/job/TaskException.java b/evo/src/main/java/com/ruoyi/common/exception/job/TaskException.java new file mode 100644 index 0000000..a567b40 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/job/TaskException.java @@ -0,0 +1,34 @@ +package com.ruoyi.common.exception.job; + +/** + * 计划策略异常 + * + * @author ruoyi + */ +public class TaskException extends Exception +{ + private static final long serialVersionUID = 1L; + + private Code code; + + public TaskException(String msg, Code code) + { + this(msg, code, null); + } + + public TaskException(String msg, Code code, Exception nestedEx) + { + super(msg, nestedEx); + this.code = code; + } + + public Code getCode() + { + return code; + } + + public enum Code + { + TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java b/evo/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java new file mode 100644 index 0000000..389dbc7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 验证码错误异常类 + * + * @author ruoyi + */ +public class CaptchaException extends UserException +{ + private static final long serialVersionUID = 1L; + + public CaptchaException() + { + super("user.jcaptcha.error", null); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java b/evo/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java new file mode 100644 index 0000000..85f9486 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 验证码失效异常类 + * + * @author ruoyi + */ +public class CaptchaExpireException extends UserException +{ + private static final long serialVersionUID = 1L; + + public CaptchaExpireException() + { + super("user.jcaptcha.expire", null); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/user/UserException.java b/evo/src/main/java/com/ruoyi/common/exception/user/UserException.java new file mode 100644 index 0000000..aa015f8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/user/UserException.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.exception.user; + +import com.ruoyi.common.exception.BaseException; + +/** + * 用户信息异常类 + * + * @author ruoyi + */ +public class UserException extends BaseException +{ + private static final long serialVersionUID = 1L; + + public UserException(String code, Object[] args) + { + super("user", code, args, null); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java b/evo/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java new file mode 100644 index 0000000..a7f3e5f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 用户密码不正确或不符合规范异常类 + * + * @author ruoyi + */ +public class UserPasswordNotMatchException extends UserException +{ + private static final long serialVersionUID = 1L; + + public UserPasswordNotMatchException() + { + super("user.password.not.match", null); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java b/evo/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java new file mode 100644 index 0000000..6e3edfc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java @@ -0,0 +1,52 @@ +package com.ruoyi.common.filter; + +import java.io.IOException; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import org.springframework.http.MediaType; +import com.ruoyi.common.utils.StringUtils; + +/** + * Repeatable 过滤器 + * + * @author ruoyi + */ +public class RepeatableFilter implements Filter +{ + @Override + public void init(FilterConfig filterConfig) throws ServletException + { + + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException + { + ServletRequest requestWrapper = null; + if (request instanceof HttpServletRequest && StringUtils.equalsAnyIgnoreCase(request.getContentType(), + MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_JSON_UTF8_VALUE)) + { + requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); + } + if (null == requestWrapper) + { + chain.doFilter(request, response); + } + else + { + chain.doFilter(requestWrapper, response); + } + } + + @Override + public void destroy() + { + + } +} diff --git a/evo/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java b/evo/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java new file mode 100644 index 0000000..bd7097f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java @@ -0,0 +1,72 @@ +package com.ruoyi.common.filter; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import com.ruoyi.common.utils.http.HttpHelper; + +/** + * 构建可重复读取inputStream的request + * + * @author ruoyi + */ +public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper +{ + private final byte[] body; + + public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException + { + super(request); + request.setCharacterEncoding("UTF-8"); + response.setCharacterEncoding("UTF-8"); + + body = HttpHelper.getBodyString(request).getBytes("UTF-8"); + } + + @Override + public BufferedReader getReader() throws IOException + { + return new BufferedReader(new InputStreamReader(getInputStream())); + } + + @Override + public ServletInputStream getInputStream() throws IOException + { + + final ByteArrayInputStream bais = new ByteArrayInputStream(body); + + return new ServletInputStream() + { + + @Override + public int read() throws IOException + { + return bais.read(); + } + + @Override + public boolean isFinished() + { + return false; + } + + @Override + public boolean isReady() + { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) + { + + } + }; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/filter/XssFilter.java b/evo/src/main/java/com/ruoyi/common/filter/XssFilter.java new file mode 100644 index 0000000..b3df122 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/filter/XssFilter.java @@ -0,0 +1,97 @@ +package com.ruoyi.common.filter; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.utils.StringUtils; + +/** + * 防止XSS攻击的过滤器 + * + * @author ruoyi + */ +public class XssFilter implements Filter +{ + /** + * 排除链接 + */ + public List excludes = new ArrayList<>(); + + /** + * xss过滤开关 + */ + public boolean enabled = false; + + @Override + public void init(FilterConfig filterConfig) throws ServletException + { + String tempExcludes = filterConfig.getInitParameter("excludes"); + String tempEnabled = filterConfig.getInitParameter("enabled"); + if (StringUtils.isNotEmpty(tempExcludes)) + { + String[] url = tempExcludes.split(","); + for (int i = 0; url != null && i < url.length; i++) + { + excludes.add(url[i]); + } + } + if (StringUtils.isNotEmpty(tempEnabled)) + { + enabled = Boolean.valueOf(tempEnabled); + } + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException + { + HttpServletRequest req = (HttpServletRequest) request; + HttpServletResponse resp = (HttpServletResponse) response; + if (handleExcludeURL(req, resp)) + { + chain.doFilter(request, response); + return; + } + XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request); + chain.doFilter(xssRequest, response); + } + + private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) + { + if (!enabled) + { + return true; + } + if (excludes == null || excludes.isEmpty()) + { + return false; + } + String url = request.getServletPath(); + for (String pattern : excludes) + { + Pattern p = Pattern.compile("^" + pattern); + Matcher m = p.matcher(url); + if (m.find()) + { + return true; + } + } + return false; + } + + @Override + public void destroy() + { + + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java b/evo/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java new file mode 100644 index 0000000..17bfec1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java @@ -0,0 +1,105 @@ +package com.ruoyi.common.filter; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import org.apache.commons.io.IOUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.html.EscapeUtil; + +/** + * XSS过滤处理 + * + * @author ruoyi + */ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper +{ + /** + * @param request + */ + public XssHttpServletRequestWrapper(HttpServletRequest request) + { + super(request); + } + + @Override + public String[] getParameterValues(String name) + { + String[] values = super.getParameterValues(name); + if (values != null) + { + int length = values.length; + String[] escapseValues = new String[length]; + for (int i = 0; i < length; i++) + { + // 防xss攻击和过滤前后空格 + escapseValues[i] = EscapeUtil.clean(values[i]).trim(); + } + return escapseValues; + } + return super.getParameterValues(name); + } + + @Override + public ServletInputStream getInputStream() throws IOException + { + // 非json类型,直接返回 + if (!isJsonRequest()) + { + return super.getInputStream(); + } + + // 为空,直接返回 + String json = IOUtils.toString(super.getInputStream(), "utf-8"); + if (StringUtils.isEmpty(json)) + { + return super.getInputStream(); + } + + // xss过滤 + json = EscapeUtil.clean(json).trim(); + final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8")); + return new ServletInputStream() + { + @Override + public boolean isFinished() + { + return true; + } + + @Override + public boolean isReady() + { + return true; + } + + @Override + public void setReadListener(ReadListener readListener) + { + } + + @Override + public int read() throws IOException + { + return bis.read(); + } + }; + } + + /** + * 是否是Json请求 + * + * @param request + */ + public boolean isJsonRequest() + { + String header = super.getHeader(HttpHeaders.CONTENT_TYPE); + return MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(header) + || MediaType.APPLICATION_JSON_UTF8_VALUE.equalsIgnoreCase(header); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/Arith.java b/evo/src/main/java/com/ruoyi/common/utils/Arith.java new file mode 100644 index 0000000..48a650e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/Arith.java @@ -0,0 +1,114 @@ +package com.ruoyi.common.utils; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +/** + * 精确的浮点数运算 + * + * @author ruoyi + */ +public class Arith +{ + + /** 默认除法运算精度 */ + private static final int DEF_DIV_SCALE = 10; + + /** 这个类不能实例化 */ + private Arith() + { + } + + /** + * 提供精确的加法运算。 + * @param v1 被加数 + * @param v2 加数 + * @return 两个参数的和 + */ + public static double add(double v1, double v2) + { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.add(b2).doubleValue(); + } + + /** + * 提供精确的减法运算。 + * @param v1 被减数 + * @param v2 减数 + * @return 两个参数的差 + */ + public static double sub(double v1, double v2) + { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.subtract(b2).doubleValue(); + } + + /** + * 提供精确的乘法运算。 + * @param v1 被乘数 + * @param v2 乘数 + * @return 两个参数的积 + */ + public static double mul(double v1, double v2) + { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.multiply(b2).doubleValue(); + } + + /** + * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 + * 小数点以后10位,以后的数字四舍五入。 + * @param v1 被除数 + * @param v2 除数 + * @return 两个参数的商 + */ + public static double div(double v1, double v2) + { + return div(v1, v2, DEF_DIV_SCALE); + } + + /** + * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 + * 定精度,以后的数字四舍五入。 + * @param v1 被除数 + * @param v2 除数 + * @param scale 表示表示需要精确到小数点以后几位。 + * @return 两个参数的商 + */ + public static double div(double v1, double v2, int scale) + { + if (scale < 0) + { + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + if (b1.compareTo(BigDecimal.ZERO) == 0) + { + return BigDecimal.ZERO.doubleValue(); + } + return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); + } + + /** + * 提供精确的小数位四舍五入处理。 + * @param v 需要四舍五入的数字 + * @param scale 小数点后保留几位 + * @return 四舍五入后的结果 + */ + public static double round(double v, int scale) + { + if (scale < 0) + { + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b = new BigDecimal(Double.toString(v)); + BigDecimal one = new BigDecimal("1"); + return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue(); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/DateUtils.java b/evo/src/main/java/com/ruoyi/common/utils/DateUtils.java new file mode 100644 index 0000000..536cb3c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/DateUtils.java @@ -0,0 +1,155 @@ +package com.ruoyi.common.utils; + +import java.lang.management.ManagementFactory; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import org.apache.commons.lang3.time.DateFormatUtils; + +/** + * 时间工具类 + * + * @author ruoyi + */ +public class DateUtils extends org.apache.commons.lang3.time.DateUtils +{ + public static String YYYY = "yyyy"; + + public static String YYYY_MM = "yyyy-MM"; + + public static String YYYY_MM_DD = "yyyy-MM-dd"; + + public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; + + public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; + + private static String[] parsePatterns = { + "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", + "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", + "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; + + /** + * 获取当前Date型日期 + * + * @return Date() 当前日期 + */ + public static Date getNowDate() + { + return new Date(); + } + + /** + * 获取当前日期, 默认格式为yyyy-MM-dd + * + * @return String + */ + public static String getDate() + { + return dateTimeNow(YYYY_MM_DD); + } + + public static final String getTime() + { + return dateTimeNow(YYYY_MM_DD_HH_MM_SS); + } + + public static final String dateTimeNow() + { + return dateTimeNow(YYYYMMDDHHMMSS); + } + + public static final String dateTimeNow(final String format) + { + return parseDateToStr(format, new Date()); + } + + public static final String dateTime(final Date date) + { + return parseDateToStr(YYYY_MM_DD, date); + } + + public static final String parseDateToStr(final String format, final Date date) + { + return new SimpleDateFormat(format).format(date); + } + + public static final Date dateTime(final String format, final String ts) + { + try + { + return new SimpleDateFormat(format).parse(ts); + } + catch (ParseException e) + { + throw new RuntimeException(e); + } + } + + /** + * 日期路径 即年/月/日 如2018/08/08 + */ + public static final String datePath() + { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyy/MM/dd"); + } + + /** + * 日期路径 即年/月/日 如20180808 + */ + public static final String dateTime() + { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyyMMdd"); + } + + /** + * 日期型字符串转化为日期 格式 + */ + public static Date parseDate(Object str) + { + if (str == null) + { + return null; + } + try + { + return parseDate(str.toString(), parsePatterns); + } + catch (ParseException e) + { + return null; + } + } + + /** + * 获取服务器启动时间 + */ + public static Date getServerStartDate() + { + long time = ManagementFactory.getRuntimeMXBean().getStartTime(); + return new Date(time); + } + + /** + * 计算两个时间差 + */ + public static String getDatePoor(Date endDate, Date nowDate) + { + long nd = 1000 * 24 * 60 * 60; + long nh = 1000 * 60 * 60; + long nm = 1000 * 60; + // long ns = 1000; + // 获得两个时间的毫秒时间差异 + long diff = endDate.getTime() - nowDate.getTime(); + // 计算差多少天 + long day = diff / nd; + // 计算差多少小时 + long hour = diff % nd / nh; + // 计算差多少分钟 + long min = diff % nd % nh / nm; + // 计算差多少秒//输出结果 + // long sec = diff % nd % nh % nm / ns; + return day + "天" + hour + "小时" + min + "分钟"; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/DictUtils.java b/evo/src/main/java/com/ruoyi/common/utils/DictUtils.java new file mode 100644 index 0000000..9281499 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/DictUtils.java @@ -0,0 +1,64 @@ +package com.ruoyi.common.utils; + +import java.util.Collection; +import java.util.List; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.redis.RedisCache; +import com.ruoyi.project.system.domain.SysDictData; + +/** + * 字典工具类 + * + * @author ruoyi + */ +public class DictUtils +{ + /** + * 设置字典缓存 + * + * @param key 参数键 + * @param dictDatas 字典数据列表 + */ + public static void setDictCache(String key, List dictDatas) + { + SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas); + } + + /** + * 获取字典缓存 + * + * @param key 参数键 + * @return dictDatas 字典数据列表 + */ + public static List getDictCache(String key) + { + Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); + if (StringUtils.isNotNull(cacheObj)) + { + List DictDatas = StringUtils.cast(cacheObj); + return DictDatas; + } + return null; + } + + /** + * 清空字典缓存 + */ + public static void clearDictCache() + { + Collection keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*"); + SpringUtils.getBean(RedisCache.class).deleteObject(keys); + } + + /** + * 设置cache key + * + * @param configKey 参数键 + * @return 缓存键key + */ + public static String getCacheKey(String configKey) + { + return Constants.SYS_DICT_KEY + configKey; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java b/evo/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java new file mode 100644 index 0000000..ad57439 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java @@ -0,0 +1,40 @@ +package com.ruoyi.common.utils; + +import java.io.PrintWriter; +import java.io.StringWriter; +import org.apache.commons.lang3.exception.ExceptionUtils; + +/** + * 错误信息处理类。 + * + * @author ruoyi + */ +public class ExceptionUtil +{ + /** + * 获取exception的详细错误信息。 + */ + public static String getExceptionMessage(Throwable e) + { + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw, true)); + String str = sw.toString(); + return str; + } + + public static String getRootErrorMseeage(Exception e) + { + Throwable root = ExceptionUtils.getRootCause(e); + root = (root == null ? e : root); + if (root == null) + { + return ""; + } + String msg = root.getMessage(); + if (msg == null) + { + return "null"; + } + return StringUtils.defaultString(msg); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/IdUtils.java b/evo/src/main/java/com/ruoyi/common/utils/IdUtils.java new file mode 100644 index 0000000..a21313f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/IdUtils.java @@ -0,0 +1,51 @@ +package com.ruoyi.common.utils; + +import com.ruoyi.common.core.lang.UUID; + +/** + * ID生成器工具类 + * + * @author ruoyi + */ +public class IdUtils +{ + /** + * 获取随机UUID + * + * @return 随机UUID + */ + public static String randomUUID() + { + return UUID.randomUUID().toString(); + } + + /** + * 简化的UUID,去掉了横线 + * + * @return 简化的UUID,去掉了横线 + */ + public static String simpleUUID() + { + return UUID.randomUUID().toString(true); + } + + /** + * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID + * + * @return 随机UUID + */ + public static String fastUUID() + { + return UUID.fastUUID().toString(); + } + + /** + * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID + * + * @return 简化的UUID,去掉了横线 + */ + public static String fastSimpleUUID() + { + return UUID.fastUUID().toString(true); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/LogUtils.java b/evo/src/main/java/com/ruoyi/common/utils/LogUtils.java new file mode 100644 index 0000000..0de30c6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/LogUtils.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.utils; + +/** + * 处理并记录日志文件 + * + * @author ruoyi + */ +public class LogUtils +{ + public static String getBlock(Object msg) + { + if (msg == null) + { + msg = ""; + } + return "[" + msg.toString() + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/MessageUtils.java b/evo/src/main/java/com/ruoyi/common/utils/MessageUtils.java new file mode 100644 index 0000000..7dac75a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/MessageUtils.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.utils; + +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import com.ruoyi.common.utils.spring.SpringUtils; + +/** + * 获取i18n资源文件 + * + * @author ruoyi + */ +public class MessageUtils +{ + /** + * 根据消息键和参数 获取消息 委托给spring messageSource + * + * @param code 消息键 + * @param args 参数 + * @return 获取国际化翻译值 + */ + public static String message(String code, Object... args) + { + MessageSource messageSource = SpringUtils.getBean(MessageSource.class); + return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/evo/src/main/java/com/ruoyi/common/utils/SecurityUtils.java new file mode 100644 index 0000000..1c86837 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/SecurityUtils.java @@ -0,0 +1,90 @@ +package com.ruoyi.common.utils; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.framework.security.LoginUser; + +/** + * 安全服务工具类 + * + * @author ruoyi + */ +public class SecurityUtils +{ + /** + * 获取用户账户 + **/ + public static String getUsername() + { + try + { + return getLoginUser().getUsername(); + } + catch (Exception e) + { + throw new CustomException("获取用户账户异常", HttpStatus.UNAUTHORIZED); + } + } + + /** + * 获取用户 + **/ + public static LoginUser getLoginUser() + { + try + { + return (LoginUser) getAuthentication().getPrincipal(); + } + catch (Exception e) + { + throw new CustomException("获取用户信息异常", HttpStatus.UNAUTHORIZED); + } + } + + /** + * 获取Authentication + */ + public static Authentication getAuthentication() + { + return SecurityContextHolder.getContext().getAuthentication(); + } + + /** + * 生成BCryptPasswordEncoder密码 + * + * @param password 密码 + * @return 加密字符串 + */ + public static String encryptPassword(String password) + { + BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + return passwordEncoder.encode(password); + } + + /** + * 判断密码是否相同 + * + * @param rawPassword 真实密码 + * @param encodedPassword 加密后字符 + * @return 结果 + */ + public static boolean matchesPassword(String rawPassword, String encodedPassword) + { + BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + return passwordEncoder.matches(rawPassword, encodedPassword); + } + + /** + * 是否为管理员 + * + * @param userId 用户ID + * @return 结果 + */ + public static boolean isAdmin(Long userId) + { + return userId != null && 1L == userId; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/ServletUtils.java b/evo/src/main/java/com/ruoyi/common/utils/ServletUtils.java new file mode 100644 index 0000000..ab9ebcf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/ServletUtils.java @@ -0,0 +1,136 @@ +package com.ruoyi.common.utils; + +import java.io.IOException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import com.ruoyi.common.core.text.Convert; + +/** + * 客户端工具类 + * + * @author ruoyi + */ +public class ServletUtils +{ + /** + * 获取String参数 + */ + public static String getParameter(String name) + { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) + { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) + { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) + { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() + { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() + { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() + { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() + { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } + + /** + * 将字符串渲染到客户端 + * + * @param response 渲染对象 + * @param string 待渲染的字符串 + * @return null + */ + public static String renderString(HttpServletResponse response, String string) + { + try + { + response.setStatus(200); + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.getWriter().print(string); + } + catch (IOException e) + { + e.printStackTrace(); + } + return null; + } + + /** + * 是否是Ajax异步请求 + * + * @param request + */ + public static boolean isAjaxRequest(HttpServletRequest request) + { + String accept = request.getHeader("accept"); + if (accept != null && accept.indexOf("application/json") != -1) + { + return true; + } + + String xRequestedWith = request.getHeader("X-Requested-With"); + if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) + { + return true; + } + + String uri = request.getRequestURI(); + if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) + { + return true; + } + + String ajax = request.getParameter("__ajax"); + if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) + { + return true; + } + return false; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/StringUtils.java b/evo/src/main/java/com/ruoyi/common/utils/StringUtils.java new file mode 100644 index 0000000..7e3969f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/StringUtils.java @@ -0,0 +1,459 @@ +package com.ruoyi.common.utils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import com.ruoyi.common.core.text.StrFormatter; + +/** + * 字符串工具类 + * + * @author ruoyi + */ +public class StringUtils extends org.apache.commons.lang3.StringUtils +{ + /** 空字符串 */ + private static final String NULLSTR = ""; + + /** 下划线 */ + private static final char SEPARATOR = '_'; + + /** + * 获取参数不为空值 + * + * @param value defaultValue 要判断的value + * @return value 返回值 + */ + public static T nvl(T value, T defaultValue) + { + return value != null ? value : defaultValue; + } + + /** + * * 判断一个Collection是否为空, 包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Collection coll) + { + return isNull(coll) || coll.isEmpty(); + } + + /** + * * 判断一个Collection是否非空,包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Collection coll) + { + return !isEmpty(coll); + } + + /** + * * 判断一个对象数组是否为空 + * + * @param objects 要判断的对象数组 + ** @return true:为空 false:非空 + */ + public static boolean isEmpty(Object[] objects) + { + return isNull(objects) || (objects.length == 0); + } + + /** + * * 判断一个对象数组是否非空 + * + * @param objects 要判断的对象数组 + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Object[] objects) + { + return !isEmpty(objects); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Map map) + { + return isNull(map) || map.isEmpty(); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Map map) + { + return !isEmpty(map); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) + { + return isNull(str) || NULLSTR.equals(str.trim()); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) + { + return !isEmpty(str); + } + + /** + * * 判断一个对象是否为空 + * + * @param object Object + * @return true:为空 false:非空 + */ + public static boolean isNull(Object object) + { + return object == null; + } + + /** + * * 判断一个对象是否非空 + * + * @param object Object + * @return true:非空 false:空 + */ + public static boolean isNotNull(Object object) + { + return !isNull(object); + } + + /** + * * 判断一个对象是否是数组类型(Java基本型别的数组) + * + * @param object 对象 + * @return true:是数组 false:不是数组 + */ + public static boolean isArray(Object object) + { + return isNotNull(object) && object.getClass().isArray(); + } + + /** + * 去空格 + */ + public static String trim(String str) + { + return (str == null ? "" : str.trim()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) + { + if (str == null) + { + return NULLSTR; + } + + if (start < 0) + { + start = str.length() + start; + } + + if (start < 0) + { + start = 0; + } + if (start > str.length()) + { + return NULLSTR; + } + + return str.substring(start); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) + { + if (str == null) + { + return NULLSTR; + } + + if (end < 0) + { + end = str.length() + end; + } + if (start < 0) + { + start = str.length() + start; + } + + if (end > str.length()) + { + end = str.length(); + } + + if (start > end) + { + return NULLSTR; + } + + if (start < 0) + { + start = 0; + } + if (end < 0) + { + end = 0; + } + + return str.substring(start, end); + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ + public static String format(String template, Object... params) + { + if (isEmpty(params) || isEmpty(template)) + { + return template; + } + return StrFormatter.format(template, params); + } + + /** + * 字符串转set + * + * @param str 字符串 + * @param sep 分隔符 + * @return set集合 + */ + public static final Set str2Set(String str, String sep) + { + return new HashSet(str2List(str, sep, true, false)); + } + + /** + * 字符串转list + * + * @param str 字符串 + * @param sep 分隔符 + * @param filterBlank 过滤纯空白 + * @param trim 去掉首尾空白 + * @return list集合 + */ + public static final List str2List(String str, String sep, boolean filterBlank, boolean trim) + { + List list = new ArrayList(); + if (StringUtils.isEmpty(str)) + { + return list; + } + + // 过滤空白字符串 + if (filterBlank && StringUtils.isBlank(str)) + { + return list; + } + String[] split = str.split(sep); + for (String string : split) + { + if (filterBlank && StringUtils.isBlank(string)) + { + continue; + } + if (trim) + { + string = string.trim(); + } + list.add(string); + } + + return list; + } + + /** + * 下划线转驼峰命名 + */ + public static String toUnderScoreCase(String str) + { + if (str == null) + { + return null; + } + StringBuilder sb = new StringBuilder(); + // 前置字符是否大写 + boolean preCharIsUpperCase = true; + // 当前字符是否大写 + boolean curreCharIsUpperCase = true; + // 下一字符是否大写 + boolean nexteCharIsUpperCase = true; + for (int i = 0; i < str.length(); i++) + { + char c = str.charAt(i); + if (i > 0) + { + preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); + } + else + { + preCharIsUpperCase = false; + } + + curreCharIsUpperCase = Character.isUpperCase(c); + + if (i < (str.length() - 1)) + { + nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); + } + + if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) + { + sb.append(SEPARATOR); + } + else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) + { + sb.append(SEPARATOR); + } + sb.append(Character.toLowerCase(c)); + } + + return sb.toString(); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) + { + if (str != null && strs != null) + { + for (String s : strs) + { + if (str.equalsIgnoreCase(trim(s))) + { + return true; + } + } + } + return false; + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) + { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (name == null || name.isEmpty()) + { + // 没必要转换 + return ""; + } + else if (!name.contains("_")) + { + // 不含下划线,仅将首字母大写 + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + // 用下划线将原始字符串分割 + String[] camels = name.split("_"); + for (String camel : camels) + { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (camel.isEmpty()) + { + continue; + } + // 首字母大写 + result.append(camel.substring(0, 1).toUpperCase()); + result.append(camel.substring(1).toLowerCase()); + } + return result.toString(); + } + + /** + * 驼峰式命名法 例如:user_name->userName + */ + public static String toCamelCase(String s) + { + if (s == null) + { + return null; + } + s = s.toLowerCase(); + StringBuilder sb = new StringBuilder(s.length()); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) + { + char c = s.charAt(i); + + if (c == SEPARATOR) + { + upperCase = true; + } + else if (upperCase) + { + sb.append(Character.toUpperCase(c)); + upperCase = false; + } + else + { + sb.append(c); + } + } + return sb.toString(); + } + + @SuppressWarnings("unchecked") + public static T cast(Object obj) + { + return (T) obj; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/Threads.java b/evo/src/main/java/com/ruoyi/common/utils/Threads.java new file mode 100644 index 0000000..1934195 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/Threads.java @@ -0,0 +1,99 @@ +package com.ruoyi.common.utils; + +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 线程相关工具类. + * + * @author ruoyi + */ +public class Threads +{ + private static final Logger logger = LoggerFactory.getLogger(Threads.class); + + /** + * sleep等待,单位为毫秒 + */ + public static void sleep(long milliseconds) + { + try + { + Thread.sleep(milliseconds); + } + catch (InterruptedException e) + { + return; + } + } + + /** + * 停止线程池 + * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务. + * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数. + * 如果仍人超時,則強制退出. + * 另对在shutdown时线程本身被调用中断做了处理. + */ + public static void shutdownAndAwaitTermination(ExecutorService pool) + { + if (pool != null && !pool.isShutdown()) + { + pool.shutdown(); + try + { + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) + { + pool.shutdownNow(); + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) + { + logger.info("Pool did not terminate"); + } + } + } + catch (InterruptedException ie) + { + pool.shutdownNow(); + Thread.currentThread().interrupt(); + } + } + } + + /** + * 打印线程异常信息 + */ + public static void printException(Runnable r, Throwable t) + { + if (t == null && r instanceof Future) + { + try + { + Future future = (Future) r; + if (future.isDone()) + { + future.get(); + } + } + catch (CancellationException ce) + { + t = ce; + } + catch (ExecutionException ee) + { + t = ee.getCause(); + } + catch (InterruptedException ie) + { + Thread.currentThread().interrupt(); + } + } + if (t != null) + { + logger.error(t.getMessage(), t); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java b/evo/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java new file mode 100644 index 0000000..912bc04 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java @@ -0,0 +1,226 @@ +package com.ruoyi.common.utils; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.OutputStream; +import java.security.SecureRandom; +import java.util.Arrays; +import java.util.Random; +import javax.imageio.ImageIO; + +/** + * 验证码工具类 + * + * @author ruoyi + */ +public class VerifyCodeUtils +{ + // 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符 + public static final String VERIFY_CODES = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ"; + + private static Random random = new SecureRandom(); + + /** + * 使用系统默认字符源生成验证码 + * + * @param verifySize 验证码长度 + * @return + */ + public static String generateVerifyCode(int verifySize) + { + return generateVerifyCode(verifySize, VERIFY_CODES); + } + + /** + * 使用指定源生成验证码 + * + * @param verifySize 验证码长度 + * @param sources 验证码字符源 + * @return + */ + public static String generateVerifyCode(int verifySize, String sources) + { + if (sources == null || sources.length() == 0) + { + sources = VERIFY_CODES; + } + int codesLen = sources.length(); + Random rand = new Random(System.currentTimeMillis()); + StringBuilder verifyCode = new StringBuilder(verifySize); + for (int i = 0; i < verifySize; i++) + { + verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1))); + } + return verifyCode.toString(); + } + + /** + * 输出指定验证码图片流 + * + * @param w + * @param h + * @param os + * @param code + * @throws IOException + */ + public static void outputImage(int w, int h, OutputStream os, String code) throws IOException + { + int verifySize = code.length(); + BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); + Random rand = new Random(); + Graphics2D g2 = image.createGraphics(); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + Color[] colors = new Color[5]; + Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, + Color.ORANGE, Color.PINK, Color.YELLOW }; + float[] fractions = new float[colors.length]; + for (int i = 0; i < colors.length; i++) + { + colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)]; + fractions[i] = rand.nextFloat(); + } + Arrays.sort(fractions); + + g2.setColor(Color.GRAY);// 设置边框色 + g2.fillRect(0, 0, w, h); + + Color c = getRandColor(200, 250); + g2.setColor(c);// 设置背景色 + g2.fillRect(0, 2, w, h - 4); + + // 绘制干扰线 + Random random = new Random(); + g2.setColor(getRandColor(160, 200));// 设置线条的颜色 + for (int i = 0; i < 20; i++) + { + int x = random.nextInt(w - 1); + int y = random.nextInt(h - 1); + int xl = random.nextInt(6) + 1; + int yl = random.nextInt(12) + 1; + g2.drawLine(x, y, x + xl + 40, y + yl + 20); + } + + // 添加噪点 + float yawpRate = 0.05f;// 噪声率 + int area = (int) (yawpRate * w * h); + for (int i = 0; i < area; i++) + { + int x = random.nextInt(w); + int y = random.nextInt(h); + int rgb = getRandomIntColor(); + image.setRGB(x, y, rgb); + } + + shear(g2, w, h, c);// 使图片扭曲 + + g2.setColor(getRandColor(100, 160)); + int fontSize = h - 4; + Font font = new Font("Algerian", Font.ITALIC, fontSize); + g2.setFont(font); + char[] chars = code.toCharArray(); + for (int i = 0; i < verifySize; i++) + { + AffineTransform affine = new AffineTransform(); + affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), + (w / verifySize) * i + fontSize / 2, h / 2); + g2.setTransform(affine); + g2.drawChars(chars, i, 1, ((w - 10) / verifySize) * i + 5, h / 2 + fontSize / 2 - 10); + } + + g2.dispose(); + ImageIO.write(image, "jpg", os); + } + + private static Color getRandColor(int fc, int bc) + { + if (fc > 255) + fc = 255; + if (bc > 255) + bc = 255; + int r = fc + random.nextInt(bc - fc); + int g = fc + random.nextInt(bc - fc); + int b = fc + random.nextInt(bc - fc); + return new Color(r, g, b); + } + + private static int getRandomIntColor() + { + int[] rgb = getRandomRgb(); + int color = 0; + for (int c : rgb) + { + color = color << 8; + color = color | c; + } + return color; + } + + private static int[] getRandomRgb() + { + int[] rgb = new int[3]; + for (int i = 0; i < 3; i++) + { + rgb[i] = random.nextInt(255); + } + return rgb; + } + + private static void shear(Graphics g, int w1, int h1, Color color) + { + shearX(g, w1, h1, color); + shearY(g, w1, h1, color); + } + + private static void shearX(Graphics g, int w1, int h1, Color color) + { + + int period = random.nextInt(2); + + boolean borderGap = true; + int frames = 1; + int phase = random.nextInt(2); + + for (int i = 0; i < h1; i++) + { + double d = (double) (period >> 1) + * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); + g.copyArea(0, i, w1, 1, (int) d, 0); + if (borderGap) + { + g.setColor(color); + g.drawLine((int) d, i, 0, i); + g.drawLine((int) d + w1, i, w1, i); + } + } + + } + + private static void shearY(Graphics g, int w1, int h1, Color color) + { + + int period = random.nextInt(40) + 10; // 50; + + boolean borderGap = true; + int frames = 20; + int phase = 7; + for (int i = 0; i < w1; i++) + { + double d = (double) (period >> 1) + * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); + g.copyArea(i, 0, 1, h1, 0, (int) d); + if (borderGap) + { + g.setColor(color); + g.drawLine(i, (int) d, i, 0); + g.drawLine(i, (int) d + h1, i, h1); + } + + } + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java b/evo/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java new file mode 100644 index 0000000..4463662 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java @@ -0,0 +1,110 @@ +package com.ruoyi.common.utils.bean; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Bean 工具类 + * + * @author ruoyi + */ +public class BeanUtils extends org.springframework.beans.BeanUtils +{ + /** Bean方法名中属性名开始的下标 */ + private static final int BEAN_METHOD_PROP_INDEX = 3; + + /** * 匹配getter方法的正则表达式 */ + private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); + + /** * 匹配setter方法的正则表达式 */ + private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); + + /** + * Bean属性复制工具方法。 + * + * @param dest 目标对象 + * @param src 源对象 + */ + public static void copyBeanProp(Object dest, Object src) + { + try + { + copyProperties(src, dest); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + /** + * 获取对象的setter方法。 + * + * @param obj 对象 + * @return 对象的setter方法列表 + */ + public static List getSetterMethods(Object obj) + { + // setter方法列表 + List setterMethods = new ArrayList(); + + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + + // 查找setter方法 + + for (Method method : methods) + { + Matcher m = SET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 1)) + { + setterMethods.add(method); + } + } + // 返回setter方法列表 + return setterMethods; + } + + /** + * 获取对象的getter方法。 + * + * @param obj 对象 + * @return 对象的getter方法列表 + */ + + public static List getGetterMethods(Object obj) + { + // getter方法列表 + List getterMethods = new ArrayList(); + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + // 查找getter方法 + for (Method method : methods) + { + Matcher m = GET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 0)) + { + getterMethods.add(method); + } + } + // 返回getter方法列表 + return getterMethods; + } + + /** + * 检查Bean方法名中的属性名是否相等。
+ * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 + * + * @param m1 方法名1 + * @param m2 方法名2 + * @return 属性名一样返回true,否则返回false + */ + + public static boolean isMethodPropEquals(String m1, String m2) + { + return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/evo/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java new file mode 100644 index 0000000..821ddfe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -0,0 +1,243 @@ +package com.ruoyi.common.utils.file; + +import java.io.File; +import java.io.IOException; +import org.apache.commons.io.FilenameUtils; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; +import com.ruoyi.common.exception.file.FileSizeLimitExceededException; +import com.ruoyi.common.exception.file.InvalidExtensionException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.security.Md5Utils; +import com.ruoyi.framework.config.RuoYiConfig; + +/** + * 文件上传工具类 + * + * @author ruoyi + */ +public class FileUploadUtils +{ + /** + * 默认大小 50M + */ + public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; + + /** + * 默认的文件名最大长度 100 + */ + public static final int DEFAULT_FILE_NAME_LENGTH = 100; + + /** + * 默认上传的地址 + */ + private static String defaultBaseDir = RuoYiConfig.getProfile(); + + private static int counter = 0; + + public static void setDefaultBaseDir(String defaultBaseDir) + { + FileUploadUtils.defaultBaseDir = defaultBaseDir; + } + + public static String getDefaultBaseDir() + { + return defaultBaseDir; + } + + /** + * 以默认配置进行文件上传 + * + * @param file 上传的文件 + * @return 文件名称 + * @throws Exception + */ + public static final String upload(MultipartFile file) throws IOException + { + try + { + return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); + } + catch (Exception e) + { + throw new IOException(e.getMessage(), e); + } + } + + /** + * 根据文件路径上传 + * + * @param baseDir 相对应用的基目录 + * @param file 上传的文件 + * @return 文件名称 + * @throws IOException + */ + public static final String upload(String baseDir, MultipartFile file) throws IOException + { + try + { + return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); + } + catch (Exception e) + { + throw new IOException(e.getMessage(), e); + } + } + + /** + * 文件上传 + * + * @param baseDir 相对应用的基目录 + * @param file 上传的文件 + * @param extension 上传文件类型 + * @return 返回上传成功的文件名 + * @throws FileSizeLimitExceededException 如果超出最大大小 + * @throws FileNameLengthLimitExceededException 文件名太长 + * @throws IOException 比如读写文件出错时 + * @throws InvalidExtensionException 文件校验异常 + */ + public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension) + throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, + InvalidExtensionException + { + int fileNamelength = file.getOriginalFilename().length(); + if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) + { + throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); + } + + assertAllowed(file, allowedExtension); + + String fileName = extractFilename(file); + + File desc = getAbsoluteFile(baseDir, fileName); + file.transferTo(desc); + String pathFileName = getPathFileName(baseDir, fileName); + return pathFileName; + } + + /** + * 编码文件名 + */ + public static final String extractFilename(MultipartFile file) + { + String fileName = file.getOriginalFilename(); + String extension = getExtension(file); + fileName = DateUtils.datePath() + "/" + encodingFilename(fileName) + "." + extension; + return fileName; + } + + private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException + { + File desc = new File(uploadDir + File.separator + fileName); + + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + if (!desc.exists()) + { + desc.createNewFile(); + } + return desc; + } + + private static final String getPathFileName(String uploadDir, String fileName) throws IOException + { + int dirLastIndex = RuoYiConfig.getProfile().length() + 1; + String currentDir = StringUtils.substring(uploadDir, dirLastIndex); + String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; + return pathFileName; + } + + /** + * 编码文件名 + */ + private static final String encodingFilename(String fileName) + { + fileName = fileName.replace("_", " "); + fileName = Md5Utils.hash(fileName + System.nanoTime() + counter++); + return fileName; + } + + /** + * 文件大小校验 + * + * @param file 上传的文件 + * @return + * @throws FileSizeLimitExceededException 如果超出最大大小 + * @throws InvalidExtensionException + */ + public static final void assertAllowed(MultipartFile file, String[] allowedExtension) + throws FileSizeLimitExceededException, InvalidExtensionException + { + long size = file.getSize(); + if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) + { + throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); + } + + String fileName = file.getOriginalFilename(); + String extension = getExtension(file); + if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) + { + if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) + { + throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, + fileName); + } + else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) + { + throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, + fileName); + } + else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) + { + throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, + fileName); + } + else + { + throw new InvalidExtensionException(allowedExtension, extension, fileName); + } + } + + } + + /** + * 判断MIME类型是否是允许的MIME类型 + * + * @param extension + * @param allowedExtension + * @return + */ + public static final boolean isAllowedExtension(String extension, String[] allowedExtension) + { + for (String str : allowedExtension) + { + if (str.equalsIgnoreCase(extension)) + { + return true; + } + } + return false; + } + + /** + * 获取文件名的后缀 + * + * @param file 表单文件 + * @return 后缀名 + */ + public static final String getExtension(MultipartFile file) + { + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (StringUtils.isEmpty(extension)) + { + extension = MimeTypeUtils.getExtension(file.getContentType()); + } + return extension; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/evo/src/main/java/com/ruoyi/common/utils/file/FileUtils.java new file mode 100644 index 0000000..04d4703 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -0,0 +1,142 @@ +package com.ruoyi.common.utils.file; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import javax.servlet.http.HttpServletRequest; + +/** + * 文件处理工具类 + * + * @author ruoyi + */ +public class FileUtils +{ + public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; + + /** + * 输出指定文件的byte数组 + * + * @param filePath 文件路径 + * @param os 输出流 + * @return + */ + public static void writeBytes(String filePath, OutputStream os) throws IOException + { + FileInputStream fis = null; + try + { + File file = new File(filePath); + if (!file.exists()) + { + throw new FileNotFoundException(filePath); + } + fis = new FileInputStream(file); + byte[] b = new byte[1024]; + int length; + while ((length = fis.read(b)) > 0) + { + os.write(b, 0, length); + } + } + catch (IOException e) + { + throw e; + } + finally + { + if (os != null) + { + try + { + os.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + if (fis != null) + { + try + { + fis.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + } + } + + /** + * 删除文件 + * + * @param filePath 文件 + * @return + */ + public static boolean deleteFile(String filePath) + { + boolean flag = false; + File file = new File(filePath); + // 路径为文件且不为空则进行删除 + if (file.isFile() && file.exists()) + { + file.delete(); + flag = true; + } + return flag; + } + + /** + * 文件名称验证 + * + * @param filename 文件名称 + * @return true 正常 false 非法 + */ + public static boolean isValidFilename(String filename) + { + return filename.matches(FILENAME_PATTERN); + } + + /** + * 下载文件名重新编码 + * + * @param request 请求对象 + * @param fileName 文件名 + * @return 编码后的文件名 + */ + public static String setFileDownloadHeader(HttpServletRequest request, String fileName) + throws UnsupportedEncodingException + { + final String agent = request.getHeader("USER-AGENT"); + String filename = fileName; + if (agent.contains("MSIE")) + { + // IE浏览器 + filename = URLEncoder.encode(filename, "utf-8"); + filename = filename.replace("+", " "); + } + else if (agent.contains("Firefox")) + { + // 火狐浏览器 + filename = new String(fileName.getBytes(), "ISO8859-1"); + } + else if (agent.contains("Chrome")) + { + // google浏览器 + filename = URLEncoder.encode(filename, "utf-8"); + } + else + { + // 其它浏览器 + filename = URLEncoder.encode(filename, "utf-8"); + } + return filename; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java b/evo/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java new file mode 100644 index 0000000..6984641 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java @@ -0,0 +1,55 @@ +package com.ruoyi.common.utils.file; + +/** + * 媒体类型工具类 + * + * @author ruoyi + */ +public class MimeTypeUtils +{ + public static final String IMAGE_PNG = "image/png"; + + public static final String IMAGE_JPG = "image/jpg"; + + public static final String IMAGE_JPEG = "image/jpeg"; + + public static final String IMAGE_BMP = "image/bmp"; + + public static final String IMAGE_GIF = "image/gif"; + + public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" }; + + public static final String[] FLASH_EXTENSION = { "swf", "flv" }; + + public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", + "asf", "rm", "rmvb" }; + + public static final String[] DEFAULT_ALLOWED_EXTENSION = { + // 图片 + "bmp", "gif", "jpg", "jpeg", "png", + // word excel powerpoint + "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", + // 压缩文件 + "rar", "zip", "gz", "bz2", + // pdf + "pdf" }; + + public static String getExtension(String prefix) + { + switch (prefix) + { + case IMAGE_PNG: + return "png"; + case IMAGE_JPG: + return "jpg"; + case IMAGE_JPEG: + return "jpeg"; + case IMAGE_BMP: + return "bmp"; + case IMAGE_GIF: + return "gif"; + default: + return ""; + } + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java b/evo/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java new file mode 100644 index 0000000..970d664 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java @@ -0,0 +1,152 @@ +package com.ruoyi.common.utils.html; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 转义和反转义工具类 + * + * @author ruoyi + */ +public class EscapeUtil +{ + public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)"; + + private static final char[][] TEXT = new char[64][]; + + static + { + for (int i = 0; i < 64; i++) + { + TEXT[i] = new char[] { (char) i }; + } + + // special HTML characters + TEXT['\''] = "'".toCharArray(); // 单引号 + TEXT['"'] = """.toCharArray(); // 单引号 + TEXT['&'] = "&".toCharArray(); // &符 + TEXT['<'] = "<".toCharArray(); // 小于号 + TEXT['>'] = ">".toCharArray(); // 大于号 + } + + /** + * 转义文本中的HTML字符为安全的字符 + * + * @param text 被转义的文本 + * @return 转义后的文本 + */ + public static String escape(String text) + { + return encode(text); + } + + /** + * 还原被转义的HTML特殊字符 + * + * @param content 包含转义符的HTML内容 + * @return 转换后的字符串 + */ + public static String unescape(String content) + { + return decode(content); + } + + /** + * 清除所有HTML标签,但是不删除标签内的内容 + * + * @param content 文本 + * @return 清除标签后的文本 + */ + public static String clean(String content) + { + return new HTMLFilter().filter(content); + } + + /** + * Escape编码 + * + * @param text 被编码的文本 + * @return 编码后的字符 + */ + private static String encode(String text) + { + int len; + if ((text == null) || ((len = text.length()) == 0)) + { + return StringUtils.EMPTY; + } + StringBuilder buffer = new StringBuilder(len + (len >> 2)); + char c; + for (int i = 0; i < len; i++) + { + c = text.charAt(i); + if (c < 64) + { + buffer.append(TEXT[c]); + } + else + { + buffer.append(c); + } + } + return buffer.toString(); + } + + /** + * Escape解码 + * + * @param content 被转义的内容 + * @return 解码后的字符串 + */ + public static String decode(String content) + { + if (StringUtils.isEmpty(content)) + { + return content; + } + + StringBuilder tmp = new StringBuilder(content.length()); + int lastPos = 0, pos = 0; + char ch; + while (lastPos < content.length()) + { + pos = content.indexOf("%", lastPos); + if (pos == lastPos) + { + if (content.charAt(pos + 1) == 'u') + { + ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16); + tmp.append(ch); + lastPos = pos + 6; + } + else + { + ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16); + tmp.append(ch); + lastPos = pos + 3; + } + } + else + { + if (pos == -1) + { + tmp.append(content.substring(lastPos)); + lastPos = content.length(); + } + else + { + tmp.append(content.substring(lastPos, pos)); + lastPos = pos; + } + } + } + return tmp.toString(); + } + + public static void main(String[] args) + { + String html = "alert('11111');"; + System.out.println(EscapeUtil.clean(html)); + System.out.println(EscapeUtil.escape(html)); + System.out.println(EscapeUtil.unescape(html)); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java b/evo/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java new file mode 100644 index 0000000..6244cd5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java @@ -0,0 +1,569 @@ +package com.ruoyi.common.utils.html; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * HTML过滤器,用于去除XSS漏洞隐患。 + * + * @author ruoyi + */ +public final class HTMLFilter +{ + /** + * regex flag union representing /si modifiers in php + **/ + private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL; + private static final Pattern P_COMMENTS = Pattern.compile("", Pattern.DOTALL); + private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI); + private static final Pattern P_TAGS = Pattern.compile("<(.*?)>", Pattern.DOTALL); + private static final Pattern P_END_TAG = Pattern.compile("^/([a-z0-9]+)", REGEX_FLAGS_SI); + private static final Pattern P_START_TAG = Pattern.compile("^([a-z0-9]+)(.*?)(/?)$", REGEX_FLAGS_SI); + private static final Pattern P_QUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)=([\"'])(.*?)\\2", REGEX_FLAGS_SI); + private static final Pattern P_UNQUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)(=)([^\"\\s']+)", REGEX_FLAGS_SI); + private static final Pattern P_PROTOCOL = Pattern.compile("^([^:]+):", REGEX_FLAGS_SI); + private static final Pattern P_ENTITY = Pattern.compile("&#(\\d+);?"); + private static final Pattern P_ENTITY_UNICODE = Pattern.compile("&#x([0-9a-f]+);?"); + private static final Pattern P_ENCODE = Pattern.compile("%([0-9a-f]{2});?"); + private static final Pattern P_VALID_ENTITIES = Pattern.compile("&([^&;]*)(?=(;|&|$))"); + private static final Pattern P_VALID_QUOTES = Pattern.compile("(>|^)([^<]+?)(<|$)", Pattern.DOTALL); + private static final Pattern P_END_ARROW = Pattern.compile("^>"); + private static final Pattern P_BODY_TO_END = Pattern.compile("<([^>]*?)(?=<|$)"); + private static final Pattern P_XML_CONTENT = Pattern.compile("(^|>)([^<]*?)(?=>)"); + private static final Pattern P_STRAY_LEFT_ARROW = Pattern.compile("<([^>]*?)(?=<|$)"); + private static final Pattern P_STRAY_RIGHT_ARROW = Pattern.compile("(^|>)([^<]*?)(?=>)"); + private static final Pattern P_AMP = Pattern.compile("&"); + private static final Pattern P_QUOTE = Pattern.compile("\""); + private static final Pattern P_LEFT_ARROW = Pattern.compile("<"); + private static final Pattern P_RIGHT_ARROW = Pattern.compile(">"); + private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>"); + + // @xxx could grow large... maybe use sesat's ReferenceMap + private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap<>(); + private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap<>(); + + /** + * set of allowed html elements, along with allowed attributes for each element + **/ + private final Map> vAllowed; + /** + * counts of open tags for each (allowable) html element + **/ + private final Map vTagCounts = new HashMap<>(); + + /** + * html elements which must always be self-closing (e.g. "") + **/ + private final String[] vSelfClosingTags; + /** + * html elements which must always have separate opening and closing tags (e.g. "") + **/ + private final String[] vNeedClosingTags; + /** + * set of disallowed html elements + **/ + private final String[] vDisallowed; + /** + * attributes which should be checked for valid protocols + **/ + private final String[] vProtocolAtts; + /** + * allowed protocols + **/ + private final String[] vAllowedProtocols; + /** + * tags which should be removed if they contain no content (e.g. "" or "") + **/ + private final String[] vRemoveBlanks; + /** + * entities allowed within html markup + **/ + private final String[] vAllowedEntities; + /** + * flag determining whether comments are allowed in input String. + */ + private final boolean stripComment; + private final boolean encodeQuotes; + /** + * flag determining whether to try to make tags when presented with "unbalanced" angle brackets (e.g. "" + * becomes " text "). If set to false, unbalanced angle brackets will be html escaped. + */ + private final boolean alwaysMakeTags; + + /** + * Default constructor. + */ + public HTMLFilter() + { + vAllowed = new HashMap<>(); + + final ArrayList a_atts = new ArrayList<>(); + a_atts.add("href"); + a_atts.add("target"); + vAllowed.put("a", a_atts); + + final ArrayList img_atts = new ArrayList<>(); + img_atts.add("src"); + img_atts.add("width"); + img_atts.add("height"); + img_atts.add("alt"); + vAllowed.put("img", img_atts); + + final ArrayList no_atts = new ArrayList<>(); + vAllowed.put("b", no_atts); + vAllowed.put("strong", no_atts); + vAllowed.put("i", no_atts); + vAllowed.put("em", no_atts); + + vSelfClosingTags = new String[] { "img" }; + vNeedClosingTags = new String[] { "a", "b", "strong", "i", "em" }; + vDisallowed = new String[] {}; + vAllowedProtocols = new String[] { "http", "mailto", "https" }; // no ftp. + vProtocolAtts = new String[] { "src", "href" }; + vRemoveBlanks = new String[] { "a", "b", "strong", "i", "em" }; + vAllowedEntities = new String[] { "amp", "gt", "lt", "quot" }; + stripComment = true; + encodeQuotes = true; + alwaysMakeTags = true; + } + + /** + * Map-parameter configurable constructor. + * + * @param conf map containing configuration. keys match field names. + */ + @SuppressWarnings("unchecked") + public HTMLFilter(final Map conf) + { + + assert conf.containsKey("vAllowed") : "configuration requires vAllowed"; + assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags"; + assert conf.containsKey("vNeedClosingTags") : "configuration requires vNeedClosingTags"; + assert conf.containsKey("vDisallowed") : "configuration requires vDisallowed"; + assert conf.containsKey("vAllowedProtocols") : "configuration requires vAllowedProtocols"; + assert conf.containsKey("vProtocolAtts") : "configuration requires vProtocolAtts"; + assert conf.containsKey("vRemoveBlanks") : "configuration requires vRemoveBlanks"; + assert conf.containsKey("vAllowedEntities") : "configuration requires vAllowedEntities"; + + vAllowed = Collections.unmodifiableMap((HashMap>) conf.get("vAllowed")); + vSelfClosingTags = (String[]) conf.get("vSelfClosingTags"); + vNeedClosingTags = (String[]) conf.get("vNeedClosingTags"); + vDisallowed = (String[]) conf.get("vDisallowed"); + vAllowedProtocols = (String[]) conf.get("vAllowedProtocols"); + vProtocolAtts = (String[]) conf.get("vProtocolAtts"); + vRemoveBlanks = (String[]) conf.get("vRemoveBlanks"); + vAllowedEntities = (String[]) conf.get("vAllowedEntities"); + stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true; + encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true; + alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true; + } + + private void reset() + { + vTagCounts.clear(); + } + + // --------------------------------------------------------------- + // my versions of some PHP library functions + public static String chr(final int decimal) + { + return String.valueOf((char) decimal); + } + + public static String htmlSpecialChars(final String s) + { + String result = s; + result = regexReplace(P_AMP, "&", result); + result = regexReplace(P_QUOTE, """, result); + result = regexReplace(P_LEFT_ARROW, "<", result); + result = regexReplace(P_RIGHT_ARROW, ">", result); + return result; + } + + // --------------------------------------------------------------- + + /** + * given a user submitted input String, filter out any invalid or restricted html. + * + * @param input text (i.e. submitted by a user) than may contain html + * @return "clean" version of input, with only valid, whitelisted html elements allowed + */ + public String filter(final String input) + { + reset(); + String s = input; + + s = escapeComments(s); + + s = balanceHTML(s); + + s = checkTags(s); + + s = processRemoveBlanks(s); + + s = validateEntities(s); + + return s; + } + + public boolean isAlwaysMakeTags() + { + return alwaysMakeTags; + } + + public boolean isStripComments() + { + return stripComment; + } + + private String escapeComments(final String s) + { + final Matcher m = P_COMMENTS.matcher(s); + final StringBuffer buf = new StringBuffer(); + if (m.find()) + { + final String match = m.group(1); // (.*?) + m.appendReplacement(buf, Matcher.quoteReplacement("")); + } + m.appendTail(buf); + + return buf.toString(); + } + + private String balanceHTML(String s) + { + if (alwaysMakeTags) + { + // + // try and form html + // + s = regexReplace(P_END_ARROW, "", s); + s = regexReplace(P_BODY_TO_END, "<$1>", s); + s = regexReplace(P_XML_CONTENT, "$1<$2", s); + + } + else + { + // + // escape stray brackets + // + s = regexReplace(P_STRAY_LEFT_ARROW, "<$1", s); + s = regexReplace(P_STRAY_RIGHT_ARROW, "$1$2><", s); + + // + // the last regexp causes '<>' entities to appear + // (we need to do a lookahead assertion so that the last bracket can + // be used in the next pass of the regexp) + // + s = regexReplace(P_BOTH_ARROWS, "", s); + } + + return s; + } + + private String checkTags(String s) + { + Matcher m = P_TAGS.matcher(s); + + final StringBuffer buf = new StringBuffer(); + while (m.find()) + { + String replaceStr = m.group(1); + replaceStr = processTag(replaceStr); + m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr)); + } + m.appendTail(buf); + + // these get tallied in processTag + // (remember to reset before subsequent calls to filter method) + final StringBuilder sBuilder = new StringBuilder(buf.toString()); + for (String key : vTagCounts.keySet()) + { + for (int ii = 0; ii < vTagCounts.get(key); ii++) + { + sBuilder.append(""); + } + } + s = sBuilder.toString(); + + return s; + } + + private String processRemoveBlanks(final String s) + { + String result = s; + for (String tag : vRemoveBlanks) + { + if (!P_REMOVE_PAIR_BLANKS.containsKey(tag)) + { + P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>")); + } + result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result); + if (!P_REMOVE_SELF_BLANKS.containsKey(tag)) + { + P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>")); + } + result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result); + } + + return result; + } + + private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) + { + Matcher m = regex_pattern.matcher(s); + return m.replaceAll(replacement); + } + + private String processTag(final String s) + { + // ending tags + Matcher m = P_END_TAG.matcher(s); + if (m.find()) + { + final String name = m.group(1).toLowerCase(); + if (allowed(name)) + { + if (false == inArray(name, vSelfClosingTags)) + { + if (vTagCounts.containsKey(name)) + { + vTagCounts.put(name, vTagCounts.get(name) - 1); + return ""; + } + } + } + } + + // starting tags + m = P_START_TAG.matcher(s); + if (m.find()) + { + final String name = m.group(1).toLowerCase(); + final String body = m.group(2); + String ending = m.group(3); + + // debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" ); + if (allowed(name)) + { + final StringBuilder params = new StringBuilder(); + + final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body); + final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body); + final List paramNames = new ArrayList<>(); + final List paramValues = new ArrayList<>(); + while (m2.find()) + { + paramNames.add(m2.group(1)); // ([a-z0-9]+) + paramValues.add(m2.group(3)); // (.*?) + } + while (m3.find()) + { + paramNames.add(m3.group(1)); // ([a-z0-9]+) + paramValues.add(m3.group(3)); // ([^\"\\s']+) + } + + String paramName, paramValue; + for (int ii = 0; ii < paramNames.size(); ii++) + { + paramName = paramNames.get(ii).toLowerCase(); + paramValue = paramValues.get(ii); + + // debug( "paramName='" + paramName + "'" ); + // debug( "paramValue='" + paramValue + "'" ); + // debug( "allowed? " + vAllowed.get( name ).contains( paramName ) ); + + if (allowedAttribute(name, paramName)) + { + if (inArray(paramName, vProtocolAtts)) + { + paramValue = processParamProtocol(paramValue); + } + params.append(' ').append(paramName).append("=\"").append(paramValue).append("\""); + } + } + + if (inArray(name, vSelfClosingTags)) + { + ending = " /"; + } + + if (inArray(name, vNeedClosingTags)) + { + ending = ""; + } + + if (ending == null || ending.length() < 1) + { + if (vTagCounts.containsKey(name)) + { + vTagCounts.put(name, vTagCounts.get(name) + 1); + } + else + { + vTagCounts.put(name, 1); + } + } + else + { + ending = " /"; + } + return "<" + name + params + ending + ">"; + } + else + { + return ""; + } + } + + // comments + m = P_COMMENT.matcher(s); + if (!stripComment && m.find()) + { + return "<" + m.group() + ">"; + } + + return ""; + } + + private String processParamProtocol(String s) + { + s = decodeEntities(s); + final Matcher m = P_PROTOCOL.matcher(s); + if (m.find()) + { + final String protocol = m.group(1); + if (!inArray(protocol, vAllowedProtocols)) + { + // bad protocol, turn into local anchor link instead + s = "#" + s.substring(protocol.length() + 1); + if (s.startsWith("#//")) + { + s = "#" + s.substring(3); + } + } + } + + return s; + } + + private String decodeEntities(String s) + { + StringBuffer buf = new StringBuffer(); + + Matcher m = P_ENTITY.matcher(s); + while (m.find()) + { + final String match = m.group(1); + final int decimal = Integer.decode(match).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + buf = new StringBuffer(); + m = P_ENTITY_UNICODE.matcher(s); + while (m.find()) + { + final String match = m.group(1); + final int decimal = Integer.valueOf(match, 16).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + buf = new StringBuffer(); + m = P_ENCODE.matcher(s); + while (m.find()) + { + final String match = m.group(1); + final int decimal = Integer.valueOf(match, 16).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + s = validateEntities(s); + return s; + } + + private String validateEntities(final String s) + { + StringBuffer buf = new StringBuffer(); + + // validate entities throughout the string + Matcher m = P_VALID_ENTITIES.matcher(s); + while (m.find()) + { + final String one = m.group(1); // ([^&;]*) + final String two = m.group(2); // (?=(;|&|$)) + m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two))); + } + m.appendTail(buf); + + return encodeQuotes(buf.toString()); + } + + private String encodeQuotes(final String s) + { + if (encodeQuotes) + { + StringBuffer buf = new StringBuffer(); + Matcher m = P_VALID_QUOTES.matcher(s); + while (m.find()) + { + final String one = m.group(1); // (>|^) + final String two = m.group(2); // ([^<]+?) + final String three = m.group(3); // (<|$) + // 不替换双引号为",防止json格式无效 regexReplace(P_QUOTE, """, two) + m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three)); + } + m.appendTail(buf); + return buf.toString(); + } + else + { + return s; + } + } + + private String checkEntity(final String preamble, final String term) + { + + return ";".equals(term) && isValidEntity(preamble) ? '&' + preamble : "&" + preamble; + } + + private boolean isValidEntity(final String entity) + { + return inArray(entity, vAllowedEntities); + } + + private static boolean inArray(final String s, final String[] array) + { + for (String item : array) + { + if (item != null && item.equals(s)) + { + return true; + } + } + return false; + } + + private boolean allowed(final String name) + { + return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed); + } + + private boolean allowedAttribute(final String name, final String paramName) + { + return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName)); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java b/evo/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java new file mode 100644 index 0000000..dcf1b8f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java @@ -0,0 +1,55 @@ +package com.ruoyi.common.utils.http; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import javax.servlet.ServletRequest; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 通用http工具封装 + * + * @author ruoyi + */ +public class HttpHelper +{ + private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class); + + public static String getBodyString(ServletRequest request) + { + StringBuilder sb = new StringBuilder(); + BufferedReader reader = null; + try (InputStream inputStream = request.getInputStream()) + { + reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8"))); + String line = ""; + while ((line = reader.readLine()) != null) + { + sb.append(line); + } + } + catch (IOException e) + { + LOGGER.warn("getBodyString出现问题!"); + } + finally + { + if (reader != null) + { + try + { + reader.close(); + } + catch (IOException e) + { + LOGGER.error(ExceptionUtils.getFullStackTrace(e)); + } + } + } + return sb.toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/http/HttpJDUtils.java b/evo/src/main/java/com/ruoyi/common/utils/http/HttpJDUtils.java new file mode 100644 index 0000000..cb8fd64 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/http/HttpJDUtils.java @@ -0,0 +1,163 @@ +package com.ruoyi.common.utils.http; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.ConnectException; +import java.net.SocketTimeoutException; +import java.net.URL; +import java.net.URLConnection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 通用http发送方法 + * + * @author ruoyi + */ +public class HttpJDUtils +{ + private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); + + + /** + * 向指定 URL 发送POST方法的请求 + * + * @param url 发送请求的 URL + * @return 所代表远程资源的响应结果 + */ + public static String sendPost(String url, String param) + { + PrintWriter out = null; + BufferedReader in = null; + StringBuilder result = new StringBuilder(); + try + { + String urlNameString = url; + log.info("sendPost - {}", urlNameString); + URL realUrl = new URL(urlNameString); + URLConnection conn = realUrl.openConnection(); + conn.setRequestProperty("Accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("Accept-Charset", "UTF-8"); + conn.setRequestProperty("Accept-Encoding", "UTF-8"); + conn.setRequestProperty("Content-Type", "application/json"); + conn.setDoOutput(true); + conn.setDoInput(true); + out = new PrintWriter(conn.getOutputStream()); + out.print(param); + out.flush(); + in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); + String line; + while ((line = in.readLine()) != null) + { + result.append(line); + } + log.info("recv - {}", result); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e); + } + finally + { + try + { + if (out != null) + { + out.close(); + } + if (in != null) + { + in.close(); + } + } + catch (IOException ex) + { + log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); + } + } + return result.toString(); + } + + public static String sendJDPost(String url, String param,String sessionId) + { + PrintWriter out = null; + BufferedReader in = null; + StringBuilder result = new StringBuilder(); + try + { + String urlNameString = url; + log.info("sendPost - {}", urlNameString); + URL realUrl = new URL(urlNameString); + URLConnection conn = realUrl.openConnection(); + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("Charset", "UTF-8"); + conn.setRequestProperty("Accept-Encoding", "UTF-8"); + conn.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); + conn.setRequestProperty("kdservice-sessionid", sessionId); + conn.setDoOutput(true); + conn.setDoInput(true); + out = new PrintWriter(conn.getOutputStream()); + out.print(param); + out.flush(); + in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); + String line; + while ((line = in.readLine()) != null) + { + result.append(line); + } + log.info("recv - {}", result); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e); + } + finally + { + try + { + if (out != null) + { + out.close(); + } + if (in != null) + { + in.close(); + } + } + catch (IOException ex) + { + log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); + } + } + return result.toString(); + } + +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/evo/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java new file mode 100644 index 0000000..9b19d0d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -0,0 +1,262 @@ +package com.ruoyi.common.utils.http; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.ConnectException; +import java.net.SocketTimeoutException; +import java.net.URL; +import java.net.URLConnection; +import java.security.cert.X509Certificate; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.constant.Constants; + +/** + * 通用http发送方法 + * + * @author ruoyi + */ +public class HttpUtils +{ + private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); + + /** + * 向指定 URL 发送GET方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @return 所代表远程资源的响应结果 + */ + public static String sendGet(String url, String param) + { + return sendGet(url, param, Constants.UTF8); + } + + /** + * 向指定 URL 发送GET方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @param contentType 编码类型 + * @return 所代表远程资源的响应结果 + */ + public static String sendGet(String url, String param, String contentType) + { + StringBuilder result = new StringBuilder(); + BufferedReader in = null; + try + { + String urlNameString = url + "?" + param; + log.info("sendGet - {}", urlNameString); + URL realUrl = new URL(urlNameString); + URLConnection connection = realUrl.openConnection(); + connection.setRequestProperty("accept", "*/*"); + connection.setRequestProperty("connection", "Keep-Alive"); + connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + connection.connect(); + in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); + String line; + while ((line = in.readLine()) != null) + { + result.append(line); + } + log.info("recv - {}", result); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e); + } + finally + { + try + { + if (in != null) + { + in.close(); + } + } + catch (Exception ex) + { + log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); + } + } + return result.toString(); + } + + /** + * 向指定 URL 发送POST方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @return 所代表远程资源的响应结果 + */ + public static String sendPost(String url, String param) + { + PrintWriter out = null; + BufferedReader in = null; + StringBuilder result = new StringBuilder(); + try + { + String urlNameString = url; + log.info("sendPost - {}", urlNameString); + URL realUrl = new URL(urlNameString); + URLConnection conn = realUrl.openConnection(); + conn.setRequestProperty("Accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("Accept-Charset", "UTF-8"); + conn.setRequestProperty("Accept-Encoding", "UTF-8"); + conn.setRequestProperty("Content-Type", "application/json"); + conn.setDoOutput(true); + conn.setDoInput(true); + out = new PrintWriter(conn.getOutputStream()); + out.print(param); + out.flush(); + in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); + String line; + while ((line = in.readLine()) != null) + { + result.append(line); + } + log.info("recv - {}", result); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e); + } + finally + { + try + { + if (out != null) + { + out.close(); + } + if (in != null) + { + in.close(); + } + } + catch (IOException ex) + { + log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); + } + } + return result.toString(); + } + + public static String sendSSLPost(String url, String param) + { + StringBuilder result = new StringBuilder(); + String urlNameString = url + "?" + param; + try + { + log.info("sendSSLPost - {}", urlNameString); + SSLContext sc = SSLContext.getInstance("SSL"); + sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom()); + URL console = new URL(urlNameString); + HttpsURLConnection conn = (HttpsURLConnection) console.openConnection(); + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + conn.setRequestProperty("Accept-Charset", "UTF-8"); + conn.setRequestProperty("contentType", "UTF-8"); + conn.setDoOutput(true); + conn.setDoInput(true); + + conn.setSSLSocketFactory(sc.getSocketFactory()); + conn.setHostnameVerifier(new TrustAnyHostnameVerifier()); + conn.connect(); + InputStream is = conn.getInputStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String ret = ""; + while ((ret = br.readLine()) != null) + { + if (ret != null && !ret.trim().equals("")) + { + result.append(new String(ret.getBytes("ISO-8859-1"), "UTF-8")); + } + } + log.info("recv - {}", result); + conn.disconnect(); + br.close(); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e); + } + return result.toString(); + } + + private static class TrustAnyTrustManager implements X509TrustManager + { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) + { + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) + { + } + + @Override + public X509Certificate[] getAcceptedIssuers() + { + return new X509Certificate[] {}; + } + } + + private static class TrustAnyHostnameVerifier implements HostnameVerifier + { + @Override + public boolean verify(String hostname, SSLSession session) + { + return true; + } + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java b/evo/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java new file mode 100644 index 0000000..4d2041e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java @@ -0,0 +1,56 @@ +package com.ruoyi.common.utils.ip; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.framework.config.RuoYiConfig; + +/** + * 获取地址类 + * + * @author ruoyi + */ +public class AddressUtils +{ + private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); + + // IP地址查询 + public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; + + // 未知地址 + public static final String UNKNOWN = "XX XX"; + + public static String getRealAddressByIP(String ip) + { + String address = UNKNOWN; + // 内网不查询 + if (IpUtils.internalIp(ip)) + { + return "内网IP"; + } + if (RuoYiConfig.isAddressEnabled()) + { + try + { + String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); + if (StringUtils.isEmpty(rspStr)) + { + log.error("获取地理位置异常 {}", ip); + return UNKNOWN; + } + JSONObject obj = JSONObject.parseObject(rspStr); + String region = obj.getString("pro"); + String city = obj.getString("city"); + return String.format("%s %s", region, city); + } + catch (Exception e) + { + log.error("获取地理位置异常 {}", ip); + } + } + return address; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java b/evo/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java new file mode 100644 index 0000000..2b9a267 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java @@ -0,0 +1,189 @@ +package com.ruoyi.common.utils.ip; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import javax.servlet.http.HttpServletRequest; +import com.ruoyi.common.utils.StringUtils; + +/** + * 获取IP方法 + * + * @author ruoyi + */ +public class IpUtils +{ + public static String getIpAddr(HttpServletRequest request) + { + if (request == null) + { + return "unknown"; + } + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("X-Forwarded-For"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("X-Real-IP"); + } + + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getRemoteAddr(); + } + + return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; + } + + public static boolean internalIp(String ip) + { + byte[] addr = textToNumericFormatV4(ip); + return internalIp(addr) || "127.0.0.1".equals(ip); + } + + private static boolean internalIp(byte[] addr) + { + if (StringUtils.isNull(addr) || addr.length < 2) + { + return true; + } + final byte b0 = addr[0]; + final byte b1 = addr[1]; + // 10.x.x.x/8 + final byte SECTION_1 = 0x0A; + // 172.16.x.x/12 + final byte SECTION_2 = (byte) 0xAC; + final byte SECTION_3 = (byte) 0x10; + final byte SECTION_4 = (byte) 0x1F; + // 192.168.x.x/16 + final byte SECTION_5 = (byte) 0xC0; + final byte SECTION_6 = (byte) 0xA8; + switch (b0) + { + case SECTION_1: + return true; + case SECTION_2: + if (b1 >= SECTION_3 && b1 <= SECTION_4) + { + return true; + } + case SECTION_5: + switch (b1) + { + case SECTION_6: + return true; + } + default: + return false; + } + } + + /** + * 将IPv4地址转换成字节 + * + * @param text IPv4地址 + * @return byte 字节 + */ + public static byte[] textToNumericFormatV4(String text) + { + if (text.length() == 0) + { + return null; + } + + byte[] bytes = new byte[4]; + String[] elements = text.split("\\.", -1); + try + { + long l; + int i; + switch (elements.length) + { + case 1: + l = Long.parseLong(elements[0]); + if ((l < 0L) || (l > 4294967295L)) + return null; + bytes[0] = (byte) (int) (l >> 24 & 0xFF); + bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF); + bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); + bytes[3] = (byte) (int) (l & 0xFF); + break; + case 2: + l = Integer.parseInt(elements[0]); + if ((l < 0L) || (l > 255L)) + return null; + bytes[0] = (byte) (int) (l & 0xFF); + l = Integer.parseInt(elements[1]); + if ((l < 0L) || (l > 16777215L)) + return null; + bytes[1] = (byte) (int) (l >> 16 & 0xFF); + bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); + bytes[3] = (byte) (int) (l & 0xFF); + break; + case 3: + for (i = 0; i < 2; ++i) + { + l = Integer.parseInt(elements[i]); + if ((l < 0L) || (l > 255L)) + return null; + bytes[i] = (byte) (int) (l & 0xFF); + } + l = Integer.parseInt(elements[2]); + if ((l < 0L) || (l > 65535L)) + return null; + bytes[2] = (byte) (int) (l >> 8 & 0xFF); + bytes[3] = (byte) (int) (l & 0xFF); + break; + case 4: + for (i = 0; i < 4; ++i) + { + l = Integer.parseInt(elements[i]); + if ((l < 0L) || (l > 255L)) + return null; + bytes[i] = (byte) (int) (l & 0xFF); + } + break; + default: + return null; + } + } + catch (NumberFormatException e) + { + return null; + } + return bytes; + } + + public static String getHostIp() + { + try + { + return InetAddress.getLocalHost().getHostAddress(); + } + catch (UnknownHostException e) + { + } + return "127.0.0.1"; + } + + public static String getHostName() + { + try + { + return InetAddress.getLocalHost().getHostName(); + } + catch (UnknownHostException e) + { + } + return "未知"; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/job/AbstractQuartzJob.java b/evo/src/main/java/com/ruoyi/common/utils/job/AbstractQuartzJob.java new file mode 100644 index 0000000..ec7e622 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/job/AbstractQuartzJob.java @@ -0,0 +1,107 @@ +package com.ruoyi.common.utils.job; + +import java.util.Date; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.utils.ExceptionUtil; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.project.monitor.domain.SysJob; +import com.ruoyi.project.monitor.domain.SysJobLog; +import com.ruoyi.project.monitor.service.ISysJobLogService; + +/** + * 抽象quartz调用 + * + * @author ruoyi + */ +public abstract class AbstractQuartzJob implements Job +{ + private static final Logger log = LoggerFactory.getLogger(AbstractQuartzJob.class); + + /** + * 线程本地变量 + */ + private static ThreadLocal threadLocal = new ThreadLocal<>(); + + @Override + public void execute(JobExecutionContext context) throws JobExecutionException + { + SysJob sysJob = new SysJob(); + BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES)); + try + { + before(context, sysJob); + if (sysJob != null) + { + doExecute(context, sysJob); + } + after(context, sysJob, null); + } + catch (Exception e) + { + log.error("任务执行异常 - :", e); + after(context, sysJob, e); + } + } + + /** + * 执行前 + * + * @param context 工作执行上下文对象 + * @param sysJob 系统计划任务 + */ + protected void before(JobExecutionContext context, SysJob sysJob) + { + threadLocal.set(new Date()); + } + + /** + * 执行后 + * + * @param context 工作执行上下文对象 + * @param sysScheduleJob 系统计划任务 + */ + protected void after(JobExecutionContext context, SysJob sysJob, Exception e) + { + Date startTime = threadLocal.get(); + threadLocal.remove(); + + final SysJobLog sysJobLog = new SysJobLog(); + sysJobLog.setJobName(sysJob.getJobName()); + sysJobLog.setJobGroup(sysJob.getJobGroup()); + sysJobLog.setInvokeTarget(sysJob.getInvokeTarget()); + sysJobLog.setStartTime(startTime); + sysJobLog.setStopTime(new Date()); + long runMs = sysJobLog.getStopTime().getTime() - sysJobLog.getStartTime().getTime(); + sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒"); + if (e != null) + { + sysJobLog.setStatus(Constants.FAIL); + String errorMsg = StringUtils.substring(ExceptionUtil.getExceptionMessage(e), 0, 2000); + sysJobLog.setExceptionInfo(errorMsg); + } + else + { + sysJobLog.setStatus(Constants.SUCCESS); + } + + // 写入数据库当中 + SpringUtils.getBean(ISysJobLogService.class).addJobLog(sysJobLog); + } + + /** + * 执行方法,由子类重载 + * + * @param context 工作执行上下文对象 + * @param sysJob 系统计划任务 + * @throws Exception 执行过程中的异常 + */ + protected abstract void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception; +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/job/CronUtils.java b/evo/src/main/java/com/ruoyi/common/utils/job/CronUtils.java new file mode 100644 index 0000000..0763a8d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/job/CronUtils.java @@ -0,0 +1,63 @@ +package com.ruoyi.common.utils.job; + +import java.text.ParseException; +import java.util.Date; +import org.quartz.CronExpression; + +/** + * cron表达式工具类 + * + * @author ruoyi + * + */ +public class CronUtils +{ + /** + * 返回一个布尔值代表一个给定的Cron表达式的有效性 + * + * @param cronExpression Cron表达式 + * @return boolean 表达式是否有效 + */ + public static boolean isValid(String cronExpression) + { + return CronExpression.isValidExpression(cronExpression); + } + + /** + * 返回一个字符串值,表示该消息无效Cron表达式给出有效性 + * + * @param cronExpression Cron表达式 + * @return String 无效时返回表达式错误描述,如果有效返回null + */ + public static String getInvalidMessage(String cronExpression) + { + try + { + new CronExpression(cronExpression); + return null; + } + catch (ParseException pe) + { + return pe.getMessage(); + } + } + + /** + * 返回下一个执行时间根据给定的Cron表达式 + * + * @param cronExpression Cron表达式 + * @return Date 下次Cron表达式执行时间 + */ + public static Date getNextExecution(String cronExpression) + { + try + { + CronExpression cron = new CronExpression(cronExpression); + return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis())); + } + catch (ParseException e) + { + throw new IllegalArgumentException(e.getMessage()); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/job/JobInvokeUtil.java b/evo/src/main/java/com/ruoyi/common/utils/job/JobInvokeUtil.java new file mode 100644 index 0000000..1670ee5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/job/JobInvokeUtil.java @@ -0,0 +1,182 @@ +package com.ruoyi.common.utils.job; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.LinkedList; +import java.util.List; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.project.monitor.domain.SysJob; + +/** + * 任务执行工具 + * + * @author ruoyi + */ +public class JobInvokeUtil +{ + /** + * 执行方法 + * + * @param sysJob 系统任务 + */ + public static void invokeMethod(SysJob sysJob) throws Exception + { + String invokeTarget = sysJob.getInvokeTarget(); + String beanName = getBeanName(invokeTarget); + String methodName = getMethodName(invokeTarget); + List methodParams = getMethodParams(invokeTarget); + + if (!isValidClassName(beanName)) + { + Object bean = SpringUtils.getBean(beanName); + invokeMethod(bean, methodName, methodParams); + } + else + { + Object bean = Class.forName(beanName).newInstance(); + invokeMethod(bean, methodName, methodParams); + } + } + + /** + * 调用任务方法 + * + * @param bean 目标对象 + * @param methodName 方法名称 + * @param methodParams 方法参数 + */ + private static void invokeMethod(Object bean, String methodName, List methodParams) + throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, + InvocationTargetException + { + if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0) + { + Method method = bean.getClass().getDeclaredMethod(methodName, getMethodParamsType(methodParams)); + method.invoke(bean, getMethodParamsValue(methodParams)); + } + else + { + Method method = bean.getClass().getDeclaredMethod(methodName); + method.invoke(bean); + } + } + + /** + * 校验是否为为class包名 + * + * @param str 名称 + * @return true是 false否 + */ + public static boolean isValidClassName(String invokeTarget) + { + return StringUtils.countMatches(invokeTarget, ".") > 1; + } + + /** + * 获取bean名称 + * + * @param invokeTarget 目标字符串 + * @return bean名称 + */ + public static String getBeanName(String invokeTarget) + { + String beanName = StringUtils.substringBefore(invokeTarget, "("); + return StringUtils.substringBeforeLast(beanName, "."); + } + + /** + * 获取bean方法 + * + * @param invokeTarget 目标字符串 + * @return method方法 + */ + public static String getMethodName(String invokeTarget) + { + String methodName = StringUtils.substringBefore(invokeTarget, "("); + return StringUtils.substringAfterLast(methodName, "."); + } + + /** + * 获取method方法参数相关列表 + * + * @param invokeTarget 目标字符串 + * @return method方法相关参数列表 + */ + public static List getMethodParams(String invokeTarget) + { + String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")"); + if (StringUtils.isEmpty(methodStr)) + { + return null; + } + String[] methodParams = methodStr.split(","); + List classs = new LinkedList<>(); + for (int i = 0; i < methodParams.length; i++) + { + String str = StringUtils.trimToEmpty(methodParams[i]); + // String字符串类型,包含' + if (StringUtils.contains(str, "'")) + { + classs.add(new Object[] { StringUtils.replace(str, "'", ""), String.class }); + } + // boolean布尔类型,等于true或者false + else if (StringUtils.equals(str, "true") || StringUtils.equalsIgnoreCase(str, "false")) + { + classs.add(new Object[] { Boolean.valueOf(str), Boolean.class }); + } + // long长整形,包含L + else if (StringUtils.containsIgnoreCase(str, "L")) + { + classs.add(new Object[] { Long.valueOf(StringUtils.replaceIgnoreCase(str, "L", "")), Long.class }); + } + // double浮点类型,包含D + else if (StringUtils.containsIgnoreCase(str, "D")) + { + classs.add(new Object[] { Double.valueOf(StringUtils.replaceIgnoreCase(str, "D", "")), Double.class }); + } + // 其他类型归类为整形 + else + { + classs.add(new Object[] { Integer.valueOf(str), Integer.class }); + } + } + return classs; + } + + /** + * 获取参数类型 + * + * @param methodParams 参数相关列表 + * @return 参数类型列表 + */ + public static Class[] getMethodParamsType(List methodParams) + { + Class[] classs = new Class[methodParams.size()]; + int index = 0; + for (Object[] os : methodParams) + { + classs[index] = (Class) os[1]; + index++; + } + return classs; + } + + /** + * 获取参数值 + * + * @param methodParams 参数相关列表 + * @return 参数值列表 + */ + public static Object[] getMethodParamsValue(List methodParams) + { + Object[] classs = new Object[methodParams.size()]; + int index = 0; + for (Object[] os : methodParams) + { + classs[index] = (Object) os[0]; + index++; + } + return classs; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/job/QuartzDisallowConcurrentExecution.java b/evo/src/main/java/com/ruoyi/common/utils/job/QuartzDisallowConcurrentExecution.java new file mode 100644 index 0000000..7097088 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/job/QuartzDisallowConcurrentExecution.java @@ -0,0 +1,21 @@ +package com.ruoyi.common.utils.job; + +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import com.ruoyi.project.monitor.domain.SysJob; + +/** + * 定时任务处理(禁止并发执行) + * + * @author ruoyi + * + */ +@DisallowConcurrentExecution +public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob +{ + @Override + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception + { + JobInvokeUtil.invokeMethod(sysJob); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/job/QuartzJobExecution.java b/evo/src/main/java/com/ruoyi/common/utils/job/QuartzJobExecution.java new file mode 100644 index 0000000..55aa7e0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/job/QuartzJobExecution.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.utils.job; + +import org.quartz.JobExecutionContext; +import com.ruoyi.project.monitor.domain.SysJob; + +/** + * 定时任务处理(允许并发执行) + * + * @author ruoyi + * + */ +public class QuartzJobExecution extends AbstractQuartzJob +{ + @Override + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception + { + JobInvokeUtil.invokeMethod(sysJob); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/job/ScheduleUtils.java b/evo/src/main/java/com/ruoyi/common/utils/job/ScheduleUtils.java new file mode 100644 index 0000000..3e107c6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/job/ScheduleUtils.java @@ -0,0 +1,113 @@ +package com.ruoyi.common.utils.job; + +import org.quartz.CronScheduleBuilder; +import org.quartz.CronTrigger; +import org.quartz.Job; +import org.quartz.JobBuilder; +import org.quartz.JobDetail; +import org.quartz.JobKey; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.quartz.TriggerBuilder; +import org.quartz.TriggerKey; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.common.exception.job.TaskException.Code; +import com.ruoyi.project.monitor.domain.SysJob; + +/** + * 定时任务工具类 + * + * @author ruoyi + * + */ +public class ScheduleUtils +{ + /** + * 得到quartz任务类 + * + * @param sysJob 执行计划 + * @return 具体执行任务类 + */ + private static Class getQuartzJobClass(SysJob sysJob) + { + boolean isConcurrent = "0".equals(sysJob.getConcurrent()); + return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class; + } + + /** + * 构建任务触发对象 + */ + public static TriggerKey getTriggerKey(Long jobId, String jobGroup) + { + return TriggerKey.triggerKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); + } + + /** + * 构建任务键对象 + */ + public static JobKey getJobKey(Long jobId, String jobGroup) + { + return JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); + } + + /** + * 创建定时任务 + */ + public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException + { + Class jobClass = getQuartzJobClass(job); + // 构建job信息 + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(getJobKey(jobId, jobGroup)).build(); + + // 表达式调度构建器 + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression()); + cronScheduleBuilder = handleCronScheduleMisfirePolicy(job, cronScheduleBuilder); + + // 按新的cronExpression表达式构建一个新的trigger + CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(jobId, jobGroup)) + .withSchedule(cronScheduleBuilder).build(); + + // 放入参数,运行时的方法可以获取 + jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job); + + // 判断是否存在 + if (scheduler.checkExists(getJobKey(jobId, jobGroup))) + { + // 防止创建时存在数据问题 先移除,然后在执行创建操作 + scheduler.deleteJob(getJobKey(jobId, jobGroup)); + } + + scheduler.scheduleJob(jobDetail, trigger); + + // 暂停任务 + if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue())) + { + scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + } + + /** + * 设置定时任务策略 + */ + public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb) + throws TaskException + { + switch (job.getMisfirePolicy()) + { + case ScheduleConstants.MISFIRE_DEFAULT: + return cb; + case ScheduleConstants.MISFIRE_IGNORE_MISFIRES: + return cb.withMisfireHandlingInstructionIgnoreMisfires(); + case ScheduleConstants.MISFIRE_FIRE_AND_PROCEED: + return cb.withMisfireHandlingInstructionFireAndProceed(); + case ScheduleConstants.MISFIRE_DO_NOTHING: + return cb.withMisfireHandlingInstructionDoNothing(); + default: + throw new TaskException("The task misfire policy '" + job.getMisfirePolicy() + + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR); + } + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java new file mode 100644 index 0000000..074d931 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -0,0 +1,986 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; + +/** + * Excel相关处理 + * + * @author ruoyi + */ +public class ExcelUtil{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 注解列表 + */ + private List fields; + + /** + * 实体对象 + */ + public Class clazz; + + public ExcelUtil(Class clazz) + { + this.clazz = clazz; + } + + // 默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.0"); + + public void init(List list, String sheetName, Type type) + { + if (list == null) + { + list = new ArrayList(); + } + this.list = list; + this.sheetName = sheetName; + this.type = type; + createExcelField(); + createWorkbook(); + } + + /** + * 对excel表单默认第一个索引名转换成list + * + * @param is 输入流 + * @return 转换后集合 + */ + public List importExcel(InputStream is) throws Exception + { + return importExcel(StringUtils.EMPTY, is); + } + + /** + * 对excel表单指定表格索引名转换成list + * + * @param sheetName 表格索引名 + * @param is 输入流 + * @return 转换后集合 + */ + public List importExcel(String sheetName, InputStream is) throws Exception + { + this.type = Type.IMPORT; + this.wb = WorkbookFactory.create(is); + List list = new ArrayList(); + Sheet sheet = null; + if (StringUtils.isNotEmpty(sheetName)) + { + // 如果指定sheet名,则取指定sheet中的内容. + sheet = wb.getSheet(sheetName); + } + else + { + // 如果传入的sheet名不存在则默认指向第1个sheet. + sheet = wb.getSheetAt(0); + } + + if (sheet == null) + { + throw new IOException("文件sheet不存在"); + } + + int rows = sheet.getPhysicalNumberOfRows(); + + if (rows > 0) + { + // 定义一个map用于存放excel列的序号和field. + Map cellMap = new HashMap(); + // 获取表头 + Row heard = sheet.getRow(0); + for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) + { + Cell cell = heard.getCell(i); + if (StringUtils.isNotNull(cell)) + { + String value = this.getCellValue(heard, i).toString(); + cellMap.put(value, i); + } + else + { + cellMap.put(null, i); + } + } + // 有数据时才处理 得到类的所有field. + Field[] allFields = clazz.getDeclaredFields(); + // 定义一个map用于存放列的序号和field. + Map fieldsMap = new HashMap(); + for (int col = 0; col < allFields.length; col++) + { + Field field = allFields[col]; + Excel attr = field.getAnnotation(Excel.class); + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + // 设置类的私有字段属性可访问. + field.setAccessible(true); + Integer column = cellMap.get(attr.name()); + fieldsMap.put(column, field); + } + } + for (int i = 1; i < rows; i++) + { + // 从第2行开始取数据,默认第一行是表头. + Row row = sheet.getRow(i); + T entity = null; + for (Map.Entry entry : fieldsMap.entrySet()) + { + Object val = this.getCellValue(row, entry.getKey()); + + // 如果不存在实例则新建. + entity = (entity == null ? clazz.newInstance() : entity); + // 从map中得到对应列的field. + Field field = fieldsMap.get(entry.getKey()); + // 取得类型,并根据对象类型设置值. + Class fieldType = field.getType(); + if (String.class == fieldType) + { + /* String s = Convert.toStr(val); + if (StringUtils.endsWith(s, ".0")) + { + val = StringUtils.substringBefore(s, ".0"); + } + else + {*/ + val = Convert.toStr(val); + /* }*/ + } + else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) + { + val = Convert.toInt(val); + } + else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) + { + val = Convert.toLong(val); + } + else if ((Double.TYPE == fieldType) || (Double.class == fieldType)) + { + val = Convert.toDouble(val); + } + else if ((Float.TYPE == fieldType) || (Float.class == fieldType)) + { + val = Convert.toFloat(val); + } + else if (BigDecimal.class == fieldType) + { + val = Convert.toBigDecimal(val); + } + else if (Date.class == fieldType) + { + if (val instanceof String) + { + val = DateUtils.parseDate(val); + } + else if (val instanceof Double) + { + val = DateUtil.getJavaDate((Double) val); + } + } + if (StringUtils.isNotNull(fieldType)) + { + Excel attr = field.getAnnotation(Excel.class); + String propertyName = field.getName(); + if (StringUtils.isNotEmpty(attr.targetAttr())) + { + propertyName = field.getName() + "." + attr.targetAttr(); + } + else if (StringUtils.isNotEmpty(attr.readConverterExp())) + { + val = reverseByExp(String.valueOf(val), attr.readConverterExp()); + } + ReflectUtils.invokeSetter(entity, propertyName, val); + } + } + list.add(entity); + } + } + return list; + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(List list, String sheetName) + { + this.init(list, sheetName, Type.EXPORT); + return exportExcel(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult importTemplateExcel(String sheetName) + { + this.init(null, sheetName, Type.IMPORT); + return exportExcel(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel() + { + OutputStream out = null; + try + { + // 取出一共有多少个sheet. + double sheetNo = Math.ceil(list.size() / sheetSize); + for (int index = 0; index <= sheetNo; index++) + { + createSheet(sheetNo, index); + + // 产生一行 + Row row = sheet.createRow(0); + int column = 0; + // 写入各个字段的列头名称 + for (Object[] os : fields) + { + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++); + } + if (Type.EXPORT.equals(type)) + { + fillExcelData(index, row); + } + } + String filename = encodingFilename(sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + } + catch (Exception e) + { + log.error("导出Excel异常{}", e.getMessage()); + throw new CustomException("导出Excel失败,请联系网站管理员!"); + } + finally + { + if (wb != null) + { + try + { + wb.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + if (out != null) + { + try + { + out.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + } + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + public void fillExcelData(int index, Row row) + { + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + for (int i = startNo; i < endNo; i++) + { + row = sheet.createRow(i + 1 - startNo); + // 得到导出对象. + T vo = (T) list.get(i); + int column = 0; + for (Object[] os : fields) + { + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb) + { + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 10); + style.setFont(dataFont); + styles.put("data", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("宋体"); + headerFont.setFontHeightInPoints((short) 10); + headerFont.setBold(true); + headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(headerFont); + styles.put("header", style); + + return styles; + } + + /** + * 创建单元格 + */ + public Cell createCell(Excel attr, Row row, int column) + { + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column); + cell.setCellStyle(styles.get("header")); + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell) + { + if (ColumnType.STRING == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(Integer.parseInt(value + "")); + } + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column) + { + if (attr.name().indexOf("注:") >= 0) + { + sheet.setColumnWidth(column, 6000); + } + else + { + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256)); + row.setHeight((short) (attr.height() * 20)); + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())) + { + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0) + { + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column) + { + Cell cell = null; + try + { + // 设置行高 + row.setHeight((short) (attr.height() * 20)); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()) + { + // 创建cell + cell = row.createCell(column); + cell.setCellStyle(styles.get("data")); + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)) + { + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + } + else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)) + { + cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); + } + else + { + // 设置列类型 + setCellVo(value, attr, cell); + } + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示 + * + * @param sheet 表单 + * @param promptTitle 提示标题 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框. + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + * @return 设置好的sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String convertByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String reverseByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename) + { +// filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; + filename = filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception + { + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())) + { + String target = excel.targetAttr(); + if (target.indexOf(".") > -1) + { + String[] targets = target.split("[.]"); + for (String name : targets) + { + o = getValue(o, name); + } + } + else + { + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); + Method method = clazz.getMethod(methodName); + o = method.invoke(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField() + { + this.fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) + { + putToField(field, excel); + } + } + } + } + + /** + * 放到字段集合中 + */ + private void putToField(Field field, Excel attr) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + this.fields.add(new Object[] { field, attr }); + } + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(double sheetNo, int index) + { + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 设置工作表的名称. + if (sheetNo == 0) + { + wb.setSheetName(index, sheetName); + } + else + { + wb.setSheetName(index, sheetName + index); + } + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (HSSFDateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if((Double) val % 1 == 0){ + val = new DecimalFormat("0").format(val); + } + /*if ((Double) val % 1 > 0) + { + val = new DecimalFormat("0.000").format(val); + } + else + { + val = new DecimalFormat("0").format(val); + }*/ + } + } + else if (cell.getCellTypeEnum() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + public static ArrayList> readExcel2007(Sheet sheet) { + if(sheet==null){ + return null; + } + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + Row row; + Cell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + // 当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {// 判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + // 当该单元格为空 + if (j != row.getLastCellNum()) {// 判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: + // System.out.println(i + "行" + j + " 列 is String + // type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle().getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell.getNumericCellValue())); + } +// value = cell.getNumericCellValue(); + // System.out.println(i + "行" + j + // + " 列 is Number type ; DateFormt:" + // + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: + // System.out.println(i + "行" + j + " 列 is Boolean + // type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: + // System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: + // System.out.println(i + "行" + j + " 列 is default + // type"); + value = cell.toString(); + }// end switch + colList.add(value); + } // end for j + rowList.add(colList); + } // end for i + + return rowList; + } catch (Exception e) { + System.out.println("exception"); + return null; + } + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUtil.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUtil.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUtil.nf = nf; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrint.java b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrint.java new file mode 100644 index 0000000..26d1db1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrint.java @@ -0,0 +1,892 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFPrintSetup; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.PrintSetup; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; + +/** + * Excel相关处理 + * + * @author ruoyi + */ +public class ExcelUtilPrint{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 工作表标题1 + */ + private String title; + + /** + * 工作表标题2 + */ + private String titleTwo; + + /** + * 工作表标题3 + */ + private String titleThree; + + /** + * 供应商名称 + */ + private String preferentialOriginName; + + /** + * 工作表表尾 + */ + private String footer; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 注解列表 + */ + private List fields; + + /** + * 实体对象 + */ + public Class clazz; + + public ExcelUtilPrint(Class clazz) + { + this.clazz = clazz; + } + + // 默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.00"); + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(List list,String sheetName,String title,String titleTwo,String preferentialOriginName,String titleThree,String footer){ + this.init(list,sheetName,title,titleTwo,preferentialOriginName,titleThree,footer,Type.EXPORT); + return exportExcel(); + } + + /** + * 初始化 + * @param list + * @param sheetName + * @param title + * @param titleTwo + * @param preferentialOriginName + * @param titleThree + * @param footer + * @param type + */ + public void init(List list,String sheetName, String title,String titleTwo,String preferentialOriginName,String titleThree, String footer,Type type){ + if (list == null){ + list = new ArrayList(); + } + this.list = list; + this.sheetName = sheetName; + this.title = title; + this.titleTwo = titleTwo; + this.preferentialOriginName = preferentialOriginName; + this.titleThree = titleThree; + this.footer = footer; + this.type = type; + createExcelField(); + createWorkbook(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel(){ + OutputStream out = null; + try{ + // 取出一共有多少个sheet. + double sheetNo = 0; + for (int index = 0; index <= sheetNo; index++){ + createSheet(sheetNo, index); + // 产生一行表头 + Row row = sheet.createRow(0); + sheet.addMergedRegion(new CellRangeAddress(0,0,0,8)); + for(int i = 0; i<9; i++){ + Cell cell = row.createCell(i); + cell.setCellStyle(styles.get("title")); + } + Row row2 = sheet.getRow(0); + Cell cell = row2.getCell(0); + cell.setCellValue(this.title); + // 产生二级表头 + Row rowTwo = sheet.createRow(1); + sheet.addMergedRegion(new CellRangeAddress(1,1,0,8)); + for(int i = 0; i<9; i++){ + Cell cellTwo = rowTwo.createCell(i); + cellTwo.setCellStyle(styles.get("title")); + } + Row row3 = sheet.getRow(1); + Cell cellTwo = row3.getCell(0); + cellTwo.setCellValue(this.titleTwo); + + // 产生三级级表头 + Row preferentialOriginNameRow = sheet.createRow(2); + sheet.addMergedRegion(new CellRangeAddress(2,2,0,8)); + for(int i = 0; i<9; i++){ + Cell preferentialOriginNameCell = preferentialOriginNameRow.createCell(i); + preferentialOriginNameCell.setCellStyle(styles.get("name")); + } + Row row4 = sheet.getRow(2); + Cell preferentialOriginNameCell = row4.getCell(0); + preferentialOriginNameCell.setCellValue(this.preferentialOriginName); + + // 产生一行空行 + Row nul = sheet.createRow(3); + sheet.addMergedRegion(new CellRangeAddress(3,3,0,8)); + for(int i = 0; i<9; i++){ + Cell nu = nul.createCell(i); + nu.setCellStyle(styles.get("name")); + } + Row rownu = sheet.getRow(3); + Cell nuCell = rownu.getCell(0); + nuCell.setCellValue(""); + + // 产生四级级表头 + Row rowThree = sheet.createRow(4); + sheet.addMergedRegion(new CellRangeAddress(4,4,0,8)); + for(int i = 0; i<9; i++){ + Cell cellThree = rowThree.createCell(i); + cellThree.setCellStyle(styles.get("footer")); + } + Row row5 = sheet.getRow(4); + Cell cellThree = row5.getCell(0); + cellThree.setCellValue(this.titleThree); + + int column = 0; + // 写入各个字段的列头名称 + row = sheet.createRow(5); + // 写入各个字段的列头名称 + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (int i = 0; i < fields2.size();i++){ + Object[] os = fields2.get(i); + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++,index); + } + // 产生一行 + Row rows = sheet.createRow(list.size()+6); + sheet.addMergedRegion(new CellRangeAddress(list.size()+6,list.size()+6,0,8)); + for(int i = 0; i<9; i++){ + Cell cells = rows.createCell(i); + cells.setCellStyle(styles.get("footer")); + } + Row rows2 = sheet.getRow(list.size()+6); + Cell cells = rows2.getCell(0); + cells.setCellValue(this.footer); + + if (Type.EXPORT.equals(type)){ + fillExcelData(index, row); + } + } + String filename = encodingFilename(sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + }catch (Exception e){ + log.error("导出Excel异常{}", e.getMessage()); + throw new CustomException("导出Excel失败,请联系网站管理员!"); + } + finally{ + if (wb != null) + { + try + { + wb.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + if (out != null) + { + try + { + out.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + } + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(double sheetNo, int index){ + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 设置工作表的名称. + if (index == 0){ + wb.setSheetName(index, sheetName); + } + //设置打印对象 +// PrintSetup printSetup = sheet.getPrintSetup(); + //设置页边距 +// printSetup.setHeaderMargin((double) 0.44); // 页眉 +// printSetup.setFooterMargin((double) 0.2);//页脚 + + //设置页宽 +// printSetup.setFitWidth((short)1); +// printSetup.setFitHeight((short)1000); + + //设置纸类型 +// sheet.getPrintSetup().setPaperSize(PrintSetup.STATEMENT_PAPERSIZE); +// sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE); + //设置横向打印 +// printSetup.setLandscape(false); + + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + public void fillExcelData(int index, Row row){ + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + for (int i = startNo; i < endNo; i++){ + row = sheet.createRow(i + 6 - startNo); + // 得到导出对象. + T vo = (T) list.get(i); + int column = 0; + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (Object[] os : fields2){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++,index); + } + } + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb) + { + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 10); + style.setFont(dataFont); +// style.setWrapText(true);//自动换行 + styles.put("data", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font dataFonts = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 9); + style.setFont(dataFonts); + styles.put("datas", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); +// style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); +// style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("宋体"); + headerFont.setFontHeightInPoints((short) 11); +// headerFont.setBold(true); +// headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(headerFont); + style.setWrapText(true);//自动换行 + styles.put("header", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("datas")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font footerFont = wb.createFont(); + footerFont.setFontName("宋体"); + footerFont.setFontHeightInPoints((short) 12); + style.setFont(footerFont); + styles.put("footer", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("datas")); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font NameFont = wb.createFont(); + NameFont.setFontName("宋体"); + NameFont.setFontHeightInPoints((short) 13); + style.setFont(NameFont); + styles.put("name", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("footer")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font titleFont = wb.createFont(); + titleFont.setFontName("宋体"); + titleFont.setFontHeightInPoints((short) 18); + style.setFont(titleFont); + styles.put("title", style); + + return styles; + } + + /** + * 创建单元格 + */ + public Cell createCell(Excel attr, Row row, int column,int index){ + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column,index); + cell.setCellStyle(styles.get("header")); + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell) + { + if (ColumnType.STRING == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(Integer.parseInt(value + "")); + } + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column,int index){ + if(index == 0){ + if (attr.name().indexOf("注:") >= 0){ + sheet.setColumnWidth(column, 6000); + }else{ + if(column==0){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 80)); + }else if(column==1){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 160)); + }else if(column==2){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 320)); + }else if(column==3){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 200)); + }else if(column==4){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 140)); + }else if(column==5){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 100)); + }else if(column==6||column==7||column==8){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + }else{ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + } + row.setHeight((short) (attr.height() * 25)); + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())){ + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0){ + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column,int index){ + Cell cell = null; + try{ + // 设置行高 + row.setHeight((short) (attr.height() * 30)); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()){ + // 创建cell + cell = row.createCell(column); + cell.setCellStyle(styles.get("data")); + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)){ + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + }else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)){ + cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); + }else{ + // 设置列类型 + setCellVo(value, attr, cell); + } + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示 + * + * @param sheet 表单 + * @param promptTitle 提示标题 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框. + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + * @return 设置好的sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String convertByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String reverseByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename) + { + filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; +// filename = filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception{ + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())){ + String target = excel.targetAttr(); + if (target.indexOf(".") > -1){ + String[] targets = target.split("[.]"); + for (String name : targets){ + o = getValue(o, name); + } + }else{ + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); + Method method = clazz.getMethod(methodName); + o = method.invoke(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField(){ + this.fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) + { + putToField(field, excel); + } + } + } + } + + /** + * 放到字段集合中 + */ + private void putToField(Field field, Excel attr) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + this.fields.add(new Object[] { field, attr }); + } + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (HSSFDateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if ((Double) val % 1 > 0) + { + val = new DecimalFormat("0.00").format(val); + } + else + { + val = new DecimalFormat("0").format(val); + } + } + } + else if (cell.getCellTypeEnum() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUtilPrint.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUtilPrint.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUtilPrint.nf = nf; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintDaoJu.java b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintDaoJu.java new file mode 100644 index 0000000..a0539d4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintDaoJu.java @@ -0,0 +1,892 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFPrintSetup; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.PrintSetup; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; + +/** + * Excel相关处理 + * + * @author ruoyi + */ +public class ExcelUtilPrintDaoJu{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 工作表标题1 + */ + private String title; + + /** + * 工作表标题2 + */ + private String titleTwo; + + /** + * 工作表标题3 + */ + private String titleThree; + + /** + * 供应商名称 + */ + private String preferentialOriginName; + + /** + * 工作表表尾 + */ + private String footer; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 注解列表 + */ + private List fields; + + /** + * 实体对象 + */ + public Class clazz; + + public ExcelUtilPrintDaoJu(Class clazz) + { + this.clazz = clazz; + } + + // 默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.00"); + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(List list,String sheetName,String title,String titleTwo,String preferentialOriginName,String titleThree,String footer){ + this.init(list,sheetName,title,titleTwo,preferentialOriginName,titleThree,footer,Type.EXPORT); + return exportExcel(); + } + + /** + * 初始化 + * @param list + * @param sheetName + * @param title + * @param titleTwo + * @param preferentialOriginName + * @param titleThree + * @param footer + * @param type + */ + public void init(List list,String sheetName, String title,String titleTwo,String preferentialOriginName,String titleThree, String footer,Type type){ + if (list == null){ + list = new ArrayList(); + } + this.list = list; + this.sheetName = sheetName; + this.title = title; + this.titleTwo = titleTwo; + this.preferentialOriginName = preferentialOriginName; + this.titleThree = titleThree; + this.footer = footer; + this.type = type; + createExcelField(); + createWorkbook(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel(){ + OutputStream out = null; + try{ + // 取出一共有多少个sheet. + double sheetNo = 0; + for (int index = 0; index <= sheetNo; index++){ + createSheet(sheetNo, index); + // 产生一行表头 + Row row = sheet.createRow(0); + sheet.addMergedRegion(new CellRangeAddress(0,0,0,8)); + for(int i = 0; i<9; i++){ + Cell cell = row.createCell(i); + cell.setCellStyle(styles.get("title")); + } + Row row2 = sheet.getRow(0); + Cell cell = row2.getCell(0); + cell.setCellValue(this.title); + // 产生二级表头 + Row rowTwo = sheet.createRow(1); + sheet.addMergedRegion(new CellRangeAddress(1,1,0,8)); + for(int i = 0; i<9; i++){ + Cell cellTwo = rowTwo.createCell(i); + cellTwo.setCellStyle(styles.get("title")); + } + Row row3 = sheet.getRow(1); + Cell cellTwo = row3.getCell(0); + cellTwo.setCellValue(this.titleTwo); + + // 产生三级级表头 + Row preferentialOriginNameRow = sheet.createRow(2); + sheet.addMergedRegion(new CellRangeAddress(2,2,0,8)); + for(int i = 0; i<9; i++){ + Cell preferentialOriginNameCell = preferentialOriginNameRow.createCell(i); + preferentialOriginNameCell.setCellStyle(styles.get("name")); + } + Row row4 = sheet.getRow(2); + Cell preferentialOriginNameCell = row4.getCell(0); + preferentialOriginNameCell.setCellValue(this.preferentialOriginName); + + // 产生一行空行 + Row nul = sheet.createRow(3); + sheet.addMergedRegion(new CellRangeAddress(3,3,0,8)); + for(int i = 0; i<9; i++){ + Cell nu = nul.createCell(i); + nu.setCellStyle(styles.get("name")); + } + Row rownu = sheet.getRow(3); + Cell nuCell = rownu.getCell(0); + nuCell.setCellValue(""); + + // 产生四级级表头 + Row rowThree = sheet.createRow(4); + sheet.addMergedRegion(new CellRangeAddress(4,4,0,8)); + for(int i = 0; i<9; i++){ + Cell cellThree = rowThree.createCell(i); + cellThree.setCellStyle(styles.get("footer")); + } + Row row5 = sheet.getRow(4); + Cell cellThree = row5.getCell(0); + cellThree.setCellValue(this.titleThree); + + int column = 0; + // 写入各个字段的列头名称 + row = sheet.createRow(5); + // 写入各个字段的列头名称 + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (int i = 0; i < fields2.size();i++){ + Object[] os = fields2.get(i); + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++,index); + } + // 产生一行 + Row rows = sheet.createRow(list.size()+6); + sheet.addMergedRegion(new CellRangeAddress(list.size()+6,list.size()+6,0,8)); + for(int i = 0; i<9; i++){ + Cell cells = rows.createCell(i); + cells.setCellStyle(styles.get("footer")); + } + Row rows2 = sheet.getRow(list.size()+6); + Cell cells = rows2.getCell(0); + cells.setCellValue(this.footer); + + if (Type.EXPORT.equals(type)){ + fillExcelData(index, row); + } + } + String filename = encodingFilename(sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + }catch (Exception e){ + log.error("导出Excel异常{}", e.getMessage()); + throw new CustomException("导出Excel失败,请联系网站管理员!"); + } + finally{ + if (wb != null) + { + try + { + wb.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + if (out != null) + { + try + { + out.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + } + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(double sheetNo, int index){ + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 设置工作表的名称. + if (index == 0){ + wb.setSheetName(index, sheetName); + } + //设置打印对象 +// PrintSetup printSetup = sheet.getPrintSetup(); + //设置页边距 +// printSetup.setHeaderMargin((double) 0.44); // 页眉 +// printSetup.setFooterMargin((double) 0.2);//页脚 + + //设置页宽 +// printSetup.setFitWidth((short)1); +// printSetup.setFitHeight((short)1000); + + //设置纸类型 +// sheet.getPrintSetup().setPaperSize(PrintSetup.STATEMENT_PAPERSIZE); +// sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE); + //设置横向打印 +// printSetup.setLandscape(false); + + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + public void fillExcelData(int index, Row row){ + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + for (int i = startNo; i < endNo; i++){ + row = sheet.createRow(i + 6 - startNo); + // 得到导出对象. + T vo = (T) list.get(i); + int column = 0; + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (Object[] os : fields2){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++,index); + } + } + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb) + { + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 10); + style.setFont(dataFont); +// style.setWrapText(true);//自动换行 + styles.put("data", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font dataFonts = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 9); + style.setFont(dataFonts); + styles.put("datas", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); +// style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); +// style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("宋体"); + headerFont.setFontHeightInPoints((short) 11); +// headerFont.setBold(true); +// headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(headerFont); + style.setWrapText(true);//自动换行 + styles.put("header", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("datas")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font footerFont = wb.createFont(); + footerFont.setFontName("宋体"); + footerFont.setFontHeightInPoints((short) 12); + style.setFont(footerFont); + styles.put("footer", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("datas")); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font NameFont = wb.createFont(); + NameFont.setFontName("宋体"); + NameFont.setFontHeightInPoints((short) 13); + style.setFont(NameFont); + styles.put("name", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("footer")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font titleFont = wb.createFont(); + titleFont.setFontName("宋体"); + titleFont.setFontHeightInPoints((short) 18); + style.setFont(titleFont); + styles.put("title", style); + + return styles; + } + + /** + * 创建单元格 + */ + public Cell createCell(Excel attr, Row row, int column,int index){ + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column,index); + cell.setCellStyle(styles.get("header")); + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell) + { + if (ColumnType.STRING == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(Integer.parseInt(value + "")); + } + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column,int index){ + if(index == 0){ + if (attr.name().indexOf("注:") >= 0){ + sheet.setColumnWidth(column, 6000); + }else{ + if(column==0){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 80)); + }else if(column==1){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 160)); + }else if(column==2){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 160)); + }else if(column==3){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 300)); + }else if(column==4){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 80)); + }else if(column==5){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 300)); + }else if(column==6||column==7){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 100)); + }else{ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 140)); + } + row.setHeight((short) (attr.height() * 25)); + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())){ + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0){ + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column,int index){ + Cell cell = null; + try{ + // 设置行高 + row.setHeight((short) (attr.height() * 30)); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()){ + // 创建cell + cell = row.createCell(column); + cell.setCellStyle(styles.get("data")); + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)){ + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + }else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)){ + cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); + }else{ + // 设置列类型 + setCellVo(value, attr, cell); + } + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示 + * + * @param sheet 表单 + * @param promptTitle 提示标题 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框. + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + * @return 设置好的sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String convertByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String reverseByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename) + { + filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; +// filename = filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception{ + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())){ + String target = excel.targetAttr(); + if (target.indexOf(".") > -1){ + String[] targets = target.split("[.]"); + for (String name : targets){ + o = getValue(o, name); + } + }else{ + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); + Method method = clazz.getMethod(methodName); + o = method.invoke(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField(){ + this.fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) + { + putToField(field, excel); + } + } + } + } + + /** + * 放到字段集合中 + */ + private void putToField(Field field, Excel attr) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + this.fields.add(new Object[] { field, attr }); + } + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (HSSFDateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if ((Double) val % 1 > 0) + { + val = new DecimalFormat("0.00").format(val); + } + else + { + val = new DecimalFormat("0").format(val); + } + } + } + else if (cell.getCellTypeEnum() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUtilPrintDaoJu.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUtilPrintDaoJu.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUtilPrintDaoJu.nf = nf; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintFaYun.java b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintFaYun.java new file mode 100644 index 0000000..5df59ed --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintFaYun.java @@ -0,0 +1,1148 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFPrintSetup; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.PrintSetup; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.PwLetterOfAdvice; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; + +/** + * Excel相关处理 + * + * @author ruoyi + */ +public class ExcelUtilPrintFaYun{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 工作表标题1 + */ + private String title; + + /** + * 工作表标题2 + */ + private String titleTwo; + + /** + * 制单人 + */ + private String userName; + + /** + * 生产令号 + */ + private String code; + + /** + * 发运单信息 + */ + private PwLetterOfAdvice pwLetterOfAdvice = new PwLetterOfAdvice(); + + /** + * 工作表表尾 + */ + private String footer; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 注解列表 + */ + private List fields; + + /** + * 实体对象 + */ + public Class clazz; + + public ExcelUtilPrintFaYun(Class clazz) + { + this.clazz = clazz; + } + + // 默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.00"); + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(PwLetterOfAdvice letterOfAdvice,List list,String title,String titleTwo,String footer,String userName,String code){ + this.init(letterOfAdvice,list,title,titleTwo,footer,userName,code,Type.EXPORT); + return exportExcel(); + } + + /** + * 初始化 + * @param list + * @param sheetName + * @param title + * @param titleTwo + * @param preferentialOriginName + * @param titleThree + * @param footer + * @param type + */ + public void init(PwLetterOfAdvice letterOfAdvice,List list,String title,String titleTwo,String footer,String userName,String code,Type type){ + if (list == null){ + list = new ArrayList(); + } + this.list = list; + this.sheetName = titleTwo; + this.title = title; + this.titleTwo = titleTwo; + this.pwLetterOfAdvice = letterOfAdvice; + this.footer = footer; + this.type = type; + this.userName = userName; + this.code = code; + createExcelField(); + createWorkbook(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel(){ + OutputStream out = null; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + try{ + // 取出一共有多少个sheet. + double sheetNo = 0; + for (int index = 0; index <= sheetNo; index++){ + //创建工作表 + createSheet(index); + // 产生一行表头 + Row rowOne = sheet.createRow(0); + sheet.addMergedRegion(new CellRangeAddress(0,0,0,5)); + for(int i = 0; i<6; i++){ + Cell cellOne = rowOne.createCell(i); + cellOne.setCellStyle(styles.get("title")); + } + Row rowOne2 = sheet.getRow(0); + Cell cellOne = rowOne2.getCell(0); + cellOne.setCellValue(this.title); + + // 产生二级表头 + Row rowTwo = sheet.createRow(1); + sheet.addMergedRegion(new CellRangeAddress(1,1,0,5)); + for(int i = 0; i<6; i++){ + Cell cellTwo = rowTwo.createCell(i); + cellTwo.setCellStyle(styles.get("title")); + } + Row rowTwo2 = sheet.getRow(1); + Cell cellTwo = rowTwo2.getCell(0); + cellTwo.setCellValue(this.titleTwo); + + // 产生一行空行 + Row rowThree = sheet.createRow(2); + rowThree.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(2,2,0,5)); + for(int i = 0; i<6; i++){ + Cell cellThree = rowThree.createCell(i); + cellThree.setCellStyle(styles.get("title")); + } + Row rowThree2 = sheet.getRow(2); + Cell cellThree = rowThree2.getCell(0); + cellThree.setCellValue(""); + + // 增加一行(合同信息,生产令号,运费支付方信息) + Row rowFour = sheet.createRow(3); + rowFour.setHeight((short) (14 * 30)); + for(int i = 0; i<6; i++){ + Cell cellFour = rowFour.createCell(i); + cellFour.setCellStyle(styles.get("footer")); + } + Row rowFour2 = sheet.getRow(3); + Cell cellFour1 = rowFour2.getCell(0); + Cell cellFour2 = rowFour2.getCell(1); + Cell cellFour3 = rowFour2.getCell(2); + Cell cellFour4 = rowFour2.getCell(3); + Cell cellFour5 = rowFour2.getCell(4); + Cell cellFour6 = rowFour2.getCell(5); + cellFour1.setCellValue("合同编号:"); + cellFour2.setCellValue(this.pwLetterOfAdvice.getContractCode()); + cellFour3.setCellValue("生产令号:"); + cellFour4.setCellValue(code); + cellFour5.setCellValue("运费支付方:"); + cellFour6.setCellValue(this.pwLetterOfAdvice.getFreightPayer()); + + //增加一行(购买方信息表头) + Row rowFive = sheet.createRow(4); + sheet.addMergedRegion(new CellRangeAddress(4,4,0,5)); + for(int i = 0; i<6; i++){ + Cell cellFive = rowFive.createCell(i); + cellFive.setCellStyle(styles.get("header")); + } + Row rowFive2 = sheet.getRow(4); + Cell cellFive = rowFive2.getCell(0); + cellFive.setCellValue("购买方信息"); + + //增加一行(购买方信息) + Row rowSix = sheet.createRow(5); + rowSix.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(5,5,1,2)); + sheet.addMergedRegion(new CellRangeAddress(5,5,4,5)); + for(int i = 0; i<6; i++){ + Cell cellSix = rowSix.createCell(i); + cellSix.setCellStyle(styles.get("footer")); + } + Row rowSix2 = sheet.getRow(5); + Cell cellSix1 = rowSix2.getCell(0); + Cell cellSix2 = rowSix2.getCell(1); + Cell cellSix3 = rowSix2.getCell(3); + Cell cellSix4 = rowSix2.getCell(4); + cellSix1.setCellValue("单位名称:"); + cellSix2.setCellValue(this.pwLetterOfAdvice.getPurchaserUnitName()); + cellSix3.setCellValue("收货人:"); + cellSix4.setCellValue(this.pwLetterOfAdvice.getConsignee()); + + //增加一行(购买方信息) + Row rowSeven = sheet.createRow(6); + rowSeven.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(6,6,1,2)); + sheet.addMergedRegion(new CellRangeAddress(6,6,4,5)); + for(int i = 0; i<6; i++){ + Cell cellSeven = rowSeven.createCell(i); + cellSeven.setCellStyle(styles.get("footer")); + } + Row rowSeven2 = sheet.getRow(6); + Cell cellSeven1 = rowSeven2.getCell(0); + Cell cellSeven2 = rowSeven2.getCell(1); + Cell cellSeven3 = rowSeven2.getCell(3); + Cell cellSeven4 = rowSeven2.getCell(4); + cellSeven1.setCellValue("收货地址:"); + cellSeven2.setCellValue(this.pwLetterOfAdvice.getShippingAddress()); + cellSeven3.setCellValue("电 话:"); + cellSeven4.setCellValue(this.pwLetterOfAdvice.getPurchaserUnitPhone()); + + //增加一行(承运方信息表头) + Row rowEight = sheet.createRow(7); + sheet.addMergedRegion(new CellRangeAddress(7,7,0,5)); + for(int i = 0; i<6; i++){ + Cell cellEight = rowEight.createCell(i); + cellEight.setCellStyle(styles.get("header")); + } + Row rowEight2 = sheet.getRow(7); + Cell cellEight = rowEight2.getCell(0); + cellEight.setCellValue("承运方信息"); + + //增加一行(承运方信息) + Row rowNine = sheet.createRow(8); + rowNine.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(8,8,1,2)); + sheet.addMergedRegion(new CellRangeAddress(8,8,4,5)); + for(int i = 0; i<6; i++){ + Cell cellNine = rowNine.createCell(i); + cellNine.setCellStyle(styles.get("footer")); + } + Row rowNine2 = sheet.getRow(8); + Cell cellNine1 = rowNine2.getCell(0); + Cell cellNine2 = rowNine2.getCell(1); + Cell cellNine3 = rowNine2.getCell(3); + Cell cellNine4 = rowNine2.getCell(4); + cellNine1.setCellValue("承运单位:"); + cellNine2.setCellValue(this.pwLetterOfAdvice.getCarrierUnitName()); + cellNine3.setCellValue("承运人:"); + cellNine4.setCellValue(this.pwLetterOfAdvice.getHaulier()); + + //增加一行(承运方信息) + Row rowTen = sheet.createRow(9); + rowTen.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(9,9,1,2)); + sheet.addMergedRegion(new CellRangeAddress(9,9,4,5)); + for(int i = 0; i<6; i++){ + Cell cellTen = rowTen.createCell(i); + cellTen.setCellStyle(styles.get("footer")); + } + Row rowTen2 = sheet.getRow(9); + Cell cellTen1 = rowTen2.getCell(0); + Cell cellTen2 = rowTen2.getCell(1); + Cell cellTen3 = rowTen2.getCell(3); + Cell cellTen4 = rowTen2.getCell(4); + cellTen1.setCellValue("承运车辆:"); + cellTen2.setCellValue(this.pwLetterOfAdvice.getCarrierCar()); + cellTen3.setCellValue("电 话:"); + cellTen4.setCellValue(this.pwLetterOfAdvice.getHaulierPhone()); + + //增加一行(货物信息表头) + Row rowEleven = sheet.createRow(10); + sheet.addMergedRegion(new CellRangeAddress(10,10,0,5)); + for(int i = 0; i<6; i++){ + Cell cellEleven = rowEleven.createCell(i); + cellEleven.setCellStyle(styles.get("header")); + } + Row rowEleven2 = sheet.getRow(10); + Cell cellEleven = rowEleven2.getCell(0); + cellEleven.setCellValue("货物信息"); + + int column = 0; + // 写入各个字段的列头名称 + rowOne = sheet.createRow(11); + // 写入各个字段的列头名称 + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (int i = 0; i < fields2.size();i++){ + Object[] os = fields2.get(i); + Excel excel = (Excel) os[1]; + this.createCell(excel, rowOne, column++,index); + } + + // 产生一行空行 + Row rowTwelve = sheet.createRow(list.size()+12); + rowTwelve.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+12,list.size()+12,0,5)); + for(int i = 0; i<6; i++){ + Cell cellTwelve = rowTwelve.createCell(i); + cellTwelve.setCellStyle(styles.get("footer")); + } + Row rowTwelve2 = sheet.getRow(list.size()+12); + Cell cellTwelve2 = rowTwelve2.getCell(0); + cellTwelve2.setCellValue(""); + + //产生一行(制单人) + Row rowThirteen = sheet.createRow(list.size()+13); + rowThirteen.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+13,list.size()+13,1,2)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+13,list.size()+13,4,5)); + for(int i = 0; i<6; i++){ + Cell cellThirteen = rowThirteen.createCell(i); + cellThirteen.setCellStyle(styles.get("footer")); + } + Row rowThirteen2 = sheet.getRow(list.size()+13); + Cell cellThirteen1 = rowThirteen2.getCell(0); + Cell cellThirteen2 = rowThirteen2.getCell(1); + Cell cellThirteen3 = rowThirteen2.getCell(3); + Cell cellThirteen4 = rowThirteen2.getCell(4); + cellThirteen1.setCellValue("制单人:"); + cellThirteen2.setCellValue(this.userName); + cellThirteen3.setCellValue("日 期:"); + cellThirteen4.setCellValue(sdf.format(new Date())); + + //产生一行(销售确认) + Row rowFourteen = sheet.createRow(list.size()+14); + rowFourteen.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+14,list.size()+14,1,2)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+14,list.size()+14,4,5)); + for(int i = 0; i<6; i++){ + Cell cellFourteen = rowFourteen.createCell(i); + cellFourteen.setCellStyle(styles.get("footer")); + } + Row rowFourteen2 = sheet.getRow(list.size()+14); + Cell cellFourteen1 = rowFourteen2.getCell(0); + Cell cellFourteen2 = rowFourteen2.getCell(1); + Cell cellFourteen3 = rowFourteen2.getCell(3); + Cell cellFourteen4 = rowFourteen2.getCell(4); + cellFourteen1.setCellValue("销售确认:"); + cellFourteen2.setCellValue(this.pwLetterOfAdvice.getProposer()); + cellFourteen3.setCellValue("日 期:"); + cellFourteen4.setCellValue(sdf.format(new Date())); + + //产生一行(财务审核) + Row rowFiveteen = sheet.createRow(list.size()+15); + rowFiveteen.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+15,list.size()+15,1,2)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+15,list.size()+15,4,5)); + for(int i = 0; i<6; i++){ + Cell cellFiveteen = rowFiveteen.createCell(i); + cellFiveteen.setCellStyle(styles.get("footer")); + } + Row rowFiveteen2 = sheet.getRow(list.size()+15); + Cell cellFiveteen1 = rowFiveteen2.getCell(0); + Cell cellFiveteen2 = rowFiveteen2.getCell(1); + Cell cellFiveteen3 = rowFiveteen2.getCell(3); + Cell cellFiveteen4 = rowFiveteen2.getCell(4); + cellFiveteen1.setCellValue("财务审核:"); + cellFiveteen2.setCellValue(this.pwLetterOfAdvice.getFinancialAuditSuggest()); + cellFiveteen3.setCellValue("日 期:"); + cellFiveteen4.setCellValue(sdf.format(this.pwLetterOfAdvice.getRatifyTime())); + + //产生一行(审批) + Row rowSixteen = sheet.createRow(list.size()+16); + rowSixteen.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+16,list.size()+16,1,2)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+16,list.size()+16,4,5)); + for(int i = 0; i<6; i++){ + Cell cellSixteen = rowSixteen.createCell(i); + cellSixteen.setCellStyle(styles.get("footer")); + } + Row rowSixteen2 = sheet.getRow(list.size()+16); + Cell cellSixteen1 = rowSixteen2.getCell(0); + Cell cellSixteen2 = rowSixteen2.getCell(1); + Cell cellSixteen3 = rowSixteen2.getCell(3); + Cell cellSixteen4 = rowSixteen2.getCell(4); + cellSixteen1.setCellValue("批 准:"); + cellSixteen2.setCellValue(""); + cellSixteen3.setCellValue("日 期:"); + cellSixteen4.setCellValue(""); + + // 产生一行空行(附注) + Row rowSeventeen = sheet.createRow(list.size()+17); + rowSeventeen.setHeight((short) (20 * 30)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+17,list.size()+17,0,5)); + for(int i = 0; i<6; i++){ + Cell cellSeventeen = rowSeventeen.createCell(i); + cellSeventeen.setCellStyle(styles.get("name")); + } + Row rowSeventeen2 = sheet.getRow(list.size()+17); + Cell cellSeventeen2 = rowSeventeen2.getCell(0); + cellSeventeen2.setCellValue("附 注:"); + + // 产生一行 + Row rows = sheet.createRow(list.size()+20); + rows.setHeight((short) (14 * 30)); + sheet.addMergedRegion(new CellRangeAddress(list.size()+20,list.size()+20,0,5)); + for(int i = 0; i<6; i++){ + Cell cells = rows.createCell(i); + cells.setCellStyle(styles.get("names")); + } + Row rows2 = sheet.getRow(list.size()+20); + Cell cells = rows2.getCell(0); + cells.setCellValue(this.footer); + + + if (Type.EXPORT.equals(type)){ + fillExcelData(index, rowOne); + } + } + String filename = encodingFilename(sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + }catch (Exception e){ + log.error("导出Excel异常{}", e.getMessage()); + throw new CustomException("导出Excel失败,请联系网站管理员!"); + } + finally{ + if (wb != null) + { + try + { + wb.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + if (out != null) + { + try + { + out.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + } + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(int index){ + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 设置工作表的名称. + if (index == 0){ + wb.setSheetName(index, sheetName); + } + //设置打印对象 +// PrintSetup printSetup = sheet.getPrintSetup(); + //设置页边距 +// printSetup.setHeaderMargin((double) 0.44); // 页眉 +// printSetup.setFooterMargin((double) 0.2);//页脚 + + //设置页宽 +// printSetup.setFitWidth((short)1); +// printSetup.setFitHeight((short)1000); + + //设置纸类型 +// sheet.getPrintSetup().setPaperSize(PrintSetup.STATEMENT_PAPERSIZE); +// sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE); + //设置横向打印 +// printSetup.setLandscape(false); + + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + public void fillExcelData(int index, Row row){ + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + for (int i = startNo; i < endNo; i++){ + row = sheet.createRow(i + 12 - startNo); + // 得到导出对象. + T vo = (T) list.get(i); + int column = 0; + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (Object[] os : fields2){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++,index); + } + } + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb) + { + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 12); + style.setFont(dataFont); +// style.setWrapText(true);//自动换行 + styles.put("data", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderLeft(BorderStyle.THIN);//左边框 + style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderTop(BorderStyle.THIN); //上边框 + style.setRightBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderRight(BorderStyle.THIN);//右边框 + style.setTopBorderColor(IndexedColors.BLACK.getIndex()); + Font dataFonts = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 11); + style.setFont(dataFonts); + styles.put("datas", style); + + //一级表头样式 + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font titleFont = wb.createFont(); + titleFont.setFontName("宋体"); + titleFont.setFontHeightInPoints((short) 18); + style.setFont(titleFont); + styles.put("title", style); + + //头部信息样式 + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderLeft(BorderStyle.THIN);//左边框 + style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderTop(BorderStyle.THIN); //上边框 + style.setRightBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderRight(BorderStyle.THIN);//右边框 + style.setTopBorderColor(IndexedColors.BLACK.getIndex()); + Font headerFont = wb.createFont(); + headerFont.setFontName("宋体"); + headerFont.setFontHeightInPoints((short) 15); + style.setFont(headerFont); +// style.setWrapText(true);//自动换行 + styles.put("header", style); + + //表尾样式 + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderLeft(BorderStyle.THIN);//左边框 + style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderTop(BorderStyle.THIN); //上边框 + style.setRightBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderRight(BorderStyle.THIN);//右边框 + style.setTopBorderColor(IndexedColors.BLACK.getIndex()); + Font footerFont = wb.createFont(); + footerFont.setFontName("宋体"); + footerFont.setFontHeightInPoints((short) 12); + style.setFont(footerFont); + styles.put("footer", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderLeft(BorderStyle.THIN);//左边框 + style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderTop(BorderStyle.THIN); //上边框 + style.setRightBorderColor(IndexedColors.BLACK.getIndex()); + style.setBorderRight(BorderStyle.THIN);//右边框 + style.setTopBorderColor(IndexedColors.BLACK.getIndex()); + Font NameFont = wb.createFont(); + NameFont.setFontName("宋体"); + NameFont.setFontHeightInPoints((short) 12); + style.setFont(NameFont); + styles.put("name", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("title")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font NameFonts = wb.createFont(); + NameFonts.setFontName("宋体"); + NameFonts.setFontHeightInPoints((short) 12); + style.setFont(NameFont); + styles.put("names", style); + + return styles; + } + + /** + * 创建单元格 + */ + public Cell createCell(Excel attr, Row row, int column,int index){ + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column,index); + cell.setCellStyle(styles.get("footer")); + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell) + { + if (ColumnType.STRING == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(Integer.parseInt(value + "")); + } + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column,int index){ + if(index == 0){ + if (attr.name().indexOf("注:") >= 0){ + sheet.setColumnWidth(column, 6000); + }else{ + if(column==0){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 200)); + }else if(column==1){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 380)); + }else if(column==2){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 200)); + }else if(column==3){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 300)); + }else if(column==4){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 200)); + }else if(column==5){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + } + row.setHeight((short) (attr.height() * 30)); + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())){ + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0){ + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column,int index){ + Cell cell = null; + try{ + // 设置行高 + row.setHeight((short) (attr.height() * 30)); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()){ + // 创建cell + cell = row.createCell(column); + cell.setCellStyle(styles.get("data")); + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)){ + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + }else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)){ + cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); + }else{ + // 设置列类型 + setCellVo(value, attr, cell); + } + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示 + * + * @param sheet 表单 + * @param promptTitle 提示标题 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框. + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + * @return 设置好的sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String convertByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String reverseByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename) + { + filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; +// filename = filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception{ + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())){ + String target = excel.targetAttr(); + if (target.indexOf(".") > -1){ + String[] targets = target.split("[.]"); + for (String name : targets){ + o = getValue(o, name); + } + }else{ + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); + Method method = clazz.getMethod(methodName); + o = method.invoke(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField(){ + this.fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) + { + putToField(field, excel); + } + } + } + } + + /** + * 放到字段集合中 + */ + private void putToField(Field field, Excel attr) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + this.fields.add(new Object[] { field, attr }); + } + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (HSSFDateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if ((Double) val % 1 > 0) + { + val = new DecimalFormat("0.00").format(val); + } + else + { + val = new DecimalFormat("0").format(val); + } + } + } + else if (cell.getCellTypeEnum() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUtilPrintFaYun.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUtilPrintFaYun.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUtilPrintFaYun.nf = nf; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintJj.java b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintJj.java new file mode 100644 index 0000000..aadb897 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilPrintJj.java @@ -0,0 +1,910 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFPrintSetup; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.PrintSetup; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; + +/** + * Excel相关处理 + * + * @author ruoyi + */ +public class ExcelUtilPrintJj{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 工作表标题1 + */ + private String title; + + /** + * 工作表标题2 + */ + private String titleTwo; + + /** + * 工作表标题3 + */ + private String titleThree; + + /** + * 供应商名称 + */ + private String preferentialOriginName; + + /** + * 工作表表尾 + */ + private String footer; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 注解列表 + */ + private List fields; + + /** + * 实体对象 + */ + public Class clazz; + + public ExcelUtilPrintJj(Class clazz) + { + this.clazz = clazz; + } + + // 默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.00"); + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(List list,String sheetName,String title,String titleTwo,String preferentialOriginName,String titleThree,String footer){ + this.init(list,sheetName,title,titleTwo,preferentialOriginName,titleThree,footer,Type.EXPORT); + return exportExcel(); + } + + /** + * 初始化 + * @param list + * @param sheetName + * @param title + * @param titleTwo + * @param preferentialOriginName + * @param titleThree + * @param footer + * @param type + */ + public void init(List list,String sheetName, String title,String titleTwo,String preferentialOriginName,String titleThree, String footer,Type type){ + if (list == null){ + list = new ArrayList(); + } + this.list = list; + this.sheetName = sheetName; + this.title = title; + this.titleTwo = titleTwo; + this.preferentialOriginName = preferentialOriginName; + this.titleThree = titleThree; + this.footer = footer; + this.type = type; + createExcelField(); + createWorkbook(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel(){ + OutputStream out = null; + try{ + // 取出一共有多少个sheet. + double sheetNo = 0; + for (int index = 0; index <= sheetNo; index++){ + createSheet(sheetNo, index); + // 产生一行表头 + Row row = sheet.createRow(0); + sheet.addMergedRegion(new CellRangeAddress(0,0,0,8)); + for(int i = 0; i<9; i++){ + Cell cell = row.createCell(i); + cell.setCellStyle(styles.get("title")); + } + Row row2 = sheet.getRow(0); + Cell cell = row2.getCell(0); + cell.setCellValue(this.title); + // 产生二级表头 + Row rowTwo = sheet.createRow(1); + sheet.addMergedRegion(new CellRangeAddress(1,1,0,8)); + for(int i = 0; i<9; i++){ + Cell cellTwo = rowTwo.createCell(i); + cellTwo.setCellStyle(styles.get("title")); + } + Row row3 = sheet.getRow(1); + Cell cellTwo = row3.getCell(0); + cellTwo.setCellValue(this.titleTwo); + + // 产生三级级表头 + Row preferentialOriginNameRow = sheet.createRow(2); + sheet.addMergedRegion(new CellRangeAddress(2,2,0,8)); + for(int i = 0; i<9; i++){ + Cell preferentialOriginNameCell = preferentialOriginNameRow.createCell(i); + preferentialOriginNameCell.setCellStyle(styles.get("name")); + } + Row row4 = sheet.getRow(2); + Cell preferentialOriginNameCell = row4.getCell(0); + preferentialOriginNameCell.setCellValue(this.preferentialOriginName); + + // 产生一行空行 + Row nul = sheet.createRow(3); + sheet.addMergedRegion(new CellRangeAddress(3,3,0,8)); + for(int i = 0; i<9; i++){ + Cell nu = nul.createCell(i); + nu.setCellStyle(styles.get("name")); + } + Row rownu = sheet.getRow(3); + Cell nuCell = rownu.getCell(0); + nuCell.setCellValue(""); + + // 产生四级级表头 + Row rowThree = sheet.createRow(4); + sheet.addMergedRegion(new CellRangeAddress(4,4,0,8)); + for(int i = 0; i<9; i++){ + Cell cellThree = rowThree.createCell(i); + cellThree.setCellStyle(styles.get("footer")); + } + Row row5 = sheet.getRow(4); + Cell cellThree = row5.getCell(0); + cellThree.setCellValue(this.titleThree); + + int column = 0; + // 写入各个字段的列头名称 + row = sheet.createRow(5); + // 写入各个字段的列头名称 + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (int i = 0; i < fields2.size();i++){ + Object[] os = fields2.get(i); + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++,index); + } + + // 产生一行空行 + Row nulT = sheet.createRow(list.size()+6); + sheet.addMergedRegion(new CellRangeAddress(list.size()+6,list.size()+6,0,8)); + for(int i = 0; i<9; i++){ + Cell nu = nulT.createCell(i); + nu.setCellStyle(styles.get("name")); + } + Row rownuT = sheet.getRow(list.size()+6); + Cell nuCellT = rownuT.getCell(0); + nuCellT.setCellValue(""); + + // 产生一行 + Row rows = sheet.createRow(list.size()+7); + sheet.addMergedRegion(new CellRangeAddress(list.size()+7,list.size()+7,0,8)); + for(int i = 0; i<9; i++){ + Cell cells = rows.createCell(i); + cells.setCellStyle(styles.get("footer")); + } + Row rows2 = sheet.getRow(list.size()+7); + Cell cells = rows2.getCell(0); + cells.setCellValue(this.footer); + + if (Type.EXPORT.equals(type)){ + fillExcelData(index, row); + } + } + String filename = encodingFilename(sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + }catch (Exception e){ + log.error("导出Excel异常{}", e.getMessage()); + throw new CustomException("导出Excel失败,请联系网站管理员!"); + } + finally{ + if (wb != null) + { + try + { + wb.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + if (out != null) + { + try + { + out.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + } + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(double sheetNo, int index){ + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 设置工作表的名称. + if (index == 0){ + wb.setSheetName(index, sheetName); + } + //设置打印对象 +// PrintSetup printSetup = sheet.getPrintSetup(); + //设置页边距 +// printSetup.setHeaderMargin((double) 0.44); // 页眉 +// printSetup.setFooterMargin((double) 0.2);//页脚 + + //设置页宽 +// printSetup.setFitWidth((short)1); +// printSetup.setFitHeight((short)1000); + + //设置纸类型 +// sheet.getPrintSetup().setPaperSize(PrintSetup.STATEMENT_PAPERSIZE); +// sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE); + //设置横向打印 +// printSetup.setLandscape(false); + + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + public void fillExcelData(int index, Row row){ + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + for (int i = startNo; i < endNo; i++){ + row = sheet.createRow(i + 6 - startNo); + // 得到导出对象. + T vo = (T) list.get(i); + int column = 0; + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + for (Object[] os : fields2){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++,index); + } + } + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb) + { + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 10); + style.setFont(dataFont); +// style.setWrapText(true);//自动换行 + styles.put("data", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font dataFonts = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 9); + style.setFont(dataFonts); + styles.put("datas", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); +// style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); +// style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("宋体"); + headerFont.setFontHeightInPoints((short) 11); +// headerFont.setBold(true); +// headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(headerFont); + style.setWrapText(true);//自动换行 + styles.put("header", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("datas")); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font footerFont = wb.createFont(); + footerFont.setFontName("宋体"); + footerFont.setFontHeightInPoints((short) 12); + style.setFont(footerFont); + styles.put("footer", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("datas")); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font NameFont = wb.createFont(); + NameFont.setFontName("宋体"); + NameFont.setFontHeightInPoints((short) 13); + style.setFont(NameFont); + styles.put("name", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("footer")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font titleFont = wb.createFont(); + titleFont.setFontName("宋体"); + titleFont.setFontHeightInPoints((short) 18); + style.setFont(titleFont); + styles.put("title", style); + + return styles; + } + + /** + * 创建单元格 + */ + public Cell createCell(Excel attr, Row row, int column,int index){ + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column,index); + cell.setCellStyle(styles.get("header")); + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell) + { + if (ColumnType.STRING == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(Integer.parseInt(value + "")); + } + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column,int index){ + if(index == 0){ + if (attr.name().indexOf("注:") >= 0){ + sheet.setColumnWidth(column, 6000); + }else{ + if(column==0){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 80)); + }else if(column==1){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 160)); + }else if(column==2){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 160)); + }else if(column==3){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 100)); + }else if(column==4){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 100)); + }else if(column==5){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + }else if(column==6){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + }else if(column==7){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 360)); + }else if(column==8){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 200)); + }else{ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + } + row.setHeight((short) (attr.height() * 25)); + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())){ + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0){ + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column,int index){ + Cell cell = null; + try{ + // 设置行高 + row.setHeight((short) (attr.height() * 30)); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()){ + // 创建cell + cell = row.createCell(column); + cell.setCellStyle(styles.get("data")); + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)){ + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + }else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)){ + cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); + }else{ + // 设置列类型 + setCellVo(value, attr, cell); + } + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示 + * + * @param sheet 表单 + * @param promptTitle 提示标题 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框. + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + * @return 设置好的sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String convertByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String reverseByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename) + { + filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; +// filename = filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception{ + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())){ + String target = excel.targetAttr(); + if (target.indexOf(".") > -1){ + String[] targets = target.split("[.]"); + for (String name : targets){ + o = getValue(o, name); + } + }else{ + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); + Method method = clazz.getMethod(methodName); + o = method.invoke(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField(){ + this.fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) + { + putToField(field, excel); + } + } + } + } + + /** + * 放到字段集合中 + */ + private void putToField(Field field, Excel attr) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + this.fields.add(new Object[] { field, attr }); + } + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (HSSFDateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if ((Double) val % 1 > 0) + { + val = new DecimalFormat("0.00").format(val); + } + else + { + val = new DecimalFormat("0").format(val); + } + } + } + else if (cell.getCellTypeEnum() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUtilPrintJj.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUtilPrintJj.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUtilPrintJj.nf = nf; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilSs.java b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilSs.java new file mode 100644 index 0000000..0d8a6aa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilSs.java @@ -0,0 +1,1130 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.PrintSetup; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; + +/** + * Excel相关处理 + * + * @author ruoyi + */ +public class ExcelUtilSs{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 工作表标题 + */ + private String title; + + /** + * 工作表表尾 + */ + private String footer; + + /** + * 各个部门工作表名称 + */ + private List sheetNameList; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 导入导出各个部门数据列表 + */ + private List> lists; + + /** + * 注解列表 + */ + private List fields; + + /** + * 实体对象 + */ + public Class clazz; + + public ExcelUtilSs(Class clazz) + { + this.clazz = clazz; + } + + // 默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.00"); + + public void init(List list,List> lists, String sheetName,List sheetNameList,String title,String footer, Type type){ + if (list == null){ + list = new ArrayList(); + } + if(sheetNameList == null){ + sheetNameList = new ArrayList(); + } + this.list = list; + this.lists = lists; + this.sheetName = sheetName; + this.sheetNameList = sheetNameList; + this.title = title; + this.footer = footer; + this.type = type; + createExcelField(); + createWorkbook(); + } + + /** + * 对excel表单默认第一个索引名转换成list + * + * @param is 输入流 + * @return 转换后集合 + */ + public List importExcel(InputStream is) throws Exception + { + return importExcel(StringUtils.EMPTY, is); + } + + /** + * 对excel表单指定表格索引名转换成list + * + * @param sheetName 表格索引名 + * @param is 输入流 + * @return 转换后集合 + */ + public List importExcel(String sheetName, InputStream is) throws Exception + { + this.type = Type.IMPORT; + this.wb = WorkbookFactory.create(is); + List list = new ArrayList(); + Sheet sheet = null; + if (StringUtils.isNotEmpty(sheetName)) + { + // 如果指定sheet名,则取指定sheet中的内容. + sheet = wb.getSheet(sheetName); + } + else + { + // 如果传入的sheet名不存在则默认指向第1个sheet. + sheet = wb.getSheetAt(0); + } + + if (sheet == null) + { + throw new IOException("文件sheet不存在"); + } + + int rows = sheet.getPhysicalNumberOfRows(); + + if (rows > 0) + { + // 定义一个map用于存放excel列的序号和field. + Map cellMap = new HashMap(); + // 获取表头 + Row heard = sheet.getRow(0); + for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) + { + Cell cell = heard.getCell(i); + if (StringUtils.isNotNull(cell)) + { + String value = this.getCellValue(heard, i).toString(); + cellMap.put(value, i); + } + else + { + cellMap.put(null, i); + } + } + // 有数据时才处理 得到类的所有field. + Field[] allFields = clazz.getDeclaredFields(); + // 定义一个map用于存放列的序号和field. + Map fieldsMap = new HashMap(); + for (int col = 0; col < allFields.length; col++) + { + Field field = allFields[col]; + Excel attr = field.getAnnotation(Excel.class); + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + // 设置类的私有字段属性可访问. + field.setAccessible(true); + Integer column = cellMap.get(attr.name()); + fieldsMap.put(column, field); + } + } + for (int i = 1; i < rows; i++) + { + // 从第2行开始取数据,默认第一行是表头. + Row row = sheet.getRow(i); + T entity = null; + for (Map.Entry entry : fieldsMap.entrySet()) + { + Object val = this.getCellValue(row, entry.getKey()); + + // 如果不存在实例则新建. + entity = (entity == null ? clazz.newInstance() : entity); + // 从map中得到对应列的field. + Field field = fieldsMap.get(entry.getKey()); + // 取得类型,并根据对象类型设置值. + Class fieldType = field.getType(); + if (String.class == fieldType) + { + String s = Convert.toStr(val); + if (StringUtils.endsWith(s, ".0")) + { + val = StringUtils.substringBefore(s, ".0"); + } + else + { + val = Convert.toStr(val); + } + } + else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) + { + val = Convert.toInt(val); + } + else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) + { + val = Convert.toLong(val); + } + else if ((Double.TYPE == fieldType) || (Double.class == fieldType)) + { + val = Convert.toDouble(val); + } + else if ((Float.TYPE == fieldType) || (Float.class == fieldType)) + { + val = Convert.toFloat(val); + } + else if (BigDecimal.class == fieldType) + { + val = Convert.toBigDecimal(val); + } + else if (Date.class == fieldType) + { + if (val instanceof String) + { + val = DateUtils.parseDate(val); + } + else if (val instanceof Double) + { + val = DateUtil.getJavaDate((Double) val); + } + } + if (StringUtils.isNotNull(fieldType)) + { + Excel attr = field.getAnnotation(Excel.class); + String propertyName = field.getName(); + if (StringUtils.isNotEmpty(attr.targetAttr())) + { + propertyName = field.getName() + "." + attr.targetAttr(); + } + else if (StringUtils.isNotEmpty(attr.readConverterExp())) + { + val = reverseByExp(String.valueOf(val), attr.readConverterExp()); + } + ReflectUtils.invokeSetter(entity, propertyName, val); + } + } + list.add(entity); + } + } + return list; + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(List list,List> lists, String sheetName,List sheetNameList,String title,String footer){ + this.init(list,lists,sheetName,sheetNameList,title,footer,Type.EXPORT); + return exportExcel(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param sheetName 工作表的名称 + * @return 结果 + */ +// public AjaxResult importTemplateExcel(String sheetName) +// { +// this.init(null, sheetName, Type.IMPORT); +// return exportExcel(); +// } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel(){ + OutputStream out = null; + try{ + // 取出一共有多少个sheet. + double sheetNo = 0; + sheetNo = sheetNameList.size(); + for (int index = 0; index <= sheetNo; index++){ + createSheet(sheetNo, index); + //sheet1和后边的sheet表头不一致,所以需要分开处理 + // 产生一行 + Row row = sheet.createRow(0); + if(index == 0){ + sheet.addMergedRegion(new CellRangeAddress(0,0,0,15)); + for(int i = 0; i<16; i++){ + Cell cell = row.createCell(i); + cell.setCellStyle(styles.get("title")); + } + Row row2 = sheet.getRow(0); + Cell cell = row2.getCell(0); + cell.setCellValue(this.title+"("+this.sheetName+")"); + int column = 0; + // 写入各个字段的列头名称 + row = sheet.createRow(1); + // 写入各个字段的列头名称 + //当index为0时,默认是第一个sheet,需要把list[1]姓名列删掉 + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + fields2.remove(1); + fields2.remove(2); + fields2.remove(2); + for (int i = 0; i < fields2.size();i++){ + Object[] os = fields2.get(i); + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++,index); + } + // 产生一行 + Row rows = sheet.createRow(list.size()+3); + sheet.addMergedRegion(new CellRangeAddress(list.size()+3,list.size()+3,0,15)); + for(int i = 0; i<16; i++){ + Cell cells = rows.createCell(i); + cells.setCellStyle(styles.get("footer")); + } + Row rows2 = sheet.getRow(list.size()+3); + Cell cells = rows2.getCell(0); + cells.setCellValue(this.footer); + }else{ + sheet.addMergedRegion(new CellRangeAddress(0,0,0,17)); + for(int i = 0; i<18; i++){ + Cell cell = row.createCell(i); + cell.setCellStyle(styles.get("title")); + } + Row row2 = sheet.getRow(0); + Cell cell = row2.getCell(0); + cell.setCellValue(this.title+"("+sheetNameList.get(index-1)+")"); + int column = 0; + // 写入各个字段的列头名称 + row = sheet.createRow(1); + List fields3 = new ArrayList<>(); + fields3.addAll(fields); + fields3.remove(0); + // 写入各个字段的列头名称 + for (int i = 0; i < fields3.size();i++){ + Object[] os = fields3.get(i); + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++,index); + } + // 产生一行(尾行) + Row rows = sheet.createRow(lists.get(index-1).size()+3); + sheet.addMergedRegion(new CellRangeAddress(lists.get(index-1).size()+3,lists.get(index-1).size()+3,0,17)); + for(int i = 0; i<18; i++){ + Cell cells = rows.createCell(i); + cells.setCellStyle(styles.get("footer")); + } + Row rows2 = sheet.getRow(lists.get(index-1).size()+3); + Cell cells = rows2.getCell(0); + cells.setCellValue(this.footer); + } + if (Type.EXPORT.equals(type)){ + fillExcelData(index, row); + } + } + String filename = encodingFilename(sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + }catch (Exception e){ + log.error("导出Excel异常{}", e.getMessage()); + throw new CustomException("导出Excel失败,请联系网站管理员!"); + } + finally{ + if (wb != null) + { + try + { + wb.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + if (out != null) + { + try + { + out.close(); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + } + } + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + public void fillExcelData(int index, Row row){ + if(index == 0){ + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + for (int i = startNo; i < endNo; i++){ + row = sheet.createRow(i + 2 - startNo); + // 得到导出对象. + T vo = (T) list.get(i); + int column = 0; + //当index为0时,默认是第一个sheet,需要把list[1]姓名列删掉 + List fields2 = new ArrayList<>(); + fields2.addAll(fields); + fields2.remove(1); + fields2.remove(2); + fields2.remove(2); + for (Object[] os : fields2){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++,index); + } + } + }else{ + int startNo = 0; + int endNo = Math.min(startNo + sheetSize, lists.get(index-1).size()); + for (int i = 0; i < endNo; i++){ + row = sheet.createRow(i + 2 - startNo); + // 得到导出对象. + T vo = (T) lists.get(index-1).get(i); + int column = 0; + List fields3 = new ArrayList<>(); + fields3.addAll(fields); + fields3.remove(0); + for (Object[] os : fields3){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++,index); + } + } + } + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb) + { + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 10); + style.setFont(dataFont); +// style.setWrapText(true);//自动换行 + styles.put("data", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font dataFonts = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 9); + style.setFont(dataFonts); + styles.put("datas", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); +// style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); +// style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("宋体"); + headerFont.setFontHeightInPoints((short) 11); +// headerFont.setBold(true); +// headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(headerFont); + style.setWrapText(true);//自动换行 + styles.put("header", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("datas")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font footerFont = wb.createFont(); + footerFont.setFontName("宋体"); + footerFont.setFontHeightInPoints((short) 12); + style.setFont(footerFont); + styles.put("footer", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font titleFont = wb.createFont(); + titleFont.setFontName("宋体"); + titleFont.setFontHeightInPoints((short) 18); + style.setFont(titleFont); + styles.put("title", style); + + return styles; + } + + /** + * 创建单元格 + */ + public Cell createCell(Excel attr, Row row, int column,int index){ + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column,index); + cell.setCellStyle(styles.get("header")); + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell) + { + if (ColumnType.STRING == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()) + { + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(Integer.parseInt(value + "")); + } + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column,int index){ + if(index == 0){ + if (attr.name().indexOf("注:") >= 0){ + sheet.setColumnWidth(column, 6000); + }else{ + if(column==0){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + }else if(column==2||column==3||column==4||column==6||column==7||column==9||column==11){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 115)); + }else{ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 130)); + } + row.setHeight((short) (attr.height() * 50)); + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())){ + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0){ + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + }else{ + if (attr.name().indexOf("注:") >= 0){ + sheet.setColumnWidth(column, 6000); + }else{ + if(column==0){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 120)); + }else if(column==2||column==3||column==4||column==6||column==7||column==9||column==11){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 100)); + }else{ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width()) * 110)); + } + row.setHeight((short) (attr.height() * 50)); + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())){ + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0){ + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column,int index){ + Cell cell = null; + try{ + // 设置行高 + row.setHeight((short) (attr.height() * 30)); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()){ + // 创建cell + cell = row.createCell(column); + cell.setCellStyle(styles.get("data")); + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)){ + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + }else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)){ + cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); + }else{ + // 设置列类型 + setCellVo(value, attr, cell); + } + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示 + * + * @param sheet 表单 + * @param promptTitle 提示标题 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框. + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + * @return 设置好的sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String convertByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String reverseByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename) + { +// filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; + filename = filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception{ + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())){ + String target = excel.targetAttr(); + if (target.indexOf(".") > -1){ + String[] targets = target.split("[.]"); + for (String name : targets){ + o = getValue(o, name); + } + }else{ + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); + Method method = clazz.getMethod(methodName); + o = method.invoke(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField() + { + this.fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) + { + putToField(field, excel); + } + } + } + } + + /** + * 放到字段集合中 + */ + private void putToField(Field field, Excel attr) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + this.fields.add(new Object[] { field, attr }); + } + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(double sheetNo, int index){ + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 设置工作表的名称. + if (index == 0){ + wb.setSheetName(index, sheetName); + }else{ + wb.setSheetName(index, sheetNameList.get(index-1)); + } + sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE); + //设置横向打印 + sheet.getPrintSetup().setLandscape(true); + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (HSSFDateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if ((Double) val % 1 > 0) + { + val = new DecimalFormat("0.00").format(val); + } + else + { + val = new DecimalFormat("0").format(val); + } + } + } + else if (cell.getCellTypeEnum() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + public static ArrayList> readExcel2007(Sheet sheet) { + if(sheet==null){ + return null; + } + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + Row row; + Cell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + // 当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {// 判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + // 当该单元格为空 + if (j != row.getLastCellNum()) {// 判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: + // System.out.println(i + "行" + j + " 列 is String + // type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle().getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell.getNumericCellValue())); + } + // System.out.println(i + "行" + j + // + " 列 is Number type ; DateFormt:" + // + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: + // System.out.println(i + "行" + j + " 列 is Boolean + // type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: + // System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: + // System.out.println(i + "行" + j + " 列 is default + // type"); + value = cell.toString(); + }// end switch + colList.add(value); + } // end for j + rowList.add(colList); + } // end for i + + return rowList; + } catch (Exception e) { + System.out.println("exception"); + return null; + } + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUtilSs.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUtilSs.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUtilSs.nf = nf; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtils.java b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtils.java new file mode 100644 index 0000000..4f80f23 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/poi/ExcelUtils.java @@ -0,0 +1,1036 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoVo; + +/** + * Excel相关处理 + * + * @author ruoyi + */ +public class ExcelUtils{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtils.class); + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 工作表名称 + */ + private String sheetName2; + + /** + * 工作表名称 + */ + private String sheetName3; + + /** + * 工作表名称 + */ + private String sheetName4; + /** + * 工作表名称 + */ + private String sheetName5; + /** + * 工作表名称 + */ + private String sheetName6; + + /** + * 工作表标题 + */ + private String title; + /** + * 标准件标题 + */ + private String titles; + + /** + * 文件名 + */ + private String code; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 导入导出数据列表 + */ + private List list2; + /** + * 导入导出数据列表 + */ + private List list3; + /** + * 导入导出数据列表 + */ + private List list4; + /** + * 导入导出数据列表 + */ + private List list5; + /** + * 导入导出数据列表 + */ + private List list6; + + /** + * 注解列表 + */ + private List fields; + + /** + * 实体对象 + */ + public Class clazz; + + public ExcelUtils(Class clazz) + { + this.clazz = clazz; + } + + // 默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0"); + + public void init(List list,List list2,List list3,List list4,List list5,List list6,String sheetName,String sheetName2,String sheetName3,String sheetName4,String sheetName5,String sheetName6,String title,String titles,String code, Type type) + { + if (list == null){ + list = new ArrayList(); + } + if (list2 == null){ + list2 = new ArrayList(); + } + if (list3 == null){ + list3 = new ArrayList(); + } + if (list4 == null){ + list4 = new ArrayList(); + } + if (list5 == null){ + list5 = new ArrayList(); + } + if (list6 == null){ + list6 = new ArrayList(); + } + this.list = list; + this.sheetName = sheetName; + this.list2 = list2; + this.sheetName2 = sheetName2; + this.list3 = list3; + this.sheetName3 = sheetName3; + this.list4 = list4; + this.sheetName4 = sheetName4; + this.list5 = list5; + this.sheetName5 = sheetName5; + this.list6 = list6; + this.sheetName6 = sheetName6; + this.type = type; + this.title = title; + this.titles = titles; + this.code = code; + createExcelField(); + createWorkbook(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(List list,List list2,List list3,List list4,List list5,List list6,String sheetName,String sheetName2,String sheetName3,String sheetName4,String sheetName5,String sheetName6,String title,String titles,String code) + { + this.init(list,list2,list3,list4,list5,list6,sheetName,sheetName2,sheetName3,sheetName4,sheetName5,sheetName6,title,titles,code,Type.EXPORT); + return exportExcel(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel(){ + OutputStream out = null; + try{ + // 取出一共有多少个sheet. +// double sheetNo = Math.ceil(list.size() / sheetSize); + double sheetNo = 0; + if(null!=sheetName2&&!"".equals(sheetName2)){ + sheetNo = 1; + } + if(null!=sheetName3&&!"".equals(sheetName3)){ + sheetNo = 2; + } + if(null!=sheetName4&&!"".equals(sheetName4)){ + sheetNo = 3; + } + if(null!=sheetName5&&!"".equals(sheetName5)){ + sheetNo = 4; + } + if(null!=sheetName6&&!"".equals(sheetName6)){ + sheetNo = 5; + } + for (int index = 0; index <= sheetNo; index++){ + createSheet(sheetNo, index); + // 产生一行 + Row row = sheet.createRow(0); + sheet.addMergedRegion(new CellRangeAddress(0,0,0,8)); + for(int i = 0; i<9; i++){ + Cell cell = row.createCell(i); + cell.setCellStyle(styles.get("title")); + } + Row row2 = sheet.getRow(0); + Cell cell = row2.getCell(0); + if(index==0){ + cell.setCellValue(this.title+"("+sheetName+")"); + }else if(index==1){ + cell.setCellValue(this.title+"("+sheetName2+")"); + }else if(index==2){ + cell.setCellValue(this.titles+"("+sheetName3+")"); + }else if(index==3){ + cell.setCellValue(this.title+"("+sheetName4+")"); + }else if(index==4){ + cell.setCellValue(this.title+"("+sheetName5+")"); + }else{ + cell.setCellValue(this.title+"("+sheetName6+")"); + } + int column = 0; + // 写入各个字段的列头名称 + row = sheet.createRow(1); + for (Object[] os : fields){ + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++); + } + if (Type.EXPORT.equals(type)){ + fillExcelData(index, row); + } + } + + String filename = encodingFilename(this.code+"-"+sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + } + catch (Exception e){ + log.error("导出Excel异常{}", e.getMessage()); + throw new CustomException("导出Excel失败,请联系网站管理员!"); + } + finally{ + if (wb != null){ + try{ + wb.close(); + } + catch (IOException e1){ + e1.printStackTrace(); + } + } + if (out != null){ + try{ + out.close(); + } + catch (IOException e1){ + e1.printStackTrace(); + } + } + } + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + public void fillExcelData(int index, Row row){ + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + int endNo2 = Math.min(startNo + sheetSize, list2.size()); + int endNo3 = Math.min(startNo + sheetSize, list3.size()); + int endNo4 = Math.min(startNo + sheetSize, list4.size()); + int endNo5 = Math.min(startNo + sheetSize, list5.size()); + int endNo6 = Math.min(startNo + sheetSize, list6.size()); + if(index == 0){ + for (int i = startNo; i < endNo; i++){ + row = sheet.createRow(i + 2 - startNo); + // 得到导出对象. + T vo = (T) list.get(i); + int column = 0; + for (Object[] os : fields){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + }else if(index == 1){ + for (int i = 0; i < endNo2; i++){ + row = sheet.createRow(i + 2); + // 得到导出对象. + T vo = (T) list2.get(i); + int column = 0; + for (Object[] os : fields){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + }else if(index == 2){ + for (int i = 0; i < endNo3; i++){ + row = sheet.createRow(i + 2); + // 得到导出对象. + T vo = (T) list3.get(i); + int column = 0; + for (Object[] os : fields){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + }else if(index == 3){ + for (int i = 0; i < endNo4; i++){ + row = sheet.createRow(i + 2); + // 得到导出对象. + T vo = (T) list4.get(i); + int column = 0; + for (Object[] os : fields){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + }else if(index == 4){ + for (int i = 0; i < endNo5; i++){ + row = sheet.createRow(i + 2); + // 得到导出对象. + T vo = (T) list5.get(i); + int column = 0; + for (Object[] os : fields){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + }else if(index == 5){ + for (int i = 0; i < endNo6; i++){ + row = sheet.createRow(i + 2); + // 得到导出对象. + T vo = (T) list6.get(i); + int column = 0; + for (Object[] os : fields){ + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 设置实体类私有属性可访问 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + } + + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb){ + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("宋体"); + dataFont.setFontHeightInPoints((short) 11); + style.setFont(dataFont); + styles.put("data", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFonts = wb.createFont(); + dataFonts.setFontName("宋体"); + dataFonts.setFontHeightInPoints((short) 11); + style.setFont(dataFonts); + styles.put("datas", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); +// style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); +// style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("宋体"); + headerFont.setFontHeightInPoints((short) 12); +// headerFont.setBold(true); +// headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(headerFont); + styles.put("header", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); +// style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); +// style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font titleFont = wb.createFont(); + titleFont.setFontName("宋体"); + titleFont.setFontHeightInPoints((short) 18); +// headerFont.setBold(true); +// headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(titleFont); + styles.put("title", style); + + return styles; + } + + /** + * 创建单元格 + */ + public Cell createCell(Excel attr, Row row, int column){ + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column); + cell.setCellStyle(styles.get("header")); + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell){ + if (ColumnType.STRING == attr.cellType()){ + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()){ + cell.setCellType(CellType.NUMERIC); + cell.setCellValue(Integer.parseInt(value + "")); + } + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column){ + if (attr.name().indexOf("注:") >= 0){ + sheet.setColumnWidth(column, 6000); + }else{ + if(column == 0){ + // 设置列宽(第一列宽度) + sheet.setColumnWidth(column, (int) ((attr.width()) * 140)); + row.setHeight((short) (attr.height() * 26)); + }else if(column>0 && column<3){ + // 设置列宽(第二列和第三列宽度) + sheet.setColumnWidth(column, (int) ((attr.width() + 1) * 320)); + row.setHeight((short) (attr.height() * 26)); + }else if(column>2 && column<7){ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width() + 0.2) * 200)); + row.setHeight((short) (attr.height() * 26)); + }else{ + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width() + 0.2) * 180)); + row.setHeight((short) (attr.height() * 26)); + } + } + // 如果设置了提示信息则鼠标放上去提示. + if (StringUtils.isNotEmpty(attr.prompt())) + { + // 这里默认设了2-101列提示. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 如果设置了combo属性则本列只能选择不能输入 + if (attr.combo().length > 0) + { + // 这里默认设了2-101列只能选择不能输入. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column){ + Cell cell = null; + try{ + // 设置行高 + row.setHeight((short) (attr.height() * 26)); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()){ + // 创建cell + cell = row.createCell(column); + if(column>0&&column<3){ + cell.setCellStyle(styles.get("datas")); + }else{ + cell.setCellStyle(styles.get("data")); + } + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)){ + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + } + else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)){ + cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); + } + else{ + // 设置列类型 + setCellVo(value, attr, cell); + } + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示 + * + * @param sheet 表单 + * @param promptTitle 提示标题 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框. + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + * @return 设置好的sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String convertByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @return 解析后值 + * @throws Exception + */ + public static String reverseByExp(String propertyValue, String converterExp) throws Exception + { + try + { + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + catch (Exception e) + { + throw e; + } + return propertyValue; + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename){ +// filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; + filename = filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception + { + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())) + { + String target = excel.targetAttr(); + if (target.indexOf(".") > -1) + { + String[] targets = target.split("[.]"); + for (String name : targets) + { + o = getValue(o, name); + } + } + else + { + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); + Method method = clazz.getMethod(methodName); + o = method.invoke(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField() + { + this.fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) + { + putToField(field, excel); + } + } + } + } + + /** + * 放到字段集合中 + */ + private void putToField(Field field, Excel attr) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + this.fields.add(new Object[] { field, attr }); + } + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(double sheetNo, int index){ + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 设置工作表的名称. + if (index == 0){ + wb.setSheetName(index, sheetName); + }else if(index == 1){ + wb.setSheetName(index, sheetName2); + }else if(index == 2){ + wb.setSheetName(index, sheetName3); + }else if(index == 3){ + wb.setSheetName(index, sheetName4); + }else if(index == 4){ + wb.setSheetName(index, sheetName5); + }else if(index == 5){ + wb.setSheetName(index, sheetName6); + } + //设置横向打印 + sheet.getPrintSetup().setLandscape(true); + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (HSSFDateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if ((Double) val % 1 > 0) + { + val = new DecimalFormat("0.00").format(val); + } + else + { + val = new DecimalFormat("0").format(val); + } + } + } + else if (cell.getCellTypeEnum() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellTypeEnum() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + public static ArrayList> readExcel2007(Sheet sheet) { + if(sheet==null){ + return null; + } + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + Row row; + Cell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + // 当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {// 判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + // 当该单元格为空 + if (j != row.getLastCellNum()) {// 判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: + // System.out.println(i + "行" + j + " 列 is String + // type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle().getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell.getNumericCellValue())); + } + // System.out.println(i + "行" + j + // + " 列 is Number type ; DateFormt:" + // + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: + // System.out.println(i + "行" + j + " 列 is Boolean + // type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: + // System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: + // System.out.println(i + "行" + j + " 列 is default + // type"); + value = cell.toString(); + }// end switch + colList.add(value); + } // end for j + rowList.add(colList); + } // end for i + + return rowList; + } catch (Exception e) { + System.out.println("exception"); + return null; + } + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUtils.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUtils.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUtils.nf = nf; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java b/evo/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java new file mode 100644 index 0000000..b78e53e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java @@ -0,0 +1,406 @@ +package com.ruoyi.common.utils.reflect; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Date; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.poi.ss.usermodel.DateUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; + +/** + * 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数. + * + * @author ruoyi + */ +@SuppressWarnings("rawtypes") +public class ReflectUtils +{ + private static final String SETTER_PREFIX = "set"; + + private static final String GETTER_PREFIX = "get"; + + private static final String CGLIB_CLASS_SEPARATOR = "$$"; + + private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class); + + /** + * 调用Getter方法. + * 支持多级,如:对象名.对象名.方法 + */ + @SuppressWarnings("unchecked") + public static E invokeGetter(Object obj, String propertyName) + { + Object object = obj; + for (String name : StringUtils.split(propertyName, ".")) + { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); + object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + } + return (E) object; + } + + /** + * 调用Setter方法, 仅匹配方法名。 + * 支持多级,如:对象名.对象名.方法 + */ + public static void invokeSetter(Object obj, String propertyName, E value) + { + Object object = obj; + String[] names = StringUtils.split(propertyName, "."); + for (int i = 0; i < names.length; i++) + { + if (i < names.length - 1) + { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]); + object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + } + else + { + String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]); + invokeMethodByName(object, setterMethodName, new Object[] { value }); + } + } + } + + /** + * 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数. + */ + @SuppressWarnings("unchecked") + public static E getFieldValue(final Object obj, final String fieldName) + { + Field field = getAccessibleField(obj, fieldName); + if (field == null) + { + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + return null; + } + E result = null; + try + { + result = (E) field.get(obj); + } + catch (IllegalAccessException e) + { + logger.error("不可能抛出的异常{}", e.getMessage()); + } + return result; + } + + /** + * 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数. + */ + public static void setFieldValue(final Object obj, final String fieldName, final E value) + { + Field field = getAccessibleField(obj, fieldName); + if (field == null) + { + // throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + return; + } + try + { + field.set(obj, value); + } + catch (IllegalAccessException e) + { + logger.error("不可能抛出的异常: {}", e.getMessage()); + } + } + + /** + * 直接调用对象方法, 无视private/protected修饰符. + * 用于一次性调用的情况,否则应使用getAccessibleMethod()函数获得Method后反复调用. + * 同时匹配方法名+参数类型, + */ + @SuppressWarnings("unchecked") + public static E invokeMethod(final Object obj, final String methodName, final Class[] parameterTypes, + final Object[] args) + { + if (obj == null || methodName == null) + { + return null; + } + Method method = getAccessibleMethod(obj, methodName, parameterTypes); + if (method == null) + { + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); + return null; + } + try + { + return (E) method.invoke(obj, args); + } + catch (Exception e) + { + String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; + throw convertReflectionExceptionToUnchecked(msg, e); + } + } + + /** + * 直接调用对象方法, 无视private/protected修饰符, + * 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用. + * 只匹配函数名,如果有多个同名函数调用第一个。 + */ + @SuppressWarnings("unchecked") + public static E invokeMethodByName(final Object obj, final String methodName, final Object[] args) + { + Method method = getAccessibleMethodByName(obj, methodName, args.length); + if (method == null) + { + // 如果为空不报错,直接返回空。 + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); + return null; + } + try + { + // 类型转换(将参数数据类型转换为目标方法参数类型) + Class[] cs = method.getParameterTypes(); + for (int i = 0; i < cs.length; i++) + { + if (args[i] != null && !args[i].getClass().equals(cs[i])) + { + if (cs[i] == String.class) + { + args[i] = Convert.toStr(args[i]); + if (StringUtils.endsWith((String) args[i], ".0")) + { + args[i] = StringUtils.substringBefore((String) args[i], ".0"); + } + } + else if (cs[i] == Integer.class) + { + args[i] = Convert.toInt(args[i]); + } + else if (cs[i] == Long.class) + { + args[i] = Convert.toLong(args[i]); + } + else if (cs[i] == Double.class) + { + args[i] = Convert.toDouble(args[i]); + } + else if (cs[i] == Float.class) + { + args[i] = Convert.toFloat(args[i]); + } + else if (cs[i] == Date.class) + { + if (args[i] instanceof String) + { + args[i] = DateUtils.parseDate(args[i]); + } + else + { + args[i] = DateUtil.getJavaDate((Double) args[i]); + } + } + } + } + return (E) method.invoke(obj, args); + } + catch (Exception e) + { + String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; + throw convertReflectionExceptionToUnchecked(msg, e); + } + } + + /** + * 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + */ + public static Field getAccessibleField(final Object obj, final String fieldName) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(fieldName, "fieldName can't be blank"); + for (Class superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) + { + try + { + Field field = superClass.getDeclaredField(fieldName); + makeAccessible(field); + return field; + } + catch (NoSuchFieldException e) + { + continue; + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 匹配函数名+参数类型。 + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethod(final Object obj, final String methodName, + final Class... parameterTypes) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(methodName, "methodName can't be blank"); + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) + { + try + { + Method method = searchType.getDeclaredMethod(methodName, parameterTypes); + makeAccessible(method); + return method; + } + catch (NoSuchMethodException e) + { + continue; + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 只匹配函数名。 + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(methodName, "methodName can't be blank"); + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) + { + Method[] methods = searchType.getDeclaredMethods(); + for (Method method : methods) + { + if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) + { + makeAccessible(method); + return method; + } + } + } + return null; + } + + /** + * 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Method method) + { + if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) + && !method.isAccessible()) + { + method.setAccessible(true); + } + } + + /** + * 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Field field) + { + if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) + || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) + { + field.setAccessible(true); + } + } + + /** + * 通过反射, 获得Class定义中声明的泛型参数的类型, 注意泛型必须定义在父类处 + * 如无法找到, 返回Object.class. + */ + @SuppressWarnings("unchecked") + public static Class getClassGenricType(final Class clazz) + { + return getClassGenricType(clazz, 0); + } + + /** + * 通过反射, 获得Class定义中声明的父类的泛型参数的类型. + * 如无法找到, 返回Object.class. + */ + public static Class getClassGenricType(final Class clazz, final int index) + { + Type genType = clazz.getGenericSuperclass(); + + if (!(genType instanceof ParameterizedType)) + { + logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType"); + return Object.class; + } + + Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); + + if (index >= params.length || index < 0) + { + logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + + params.length); + return Object.class; + } + if (!(params[index] instanceof Class)) + { + logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); + return Object.class; + } + + return (Class) params[index]; + } + + public static Class getUserClass(Object instance) + { + if (instance == null) + { + throw new RuntimeException("Instance must not be null"); + } + Class clazz = instance.getClass(); + if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) + { + Class superClass = clazz.getSuperclass(); + if (superClass != null && !Object.class.equals(superClass)) + { + return superClass; + } + } + return clazz; + + } + + /** + * 将反射时的checked exception转换为unchecked exception. + */ + public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) + { + if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException + || e instanceof NoSuchMethodException) + { + return new IllegalArgumentException(msg, e); + } + else if (e instanceof InvocationTargetException) + { + return new RuntimeException(msg, ((InvocationTargetException) e).getTargetException()); + } + return new RuntimeException(msg, e); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/security/Md5Utils.java b/evo/src/main/java/com/ruoyi/common/utils/security/Md5Utils.java new file mode 100644 index 0000000..2bb1a8b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/security/Md5Utils.java @@ -0,0 +1,66 @@ +package com.ruoyi.common.utils.security; + +import java.security.MessageDigest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Md5加密方法 + * + * @author ruoyi + */ +public class Md5Utils +{ + private static final Logger log = LoggerFactory.getLogger(Md5Utils.class); + + private static byte[] md5(String s) + { + MessageDigest algorithm; + try + { + algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(s.getBytes("UTF-8")); + byte[] messageDigest = algorithm.digest(); + return messageDigest; + } + catch (Exception e) + { + log.error("MD5 Error...", e); + } + return null; + } + + private static final String toHex(byte hash[]) + { + if (hash == null) + { + return null; + } + StringBuffer buf = new StringBuffer(hash.length * 2); + int i; + + for (i = 0; i < hash.length; i++) + { + if ((hash[i] & 0xff) < 0x10) + { + buf.append("0"); + } + buf.append(Long.toString(hash[i] & 0xff, 16)); + } + return buf.toString(); + } + + public static String hash(String s) + { + try + { + return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8"); + } + catch (Exception e) + { + log.error("not supported charset...{}", e); + return s; + } + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/sign/Base64.java b/evo/src/main/java/com/ruoyi/common/utils/sign/Base64.java new file mode 100644 index 0000000..ca1cd92 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/sign/Base64.java @@ -0,0 +1,291 @@ +package com.ruoyi.common.utils.sign; + +/** + * Base64工具类 + * + * @author ruoyi + */ +public final class Base64 +{ + static private final int BASELENGTH = 128; + static private final int LOOKUPLENGTH = 64; + static private final int TWENTYFOURBITGROUP = 24; + static private final int EIGHTBIT = 8; + static private final int SIXTEENBIT = 16; + static private final int FOURBYTE = 4; + static private final int SIGN = -128; + static private final char PAD = '='; + static final private byte[] base64Alphabet = new byte[BASELENGTH]; + static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH]; + + static + { + for (int i = 0; i < BASELENGTH; ++i) + { + base64Alphabet[i] = -1; + } + for (int i = 'Z'; i >= 'A'; i--) + { + base64Alphabet[i] = (byte) (i - 'A'); + } + for (int i = 'z'; i >= 'a'; i--) + { + base64Alphabet[i] = (byte) (i - 'a' + 26); + } + + for (int i = '9'; i >= '0'; i--) + { + base64Alphabet[i] = (byte) (i - '0' + 52); + } + + base64Alphabet['+'] = 62; + base64Alphabet['/'] = 63; + + for (int i = 0; i <= 25; i++) + { + lookUpBase64Alphabet[i] = (char) ('A' + i); + } + + for (int i = 26, j = 0; i <= 51; i++, j++) + { + lookUpBase64Alphabet[i] = (char) ('a' + j); + } + + for (int i = 52, j = 0; i <= 61; i++, j++) + { + lookUpBase64Alphabet[i] = (char) ('0' + j); + } + lookUpBase64Alphabet[62] = (char) '+'; + lookUpBase64Alphabet[63] = (char) '/'; + } + + private static boolean isWhiteSpace(char octect) + { + return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9); + } + + private static boolean isPad(char octect) + { + return (octect == PAD); + } + + private static boolean isData(char octect) + { + return (octect < BASELENGTH && base64Alphabet[octect] != -1); + } + + /** + * Encodes hex octects into Base64 + * + * @param binaryData Array containing binaryData + * @return Encoded Base64 array + */ + public static String encode(byte[] binaryData) + { + if (binaryData == null) + { + return null; + } + + int lengthDataBits = binaryData.length * EIGHTBIT; + if (lengthDataBits == 0) + { + return ""; + } + + int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP; + int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP; + int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets; + char encodedData[] = null; + + encodedData = new char[numberQuartet * 4]; + + byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0; + + int encodedIndex = 0; + int dataIndex = 0; + + for (int i = 0; i < numberTriplets; i++) + { + b1 = binaryData[dataIndex++]; + b2 = binaryData[dataIndex++]; + b3 = binaryData[dataIndex++]; + + l = (byte) (b2 & 0x0f); + k = (byte) (b1 & 0x03); + + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); + byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc); + + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f]; + } + + // form integral number of 6-bit groups + if (fewerThan24bits == EIGHTBIT) + { + b1 = binaryData[dataIndex]; + k = (byte) (b1 & 0x03); + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4]; + encodedData[encodedIndex++] = PAD; + encodedData[encodedIndex++] = PAD; + } + else if (fewerThan24bits == SIXTEENBIT) + { + b1 = binaryData[dataIndex]; + b2 = binaryData[dataIndex + 1]; + l = (byte) (b2 & 0x0f); + k = (byte) (b1 & 0x03); + + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); + + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2]; + encodedData[encodedIndex++] = PAD; + } + return new String(encodedData); + } + + /** + * Decodes Base64 data into octects + * + * @param encoded string containing Base64 data + * @return Array containind decoded data. + */ + public static byte[] decode(String encoded) + { + if (encoded == null) + { + return null; + } + + char[] base64Data = encoded.toCharArray(); + // remove white spaces + int len = removeWhiteSpace(base64Data); + + if (len % FOURBYTE != 0) + { + return null;// should be divisible by four + } + + int numberQuadruple = (len / FOURBYTE); + + if (numberQuadruple == 0) + { + return new byte[0]; + } + + byte decodedData[] = null; + byte b1 = 0, b2 = 0, b3 = 0, b4 = 0; + char d1 = 0, d2 = 0, d3 = 0, d4 = 0; + + int i = 0; + int encodedIndex = 0; + int dataIndex = 0; + decodedData = new byte[(numberQuadruple) * 3]; + + for (; i < numberQuadruple - 1; i++) + { + + if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++])) + || !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++]))) + { + return null; + } // if found "no data" just return null + + b1 = base64Alphabet[d1]; + b2 = base64Alphabet[d2]; + b3 = base64Alphabet[d3]; + b4 = base64Alphabet[d4]; + + decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); + } + + if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) + { + return null;// if found "no data" just return null + } + + b1 = base64Alphabet[d1]; + b2 = base64Alphabet[d2]; + + d3 = base64Data[dataIndex++]; + d4 = base64Data[dataIndex++]; + if (!isData((d3)) || !isData((d4))) + {// Check if they are PAD characters + if (isPad(d3) && isPad(d4)) + { + if ((b2 & 0xf) != 0)// last 4 bits should be zero + { + return null; + } + byte[] tmp = new byte[i * 3 + 1]; + System.arraycopy(decodedData, 0, tmp, 0, i * 3); + tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4); + return tmp; + } + else if (!isPad(d3) && isPad(d4)) + { + b3 = base64Alphabet[d3]; + if ((b3 & 0x3) != 0)// last 2 bits should be zero + { + return null; + } + byte[] tmp = new byte[i * 3 + 2]; + System.arraycopy(decodedData, 0, tmp, 0, i * 3); + tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + return tmp; + } + else + { + return null; + } + } + else + { // No PAD e.g 3cQl + b3 = base64Alphabet[d3]; + b4 = base64Alphabet[d4]; + decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); + + } + return decodedData; + } + + /** + * remove WhiteSpace from MIME containing encoded Base64 data. + * + * @param data the byte array of base64 data (with WS) + * @return the new length + */ + private static int removeWhiteSpace(char[] data) + { + if (data == null) + { + return 0; + } + + // count characters that's not whitespace + int newSize = 0; + int len = data.length; + for (int i = 0; i < len; i++) + { + if (!isWhiteSpace(data[i])) + { + data[newSize++] = data[i]; + } + } + return newSize; + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java b/evo/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java new file mode 100644 index 0000000..19bd77e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java @@ -0,0 +1,114 @@ +package com.ruoyi.common.utils.spring; + +import org.springframework.aop.framework.AopContext; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.beans.factory.config.BeanFactoryPostProcessor; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.stereotype.Component; + +/** + * spring工具类 方便在非spring管理环境中获取bean + * + * @author ruoyi + */ +@Component +public final class SpringUtils implements BeanFactoryPostProcessor +{ + /** Spring应用上下文环境 */ + private static ConfigurableListableBeanFactory beanFactory; + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + { + SpringUtils.beanFactory = beanFactory; + } + + /** + * 获取对象 + * + * @param name + * @return Object 一个以所给名字注册的bean的实例 + * @throws org.springframework.beans.BeansException + * + */ + @SuppressWarnings("unchecked") + public static T getBean(String name) throws BeansException + { + return (T) beanFactory.getBean(name); + } + + /** + * 获取类型为requiredType的对象 + * + * @param clz + * @return + * @throws org.springframework.beans.BeansException + * + */ + public static T getBean(Class clz) throws BeansException + { + T result = (T) beanFactory.getBean(clz); + return result; + } + + /** + * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true + * + * @param name + * @return boolean + */ + public static boolean containsBean(String name) + { + return beanFactory.containsBean(name); + } + + /** + * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) + * + * @param name + * @return boolean + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.isSingleton(name); + } + + /** + * @param name + * @return Class 注册对象的类型 + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static Class getType(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.getType(name); + } + + /** + * 如果给定的bean名字在bean定义中有别名,则返回这些别名 + * + * @param name + * @return + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static String[] getAliases(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.getAliases(name); + } + + /** + * 获取aop代理对象 + * + * @param invoker + * @return + */ + @SuppressWarnings("unchecked") + public static T getAopProxy(T invoker) + { + return (T) AopContext.currentProxy(); + } +} diff --git a/evo/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java b/evo/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java new file mode 100644 index 0000000..b31804b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java @@ -0,0 +1,36 @@ +package com.ruoyi.common.utils.sql; + +import com.ruoyi.common.utils.StringUtils; + +/** + * sql操作工具类 + * + * @author ruoyi + */ +public class SqlUtil +{ + /** + * 仅支持字母、数字、下划线、空格、逗号(支持多个字段排序) + */ + public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,]+"; + + /** + * 检查字符,防止注入绕过 + */ + public static String escapeOrderBySql(String value) + { + if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) + { + return StringUtils.EMPTY; + } + return value; + } + + /** + * 验证 order by 语法是否符合规范 + */ + public static boolean isValidOrderBySql(String value) + { + return value.matches(SQL_PATTERN); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/evo/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java new file mode 100644 index 0000000..3ca634d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java @@ -0,0 +1,165 @@ +package com.ruoyi.framework.aspectj; + +import java.lang.reflect.Method; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.Signature; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.DataScope; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.domain.BaseEntity; +import com.ruoyi.project.system.domain.SysRole; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 数据过滤处理 + * + * @author ruoyi + */ +@Aspect +@Component +public class DataScopeAspect +{ + /** + * 全部数据权限 + */ + public static final String DATA_SCOPE_ALL = "1"; + + /** + * 自定数据权限 + */ + public static final String DATA_SCOPE_CUSTOM = "2"; + + /** + * 部门数据权限 + */ + public static final String DATA_SCOPE_DEPT = "3"; + + /** + * 部门及以下数据权限 + */ + public static final String DATA_SCOPE_DEPT_AND_CHILD = "4"; + + /** + * 仅本人数据权限 + */ + public static final String DATA_SCOPE_SELF = "5"; + + /** + * 数据权限过滤关键字 + */ + public static final String DATA_SCOPE = "dataScope"; + + // 配置织入点 + @Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.DataScope)") + public void dataScopePointCut() + { + } + + @Before("dataScopePointCut()") + public void doBefore(JoinPoint point) throws Throwable + { + handleDataScope(point); + } + + protected void handleDataScope(final JoinPoint joinPoint) + { + // 获得注解 + DataScope controllerDataScope = getAnnotationLog(joinPoint); + if (controllerDataScope == null) + { + return; + } + // 获取当前的用户 + LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest()); + SysUser currentUser = loginUser.getUser(); + if (currentUser != null) + { + // 如果是超级管理员,则不过滤数据 + if (!currentUser.isAdmin()) + { + dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), + controllerDataScope.userAlias()); + } + } + } + + /** + * 数据范围过滤 + * + * @param joinPoint 切点 + * @param user 用户 + * @param alias 别名 + */ + public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) + { + StringBuilder sqlString = new StringBuilder(); + + for (SysRole role : user.getRoles()) + { + String dataScope = role.getDataScope(); + if (DATA_SCOPE_ALL.equals(dataScope)) + { + sqlString = new StringBuilder(); + break; + } + else if (DATA_SCOPE_CUSTOM.equals(dataScope)) + { + sqlString.append(StringUtils.format( + " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, + role.getRoleId())); + } + else if (DATA_SCOPE_DEPT.equals(dataScope)) + { + sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId())); + } + else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) + { + sqlString.append(StringUtils.format( + " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", + deptAlias, user.getDeptId(), user.getDeptId())); + } + else if (DATA_SCOPE_SELF.equals(dataScope)) + { + if (StringUtils.isNotBlank(userAlias)) + { + sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId())); + } + else + { + // 数据权限为仅本人且没有userAlias别名不查询任何数据 + sqlString.append(" OR 1=0 "); + } + } + } + + if (StringUtils.isNotBlank(sqlString.toString())) + { + BaseEntity baseEntity = (BaseEntity) joinPoint.getArgs()[0]; + baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")"); + } + } + + /** + * 是否存在注解,如果存在就获取 + */ + private DataScope getAnnotationLog(JoinPoint joinPoint) + { + Signature signature = joinPoint.getSignature(); + MethodSignature methodSignature = (MethodSignature) signature; + Method method = methodSignature.getMethod(); + + if (method != null) + { + return method.getAnnotation(DataScope.class); + } + return null; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java b/evo/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java new file mode 100644 index 0000000..c2bb892 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java @@ -0,0 +1,72 @@ +package com.ruoyi.framework.aspectj; + +import java.util.Objects; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.DataSource; +import com.ruoyi.framework.datasource.DynamicDataSourceContextHolder; + +/** + * 多数据源处理 + * + * @author ruoyi + */ +@Aspect +@Order(1) +@Component +public class DataSourceAspect +{ + protected Logger logger = LoggerFactory.getLogger(getClass()); + + @Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.DataSource)" + + "|| @within(com.ruoyi.framework.aspectj.lang.annotation.DataSource)") + public void dsPointCut() + { + + } + + @Around("dsPointCut()") + public Object around(ProceedingJoinPoint point) throws Throwable + { + DataSource dataSource = getDataSource(point); + + if (StringUtils.isNotNull(dataSource)) + { + DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name()); + } + + try + { + return point.proceed(); + } + finally + { + // 销毁数据源 在执行方法之后 + DynamicDataSourceContextHolder.clearDataSourceType(); + } + } + + /** + * 获取需要切换的数据源 + */ + public DataSource getDataSource(ProceedingJoinPoint point) + { + MethodSignature signature = (MethodSignature) point.getSignature(); + DataSource dataSource = AnnotationUtils.findAnnotation(signature.getMethod(), DataSource.class); + if (Objects.nonNull(dataSource)) + { + return dataSource; + } + + return AnnotationUtils.findAnnotation(signature.getDeclaringType(), DataSource.class); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/evo/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java new file mode 100644 index 0000000..4ccf8ec --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -0,0 +1,217 @@ +package com.ruoyi.framework.aspectj; + +import java.lang.reflect.Method; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.Signature; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.HandlerMapping; +import com.alibaba.fastjson.JSON; +import com.ruoyi.common.enums.HttpMethod; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessStatus; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.monitor.domain.SysOperLog; + +/** + * 操作日志记录处理 + * + * @author ruoyi + */ +@Aspect +@Component +public class LogAspect +{ + private static final Logger log = LoggerFactory.getLogger(LogAspect.class); + + // 配置织入点 + @Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.Log)") + public void logPointCut() + { + } + + /** + * 处理完请求后执行 + * + * @param joinPoint 切点 + */ + @AfterReturning(pointcut = "logPointCut()", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) + { + handleLog(joinPoint, null, jsonResult); + } + + /** + * 拦截异常操作 + * + * @param joinPoint 切点 + * @param e 异常 + */ + @AfterThrowing(value = "logPointCut()", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, Exception e) + { + handleLog(joinPoint, e, null); + } + + protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult) + { + try + { + // 获得注解 + Log controllerLog = getAnnotationLog(joinPoint); + if (controllerLog == null) + { + return; + } + + // 获取当前的用户 + LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest()); + + // *========数据库日志=========*// + SysOperLog operLog = new SysOperLog(); + operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); + // 请求的地址 + String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); + operLog.setOperIp(ip); + // 返回参数 + operLog.setJsonResult(JSON.toJSONString(jsonResult)); + + operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); + if (loginUser != null) + { + operLog.setOperName(loginUser.getUsername()); + } + + if (e != null) + { + operLog.setStatus(BusinessStatus.FAIL.ordinal()); + operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); + } + // 设置方法名称 + String className = joinPoint.getTarget().getClass().getName(); + String methodName = joinPoint.getSignature().getName(); + operLog.setMethod(className + "." + methodName + "()"); + // 设置请求方式 + operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); + // 处理设置注解上的参数 + getControllerMethodDescription(joinPoint, controllerLog, operLog); + // 保存数据库 + AsyncManager.me().execute(AsyncFactory.recordOper(operLog)); + } + catch (Exception exp) + { + // 记录本地异常日志 + log.error("==前置通知异常=="); + log.error("异常信息:{}", exp.getMessage()); + exp.printStackTrace(); + } + } + + /** + * 获取注解中对方法的描述信息 用于Controller层注解 + * + * @param log 日志 + * @param operLog 操作日志 + * @throws Exception + */ + public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog) throws Exception + { + // 设置action动作 + operLog.setBusinessType(log.businessType().ordinal()); + // 设置标题 + operLog.setTitle(log.title()); + // 设置操作人类别 + operLog.setOperatorType(log.operatorType().ordinal()); + // 是否需要保存request,参数和值 + if (log.isSaveRequestData()) + { + // 获取参数的信息,传入到数据库中。 + setRequestValue(joinPoint, operLog); + } + } + + /** + * 获取请求的参数,放到log中 + * + * @param operLog 操作日志 + * @throws Exception 异常 + */ + private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception + { + String requestMethod = operLog.getRequestMethod(); + if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) + { + String params = argsArrayToString(joinPoint.getArgs()); + operLog.setOperParam(StringUtils.substring(params, 0, 2000)); + } + else + { + Map paramsMap = (Map) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); + operLog.setOperParam(StringUtils.substring(paramsMap.toString(), 0, 2000)); + } + } + + /** + * 是否存在注解,如果存在就获取 + */ + private Log getAnnotationLog(JoinPoint joinPoint) throws Exception + { + Signature signature = joinPoint.getSignature(); + MethodSignature methodSignature = (MethodSignature) signature; + Method method = methodSignature.getMethod(); + + if (method != null) + { + return method.getAnnotation(Log.class); + } + return null; + } + + /** + * 参数拼装 + */ + private String argsArrayToString(Object[] paramsArray) + { + String params = ""; + if (paramsArray != null && paramsArray.length > 0) + { + for (int i = 0; i < paramsArray.length; i++) + { + if (!isFilterObject(paramsArray[i])) + { + Object jsonObj = JSON.toJSON(paramsArray[i]); + params += jsonObj.toString() + " "; + } + } + } + return params.trim(); + } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + public boolean isFilterObject(final Object o) + { + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataScope.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataScope.java new file mode 100644 index 0000000..abb5978 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataScope.java @@ -0,0 +1,28 @@ +package com.ruoyi.framework.aspectj.lang.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 数据权限过滤注解 + * + * @author ruoyi + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataScope +{ + /** + * 部门表的别名 + */ + public String deptAlias() default ""; + + /** + * 用户表的别名 + */ + public String userAlias() default ""; +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataSource.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataSource.java new file mode 100644 index 0000000..e5a780e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataSource.java @@ -0,0 +1,28 @@ +package com.ruoyi.framework.aspectj.lang.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import com.ruoyi.framework.aspectj.lang.enums.DataSourceType; + +/** + * 自定义多数据源切换注解 + * + * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 + * + * @author ruoyi + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface DataSource +{ + /** + * 切换数据源名称 + */ + public DataSourceType value() default DataSourceType.MASTER; +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java new file mode 100644 index 0000000..8037cb8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java @@ -0,0 +1,113 @@ +package com.ruoyi.framework.aspectj.lang.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 自定义导出Excel数据注解 + * + * @author ruoyi + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Excel +{ + /** + * 导出到Excel中的名字. + */ + public String name() default ""; + + /** + * 日期格式, 如: yyyy-MM-dd + */ + public String dateFormat() default ""; + + /** + * 读取内容转表达式 (如: 0=男,1=女,2=未知) + */ + public String readConverterExp() default ""; + + /** + * 导出类型(0数字 1字符串) + */ + public ColumnType cellType() default ColumnType.STRING; + + /** + * 导出时在excel中每个列的高度 单位为字符 + */ + public double height() default 14; + + /** + * 导出时在excel中每个列的宽 单位为字符 + */ + public double width() default 16; + + /** + * 文字后缀,如% 90 变成90% + */ + public String suffix() default ""; + + /** + * 当值为空时,字段的默认值 + */ + public String defaultValue() default ""; + + /** + * 提示信息 + */ + public String prompt() default ""; + + /** + * 设置只能选择不能输入的列内容. + */ + public String[] combo() default {}; + + /** + * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写. + */ + public boolean isExport() default true; + + /** + * 另一个类中的属性名称,支持多级获取,以小数点隔开 + */ + public String targetAttr() default ""; + + /** + * 字段类型(0:导出导入;1:仅导出;2:仅导入) + */ + Type type() default Type.ALL; + + public enum Type + { + ALL(0), EXPORT(1), IMPORT(2); + private final int value; + + Type(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + public enum ColumnType + { + NUMERIC(0), STRING(1); + private final int value; + + ColumnType(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java new file mode 100644 index 0000000..ff22802 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java @@ -0,0 +1,18 @@ +package com.ruoyi.framework.aspectj.lang.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Excel注解集 + * + * @author ruoyi + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Excels +{ + Excel[] value(); +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java new file mode 100644 index 0000000..8388f70 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java @@ -0,0 +1,41 @@ +package com.ruoyi.framework.aspectj.lang.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.OperatorType; + +/** + * 自定义操作日志记录注解 + * + * @author ruoyi + * + */ +@Target({ ElementType.PARAMETER, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Log +{ + /** + * 模块 + */ + public String title() default ""; + + /** + * 功能 + */ + public BusinessType businessType() default BusinessType.OTHER; + + /** + * 操作人类别 + */ + public OperatorType operatorType() default OperatorType.MANAGE; + + /** + * 是否保存请求的参数 + */ + public boolean isSaveRequestData() default true; +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java new file mode 100644 index 0000000..2e1c7af --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java @@ -0,0 +1,20 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 操作状态 + * + * @author ruoyi + * + */ +public enum BusinessStatus +{ + /** + * 成功 + */ + SUCCESS, + + /** + * 失败 + */ + FAIL, +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java new file mode 100644 index 0000000..2810215 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java @@ -0,0 +1,59 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 业务操作类型 + * + * @author ruoyi + */ +public enum BusinessType +{ + /** + * 其它 + */ + OTHER, + + /** + * 新增 + */ + INSERT, + + /** + * 修改 + */ + UPDATE, + + /** + * 删除 + */ + DELETE, + + /** + * 授权 + */ + GRANT, + + /** + * 导出 + */ + EXPORT, + + /** + * 导入 + */ + IMPORT, + + /** + * 强退 + */ + FORCE, + + /** + * 生成代码 + */ + GENCODE, + + /** + * 清空数据 + */ + CLEAN, +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java new file mode 100644 index 0000000..103cd80 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java @@ -0,0 +1,19 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 数据源 + * + * @author ruoyi + */ +public enum DataSourceType +{ + /** + * 主库 + */ + MASTER, + + /** + * 从库 + */ + SLAVE +} diff --git a/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java new file mode 100644 index 0000000..e3d87db --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java @@ -0,0 +1,24 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 操作人类别 + * + * @author ruoyi + */ +public enum OperatorType +{ + /** + * 其它 + */ + OTHER, + + /** + * 后台用户 + */ + MANAGE, + + /** + * 手机端用户 + */ + MOBILE +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java b/evo/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java new file mode 100644 index 0000000..55de6f7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java @@ -0,0 +1,30 @@ +package com.ruoyi.framework.config; + +import java.util.TimeZone; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.EnableAspectJAutoProxy; + +/** + * 程序注解配置 + * + * @author ruoyi + */ +@Configuration +// 表示通过aop框架暴露该代理对象,AopContext能够访问 +@EnableAspectJAutoProxy(exposeProxy = true) +// 指定要扫描的Mapper类的包的路径 +@MapperScan("com.ruoyi.project.**.mapper") +public class ApplicationConfig +{ + /** + * 时区配置 + */ + @Bean + public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() + { + return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault()); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/CustomCORSConfiguration.java b/evo/src/main/java/com/ruoyi/framework/config/CustomCORSConfiguration.java new file mode 100644 index 0000000..0e9e3eb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/CustomCORSConfiguration.java @@ -0,0 +1,30 @@ +package com.ruoyi.framework.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +/** + * 描述:跨域请求问题处理(需要在securityConfig中添加配置 .cors().and()) + * 作者:gdd + * 日期:2020/03/27 + */ +public class CustomCORSConfiguration { + + private CorsConfiguration buildConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + corsConfiguration.addAllowedOrigin("*"); + corsConfiguration.addAllowedHeader("*"); + corsConfiguration.addAllowedMethod("*"); + corsConfiguration.setAllowCredentials(true); + return corsConfiguration; + } + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", buildConfig()); + return new CorsFilter(source); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/evo/src/main/java/com/ruoyi/framework/config/DruidConfig.java new file mode 100644 index 0000000..7a8fd82 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -0,0 +1,126 @@ +package com.ruoyi.framework.config; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.sql.DataSource; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import com.alibaba.druid.pool.DruidDataSource; +import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; +import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties; +import com.alibaba.druid.util.Utils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.aspectj.lang.enums.DataSourceType; +import com.ruoyi.framework.config.properties.DruidProperties; +import com.ruoyi.framework.datasource.DynamicDataSource; + +/** + * druid 配置多数据源 + * + * @author ruoyi + */ +@Configuration +public class DruidConfig +{ + @Bean + @ConfigurationProperties("spring.datasource.druid.master") + public DataSource masterDataSource(DruidProperties druidProperties) + { + DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); + return druidProperties.dataSource(dataSource); + } + + @Bean + @ConfigurationProperties("spring.datasource.druid.slave") + @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true") + public DataSource slaveDataSource(DruidProperties druidProperties) + { + DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); + return druidProperties.dataSource(dataSource); + } + + @Bean(name = "dynamicDataSource") + @Primary + public DynamicDataSource dataSource(DataSource masterDataSource) + { + Map targetDataSources = new HashMap<>(); + targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource); + setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource"); + return new DynamicDataSource(masterDataSource, targetDataSources); + } + + /** + * 设置数据源 + * + * @param targetDataSources 备选数据源集合 + * @param sourceName 数据源名称 + * @param beanName bean名称 + */ + public void setDataSource(Map targetDataSources, String sourceName, String beanName) + { + try + { + DataSource dataSource = SpringUtils.getBean(beanName); + targetDataSources.put(sourceName, dataSource); + } + catch (Exception e) + { + } + } + + /** + * 去除监控页面底部的广告 + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Bean + @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true") + public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) + { + // 获取web监控页面的参数 + DruidStatProperties.StatViewServlet config = properties.getStatViewServlet(); + // 提取common.js的配置路径 + String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*"; + String commonJsPattern = pattern.replaceAll("\\*", "js/common.js"); + final String filePath = "support/http/resources/js/common.js"; + // 创建filter进行过滤 + Filter filter = new Filter() + { + @Override + public void init(javax.servlet.FilterConfig filterConfig) throws ServletException + { + } + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException + { + chain.doFilter(request, response); + // 重置缓冲区,响应头不会被重置 + response.resetBuffer(); + // 获取common.js + String text = Utils.readFromResource(filePath); + // 正则替换banner, 除去底部的广告信息 + text = text.replaceAll("
", ""); + text = text.replaceAll("powered.*?shrek.wang", ""); + response.getWriter().write(text); + } + @Override + public void destroy() + { + } + }; + FilterRegistrationBean registrationBean = new FilterRegistrationBean(); + registrationBean.setFilter(filter); + registrationBean.addUrlPatterns(commonJsPattern); + return registrationBean; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java b/evo/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java new file mode 100644 index 0000000..2f27ed1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java @@ -0,0 +1,69 @@ +package com.ruoyi.framework.config; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; +import com.alibaba.fastjson.parser.ParserConfig; +import org.springframework.util.Assert; +import java.nio.charset.Charset; + +/** + * Redis使用FastJson序列化 + * + * @author ruoyi + */ +public class FastJson2JsonRedisSerializer implements RedisSerializer +{ + @SuppressWarnings("unused") + private ObjectMapper objectMapper = new ObjectMapper(); + + public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); + + private Class clazz; + + static + { + ParserConfig.getGlobalInstance().setAutoTypeSupport(true); + } + + public FastJson2JsonRedisSerializer(Class clazz) + { + super(); + this.clazz = clazz; + } + + public byte[] serialize(T t) throws SerializationException + { + if (t == null) + { + return new byte[0]; + } + return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET); + } + + public T deserialize(byte[] bytes) throws SerializationException + { + if (bytes == null || bytes.length <= 0) + { + return null; + } + String str = new String(bytes, DEFAULT_CHARSET); + + return JSON.parseObject(str, clazz); + } + + public void setObjectMapper(ObjectMapper objectMapper) + { + Assert.notNull(objectMapper, "'objectMapper' must not be null"); + this.objectMapper = objectMapper; + } + + protected JavaType getJavaType(Class clazz) + { + return TypeFactory.defaultInstance().constructType(clazz); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/FilterConfig.java b/evo/src/main/java/com/ruoyi/framework/config/FilterConfig.java new file mode 100644 index 0000000..b5f03ec --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/FilterConfig.java @@ -0,0 +1,60 @@ +package com.ruoyi.framework.config; + +import java.util.HashMap; +import java.util.Map; +import javax.servlet.DispatcherType; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import com.ruoyi.common.filter.RepeatableFilter; +import com.ruoyi.common.filter.XssFilter; +import com.ruoyi.common.utils.StringUtils; + +/** + * Filter配置 + * + * @author ruoyi + */ +@Configuration +public class FilterConfig +{ + @Value("${xss.enabled}") + private String enabled; + + @Value("${xss.excludes}") + private String excludes; + + @Value("${xss.urlPatterns}") + private String urlPatterns; + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Bean + public FilterRegistrationBean xssFilterRegistration() + { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns(StringUtils.split(urlPatterns, ",")); + registration.setName("xssFilter"); + registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); + Map initParameters = new HashMap(); + initParameters.put("excludes", excludes); + initParameters.put("enabled", enabled); + registration.setInitParameters(initParameters); + return registration; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Bean + public FilterRegistrationBean someFilterRegistration() + { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(new RepeatableFilter()); + registration.addUrlPatterns("/*"); + registration.setName("repeatableFilter"); + registration.setOrder(FilterRegistrationBean.LOWEST_PRECEDENCE); + return registration; + } + +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/GenConfig.java b/evo/src/main/java/com/ruoyi/framework/config/GenConfig.java new file mode 100644 index 0000000..ef4456b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/GenConfig.java @@ -0,0 +1,66 @@ +package com.ruoyi.framework.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 读取代码生成相关配置 + * + * @author ruoyi + */ +@Component +@ConfigurationProperties(prefix = "gen") +public class GenConfig +{ + /** 作者 */ + public static String author; + + /** 生成包路径 */ + public static String packageName; + + /** 自动去除表前缀,默认是true */ + public static boolean autoRemovePre; + + /** 表前缀(类名不会包含表前缀) */ + public static String tablePrefix; + + public static String getAuthor() + { + return author; + } + + public void setAuthor(String author) + { + GenConfig.author = author; + } + + public static String getPackageName() + { + return packageName; + } + + public void setPackageName(String packageName) + { + GenConfig.packageName = packageName; + } + + public static boolean getAutoRemovePre() + { + return autoRemovePre; + } + + public void setAutoRemovePre(boolean autoRemovePre) + { + GenConfig.autoRemovePre = autoRemovePre; + } + + public static String getTablePrefix() + { + return tablePrefix; + } + + public void setTablePrefix(String tablePrefix) + { + GenConfig.tablePrefix = tablePrefix; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java b/evo/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java new file mode 100644 index 0000000..0bc8a2b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java @@ -0,0 +1,108 @@ +package com.ruoyi.framework.config; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import javax.sql.DataSource; +import org.apache.ibatis.io.VFS; +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.boot.autoconfigure.SpringBootVFS; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.core.io.DefaultResourceLoader; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.core.type.classreading.CachingMetadataReaderFactory; +import org.springframework.core.type.classreading.MetadataReader; +import org.springframework.core.type.classreading.MetadataReaderFactory; +import org.springframework.util.ClassUtils; + +/** + * Mybatis支持*匹配扫描包 + * + * @author ruoyi + */ +@Configuration +public class MyBatisConfig +{ + @Autowired + private Environment env; + + static final String DEFAULT_RESOURCE_PATTERN = "**/*.class"; + + public static String setTypeAliasesPackage(String typeAliasesPackage) + { + ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver(); + MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver); + List allResult = new ArrayList(); + try + { + for (String aliasesPackage : typeAliasesPackage.split(",")) + { + List result = new ArrayList(); + aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN; + Resource[] resources = resolver.getResources(aliasesPackage); + if (resources != null && resources.length > 0) + { + MetadataReader metadataReader = null; + for (Resource resource : resources) + { + if (resource.isReadable()) + { + metadataReader = metadataReaderFactory.getMetadataReader(resource); + try + { + result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName()); + } + catch (ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } + if (result.size() > 0) + { + HashSet hashResult = new HashSet(result); + allResult.addAll(hashResult); + } + } + if (allResult.size() > 0) + { + typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0])); + } + else + { + throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包"); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + return typeAliasesPackage; + } + + @Bean + public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception + { + String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage"); + String mapperLocations = env.getProperty("mybatis.mapperLocations"); + String configLocation = env.getProperty("mybatis.configLocation"); + typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage); + VFS.addImplClass(SpringBootVFS.class); + + final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); + sessionFactory.setDataSource(dataSource); + sessionFactory.setTypeAliasesPackage(typeAliasesPackage); + sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations)); + sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation)); + return sessionFactory.getObject(); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/config/RedisConfig.java b/evo/src/main/java/com/ruoyi/framework/config/RedisConfig.java new file mode 100644 index 0000000..8eb4fb2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/RedisConfig.java @@ -0,0 +1,43 @@ +package com.ruoyi.framework.config; + +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.StringRedisSerializer; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * redis配置 + * + * @author ruoyi + */ +@Configuration +@EnableCaching +public class RedisConfig extends CachingConfigurerSupport +{ + @Bean + @SuppressWarnings(value = { "unchecked", "rawtypes" }) + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) + { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + + FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class); + + ObjectMapper mapper = new ObjectMapper(); + mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + serializer.setObjectMapper(mapper); + + template.setValueSerializer(serializer); + // 使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + return template; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/evo/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java new file mode 100644 index 0000000..6b230c0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java @@ -0,0 +1,63 @@ +package com.ruoyi.framework.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import com.ruoyi.common.constant.Constants; +import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; + +/** + * 通用配置 + * + * @author ruoyi + */ +@Configuration +public class ResourcesConfig implements WebMvcConfigurer +{ + @Autowired + private RepeatSubmitInterceptor repeatSubmitInterceptor; + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) + { + /** 本地文件上传路径 */ + registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); + + /** swagger配置 */ + registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); + } + + /** + * 自定义拦截规则 + */ + @Override + public void addInterceptors(InterceptorRegistry registry) + { + registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**"); + } + + /** + * web跨域访问配置 + */ + @Override + public void addCorsMappings(CorsRegistry registry) + { + // 设置允许跨域的路径 + registry.addMapping("/**") + // 设置允许跨域请求的域名 + .allowedOrigins("*") + // 是否允许证书 + .allowCredentials(true) + // 设置允许的方法 + .allowedMethods("GET", "POST", "DELETE", "PUT") + // 设置允许的header属性 + .allowedHeaders("*") + // 跨域允许时间 + .maxAge(3600); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java b/evo/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java new file mode 100644 index 0000000..ed524cd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java @@ -0,0 +1,116 @@ +package com.ruoyi.framework.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 读取项目相关配置 + * + * @author ruoyi + */ +@Component +@ConfigurationProperties(prefix = "ruoyi") +public class RuoYiConfig +{ + /** 项目名称 */ + private String name; + + /** 版本 */ + private String version; + + /** 版权年份 */ + private String copyrightYear; + + /** 实例演示开关 */ + private boolean demoEnabled; + + /** 上传路径 */ + private static String profile; + + /** 获取地址开关 */ + private static boolean addressEnabled; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getVersion() + { + return version; + } + + public void setVersion(String version) + { + this.version = version; + } + + public String getCopyrightYear() + { + return copyrightYear; + } + + public void setCopyrightYear(String copyrightYear) + { + this.copyrightYear = copyrightYear; + } + + public boolean isDemoEnabled() + { + return demoEnabled; + } + + public void setDemoEnabled(boolean demoEnabled) + { + this.demoEnabled = demoEnabled; + } + + public static String getProfile() + { + return profile; + } + + public void setProfile(String profile) + { + RuoYiConfig.profile = profile; + } + + public static boolean isAddressEnabled() + { + return addressEnabled; + } + + public void setAddressEnabled(boolean addressEnabled) + { + RuoYiConfig.addressEnabled = addressEnabled; + } + + /** + * 获取头像上传路径 + */ + public static String getAvatarPath() + { + return getProfile() + "/avatar"; + } + + /** + * 获取下载路径 + */ + public static String getDownloadPath() + { + return getProfile() + "/download/"; + } + + /** + * 获取上传路径 + */ + public static String getUploadPath() + { + return getProfile() + "/upload"; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/config/ScheduleConfig.java b/evo/src/main/java/com/ruoyi/framework/config/ScheduleConfig.java new file mode 100644 index 0000000..a607e85 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/ScheduleConfig.java @@ -0,0 +1,57 @@ +package com.ruoyi.framework.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; +import javax.sql.DataSource; +import java.util.Properties; + +/** + * 定时任务配置 + * + * @author ruoyi + */ +@Configuration +public class ScheduleConfig +{ + @Bean + public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) + { + SchedulerFactoryBean factory = new SchedulerFactoryBean(); + factory.setDataSource(dataSource); + + // quartz参数 + Properties prop = new Properties(); + prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); + prop.put("org.quartz.scheduler.instanceId", "AUTO"); + // 线程池配置 + prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); + prop.put("org.quartz.threadPool.threadCount", "20"); + prop.put("org.quartz.threadPool.threadPriority", "5"); + // JobStore配置 + prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX"); + // 集群配置 + prop.put("org.quartz.jobStore.isClustered", "true"); + prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); + prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); + prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); + + // sqlserver 启用 + // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); + prop.put("org.quartz.jobStore.misfireThreshold", "12000"); + prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); + factory.setQuartzProperties(prop); + + factory.setSchedulerName("RuoyiScheduler"); + // 延时启动 + factory.setStartupDelay(1); + factory.setApplicationContextSchedulerContextKey("applicationContextKey"); + // 可选,QuartzScheduler + // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 + factory.setOverwriteExistingJobs(true); + // 设置自动启动,默认为true + factory.setAutoStartup(true); + + return factory; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/evo/src/main/java/com/ruoyi/framework/config/SecurityConfig.java new file mode 100644 index 0000000..0a2d68c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -0,0 +1,158 @@ +package com.ruoyi.framework.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; +import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; +import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; + +/** + * spring security配置 + * + * @author ruoyi + */ +@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) +public class SecurityConfig extends WebSecurityConfigurerAdapter +{ + /** + * 自定义用户认证逻辑 + */ + @Autowired + private UserDetailsService userDetailsService; + + /** + * 认证失败处理类 + */ + @Autowired + private AuthenticationEntryPointImpl unauthorizedHandler; + + /** + * 退出处理类 + */ + @Autowired + private LogoutSuccessHandlerImpl logoutSuccessHandler; + + /** + * token认证过滤器 + */ + @Autowired + private JwtAuthenticationTokenFilter authenticationTokenFilter; + + /** + * 解决 无法直接注入 AuthenticationManager + * + * @return + * @throws Exception + */ + @Bean + @Override + public AuthenticationManager authenticationManagerBean() throws Exception + { + return super.authenticationManagerBean(); + } + + /** + * anyRequest | 匹配所有请求路径 + * access | SpringEl表达式结果为true时可以访问 + * anonymous | 匿名可以访问 + * denyAll | 用户不能访问 + * fullyAuthenticated | 用户完全认证可以访问(非remember-me下自动登录) + * hasAnyAuthority | 如果有参数,参数表示权限,则其中任何一个权限可以访问 + * hasAnyRole | 如果有参数,参数表示角色,则其中任何一个角色可以访问 + * hasAuthority | 如果有参数,参数表示权限,则其权限可以访问 + * hasIpAddress | 如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问 + * hasRole | 如果有参数,参数表示角色,则其角色可以访问 + * permitAll | 用户可以任意访问 + * rememberMe | 允许通过remember-me登录的用户访问 + * authenticated | 用户登录后可访问 + */ + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception + { + httpSecurity + // CRSF禁用,因为不使用session + .csrf().disable() + // 认证失败处理类 + .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() + // 基于token,所以不需要session + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() + // 过滤请求 + .authorizeRequests() + // 对于登录login 验证码captchaImage 允许匿名访问 + .antMatchers("/login", "/captchaImage").anonymous() + .antMatchers( + HttpMethod.GET, + "/*.html", + "/**/*.html", + "/**/*.css", + "/**/*.js" + ).permitAll() + .antMatchers("/profile/**").anonymous() + .antMatchers("/common/download**").anonymous() + .antMatchers("/common/download/resource**").anonymous() + .antMatchers("/swagger-ui.html").anonymous() + .antMatchers("/swagger-resources/**").anonymous() + .antMatchers("/webjars/**").anonymous() + .antMatchers("/*/api-docs").anonymous() + .antMatchers("/management/scheme/updateScheme").anonymous() + .antMatchers("/druid/**").anonymous() + .antMatchers("/management/productionBill/createBom").anonymous() + .antMatchers("/management/productionBill/updateR").anonymous() + .antMatchers("/management/productionBill/getDrwing").anonymous() + .antMatchers("/management/pwBomNumber/export").anonymous() + .antMatchers("/management/productionBill/importBom").permitAll() + .antMatchers("/websocket/**").anonymous() + .antMatchers("/api/v1/verify_user").anonymous() + .antMatchers("/api/v1/record/face").anonymous() + .antMatchers("/api/v2/verify_user_yt").anonymous() + .antMatchers("/api/v2/flushData").anonymous() //实时查询最后一餐的刷脸人数 + .antMatchers("/JDinterFace/picking").anonymous() //金蝶bom接口 + .antMatchers("/management/jdReceiptsDataInfo/addInfo").anonymous() //金蝶回推发票和收款数据信息 + .antMatchers("/management/cadMaterialInfo/verify").anonymous() + //原材料接口 + .antMatchers("/management/imMaterial/imMaterialList").anonymous() + //工序信息接口 + .antMatchers("/management/pwProcess/pwProcessList").anonymous() + //派工部门接口 + .antMatchers("/system/dept/deptList").anonymous() + //上传bom + .antMatchers("/management/pwBomNumberTwo/uploadBomInfo").anonymous() + // 除上面外的所有请求全部需要鉴权认证 + .anyRequest().authenticated() + //添加后解决退出登录的跨域问题 + .and().cors().and() + .headers().frameOptions().disable(); + httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); + // 添加JWT filter + httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); + } + + + /** + * 强散列哈希加密实现 + */ + @Bean + public BCryptPasswordEncoder bCryptPasswordEncoder() + { + return new BCryptPasswordEncoder(); + } + + /** + * 身份认证接口 + */ + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception + { + auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/ServerConfig.java b/evo/src/main/java/com/ruoyi/framework/config/ServerConfig.java new file mode 100644 index 0000000..b5b7de3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/ServerConfig.java @@ -0,0 +1,32 @@ +package com.ruoyi.framework.config; + +import javax.servlet.http.HttpServletRequest; +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.ServletUtils; + +/** + * 服务相关配置 + * + * @author ruoyi + */ +@Component +public class ServerConfig +{ + /** + * 获取完整的请求路径,包括:域名,端口,上下文访问路径 + * + * @return 服务地址 + */ + public String getUrl() + { + HttpServletRequest request = ServletUtils.getRequest(); + return getDomain(request); + } + + public static String getDomain(HttpServletRequest request) + { + StringBuffer url = request.getRequestURL(); + String contextPath = request.getServletContext().getContextPath(); + return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/evo/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java new file mode 100644 index 0000000..692bb30 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java @@ -0,0 +1,124 @@ +package com.ruoyi.framework.config; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import io.swagger.annotations.ApiOperation; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.service.AuthorizationScope; +import springfox.documentation.service.Contact; +import springfox.documentation.service.SecurityReference; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.contexts.SecurityContext; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * Swagger2的接口配置 + * + * @author ruoyi + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig +{ + /** 系统基础配置 */ + @Autowired + private RuoYiConfig ruoyiConfig; + + /** 是否开启swagger */ + @Value("${swagger.enabled}") + private boolean enabled; + + /** 设置请求的统一前缀 */ + @Value("${swagger.pathMapping}") + private String pathMapping; + + /** + * 创建API + */ + @Bean + public Docket createRestApi() + { + return new Docket(DocumentationType.SWAGGER_2) + // 是否启用Swagger + .enable(enabled) + // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) + .apiInfo(apiInfo()) + // 设置哪些接口暴露给Swagger展示 + .select() + // 扫描所有有注解的api,用这种方式更灵活 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + // 扫描指定包中的swagger注解 + // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) + // 扫描所有 .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() + /* 设置安全模式,swagger可以设置访问token */ + .securitySchemes(securitySchemes()) + .securityContexts(securityContexts()) + .pathMapping(pathMapping); + } + + /** + * 安全模式,这里指定token通过Authorization头请求头传递 + */ + private List securitySchemes() + { + List apiKeyList = new ArrayList(); + apiKeyList.add(new ApiKey("Authorization", "Authorization", "header")); + return apiKeyList; + } + + /** + * 安全上下文 + */ + private List securityContexts() + { + List securityContexts = new ArrayList<>(); + securityContexts.add( + SecurityContext.builder() + .securityReferences(defaultAuth()) + .forPaths(PathSelectors.regex("^(?!auth).*$")) + .build()); + return securityContexts; + } + + /** + * 默认的安全上引用 + */ + private List defaultAuth() + { + AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); + AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; + authorizationScopes[0] = authorizationScope; + List securityReferences = new ArrayList<>(); + securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); + return securityReferences; + } + + /** + * 添加摘要信息 + */ + private ApiInfo apiInfo() + { + // 用ApiInfoBuilder进行定制 + return new ApiInfoBuilder() + // 设置标题 + .title("标题:若依管理系统_接口文档") + // 描述 + .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...") + // 作者信息 + .contact(new Contact(ruoyiConfig.getName(), null, null)) + // 版本 + .version("版本号:" + ruoyiConfig.getVersion()) + .build(); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java b/evo/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java new file mode 100644 index 0000000..0d67c22 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java @@ -0,0 +1,62 @@ +package com.ruoyi.framework.config; + +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; +import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import com.ruoyi.common.utils.Threads; + +/** + * 线程池配置 + * + * @author ruoyi + **/ +@Configuration +public class ThreadPoolConfig +{ + // 核心线程池大小 + private int corePoolSize = 50; + + // 最大可创建的线程数 + private int maxPoolSize = 200; + + // 队列最大长度 + private int queueCapacity = 1000; + + // 线程池维护线程所允许的空闲时间 + private int keepAliveSeconds = 300; + + @Bean(name = "threadPoolTaskExecutor") + public ThreadPoolTaskExecutor threadPoolTaskExecutor() + { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setMaxPoolSize(maxPoolSize); + executor.setCorePoolSize(corePoolSize); + executor.setQueueCapacity(queueCapacity); + executor.setKeepAliveSeconds(keepAliveSeconds); + // 线程池对拒绝任务(无线程可用)的处理策略 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + return executor; + } + + /** + * 执行周期性或定时任务 + */ + @Bean(name = "scheduledExecutorService") + protected ScheduledExecutorService scheduledExecutorService() + { + return new ScheduledThreadPoolExecutor(corePoolSize, + new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) + { + @Override + protected void afterExecute(Runnable r, Throwable t) + { + super.afterExecute(r, t); + Threads.printException(r, t); + } + }; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java b/evo/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java new file mode 100644 index 0000000..84f7e00 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java @@ -0,0 +1,77 @@ +package com.ruoyi.framework.config.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import com.alibaba.druid.pool.DruidDataSource; + +/** + * druid 配置属性 + * + * @author ruoyi + */ +@Configuration +public class DruidProperties +{ + @Value("${spring.datasource.druid.initialSize}") + private int initialSize; + + @Value("${spring.datasource.druid.minIdle}") + private int minIdle; + + @Value("${spring.datasource.druid.maxActive}") + private int maxActive; + + @Value("${spring.datasource.druid.maxWait}") + private int maxWait; + + @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}") + private int timeBetweenEvictionRunsMillis; + + @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}") + private int minEvictableIdleTimeMillis; + + @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}") + private int maxEvictableIdleTimeMillis; + + @Value("${spring.datasource.druid.validationQuery}") + private String validationQuery; + + @Value("${spring.datasource.druid.testWhileIdle}") + private boolean testWhileIdle; + + @Value("${spring.datasource.druid.testOnBorrow}") + private boolean testOnBorrow; + + @Value("${spring.datasource.druid.testOnReturn}") + private boolean testOnReturn; + + public DruidDataSource dataSource(DruidDataSource datasource) + { + /** 配置初始化大小、最小、最大 */ + datasource.setInitialSize(initialSize); + datasource.setMaxActive(maxActive); + datasource.setMinIdle(minIdle); + + /** 配置获取连接等待超时的时间 */ + datasource.setMaxWait(maxWait); + + /** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */ + datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); + + /** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */ + datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); + datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis); + + /** + * 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。 + */ + datasource.setValidationQuery(validationQuery); + /** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */ + datasource.setTestWhileIdle(testWhileIdle); + /** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */ + datasource.setTestOnBorrow(testOnBorrow); + /** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */ + datasource.setTestOnReturn(testOnReturn); + return datasource; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java b/evo/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java new file mode 100644 index 0000000..e70b8cf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java @@ -0,0 +1,26 @@ +package com.ruoyi.framework.datasource; + +import java.util.Map; +import javax.sql.DataSource; +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + +/** + * 动态数据源 + * + * @author ruoyi + */ +public class DynamicDataSource extends AbstractRoutingDataSource +{ + public DynamicDataSource(DataSource defaultTargetDataSource, Map targetDataSources) + { + super.setDefaultTargetDataSource(defaultTargetDataSource); + super.setTargetDataSources(targetDataSources); + super.afterPropertiesSet(); + } + + @Override + protected Object determineCurrentLookupKey() + { + return DynamicDataSourceContextHolder.getDataSourceType(); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java b/evo/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java new file mode 100644 index 0000000..3572db9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java @@ -0,0 +1,45 @@ +package com.ruoyi.framework.datasource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 数据源切换处理 + * + * @author ruoyi + */ +public class DynamicDataSourceContextHolder +{ + public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class); + + /** + * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, + * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 + */ + private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); + + /** + * 设置数据源的变量 + */ + public static void setDataSourceType(String dsType) + { + log.info("切换到{}数据源", dsType); + CONTEXT_HOLDER.set(dsType); + } + + /** + * 获得数据源的变量 + */ + public static String getDataSourceType() + { + return CONTEXT_HOLDER.get(); + } + + /** + * 清空数据源变量 + */ + public static void clearDataSourceType() + { + CONTEXT_HOLDER.remove(); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java b/evo/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java new file mode 100644 index 0000000..088798d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java @@ -0,0 +1,55 @@ +package com.ruoyi.framework.interceptor; + +import java.lang.reflect.Method; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.framework.web.domain.AjaxResult; + +/** + * 防止重复提交拦截器 + * + * @author ruoyi + */ +@Component +public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter +{ + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception + { + if (handler instanceof HandlerMethod) + { + HandlerMethod handlerMethod = (HandlerMethod) handler; + Method method = handlerMethod.getMethod(); + RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); + if (annotation != null) + { + if (this.isRepeatSubmit(request)) + { + AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试"); + ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult)); + return false; + } + } + return true; + } + else + { + return super.preHandle(request, response, handler); + } + } + + /** + * 验证是否重复提交由子类实现具体的防重复提交的规则 + * + * @param httpServletRequest + * @return + * @throws Exception + */ + public abstract boolean isRepeatSubmit(HttpServletRequest request); +} diff --git a/evo/src/main/java/com/ruoyi/framework/interceptor/annotation/RepeatSubmit.java b/evo/src/main/java/com/ruoyi/framework/interceptor/annotation/RepeatSubmit.java new file mode 100644 index 0000000..0fbd73b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/interceptor/annotation/RepeatSubmit.java @@ -0,0 +1,23 @@ +package com.ruoyi.framework.interceptor.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 自定义注解防止表单重复提交 + * + * @author ruoyi + * + */ +@Inherited +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RepeatSubmit +{ + +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/evo/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java new file mode 100644 index 0000000..05f59ee --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java @@ -0,0 +1,107 @@ +package com.ruoyi.framework.interceptor.impl; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.servlet.http.HttpServletRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.filter.RepeatedlyRequestWrapper; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpHelper; +import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; +import com.ruoyi.framework.redis.RedisCache; + +/** + * 判断请求url和数据是否和上一次相同, + * 如果和上次相同,则是重复提交表单。 有效时间为10秒内。 + * + * @author ruoyi + */ +@Component +public class SameUrlDataInterceptor extends RepeatSubmitInterceptor +{ + public final String REPEAT_PARAMS = "repeatParams"; + + public final String REPEAT_TIME = "repeatTime"; + + public final String CACHE_REPEAT_KEY = "repeatData"; + + @Autowired + private RedisCache redisCache; + + /** + * 间隔时间,单位:秒 默认10秒 + * + * 两次相同参数的请求,如果间隔时间大于该参数,系统不会认定为重复提交的数据 + */ + private int intervalTime = 10; + + public void setIntervalTime(int intervalTime) + { + this.intervalTime = intervalTime; + } + + @SuppressWarnings("unchecked") + @Override + public boolean isRepeatSubmit(HttpServletRequest request) + { + RepeatedlyRequestWrapper repeatedlyRequest = (RepeatedlyRequestWrapper) request; + String nowParams = HttpHelper.getBodyString(repeatedlyRequest); + + // body参数为空,获取Parameter的数据 + if (StringUtils.isEmpty(nowParams)) + { + nowParams = JSONObject.toJSONString(request.getParameterMap()); + } + Map nowDataMap = new HashMap(); + nowDataMap.put(REPEAT_PARAMS, nowParams); + nowDataMap.put(REPEAT_TIME, System.currentTimeMillis()); + + // 请求地址(作为存放cache的key值) + String url = request.getRequestURI(); + + Object sessionObj = redisCache.getCacheObject(CACHE_REPEAT_KEY); + if (sessionObj != null) + { + Map sessionMap = (Map) sessionObj; + if (sessionMap.containsKey(url)) + { + Map preDataMap = (Map) sessionMap.get(url); + if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap)) + { + return true; + } + } + } + Map cacheMap = new HashMap(); + cacheMap.put(url, nowDataMap); + redisCache.setCacheObject(CACHE_REPEAT_KEY, cacheMap, intervalTime, TimeUnit.SECONDS); + return false; + } + + /** + * 判断参数是否相同 + */ + private boolean compareParams(Map nowMap, Map preMap) + { + String nowParams = (String) nowMap.get(REPEAT_PARAMS); + String preParams = (String) preMap.get(REPEAT_PARAMS); + return nowParams.equals(preParams); + } + + /** + * 判断两次间隔时间 + */ + private boolean compareTime(Map nowMap, Map preMap) + { + long time1 = (Long) nowMap.get(REPEAT_TIME); + long time2 = (Long) preMap.get(REPEAT_TIME); + if ((time1 - time2) < (this.intervalTime * 1000)) + { + return true; + } + return false; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/manager/AsyncManager.java b/evo/src/main/java/com/ruoyi/framework/manager/AsyncManager.java new file mode 100644 index 0000000..7387a02 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/manager/AsyncManager.java @@ -0,0 +1,55 @@ +package com.ruoyi.framework.manager; + +import java.util.TimerTask; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import com.ruoyi.common.utils.Threads; +import com.ruoyi.common.utils.spring.SpringUtils; + +/** + * 异步任务管理器 + * + * @author ruoyi + */ +public class AsyncManager +{ + /** + * 操作延迟10毫秒 + */ + private final int OPERATE_DELAY_TIME = 10; + + /** + * 异步操作任务调度线程池 + */ + private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); + + /** + * 单例模式 + */ + private AsyncManager(){} + + private static AsyncManager me = new AsyncManager(); + + public static AsyncManager me() + { + return me; + } + + /** + * 执行任务 + * + * @param task 任务 + */ + public void execute(TimerTask task) + { + executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); + } + + /** + * 停止任务线程池 + */ + public void shutdown() + { + Threads.shutdownAndAwaitTermination(executor); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java b/evo/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java new file mode 100644 index 0000000..e36ca3c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java @@ -0,0 +1,39 @@ +package com.ruoyi.framework.manager; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import javax.annotation.PreDestroy; + +/** + * 确保应用退出时能关闭后台线程 + * + * @author ruoyi + */ +@Component +public class ShutdownManager +{ + private static final Logger logger = LoggerFactory.getLogger("sys-user"); + + @PreDestroy + public void destroy() + { + shutdownAsyncManager(); + } + + /** + * 停止异步执行任务 + */ + private void shutdownAsyncManager() + { + try + { + logger.info("====关闭后台任务任务线程池===="); + AsyncManager.me().shutdown(); + } + catch (Exception e) + { + logger.error(e.getMessage(), e); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java b/evo/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java new file mode 100644 index 0000000..88633ad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java @@ -0,0 +1,101 @@ +package com.ruoyi.framework.manager.factory; + +import java.util.TimerTask; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.LogUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.ip.AddressUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.project.monitor.domain.SysLogininfor; +import com.ruoyi.project.monitor.domain.SysOperLog; +import com.ruoyi.project.monitor.service.ISysLogininforService; +import com.ruoyi.project.monitor.service.ISysOperLogService; +import eu.bitwalker.useragentutils.UserAgent; + +/** + * 异步工厂(产生任务用) + * + * @author ruoyi + */ +public class AsyncFactory +{ + private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user"); + + /** + * 记录登陆信息 + * + * @param username 用户名 + * @param status 状态 + * @param message 消息 + * @param args 列表 + * @return 任务task + */ + public static TimerTask recordLogininfor(final String username, final String status, final String message, + final Object... args) + { + final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); + final String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); + return new TimerTask() + { + @Override + public void run() + { + String address = AddressUtils.getRealAddressByIP(ip); + StringBuilder s = new StringBuilder(); + s.append(LogUtils.getBlock(ip)); + s.append(address); + s.append(LogUtils.getBlock(username)); + s.append(LogUtils.getBlock(status)); + s.append(LogUtils.getBlock(message)); + // 打印信息到日志 + sys_user_logger.info(s.toString(), args); + // 获取客户端操作系统 + String os = userAgent.getOperatingSystem().getName(); + // 获取客户端浏览器 + String browser = userAgent.getBrowser().getName(); + // 封装对象 + SysLogininfor logininfor = new SysLogininfor(); + logininfor.setUserName(username); + logininfor.setIpaddr(ip); + logininfor.setLoginLocation(address); + logininfor.setBrowser(browser); + logininfor.setOs(os); + logininfor.setMsg(message); + // 日志状态 + if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status)) + { + logininfor.setStatus(Constants.SUCCESS); + } + else if (Constants.LOGIN_FAIL.equals(status)) + { + logininfor.setStatus(Constants.FAIL); + } + // 插入数据 + SpringUtils.getBean(ISysLogininforService.class).insertLogininfor(logininfor); + } + }; + } + + /** + * 操作日志记录 + * + * @param operLog 操作日志信息 + * @return 任务task + */ + public static TimerTask recordOper(final SysOperLog operLog) + { + return new TimerTask() + { + @Override + public void run() + { + // 远程查询操作地点 + operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp())); + SpringUtils.getBean(ISysOperLogService.class).insertOperlog(operLog); + } + }; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/redis/RedisCache.java b/evo/src/main/java/com/ruoyi/framework/redis/RedisCache.java new file mode 100644 index 0000000..1bc6050 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/redis/RedisCache.java @@ -0,0 +1,207 @@ +package com.ruoyi.framework.redis; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.ListOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Component; + +/** + * spring redis 工具类 + * + * @author ruoyi + **/ +@SuppressWarnings(value = { "unchecked", "rawtypes" }) +@Component +public class RedisCache +{ + @Autowired + public RedisTemplate redisTemplate; + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @return 缓存的对象 + */ + public ValueOperations setCacheObject(String key, T value) + { + ValueOperations operation = redisTemplate.opsForValue(); + operation.set(key, value); + return operation; + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 + * @param timeUnit 时间颗粒度 + * @return 缓存的对象 + */ + public ValueOperations setCacheObject(String key, T value, Integer timeout, TimeUnit timeUnit) + { + ValueOperations operation = redisTemplate.opsForValue(); + operation.set(key, value, timeout, timeUnit); + return operation; + } + + /** + * 获得缓存的基本对象。 + * + * @param key 缓存键值 + * @return 缓存键值对应的数据 + */ + public T getCacheObject(String key) + { + ValueOperations operation = redisTemplate.opsForValue(); + return operation.get(key); + } + + /** + * 删除单个对象 + * + * @param key + */ + public void deleteObject(String key) + { + redisTemplate.delete(key); + } + + /** + * 删除集合对象 + * + * @param collection + */ + public void deleteObject(Collection collection) + { + redisTemplate.delete(collection); + } + + /** + * 缓存List数据 + * + * @param key 缓存的键值 + * @param dataList 待缓存的List数据 + * @return 缓存的对象 + */ + public ListOperations setCacheList(String key, List dataList) + { + ListOperations listOperation = redisTemplate.opsForList(); + if (null != dataList) + { + int size = dataList.size(); + for (int i = 0; i < size; i++) + { + listOperation.leftPush(key, dataList.get(i)); + } + } + return listOperation; + } + + /** + * 获得缓存的list对象 + * + * @param key 缓存的键值 + * @return 缓存键值对应的数据 + */ + public List getCacheList(String key) + { + List dataList = new ArrayList(); + ListOperations listOperation = redisTemplate.opsForList(); + Long size = listOperation.size(key); + + for (int i = 0; i < size; i++) + { + dataList.add(listOperation.index(key, i)); + } + return dataList; + } + + /** + * 缓存Set + * + * @param key 缓存键值 + * @param dataSet 缓存的数据 + * @return 缓存数据的对象 + */ + public BoundSetOperations setCacheSet(String key, Set dataSet) + { + BoundSetOperations setOperation = redisTemplate.boundSetOps(key); + Iterator it = dataSet.iterator(); + while (it.hasNext()) + { + setOperation.add(it.next()); + } + return setOperation; + } + + /** + * 获得缓存的set + * + * @param key + * @return + */ + public Set getCacheSet(String key) + { + Set dataSet = new HashSet(); + BoundSetOperations operation = redisTemplate.boundSetOps(key); + dataSet = operation.members(); + return dataSet; + } + + /** + * 缓存Map + * + * @param key + * @param dataMap + * @return + */ + public HashOperations setCacheMap(String key, Map dataMap) + { + HashOperations hashOperations = redisTemplate.opsForHash(); + if (null != dataMap) + { + for (Map.Entry entry : dataMap.entrySet()) + { + hashOperations.put(key, entry.getKey(), entry.getValue()); + } + } + return hashOperations; + } + + /** + * 获得缓存的Map + * + * @param key + * @return + */ + public Map getCacheMap(String key) + { + Map map = redisTemplate.opsForHash().entries(key); + return map; + } + + /** + * 获得缓存的基本对象列表 + * + * @param pattern 字符串前缀 + * @return 对象列表 + */ + public Collection keys(String pattern) + { + return redisTemplate.keys(pattern); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/LoginBody.java b/evo/src/main/java/com/ruoyi/framework/security/LoginBody.java new file mode 100644 index 0000000..ebe4f9e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/LoginBody.java @@ -0,0 +1,69 @@ +package com.ruoyi.framework.security; + +/** + * 用户登录对象 + * + * @author ruoyi + */ +public class LoginBody +{ + /** + * 用户名 + */ + private String username; + + /** + * 用户密码 + */ + private String password; + + /** + * 验证码 + */ + private String code; + + /** + * 唯一标识 + */ + private String uuid = ""; + + public String getUsername() + { + return username; + } + + public void setUsername(String username) + { + this.username = username; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getCode() + { + return code; + } + + public void setCode(String code) + { + this.code = code; + } + + public String getUuid() + { + return uuid; + } + + public void setUuid(String uuid) + { + this.uuid = uuid; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/LoginUser.java b/evo/src/main/java/com/ruoyi/framework/security/LoginUser.java new file mode 100644 index 0000000..e6b997e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/LoginUser.java @@ -0,0 +1,228 @@ +package com.ruoyi.framework.security; + +import java.util.Collection; +import java.util.Set; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 登录用户身份权限 + * + * @author ruoyi + */ +public class LoginUser implements UserDetails +{ + private static final long serialVersionUID = 1L; + + /** + * 用户唯一标识 + */ + private String token; + + /** + * 登陆时间 + */ + private Long loginTime; + + /** + * 过期时间 + */ + private Long expireTime; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地点 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 权限列表 + */ + private Set permissions; + + /** + * 用户信息 + */ + private SysUser user; + + public String getToken() + { + return token; + } + + public void setToken(String token) + { + this.token = token; + } + + public LoginUser() + { + } + + public LoginUser(SysUser user, Set permissions) + { + this.user = user; + this.permissions = permissions; + } + + @JsonIgnore + @Override + public String getPassword() + { + return user.getPassword(); + } + + @Override + public String getUsername() + { + return user.getUserName(); + } + + /** + * 账户是否未过期,过期无法验证 + */ + @JsonIgnore + @Override + public boolean isAccountNonExpired() + { + return true; + } + + /** + * 指定用户是否解锁,锁定的用户无法进行身份验证 + * + * @return + */ + @JsonIgnore + @Override + public boolean isAccountNonLocked() + { + return true; + } + + /** + * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证 + * + * @return + */ + @JsonIgnore + @Override + public boolean isCredentialsNonExpired() + { + return true; + } + + /** + * 是否可用 ,禁用的用户不能身份验证 + * + * @return + */ + @JsonIgnore + @Override + public boolean isEnabled() + { + return true; + } + + public Long getLoginTime() + { + return loginTime; + } + + public void setLoginTime(Long loginTime) + { + this.loginTime = loginTime; + } + + public String getIpaddr() + { + return ipaddr; + } + + public void setIpaddr(String ipaddr) + { + this.ipaddr = ipaddr; + } + + public String getLoginLocation() + { + return loginLocation; + } + + public void setLoginLocation(String loginLocation) + { + this.loginLocation = loginLocation; + } + + public String getBrowser() + { + return browser; + } + + public void setBrowser(String browser) + { + this.browser = browser; + } + + public String getOs() + { + return os; + } + + public void setOs(String os) + { + this.os = os; + } + + public Long getExpireTime() + { + return expireTime; + } + + public void setExpireTime(Long expireTime) + { + this.expireTime = expireTime; + } + + public Set getPermissions() + { + return permissions; + } + + public void setPermissions(Set permissions) + { + this.permissions = permissions; + } + + public SysUser getUser() + { + return user; + } + + public void setUser(SysUser user) + { + this.user = user; + } + + @Override + public Collection getAuthorities() + { + return null; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java b/evo/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java new file mode 100644 index 0000000..fa8a654 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java @@ -0,0 +1,44 @@ +package com.ruoyi.framework.security.filter; + +import java.io.IOException; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; + +/** + * token过滤器 验证token有效性 + * + * @author ruoyi + */ +@Component +public class JwtAuthenticationTokenFilter extends OncePerRequestFilter +{ + @Autowired + private TokenService tokenService; + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) + throws ServletException, IOException + { + LoginUser loginUser = tokenService.getLoginUser(request); + if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) + { + tokenService.verifyToken(loginUser); + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); + authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); + SecurityContextHolder.getContext().setAuthentication(authenticationToken); + } + chain.doFilter(request, response); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java b/evo/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java new file mode 100644 index 0000000..f20bf2e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java @@ -0,0 +1,34 @@ +package com.ruoyi.framework.security.handle; + +import java.io.IOException; +import java.io.Serializable; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; +import com.alibaba.fastjson.JSON; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.AjaxResult; + +/** + * 认证失败处理类 返回未授权 + * + * @author ruoyi + */ +@Component +public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable +{ + private static final long serialVersionUID = -8970718410437077606L; + + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) + throws IOException + { + int code = HttpStatus.UNAUTHORIZED; + String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg))); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java b/evo/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java new file mode 100644 index 0000000..a41cd0a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java @@ -0,0 +1,53 @@ +package com.ruoyi.framework.security.handle; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.Authentication; +import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; +import com.alibaba.fastjson.JSON; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.domain.AjaxResult; + +/** + * 自定义退出处理类 返回成功 + * + * @author ruoyi + */ +@Configuration +public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler +{ + @Autowired + private TokenService tokenService; + + /** + * 退出处理 + * + * @return + */ + @Override + public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) + throws IOException, ServletException + { + LoginUser loginUser = tokenService.getLoginUser(request); + if (StringUtils.isNotNull(loginUser)) + { + String userName = loginUser.getUsername(); + // 删除用户缓存记录 + tokenService.delLoginUser(loginUser.getToken()); + // 记录用户退出日志 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功")); + } + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功"))); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/service/PermissionService.java b/evo/src/main/java/com/ruoyi/framework/security/service/PermissionService.java new file mode 100644 index 0000000..be68cc2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/service/PermissionService.java @@ -0,0 +1,169 @@ +package com.ruoyi.framework.security.service; + +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.project.system.domain.SysRole; + +/** + * RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母 + * + * @author ruoyi + */ +@Service("ss") +public class PermissionService +{ + /** 所有权限标识 */ + private static final String ALL_PERMISSION = "*:*:*"; + + /** 管理员角色权限标识 */ + private static final String SUPER_ADMIN = "admin"; + + private static final String ROLE_DELIMETER = ","; + + private static final String PERMISSION_DELIMETER = ","; + + @Autowired + private TokenService tokenService; + + /** + * 验证用户是否具备某权限 + * + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ + public boolean hasPermi(String permission) + { + if (StringUtils.isEmpty(permission)) + { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) + { + return false; + } + return hasPermissions(loginUser.getPermissions(), permission); + } + + /** + * 验证用户是否不具备某权限,与 hasPermi逻辑相反 + * + * @param permission 权限字符串 + * @return 用户是否不具备某权限 + */ + public boolean lacksPermi(String permission) + { + return hasPermi(permission) != true; + } + + /** + * 验证用户是否具有以下任意一个权限 + * + * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 + * @return 用户是否具有以下任意一个权限 + */ + public boolean hasAnyPermi(String permissions) + { + if (StringUtils.isEmpty(permissions)) + { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) + { + return false; + } + Set authorities = loginUser.getPermissions(); + for (String permission : permissions.split(PERMISSION_DELIMETER)) + { + if (permission != null && hasPermissions(authorities, permission)) + { + return true; + } + } + return false; + } + + /** + * 判断用户是否拥有某个角色 + * + * @param role 角色字符串 + * @return 用户是否具备某角色 + */ + public boolean hasRole(String role) + { + if (StringUtils.isEmpty(role)) + { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) + { + return false; + } + for (SysRole sysRole : loginUser.getUser().getRoles()) + { + String roleKey = sysRole.getRoleKey(); + if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role))) + { + return true; + } + } + return false; + } + + /** + * 验证用户是否不具备某角色,与 isRole逻辑相反。 + * + * @param role 角色名称 + * @return 用户是否不具备某角色 + */ + public boolean lacksRole(String role) + { + return hasRole(role) != true; + } + + /** + * 验证用户是否具有以下任意一个角色 + * + * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表 + * @return 用户是否具有以下任意一个角色 + */ + public boolean hasAnyRoles(String roles) + { + if (StringUtils.isEmpty(roles)) + { + return false; + } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) + { + return false; + } + for (String role : roles.split(ROLE_DELIMETER)) + { + if (hasRole(role)) + { + return true; + } + } + return false; + } + + /** + * 判断是否包含权限 + * + * @param permissions 权限列表 + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ + private boolean hasPermissions(Set permissions, String permission) + { + return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission)); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java b/evo/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java new file mode 100644 index 0000000..5bf4ceb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java @@ -0,0 +1,88 @@ +package com.ruoyi.framework.security.service; + +import javax.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.user.CaptchaException; +import com.ruoyi.common.exception.user.CaptchaExpireException; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.redis.RedisCache; +import com.ruoyi.framework.security.LoginUser; + +/** + * 登录校验方法 + * + * @author ruoyi + */ +@Component +public class SysLoginService +{ + @Autowired + private TokenService tokenService; + + @Resource + private AuthenticationManager authenticationManager; + + @Autowired + private RedisCache redisCache; + + /** + * 登录验证 + * + * @param username 用户名 + * @param password 密码 + * @param captcha 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public String login(String username, String password, String code, String uuid) + { + String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; +// String captcha = redisCache.getCacheObject(verifyKey); + redisCache.deleteObject(verifyKey); +// if (captcha == null) +// { +// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); +// throw new CaptchaExpireException(); +// } +// if (!code.equalsIgnoreCase(captcha)) +// { +// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); +// throw new CaptchaException(); +// } + // 用户验证 + Authentication authentication = null; + try + { + // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername + authentication = authenticationManager + .authenticate(new UsernamePasswordAuthenticationToken(username, password)); + } + catch (Exception e) + { + if (e instanceof BadCredentialsException) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + throw new UserPasswordNotMatchException(); + } + else + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); + throw new CustomException(e.getMessage()); + } + } + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); + LoginUser loginUser = (LoginUser) authentication.getPrincipal(); + // 生成token + return tokenService.createToken(loginUser); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java b/evo/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java new file mode 100644 index 0000000..20a2a0b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java @@ -0,0 +1,66 @@ +package com.ruoyi.framework.security.service; + +import java.util.HashSet; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysMenuService; +import com.ruoyi.project.system.service.ISysRoleService; + +/** + * 用户权限处理 + * + * @author ruoyi + */ +@Component +public class SysPermissionService +{ + @Autowired + private ISysRoleService roleService; + + @Autowired + private ISysMenuService menuService; + + /** + * 获取角色数据权限 + * + * @param user 用户信息 + * @return 角色权限信息 + */ + public Set getRolePermission(SysUser user) + { + Set roles = new HashSet(); + // 管理员拥有所有权限 + if (user.isAdmin()) + { + roles.add("admin"); + } + else + { + roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); + } + return roles; + } + + /** + * 获取菜单数据权限 + * + * @param user 用户信息 + * @return 菜单权限信息 + */ + public Set getMenuPermission(SysUser user) + { + Set perms = new HashSet(); + // 管理员拥有所有权限 + if (user.isAdmin()) + { + perms.add("*:*:*"); + } + else + { + perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); + } + return perms; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/service/TokenService.java b/evo/src/main/java/com/ruoyi/framework/security/service/TokenService.java new file mode 100644 index 0000000..82015c9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/service/TokenService.java @@ -0,0 +1,219 @@ +package com.ruoyi.framework.security.service; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.servlet.http.HttpServletRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.IdUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.AddressUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.framework.redis.RedisCache; +import com.ruoyi.framework.security.LoginUser; +import eu.bitwalker.useragentutils.UserAgent; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; + +/** + * token验证处理 + * + * @author ruoyi + */ +@Component +public class TokenService +{ + // 令牌自定义标识 + @Value("${token.header}") + private String header; + + // 令牌秘钥 + @Value("${token.secret}") + private String secret; + + // 令牌有效期(默认30分钟) + @Value("${token.expireTime}") + private int expireTime; + + protected static final long MILLIS_SECOND = 1000; + + protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND; + + private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L; + + @Autowired + private RedisCache redisCache; + + /** + * 获取用户身份信息 + * + * @return 用户信息 + */ + public LoginUser getLoginUser(HttpServletRequest request) + { + // 获取请求携带的令牌 + String token = getToken(request); + if (StringUtils.isNotEmpty(token)) + { + Claims claims = parseToken(token); + // 解析对应的权限以及用户信息 + String uuid = (String) claims.get(Constants.LOGIN_USER_KEY); + String userKey = getTokenKey(uuid); + LoginUser user = redisCache.getCacheObject(userKey); + return user; + } + return null; + } + + /** + * 设置用户身份信息 + */ + public void setLoginUser(LoginUser loginUser) + { + if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken())) + { + refreshToken(loginUser); + } + } + + /** + * 删除用户身份信息 + */ + public void delLoginUser(String token) + { + if (StringUtils.isNotEmpty(token)) + { + String userKey = getTokenKey(token); + redisCache.deleteObject(userKey); + } + } + + /** + * 创建令牌 + * + * @param loginUser 用户信息 + * @return 令牌 + */ + public String createToken(LoginUser loginUser) + { + String token = IdUtils.fastUUID(); + loginUser.setToken(token); + setUserAgent(loginUser); + refreshToken(loginUser); + + Map claims = new HashMap<>(); + claims.put(Constants.LOGIN_USER_KEY, token); + return createToken(claims); + } + + /** + * 验证令牌有效期,相差不足20分钟,自动刷新缓存 + * + * @param token 令牌 + * @return 令牌 + */ + public void verifyToken(LoginUser loginUser) + { + long expireTime = loginUser.getExpireTime(); + long currentTime = System.currentTimeMillis(); + if (expireTime - currentTime <= MILLIS_MINUTE_TEN) + { + refreshToken(loginUser); + } + } + + /** + * 刷新令牌有效期 + * + * @param loginUser 登录信息 + */ + public void refreshToken(LoginUser loginUser) + { + loginUser.setLoginTime(System.currentTimeMillis()); + loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE); + // 根据uuid将loginUser缓存 + String userKey = getTokenKey(loginUser.getToken()); + redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES); + } + + /** + * 设置用户代理信息 + * + * @param loginUser 登录信息 + */ + public void setUserAgent(LoginUser loginUser) + { + UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); + String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); + loginUser.setIpaddr(ip); + loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip)); + loginUser.setBrowser(userAgent.getBrowser().getName()); + loginUser.setOs(userAgent.getOperatingSystem().getName()); + } + + /** + * 从数据声明生成令牌 + * + * @param claims 数据声明 + * @return 令牌 + */ + private String createToken(Map claims) + { + String token = Jwts.builder() + .setClaims(claims) + .signWith(SignatureAlgorithm.HS512, secret).compact(); + return token; + } + + /** + * 从令牌中获取数据声明 + * + * @param token 令牌 + * @return 数据声明 + */ + private Claims parseToken(String token) + { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } + + /** + * 从令牌中获取用户名 + * + * @param token 令牌 + * @return 用户名 + */ + public String getUsernameFromToken(String token) + { + Claims claims = parseToken(token); + return claims.getSubject(); + } + + /** + * 获取请求token + * + * @param request + * @return token + */ + private String getToken(HttpServletRequest request) + { + String token = request.getHeader(header); + if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) + { + token = token.replace(Constants.TOKEN_PREFIX, ""); + } + return token; + } + + private String getTokenKey(String uuid) + { + return Constants.LOGIN_TOKEN_KEY + uuid; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/security/service/UserDetailsServiceImpl.java b/evo/src/main/java/com/ruoyi/framework/security/service/UserDetailsServiceImpl.java new file mode 100644 index 0000000..67a7ecc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/security/service/UserDetailsServiceImpl.java @@ -0,0 +1,60 @@ +package com.ruoyi.framework.security.service; + +import com.ruoyi.project.system.service.ISysUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; +import com.ruoyi.common.enums.UserStatus; +import com.ruoyi.common.exception.BaseException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 用户验证处理 + * + * @author ruoyi + */ +@Service +public class UserDetailsServiceImpl implements UserDetailsService +{ + private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class); + + @Autowired + private ISysUserService userService; + + @Autowired + private SysPermissionService permissionService; + + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException + { + SysUser user = userService.selectUserByUserName(username); + if (StringUtils.isNull(user)) + { + log.info("登录用户:{} 不存在.", username); + throw new UsernameNotFoundException("登录用户:" + username + " 不存在"); + } + else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) + { + log.info("登录用户:{} 已被删除.", username); + throw new BaseException("对不起,您的账号:" + username + " 已被删除"); + } + else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) + { + log.info("登录用户:{} 已被停用.", username); + throw new BaseException("对不起,您的账号:" + username + " 已停用"); + } + + return createLoginUser(user); + } + + public UserDetails createLoginUser(SysUser user) + { + return new LoginUser(user, permissionService.getMenuPermission(user)); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/task/RyTask.java b/evo/src/main/java/com/ruoyi/framework/task/RyTask.java new file mode 100644 index 0000000..eb7f5b9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/task/RyTask.java @@ -0,0 +1,28 @@ +package com.ruoyi.framework.task; + +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.StringUtils; + +/** + * 定时任务调度测试 + * + * @author ruoyi + */ +@Component("ryTask") +public class RyTask +{ + public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) + { + System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); + } + + public void ryParams(String params) + { + System.out.println("执行有参方法:" + params); + } + + public void ryNoParams() + { + System.out.println("执行无参方法"); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/controller/BaseController.java b/evo/src/main/java/com/ruoyi/framework/web/controller/BaseController.java new file mode 100644 index 0000000..d131e70 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/controller/BaseController.java @@ -0,0 +1,86 @@ +package com.ruoyi.framework.web.controller; + +import java.beans.PropertyEditorSupport; +import java.util.Date; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.sql.SqlUtil; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.PageDomain; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.framework.web.page.TableSupport; + +/** + * web层通用数据处理 + * + * @author ruoyi + */ +public class BaseController +{ + protected final Logger logger = LoggerFactory.getLogger(BaseController.class); + + /** + * 将前台传递过来的日期格式的字符串,自动转化为Date类型 + */ + @InitBinder + public void initBinder(WebDataBinder binder) + { + // Date 类型转换 + binder.registerCustomEditor(Date.class, new PropertyEditorSupport() + { + @Override + public void setAsText(String text) + { + setValue(DateUtils.parseDate(text)); + } + }); + } + + /** + * 设置请求分页数据 + */ + protected void startPage() + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) + { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + PageHelper.startPage(pageNum, pageSize, orderBy); + } + } + + /** + * 响应请求分页数据 + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected TableDataInfo getDataTable(List list) + { + TableDataInfo rspData = new TableDataInfo(); + rspData.setCode(HttpStatus.SUCCESS); + rspData.setMsg("查询成功"); + rspData.setRows(list); + rspData.setTotal(new PageInfo(list).getTotal()); + return rspData; + } + + /** + * 响应返回结果 + * + * @param rows 影响行数 + * @return 操作结果 + */ + protected AjaxResult toAjax(int rows) + { + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java b/evo/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java new file mode 100644 index 0000000..84c0dbf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java @@ -0,0 +1,148 @@ +package com.ruoyi.framework.web.domain; + +import java.util.HashMap; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.utils.StringUtils; + +/** + * 操作消息提醒 + * + * @author ruoyi + */ +public class AjaxResult extends HashMap +{ + private static final long serialVersionUID = 1L; + + /** 状态码 */ + public static final String CODE_TAG = "code"; + + /** 返回内容 */ + public static final String MSG_TAG = "msg"; + + /** 数据对象 */ + public static final String DATA_TAG = "data"; + + /** + * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 + */ + public AjaxResult() + { + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + */ + public AjaxResult(int code, String msg) + { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + * @param data 数据对象 + */ + public AjaxResult(int code, String msg, Object data) + { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + if (StringUtils.isNotNull(data)) + { + super.put(DATA_TAG, data); + } + } + + /** + * 返回成功消息 + * + * @return 成功消息 + */ + public static AjaxResult success() + { + return AjaxResult.success("操作成功"); + } + + /** + * 返回成功数据 + * + * @return 成功消息 + */ + public static AjaxResult success(Object data) + { + return AjaxResult.success("操作成功", data); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @return 成功消息 + */ + public static AjaxResult success(String msg) + { + return AjaxResult.success(msg, null); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 成功消息 + */ + public static AjaxResult success(String msg, Object data) + { + return new AjaxResult(HttpStatus.SUCCESS, msg, data); + } + + /** + * 返回错误消息 + * + * @return + */ + public static AjaxResult error() + { + return AjaxResult.error("操作失败"); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @return 警告消息 + */ + public static AjaxResult error(String msg) + { + return AjaxResult.error(msg, null); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 警告消息 + */ + public static AjaxResult error(String msg, Object data) + { + return new AjaxResult(HttpStatus.ERROR, msg, data); + } + + /** + * 返回错误消息 + * + * @param code 状态码 + * @param msg 返回内容 + * @return 警告消息 + */ + public static AjaxResult error(int code, String msg) + { + return new AjaxResult(code, msg, null); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java b/evo/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java new file mode 100644 index 0000000..23f1884 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java @@ -0,0 +1,167 @@ +package com.ruoyi.framework.web.domain; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** + * Entity基类 + * + * @author ruoyi + */ +public class BaseEntity implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 搜索值 */ + private String searchValue; + + /** 创建者 */ + private String createBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新者 */ + private String updateBy; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** 备注 */ + private String remark; + + /** 开始时间 */ + @JsonIgnore + private String beginTime; + + /** 结束时间 */ + @JsonIgnore + private String endTime; + + /** 开始时间 */ + @JsonIgnore + private String beginTimeTwo; + + /** 结束时间 */ + @JsonIgnore + private String endTimeTwo; + + /** 请求参数 */ + private Map params; + + public String getSearchValue() + { + return searchValue; + } + + public void setSearchValue(String searchValue) + { + this.searchValue = searchValue; + } + + public String getCreateBy() + { + return createBy; + } + + public void setCreateBy(String createBy) + { + this.createBy = createBy; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public String getUpdateBy() + { + return updateBy; + } + + public void setUpdateBy(String updateBy) + { + this.updateBy = updateBy; + } + + public Date getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Date updateTime) + { + this.updateTime = updateTime; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public String getBeginTime() + { + return beginTime; + } + + public void setBeginTime(String beginTime) + { + this.beginTime = beginTime; + } + + public String getEndTime() + { + return endTime; + } + + public void setEndTime(String endTime) + { + this.endTime = endTime; + } + + public String getBeginTimeTwo() { + return beginTimeTwo; + } + + public void setBeginTimeTwo(String beginTimeTwo) { + this.beginTimeTwo = beginTimeTwo; + } + + public String getEndTimeTwo() { + return endTimeTwo; + } + + public void setEndTimeTwo(String endTimeTwo) { + this.endTimeTwo = endTimeTwo; + } + + public Map getParams() + { + if (params == null) + { + params = new HashMap<>(); + } + return params; + } + + public void setParams(Map params) + { + this.params = params; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/Server.java b/evo/src/main/java/com/ruoyi/framework/web/domain/Server.java new file mode 100644 index 0000000..7ffa538 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/Server.java @@ -0,0 +1,240 @@ +package com.ruoyi.framework.web.domain; + +import java.net.UnknownHostException; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; +import com.ruoyi.common.utils.Arith; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.framework.web.domain.server.Cpu; +import com.ruoyi.framework.web.domain.server.Jvm; +import com.ruoyi.framework.web.domain.server.Mem; +import com.ruoyi.framework.web.domain.server.Sys; +import com.ruoyi.framework.web.domain.server.SysFile; +import oshi.SystemInfo; +import oshi.hardware.CentralProcessor; +import oshi.hardware.CentralProcessor.TickType; +import oshi.hardware.GlobalMemory; +import oshi.hardware.HardwareAbstractionLayer; +import oshi.software.os.FileSystem; +import oshi.software.os.OSFileStore; +import oshi.software.os.OperatingSystem; +import oshi.util.Util; + +/** + * 服务器相关信息 + * + * @author ruoyi + */ +public class Server +{ + private static final int OSHI_WAIT_SECOND = 1000; + + /** + * CPU相关信息 + */ + private Cpu cpu = new Cpu(); + + /** + * 內存相关信息 + */ + private Mem mem = new Mem(); + + /** + * JVM相关信息 + */ + private Jvm jvm = new Jvm(); + + /** + * 服务器相关信息 + */ + private Sys sys = new Sys(); + + /** + * 磁盘相关信息 + */ + private List sysFiles = new LinkedList(); + + public Cpu getCpu() + { + return cpu; + } + + public void setCpu(Cpu cpu) + { + this.cpu = cpu; + } + + public Mem getMem() + { + return mem; + } + + public void setMem(Mem mem) + { + this.mem = mem; + } + + public Jvm getJvm() + { + return jvm; + } + + public void setJvm(Jvm jvm) + { + this.jvm = jvm; + } + + public Sys getSys() + { + return sys; + } + + public void setSys(Sys sys) + { + this.sys = sys; + } + + public List getSysFiles() + { + return sysFiles; + } + + public void setSysFiles(List sysFiles) + { + this.sysFiles = sysFiles; + } + + public void copyTo() throws Exception + { + SystemInfo si = new SystemInfo(); + HardwareAbstractionLayer hal = si.getHardware(); + + setCpuInfo(hal.getProcessor()); + + setMemInfo(hal.getMemory()); + + setSysInfo(); + + setJvmInfo(); + + setSysFiles(si.getOperatingSystem()); + } + + /** + * 设置CPU信息 + */ + private void setCpuInfo(CentralProcessor processor) + { + // CPU信息 + long[] prevTicks = processor.getSystemCpuLoadTicks(); + Util.sleep(OSHI_WAIT_SECOND); + long[] ticks = processor.getSystemCpuLoadTicks(); + long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()]; + long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()]; + long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()]; + long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()]; + long cSys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()]; + long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()]; + long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()]; + long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()]; + long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal; + cpu.setCpuNum(processor.getLogicalProcessorCount()); + cpu.setTotal(totalCpu); + cpu.setSys(cSys); + cpu.setUsed(user); + cpu.setWait(iowait); + cpu.setFree(idle); + } + + /** + * 设置内存信息 + */ + private void setMemInfo(GlobalMemory memory) + { + mem.setTotal(memory.getTotal()); + mem.setUsed(memory.getTotal() - memory.getAvailable()); + mem.setFree(memory.getAvailable()); + } + + /** + * 设置服务器信息 + */ + private void setSysInfo() + { + Properties props = System.getProperties(); + sys.setComputerName(IpUtils.getHostName()); + sys.setComputerIp(IpUtils.getHostIp()); + sys.setOsName(props.getProperty("os.name")); + sys.setOsArch(props.getProperty("os.arch")); + sys.setUserDir(props.getProperty("user.dir")); + } + + /** + * 设置Java虚拟机 + */ + private void setJvmInfo() throws UnknownHostException + { + Properties props = System.getProperties(); + jvm.setTotal(Runtime.getRuntime().totalMemory()); + jvm.setMax(Runtime.getRuntime().maxMemory()); + jvm.setFree(Runtime.getRuntime().freeMemory()); + jvm.setVersion(props.getProperty("java.version")); + jvm.setHome(props.getProperty("java.home")); + } + + /** + * 设置磁盘信息 + */ + private void setSysFiles(OperatingSystem os) + { + FileSystem fileSystem = os.getFileSystem(); + OSFileStore[] fsArray = fileSystem.getFileStores(); + for (OSFileStore fs : fsArray) + { + long free = fs.getUsableSpace(); + long total = fs.getTotalSpace(); + long used = total - free; + SysFile sysFile = new SysFile(); + sysFile.setDirName(fs.getMount()); + sysFile.setSysTypeName(fs.getType()); + sysFile.setTypeName(fs.getName()); + sysFile.setTotal(convertFileSize(total)); + sysFile.setFree(convertFileSize(free)); + sysFile.setUsed(convertFileSize(used)); + sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100)); + sysFiles.add(sysFile); + } + } + + /** + * 字节转换 + * + * @param size 字节大小 + * @return 转换后值 + */ + public String convertFileSize(long size) + { + long kb = 1024; + long mb = kb * 1024; + long gb = mb * 1024; + if (size >= gb) + { + return String.format("%.1f GB", (float) size / gb); + } + else if (size >= mb) + { + float f = (float) size / mb; + return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f); + } + else if (size >= kb) + { + float f = (float) size / kb; + return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f); + } + else + { + return String.format("%d B", size); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/TreeEntity.java b/evo/src/main/java/com/ruoyi/framework/web/domain/TreeEntity.java new file mode 100644 index 0000000..b071425 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/TreeEntity.java @@ -0,0 +1,79 @@ +package com.ruoyi.framework.web.domain; + +import java.util.ArrayList; +import java.util.List; + +/** + * Tree基类 + * + * @author ruoyi + */ +public class TreeEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 父菜单名称 */ + private String parentName; + + /** 父菜单ID */ + private Long parentId; + + /** 显示顺序 */ + private Integer orderNum; + + /** 祖级列表 */ + private String ancestors; + + /** 子部门 */ + private List children = new ArrayList<>(); + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + public String getAncestors() + { + return ancestors; + } + + public void setAncestors(String ancestors) + { + this.ancestors = ancestors; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java b/evo/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java new file mode 100644 index 0000000..680d65b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java @@ -0,0 +1,77 @@ +package com.ruoyi.framework.web.domain; + +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysMenu; + +/** + * Treeselect树结构实体类 + * + * @author ruoyi + */ +public class TreeSelect implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 节点ID */ + private Long id; + + /** 节点名称 */ + private String label; + + /** 子节点 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + public TreeSelect() + { + + } + + public TreeSelect(SysDept dept) + { + this.id = dept.getDeptId(); + this.label = dept.getDeptName(); + this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + public TreeSelect(SysMenu menu) + { + this.id = menu.getMenuId(); + this.label = menu.getMenuName(); + this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getLabel() + { + return label; + } + + public void setLabel(String label) + { + this.label = label; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java new file mode 100644 index 0000000..a13a66c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java @@ -0,0 +1,101 @@ +package com.ruoyi.framework.web.domain.server; + +import com.ruoyi.common.utils.Arith; + +/** + * CPU相关信息 + * + * @author ruoyi + */ +public class Cpu +{ + /** + * 核心数 + */ + private int cpuNum; + + /** + * CPU总的使用率 + */ + private double total; + + /** + * CPU系统使用率 + */ + private double sys; + + /** + * CPU用户使用率 + */ + private double used; + + /** + * CPU当前等待率 + */ + private double wait; + + /** + * CPU当前空闲率 + */ + private double free; + + public int getCpuNum() + { + return cpuNum; + } + + public void setCpuNum(int cpuNum) + { + this.cpuNum = cpuNum; + } + + public double getTotal() + { + return Arith.round(Arith.mul(total, 100), 2); + } + + public void setTotal(double total) + { + this.total = total; + } + + public double getSys() + { + return Arith.round(Arith.mul(sys / total, 100), 2); + } + + public void setSys(double sys) + { + this.sys = sys; + } + + public double getUsed() + { + return Arith.round(Arith.mul(used / total, 100), 2); + } + + public void setUsed(double used) + { + this.used = used; + } + + public double getWait() + { + return Arith.round(Arith.mul(wait / total, 100), 2); + } + + public void setWait(double wait) + { + this.wait = wait; + } + + public double getFree() + { + return Arith.round(Arith.mul(free / total, 100), 2); + } + + public void setFree(double free) + { + this.free = free; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java new file mode 100644 index 0000000..485d201 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java @@ -0,0 +1,122 @@ +package com.ruoyi.framework.web.domain.server; + +import java.lang.management.ManagementFactory; +import com.ruoyi.common.utils.Arith; +import com.ruoyi.common.utils.DateUtils; + +/** + * JVM相关信息 + * + * @author ruoyi + */ +public class Jvm +{ + /** + * 当前JVM占用的内存总数(M) + */ + private double total; + + /** + * JVM最大可用内存总数(M) + */ + private double max; + + /** + * JVM空闲内存(M) + */ + private double free; + + /** + * JDK版本 + */ + private String version; + + /** + * JDK路径 + */ + private String home; + + public double getTotal() + { + return Arith.div(total, (1024 * 1024), 2); + } + + public void setTotal(double total) + { + this.total = total; + } + + public double getMax() + { + return Arith.div(max, (1024 * 1024), 2); + } + + public void setMax(double max) + { + this.max = max; + } + + public double getFree() + { + return Arith.div(free, (1024 * 1024), 2); + } + + public void setFree(double free) + { + this.free = free; + } + + public double getUsed() + { + return Arith.div(total - free, (1024 * 1024), 2); + } + + public double getUsage() + { + return Arith.mul(Arith.div(total - free, total, 4), 100); + } + + /** + * 获取JDK名称 + */ + public String getName() + { + return ManagementFactory.getRuntimeMXBean().getVmName(); + } + + public String getVersion() + { + return version; + } + + public void setVersion(String version) + { + this.version = version; + } + + public String getHome() + { + return home; + } + + public void setHome(String home) + { + this.home = home; + } + + /** + * JDK启动时间 + */ + public String getStartTime() + { + return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()); + } + + /** + * JDK运行时间 + */ + public String getRunTime() + { + return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java new file mode 100644 index 0000000..13eec52 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java @@ -0,0 +1,61 @@ +package com.ruoyi.framework.web.domain.server; + +import com.ruoyi.common.utils.Arith; + +/** + * 內存相关信息 + * + * @author ruoyi + */ +public class Mem +{ + /** + * 内存总量 + */ + private double total; + + /** + * 已用内存 + */ + private double used; + + /** + * 剩余内存 + */ + private double free; + + public double getTotal() + { + return Arith.div(total, (1024 * 1024 * 1024), 2); + } + + public void setTotal(long total) + { + this.total = total; + } + + public double getUsed() + { + return Arith.div(used, (1024 * 1024 * 1024), 2); + } + + public void setUsed(long used) + { + this.used = used; + } + + public double getFree() + { + return Arith.div(free, (1024 * 1024 * 1024), 2); + } + + public void setFree(long free) + { + this.free = free; + } + + public double getUsage() + { + return Arith.mul(Arith.div(used, total, 4), 100); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java new file mode 100644 index 0000000..45d64d9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java @@ -0,0 +1,84 @@ +package com.ruoyi.framework.web.domain.server; + +/** + * 系统相关信息 + * + * @author ruoyi + */ +public class Sys +{ + /** + * 服务器名称 + */ + private String computerName; + + /** + * 服务器Ip + */ + private String computerIp; + + /** + * 项目路径 + */ + private String userDir; + + /** + * 操作系统 + */ + private String osName; + + /** + * 系统架构 + */ + private String osArch; + + public String getComputerName() + { + return computerName; + } + + public void setComputerName(String computerName) + { + this.computerName = computerName; + } + + public String getComputerIp() + { + return computerIp; + } + + public void setComputerIp(String computerIp) + { + this.computerIp = computerIp; + } + + public String getUserDir() + { + return userDir; + } + + public void setUserDir(String userDir) + { + this.userDir = userDir; + } + + public String getOsName() + { + return osName; + } + + public void setOsName(String osName) + { + this.osName = osName; + } + + public String getOsArch() + { + return osArch; + } + + public void setOsArch(String osArch) + { + this.osArch = osArch; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java b/evo/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java new file mode 100644 index 0000000..1320cde --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java @@ -0,0 +1,114 @@ +package com.ruoyi.framework.web.domain.server; + +/** + * 系统文件相关信息 + * + * @author ruoyi + */ +public class SysFile +{ + /** + * 盘符路径 + */ + private String dirName; + + /** + * 盘符类型 + */ + private String sysTypeName; + + /** + * 文件类型 + */ + private String typeName; + + /** + * 总大小 + */ + private String total; + + /** + * 剩余大小 + */ + private String free; + + /** + * 已经使用量 + */ + private String used; + + /** + * 资源的使用率 + */ + private double usage; + + public String getDirName() + { + return dirName; + } + + public void setDirName(String dirName) + { + this.dirName = dirName; + } + + public String getSysTypeName() + { + return sysTypeName; + } + + public void setSysTypeName(String sysTypeName) + { + this.sysTypeName = sysTypeName; + } + + public String getTypeName() + { + return typeName; + } + + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTotal() + { + return total; + } + + public void setTotal(String total) + { + this.total = total; + } + + public String getFree() + { + return free; + } + + public void setFree(String free) + { + this.free = free; + } + + public String getUsed() + { + return used; + } + + public void setUsed(String used) + { + this.used = used; + } + + public double getUsage() + { + return usage; + } + + public void setUsage(double usage) + { + this.usage = usage; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/evo/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..9450a55 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -0,0 +1,117 @@ +package com.ruoyi.framework.web.exception; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.AccountExpiredException; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.validation.BindException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.NoHandlerFoundException; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.exception.BaseException; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.DemoModeException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.AjaxResult; + +/** + * 全局异常处理器 + * + * @author ruoyi + */ +@RestControllerAdvice +public class GlobalExceptionHandler +{ + private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); + + /** + * 基础异常 + */ + @ExceptionHandler(BaseException.class) + public AjaxResult baseException(BaseException e) + { + return AjaxResult.error(e.getMessage()); + } + + /** + * 业务异常 + */ + @ExceptionHandler(CustomException.class) + public AjaxResult businessException(CustomException e) + { + if (StringUtils.isNull(e.getCode())) + { + return AjaxResult.error(e.getMessage()); + } + return AjaxResult.error(e.getCode(), e.getMessage()); + } + + @ExceptionHandler(NoHandlerFoundException.class) + public AjaxResult handlerNoFoundException(Exception e) + { + log.error(e.getMessage(), e); + return AjaxResult.error(HttpStatus.NOT_FOUND, "路径不存在,请检查路径是否正确"); + } + + @ExceptionHandler(AccessDeniedException.class) + public AjaxResult handleAuthorizationException(AccessDeniedException e) + { + log.error(e.getMessage()); + return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权"); + } + + @ExceptionHandler(AccountExpiredException.class) + public AjaxResult handleAccountExpiredException(AccountExpiredException e) + { + log.error(e.getMessage(), e); + return AjaxResult.error(e.getMessage()); + } + + @ExceptionHandler(UsernameNotFoundException.class) + public AjaxResult handleUsernameNotFoundException(UsernameNotFoundException e) + { + log.error(e.getMessage(), e); + return AjaxResult.error(e.getMessage()); + } + + @ExceptionHandler(Exception.class) + public AjaxResult handleException(Exception e) + { + log.error(e.getMessage(), e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(BindException.class) + public AjaxResult validatedBindException(BindException e) + { + log.error(e.getMessage(), e); + String message = e.getAllErrors().get(0).getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public Object validExceptionHandler(MethodArgumentNotValidException e) + { + log.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 演示模式异常 + */ + @ExceptionHandler(DemoModeException.class) + public AjaxResult demoModeException(DemoModeException e) + { + return AjaxResult.error("演示模式,不允许操作"); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/page/PageDomain.java b/evo/src/main/java/com/ruoyi/framework/web/page/PageDomain.java new file mode 100644 index 0000000..84f7004 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/page/PageDomain.java @@ -0,0 +1,69 @@ +package com.ruoyi.framework.web.page; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 分页数据 + * + * @author ruoyi + */ +public class PageDomain +{ + /** 当前记录起始索引 */ + private Integer pageNum; + /** 每页显示记录数 */ + private Integer pageSize; + /** 排序列 */ + private String orderByColumn; + /** 排序的方向 "desc" 或者 "asc". */ + private String isAsc; + + public String getOrderBy() + { + if (StringUtils.isEmpty(orderByColumn)) + { + return ""; + } + return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; + } + + public Integer getPageNum() + { + return pageNum; + } + + public void setPageNum(Integer pageNum) + { + this.pageNum = pageNum; + } + + public Integer getPageSize() + { + return pageSize; + } + + public void setPageSize(Integer pageSize) + { + this.pageSize = pageSize; + } + + public String getOrderByColumn() + { + return orderByColumn; + } + + public void setOrderByColumn(String orderByColumn) + { + this.orderByColumn = orderByColumn; + } + + public String getIsAsc() + { + return isAsc; + } + + public void setIsAsc(String isAsc) + { + this.isAsc = isAsc; + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java b/evo/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java new file mode 100644 index 0000000..c44e527 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java @@ -0,0 +1,85 @@ +package com.ruoyi.framework.web.page; + +import java.io.Serializable; +import java.util.List; + +/** + * 表格分页数据对象 + * + * @author ruoyi + */ +public class TableDataInfo implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 总记录数 */ + private long total; + + /** 列表数据 */ + private List rows; + + /** 消息状态码 */ + private int code; + + /** 消息内容 */ + private String msg; + + /** + * 表格数据对象 + */ + public TableDataInfo() + { + } + + /** + * 分页 + * + * @param list 列表数据 + * @param total 总记录数 + */ + public TableDataInfo(List list, int total) + { + this.rows = list; + this.total = total; + } + + public long getTotal() + { + return total; + } + + public void setTotal(long total) + { + this.total = total; + } + + public List getRows() + { + return rows; + } + + public void setRows(List rows) + { + this.rows = rows; + } + + public int getCode() + { + return code; + } + + public void setCode(int code) + { + this.code = code; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/framework/web/page/TableSupport.java b/evo/src/main/java/com/ruoyi/framework/web/page/TableSupport.java new file mode 100644 index 0000000..156417a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/web/page/TableSupport.java @@ -0,0 +1,49 @@ +package com.ruoyi.framework.web.page; + +import com.ruoyi.common.utils.ServletUtils; + +/** + * 表格数据处理 + * + * @author ruoyi + */ +public class TableSupport +{ + /** + * 当前记录起始索引 + */ + public static final String PAGE_NUM = "pageNum"; + + /** + * 每页显示记录数 + */ + public static final String PAGE_SIZE = "pageSize"; + + /** + * 排序列 + */ + public static final String ORDER_BY_COLUMN = "orderByColumn"; + + /** + * 排序的方向 "desc" 或者 "asc". + */ + public static final String IS_ASC = "isAsc"; + + /** + * 封装分页对象 + */ + public static PageDomain getPageDomain() + { + PageDomain pageDomain = new PageDomain(); + pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM)); + pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE)); + pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); + pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); + return pageDomain; + } + + public static PageDomain buildPageRequest() + { + return getPageDomain(); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/websocket/SemaphoreUtils.java b/evo/src/main/java/com/ruoyi/framework/websocket/SemaphoreUtils.java new file mode 100644 index 0000000..57567f3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/websocket/SemaphoreUtils.java @@ -0,0 +1,58 @@ +package com.ruoyi.framework.websocket; + +import java.util.concurrent.Semaphore; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 信号量相关处理 + * + * @author ruoyi + */ +public class SemaphoreUtils +{ + /** + * SemaphoreUtils 日志控制器 + */ + private static final Logger LOGGER = LoggerFactory.getLogger(SemaphoreUtils.class); + + /** + * 获取信号量 + * + * @param semaphore + * @return + */ + public static boolean tryAcquire(Semaphore semaphore) + { + boolean flag = false; + + try + { + flag = semaphore.tryAcquire(); + } + catch (Exception e) + { + LOGGER.error("获取信号量异常", e); + } + + return flag; + } + + /** + * 释放信号量 + * + * @param semaphore + */ + public static void release(Semaphore semaphore) + { + + try + { + semaphore.release(); + } + catch (Exception e) + { + LOGGER.error("释放信号量异常", e); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketConfig.java b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketConfig.java new file mode 100644 index 0000000..b0934a9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketConfig.java @@ -0,0 +1,23 @@ +package com.ruoyi.framework.websocket; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +/** + * websocket 配置 + * + * @author ruoyi + */ +// 服务器上需要此注解,本地不需要,springBoot加上此注解,websocket无法连接,服务器上是外置的tomcat,所以得加此注解 +@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev") +@Configuration +public class WebSocketConfig +{ + @Bean + public ServerEndpointExporter serverEndpointExporter() + { + return new ServerEndpointExporter(); + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketServer.java b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketServer.java new file mode 100644 index 0000000..83ce6b1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketServer.java @@ -0,0 +1,179 @@ +package com.ruoyi.framework.websocket; + +import java.util.Date; +import java.util.concurrent.Semaphore; +import javax.websocket.OnClose; +import javax.websocket.OnError; +import javax.websocket.OnMessage; +import javax.websocket.OnOpen; +import javax.websocket.Session; +import javax.websocket.server.ServerEndpoint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.stereotype.Component; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.project.management.domain.CwSnDetail; +import com.ruoyi.project.management.service.ICwSnDetailService; + +/** + * websocket 消息处理 + * + * @author ruoyi + */ +@ConditionalOnClass(value = WebSocketServer.class) +@Component +@ServerEndpoint("/websocket/message") +public class WebSocketServer{ + + private static ICwSnDetailService cwSnDetailService; + + @Autowired + public void setBrandService(ICwSnDetailService cwSnDetailService) { + WebSocketServer.cwSnDetailService = cwSnDetailService; + } + + /** + * WebSocketServer 日志控制器 + */ + private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketServer.class); + + /** + * 默认最多允许同时在线人数100 + */ + public static int socketMaxOnlineCount = 100; + + private static Semaphore socketSemaphore = new Semaphore(socketMaxOnlineCount); + + /** + * 连接建立成功调用的方法 + */ + @OnOpen + public void onOpen(Session session) throws Exception{ + boolean semaphoreFlag = false; + // 尝试获取信号量 + semaphoreFlag = SemaphoreUtils.tryAcquire(socketSemaphore); + if (!semaphoreFlag){ + // 未获取到信号量 + LOGGER.error("\n 当前在线人数超过限制数- {}", socketMaxOnlineCount); + WebSocketUsers.sendMessageToUserByText(session, "当前在线人数超过限制数:" + socketMaxOnlineCount); + session.close(); + }else{ + // 添加用户 + WebSocketUsers.put(session.getId(), session); + LOGGER.info("\n 建立连接 - {}", session); + LOGGER.info("\n 当前人数 - {}", WebSocketUsers.getUsers().size()); + } + } + + /** + * 连接关闭时处理 + */ + @OnClose + public void onClose(Session session) + { + LOGGER.info("\n 关闭连接 - {}", session); + // 移除用户 + WebSocketUsers.remove(session.getId()); + // 获取到信号量则需释放 + SemaphoreUtils.release(socketSemaphore); + } + + /** + * 抛出异常时处理 + */ + @OnError + public void onError(Session session, Throwable exception) throws Exception + { + if (session.isOpen()) + { + // 关闭连接 + session.close(); + } + String sessionId = session.getId(); + LOGGER.info("\n 连接异常 - {}", sessionId); + LOGGER.info("\n 异常信息 - {}", exception); + // 移出用户 + WebSocketUsers.remove(sessionId); + // 获取到信号量则需释放 + SemaphoreUtils.release(socketSemaphore); + } + + /** + * 服务器接收到客户端消息时调用的方法 + */ + @OnMessage + public void onMessage(String message, Session session){ + + //解析客户端发送的消息 + JSONObject jsonObject = JSONObject.parseObject(message); + + System.out.println("shuju:"+jsonObject); + String cmd = jsonObject.getString("cmd"); + if(null != cmd&&cmd.equals("ping")){ + //心跳请求 + String s = "{\"cmd\":\"pong\"}"; + //单发user 返回 pong + WebSocketUsers.sendMessageToUserByText(session,s); + } + if(null != cmd&&cmd.equals("declare")){ + //客户端声明,判断设备信息表中是否有此设备的信息,如果有则修改,如果没有则新增 + //请求的数据 + String type = jsonObject.getString("type"); + //设备号 + String sn = jsonObject.getString("sn"); + //内部版本号 + String version_code = jsonObject.getString("version_code"); + //设备识别页面显示的版本号 + String version_name = jsonObject.getString("version_name"); + //token 是参数的默认名字, + String token = jsonObject.getString("token"); + //ip地址 + String ip = jsonObject.getString("ip"); + //设备当前时间,秒级别时间戳 + String timestamp = jsonObject.getString("timestamp"); + //根据设备号查询 + CwSnDetail snDetail = cwSnDetailService.selectCwSnDetailBySn(sn); + + //格式化时间 + Date date = new Date(); + if(null != timestamp){ + date.setTime(Long.valueOf(timestamp)*1000); + } + if(null != snDetail){ + //说明添加过此设备,修改 + snDetail.setVersionCode(version_code); + snDetail.setVersionName(version_name); + snDetail.setToken(token); + snDetail.setIp(ip); + snDetail.setSnTime(date); + snDetail.setType("已连接"); + + //修改 + cwSnDetailService.updateCwSnDetail(snDetail); + }else{ + //说明没有添加过此设备,添加 + snDetail = new CwSnDetail(); + //设备号 + snDetail.setSn(sn); + snDetail.setVersionCode(version_code); + snDetail.setVersionName(version_name); + snDetail.setToken(token); + snDetail.setIp(ip); + snDetail.setSnTime(date); + snDetail.setType("已连接"); + + //添加 + cwSnDetailService.insertCwSnDetail(snDetail); + } + }else{ + //群发 users +// WebSocketUsers.sendMessageToUsersByText(message); + //接受设备端返回的数据,先不做处理 + System.out.println("设备返回信息:"+message); + + } + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketTwoServer.java b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketTwoServer.java new file mode 100644 index 0000000..3f3ecac --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketTwoServer.java @@ -0,0 +1,98 @@ +package com.ruoyi.framework.websocket; + +import java.util.concurrent.Semaphore; +import javax.websocket.OnClose; +import javax.websocket.OnError; +import javax.websocket.OnMessage; +import javax.websocket.OnOpen; +import javax.websocket.Session; +import javax.websocket.server.ServerEndpoint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * websocket 消息处理 + * + * @author ruoyi + */ +//@Component +@ServerEndpoint("/websocketTwo/message") +public class WebSocketTwoServer{ + + + /** + * WebSocketServer 日志控制器 + */ + private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketTwoServer.class); + + /** + * 默认最多允许同时在线人数100 + */ + public static int socketMaxOnlineCount = 100; + + private static Semaphore socketSemaphore = new Semaphore(socketMaxOnlineCount); + + /** + * 连接建立成功调用的方法 + */ + @OnOpen + public void onOpen(Session session) throws Exception{ + boolean semaphoreFlag = false; + // 尝试获取信号量 + semaphoreFlag = SemaphoreUtils.tryAcquire(socketSemaphore); + if (!semaphoreFlag){ + // 未获取到信号量 + LOGGER.error("\n 当前在线人数超过限制数- {}", socketMaxOnlineCount); + WebSocketUsersTwo.sendMessageToUserByText(session, "当前在线人数超过限制数:" + socketMaxOnlineCount); + session.close(); + }else{ + // 添加用户 + WebSocketUsersTwo.put(session.getId(), session); + LOGGER.info("\n 建立连接 - {}", session); + LOGGER.info("\n 当前人数 - {}", WebSocketUsers.getUsers().size()); + } + } + + /** + * 连接关闭时处理 + */ + @OnClose + public void onClose(Session session) + { + LOGGER.info("\n 关闭连接 - {}", session); + // 移除用户 + WebSocketUsersTwo.remove(session.getId()); + // 获取到信号量则需释放 + SemaphoreUtils.release(socketSemaphore); + } + + /** + * 抛出异常时处理 + */ + @OnError + public void onError(Session session, Throwable exception) throws Exception + { + if (session.isOpen()) + { + // 关闭连接 + session.close(); + } + String sessionId = session.getId(); + LOGGER.info("\n 连接异常 - {}", sessionId); + LOGGER.info("\n 异常信息 - {}", exception); + // 移出用户 + WebSocketUsersTwo.remove(sessionId); + // 获取到信号量则需释放 + SemaphoreUtils.release(socketSemaphore); + } + + /** + * 服务器接收到客户端消息时调用的方法 + */ + @OnMessage + public void onMessage(String message, Session session){ + //群发 users + WebSocketUsersTwo.sendMessageToUsersByText(message); + } + +} diff --git a/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketUsers.java b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketUsers.java new file mode 100644 index 0000000..1e50dbd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketUsers.java @@ -0,0 +1,134 @@ +package com.ruoyi.framework.websocket; + +import java.io.IOException; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import javax.websocket.Session; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * websocket 客户端用户集 + * + * @author ruoyi + */ +public class WebSocketUsers +{ + /** + * WebSocketUsers 日志控制器 + */ + private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketUsers.class); + + /** + * 用户集 + */ + private static Map USERS = new ConcurrentHashMap(); + + /** + * 存储用户 + * + * @param key 唯一键 + * @param session 用户信息 + */ + public static void put(String key, Session session) + { + USERS.put(key, session); + } + + /** + * 移除用户 + * + * @param session 用户信息 + * + * @return 移除结果 + */ + public static boolean remove(Session session) + { + String key = null; + boolean flag = USERS.containsValue(session); + if (flag){ + Set> entries = USERS.entrySet(); + for (Map.Entry entry : entries){ + Session value = entry.getValue(); + if (value.equals(session)){ + key = entry.getKey(); + break; + } + } + } + else{ + return true; + } + return remove(key); + } + + /** + * 移出用户 + * + * @param key 键 + */ + public static boolean remove(String key) + { + LOGGER.info("\n 正在移出用户 - {}", key); + Session remove = USERS.remove(key); + if (remove != null){ + boolean containsValue = USERS.containsValue(remove); + LOGGER.info("\n 移出结果 - {}", containsValue ? "失败" : "成功"); + return containsValue; + } + else + { + return true; + } + } + + /** + * 获取在线用户列表 + * + * @return 返回用户集合 + */ + public static Map getUsers() + { + return USERS; + } + + /** + * 群发消息文本消息 + * + * @param message 消息内容 + */ + public static void sendMessageToUsersByText(String message){ + Collection values = USERS.values(); + for (Session value : values){ + sendMessageToUserByText(value, message); + } + } + + /** + * 发送文本消息 + * + * @param userName 自己的用户名 + * @param message 消息内容 + */ + public static void sendMessageToUserByText(Session session, String message) + { + if (session != null) + { + try + { + session.getBasicRemote().sendText(message); + System.out.println("发送成功:"+message); + } + catch (IOException e) + { + LOGGER.error("\n[发送消息异常]", e); + } + } + else + { + LOGGER.info("\n[你已离线]"); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketUsersTwo.java b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketUsersTwo.java new file mode 100644 index 0000000..b84cefc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/framework/websocket/WebSocketUsersTwo.java @@ -0,0 +1,133 @@ +package com.ruoyi.framework.websocket; + +import java.io.IOException; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import javax.websocket.Session; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * websocket 客户端用户集 + * + * @author ruoyi + */ +public class WebSocketUsersTwo +{ + /** + * WebSocketUsers 日志控制器 + */ + private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketUsersTwo.class); + + /** + * 用户集 + */ + private static Map USERS = new ConcurrentHashMap(); + + /** + * 存储用户 + * + * @param key 唯一键 + * @param session 用户信息 + */ + public static void put(String key, Session session) + { + USERS.put(key, session); + } + + /** + * 移除用户 + * + * @param session 用户信息 + * + * @return 移除结果 + */ + public static boolean remove(Session session) + { + String key = null; + boolean flag = USERS.containsValue(session); + if (flag){ + Set> entries = USERS.entrySet(); + for (Map.Entry entry : entries){ + Session value = entry.getValue(); + if (value.equals(session)){ + key = entry.getKey(); + break; + } + } + } + else{ + return true; + } + return remove(key); + } + + /** + * 移出用户 + * + * @param key 键 + */ + public static boolean remove(String key) + { + LOGGER.info("\n 正在移出用户 - {}", key); + Session remove = USERS.remove(key); + if (remove != null){ + boolean containsValue = USERS.containsValue(remove); + LOGGER.info("\n 移出结果 - {}", containsValue ? "失败" : "成功"); + return containsValue; + } + else + { + return true; + } + } + + /** + * 获取在线用户列表 + * + * @return 返回用户集合 + */ + public static Map getUsers() + { + return USERS; + } + + /** + * 群发消息文本消息 + * + * @param message 消息内容 + */ + public static void sendMessageToUsersByText(String message){ + Collection values = USERS.values(); + for (Session value : values){ + sendMessageToUserByText(value, message); + } + } + + /** + * 发送文本消息 + * + * @param userName 自己的用户名 + * @param message 消息内容 + */ + public static void sendMessageToUserByText(Session session, String message) + { + if (session != null) + { + try + { + session.getBasicRemote().sendText(message); + } + catch (IOException e) + { + LOGGER.error("\n[发送消息异常]", e); + } + } + else + { + LOGGER.info("\n[你已离线]"); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/project/common/CaptchaController.java b/evo/src/main/java/com/ruoyi/project/common/CaptchaController.java new file mode 100644 index 0000000..0ad77d5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/common/CaptchaController.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.common; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.IdUtils; +import com.ruoyi.common.utils.VerifyCodeUtils; +import com.ruoyi.common.utils.sign.Base64; +import com.ruoyi.framework.redis.RedisCache; +import com.ruoyi.framework.web.domain.AjaxResult; + +/** + * 验证码操作处理 + * + * @author ruoyi + */ +@RestController +public class CaptchaController +{ + @Autowired + private RedisCache redisCache; + + /** + * 生成验证码 + */ + @GetMapping("/captchaImage") + public AjaxResult getCode(HttpServletResponse response) throws IOException + { + // 生成随机字串 + String verifyCode = VerifyCodeUtils.generateVerifyCode(4); + // 唯一标识 + String uuid = IdUtils.simpleUUID(); + String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; + + redisCache.setCacheObject(verifyKey, verifyCode, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); + // 生成图片 + int w = 111, h = 36; + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + VerifyCodeUtils.outputImage(w, h, stream, verifyCode); + try + { + AjaxResult ajax = AjaxResult.success(); + ajax.put("uuid", uuid); + ajax.put("img", Base64.encode(stream.toByteArray())); + return ajax; + } + catch (Exception e) + { + e.printStackTrace(); + return AjaxResult.error(e.getMessage()); + } + finally + { + stream.close(); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/project/common/CommonController.java b/evo/src/main/java/com/ruoyi/project/common/CommonController.java new file mode 100644 index 0000000..7bb4837 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/common/CommonController.java @@ -0,0 +1,110 @@ +package com.ruoyi.project.common; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.FileUtils; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.config.ServerConfig; +import com.ruoyi.framework.web.domain.AjaxResult; + +/** + * 通用请求处理 + * + * @author ruoyi + */ +@RestController +public class CommonController +{ + private static final Logger log = LoggerFactory.getLogger(CommonController.class); + + @Autowired + private ServerConfig serverConfig; + + /** + * 通用下载请求 + * + * @param fileName 文件名称 + * @param delete 是否删除 + */ + @GetMapping("common/download") + public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) + { + try + { + if (!FileUtils.isValidFilename(fileName)) + { + throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); + } +// String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); + String realFileName = fileName.substring(fileName.indexOf("_") + 1); + String filePath = RuoYiConfig.getDownloadPath() + fileName; + + response.setCharacterEncoding("utf-8"); + response.setContentType("multipart/form-data"); + response.setHeader("Content-Disposition", + "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName)); + FileUtils.writeBytes(filePath, response.getOutputStream()); + if (delete) + { + FileUtils.deleteFile(filePath); + } + } + catch (Exception e) + { + log.error("下载文件失败", e); + } + } + + /** + * 通用上传请求 + */ + @PostMapping("/common/upload") + public AjaxResult uploadFile(MultipartFile file) throws Exception + { + try + { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + String url = serverConfig.getUrl() + fileName; + AjaxResult ajax = AjaxResult.success(); + ajax.put("fileName", fileName); + ajax.put("url", url); + return ajax; + } + catch (Exception e) + { + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 本地资源通用下载 + */ + @GetMapping("/common/download/resource") + public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception + { + // 本地资源路径 + String localPath = RuoYiConfig.getProfile(); + // 数据库资源地址 + String downloadPath = localPath + StringUtils.substringAfter(name, Constants.RESOURCE_PREFIX); + // 下载名称 + String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); + response.setCharacterEncoding("utf-8"); + response.setContentType("multipart/form-data"); + response.setHeader("Content-Disposition", + "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName)); + FileUtils.writeBytes(downloadPath, response.getOutputStream()); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/constant/Constants.java b/evo/src/main/java/com/ruoyi/project/management/constant/Constants.java new file mode 100644 index 0000000..35862d2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/constant/Constants.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.management.constant; + +public class Constants { + + //自动推送金蝶物参数 + public static final String MATERIAL_GROUP_ID = "YT222.01"; //物料分组ID + + public static final String BOM_GROUP_ID = "YT222.01"; //BOM分组ID + public static final String UNIT_ID = "jian"; //单位 + //仓库 + public static final String WAREHOUSE_BCP = "半成品库"; + public static final String WAREHOUSE_BZ = "标准件库"; + public static final String WAREHOUSE_ZZ = "非标零件库"; + //存货类别 + public static final String CATEGORY_BZJ = "标准件"; + public static final String CATEGORY_BCP = "半成品"; + public static final String CATEGORY_CCP = "产成品"; + public static final String CATEGORY_YCL = "原材料"; + public static final String MATERIAL_CL = "部件"; + + public static final String JD_DEPT_NAME_JJ = "机加车间"; //部门 + public static final String JD_DEPT_NAME_ZP = "装配车间"; //部门 + public static final String JD_DEPT_ID_JJCJ = "0501"; //部门ID + public static final String JD_DEPT_ID_ZPCJ = "0502"; //部门ID + public static final String UNIT_NAME = "件"; //单位名称 + + //审核状态 + public static final String AUDIT_STATUS_DSH = "待审核"; //单位名称 + public static final String AUDIT_STATUS_SHZ = "审核中"; //单位名称 + public static final String AUDIT_STATUS_YSH = "已审核"; //单位名称 + + //物料属性 + public static final String MATERIAL_ATTRIBUTE_WG = "外购"; + public static final String MATERIAL_ATTRIBUTE_ZZ = "自制"; + public static final String MATERIAL_ATTRIBUTE_WW = "委外"; + /** 推送状态 */ + public static final String PUSH_STATUS_YTS = "1"; + public static final String PUSH_STATUS_WTS = "0"; + + public static final String SYS_ERROR = "系统出错!!!"; //金蝶接口返回空的结果 + + public static final String JD_RESULT = "[]"; //金蝶接口返回空的结果 + + /** 金蝶业务状态参码 */ + public static final String ORDER_STATUS_A = "A"; //创建 + public static final String ORDER_STATUS_B = "B"; //审核中 + public static final String ORDER_STATUS_C = "C"; //已审核 + public static final String ORDER_STATUS_D = "D"; //重审 + public static final String ORDER_STATUS_Z = "Z"; //暂存 + + /** 金蝶业务标识码 */ + public static final String JD_FORMID_PLANNEDORDER = "PLN_PLANORDER"; + public static final String JD_MESSAGE_ERROR_FLAG = "0"; //错误信息显示标识 + public static final String JD_MESSAGE_TYPE = "计划订单"; //金蝶错误板块 计划订单 + public static final String JD_MESSAGE_SUBMIT = "提交"; //金蝶错误板块 计划订单提交 + public static final String JD_MESSAGE_AUDIT = "审核"; //金蝶错误板块 计划订单审核 + + /** 金蝶投放返回状态 */ + public static final String ADVERTISSING_SECCESS = "true"; + public static final String ADVERTISSING_TYPE = "CGSQD01_SYS"; //投放单据类型 + + //委外工序特殊处理 + public static final String PROCESS_TYPE = "DZ"; + + /** 图纸存放路径 */ + public static final String BASIC_URL = "E:/电子档案/1.标准图纸存放文件夹"; + public static final String BASIC_URL_BZ = "/1.1标准图纸"; + public static final String BASIC_URL_FB = "/1.3非标图纸/"; + public static final String XCL_URL = "/1.1.1 XCL-销齿链标准图纸/"; + public static final String ELS_URL = "/1.1.2 ELS-行程检测装置标准图纸/"; + public static final String EDS_URL = "/1.1.3 EDS-行程检测装置(带显示灯)标准图纸/"; + public static final String WB_URL = "/1.1.4 WB-舞台设备标准图纸/"; + public static final String QD_URL = "/1.1.5 QD-销齿链驱动单元标准图纸/"; + public static final String ZHD_URL = "/1.1.6 ZHD-中置换电标准图纸/"; + public static final String ETK_URL = "/1.1.7 ETK-K系列减速器标准图纸/"; + public static final String ETT_URL = "/1.1.8 ETT-T系列换向器标准图纸/"; + public static final String ETP_URL = "/1.1.9 ETP-P系列减速器标准图纸/"; + public static final String ETH_URL = "/1.1.10 ETH-H系列减速器标准图纸/"; + /** 删除标识 */ + public static final String DELETE_FLAG_1 = "1"; + public static final String DELETE_FLAG_0 = "0"; + + public static final String RETURN_MESSEGES_SUSSESS = "文件上传成功!"; //上传文件返回非法结果 + public static final String RETURN_MESSEGES_ERROR = "文件上传失败!"; //上传文件返回非法结果 + public static final String RETURN_MESSEGES_EMPTY = "上传文件为空!"; //上传文件返回非法结果 + public static final String RETURN_MESSEGES_0 = "禁止非法文件上传!"; //上传文件返回非法结果 + public static final String SEIZE_A_SEAT_0 = "0"; //占位符 + public static final String SEIZE_A_SEAT_1 = "00"; //占位符 + public static final String SEIZE_A_SEAT_2 = "000"; //占位符 + public static final String SEIZE_A_SEAT_3 = "0000"; //占位符 + public static final String SEIZE_A_SEAT_4 = "00000"; //占位符 + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/AutoInventoryIssueController.java b/evo/src/main/java/com/ruoyi/project/management/controller/AutoInventoryIssueController.java new file mode 100644 index 0000000..90d1432 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/AutoInventoryIssueController.java @@ -0,0 +1,127 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.AutoInventoryIssue; +import com.ruoyi.project.management.service.IAutoInventoryIssueService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 安全库存出单Controller + * + * @author chenyongjiang + * @date 2024-02-19 + */ +@RestController +@RequestMapping("/management/issue") +public class AutoInventoryIssueController extends BaseController +{ + @Autowired + private IAutoInventoryIssueService autoInventoryIssueService; + + /** + * 查询安全库存出单列表 + */ + @PreAuthorize("@ss.hasPermi('management:issue:list')") + @GetMapping("/list") + public TableDataInfo list(AutoInventoryIssue autoInventoryIssue) + { + startPage(); + List list = autoInventoryIssueService.selectAutoInventoryIssueList(autoInventoryIssue); + return getDataTable(list); + } + + /** + * 导出安全库存出单列表 + + @PreAuthorize("@ss.hasPermi('management:issue:export')") + @Log(title = "安全库存出单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(AutoInventoryIssue autoInventoryIssue) + { + List list = autoInventoryIssueService.selectAutoInventoryIssueList(autoInventoryIssue); + //修改导出标识 + for (AutoInventoryIssue inventoryIssue : list) { + inventoryIssue.setFlag("1"); + autoInventoryIssueService.updateAutoInventoryIssue(inventoryIssue); + } + ExcelUtil util = new ExcelUtil(AutoInventoryIssue.class); + return util.exportExcel(list, "issue"); + } + */ + + /** + * 导出安全库存出单列表 + */ + @PreAuthorize("@ss.hasPermi('management:issue:export')") + @Log(title = "安全库存出单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public List export(AutoInventoryIssue autoInventoryIssue) + { + List list = autoInventoryIssueService.selectAutoInventoryIssueList(autoInventoryIssue); + //修改导出标识 + for (AutoInventoryIssue inventoryIssue : list) { + inventoryIssue.setFlag("1"); + autoInventoryIssueService.updateAutoInventoryIssue(inventoryIssue); + } + //ExcelUtil util = new ExcelUtil(AutoInventoryIssue.class); + return list; + } + + /** + * 获取安全库存出单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:issue:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(autoInventoryIssueService.selectAutoInventoryIssueById(id)); + } + + /** + * 新增安全库存出单 + */ + @PreAuthorize("@ss.hasPermi('management:issue:add')") + @Log(title = "安全库存出单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody AutoInventoryIssue autoInventoryIssue) + { + return toAjax(autoInventoryIssueService.insertAutoInventoryIssue(autoInventoryIssue)); + } + + /** + * 修改安全库存出单 + */ + @PreAuthorize("@ss.hasPermi('management:issue:edit')") + @Log(title = "安全库存出单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody AutoInventoryIssue autoInventoryIssue) + { + return toAjax(autoInventoryIssueService.updateAutoInventoryIssue(autoInventoryIssue)); + } + + /** + * 删除安全库存出单 + */ + @PreAuthorize("@ss.hasPermi('management:issue:remove')") + @Log(title = "安全库存出单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(autoInventoryIssueService.deleteAutoInventoryIssueByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/BaseQuestionController.java b/evo/src/main/java/com/ruoyi/project/management/controller/BaseQuestionController.java new file mode 100644 index 0000000..7d60657 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/BaseQuestionController.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; + +import com.ruoyi.project.management.domain.BaseQuestion; +import com.ruoyi.project.management.service.IBaseQuestionService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 问题处理Controller + * + * @author zhukangchao + * @date 2023-10-07 + */ +@RestController +@RequestMapping("/question/question") +public class BaseQuestionController extends BaseController +{ + @Autowired + private IBaseQuestionService baseQuestionService; + + /** + * 查询问题处理列表 + */ + @PreAuthorize("@ss.hasPermi('question:question:list')") + @GetMapping("/list") + public TableDataInfo list(BaseQuestion baseQuestion) + { + startPage(); + List list = baseQuestionService.selectBaseQuestionList(baseQuestion); + return getDataTable(list); + } + + /** + * 导出问题处理列表 + */ + @PreAuthorize("@ss.hasPermi('question:question:export')") + @Log(title = "问题处理", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(BaseQuestion baseQuestion) + { + List list = baseQuestionService.selectBaseQuestionList(baseQuestion); + ExcelUtil util = new ExcelUtil(BaseQuestion.class); + return util.exportExcel(list, "question"); + } + + /** + * 获取问题处理详细信息 + */ + @PreAuthorize("@ss.hasPermi('question:question:query')") + @GetMapping(value = "/{questionId}") + public AjaxResult getInfo(@PathVariable("questionId") Long questionId) + { + return AjaxResult.success(baseQuestionService.selectBaseQuestionById(questionId)); + } + + /** + * 新增问题处理 + */ + @PreAuthorize("@ss.hasPermi('question:question:add')") + @Log(title = "问题处理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseQuestion baseQuestion) + { + return toAjax(baseQuestionService.insertBaseQuestion(baseQuestion)); + } + + /** + * 修改问题处理 + */ + @PreAuthorize("@ss.hasPermi('question:question:edit')") + @Log(title = "问题处理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseQuestion baseQuestion) + { + return toAjax(baseQuestionService.updateBaseQuestion(baseQuestion)); + } + + /** + * 删除问题处理 + */ + @PreAuthorize("@ss.hasPermi('question:question:remove')") + @Log(title = "问题处理", businessType = BusinessType.DELETE) + @DeleteMapping("/{questionId}") + public AjaxResult remove(@PathVariable Long questionId) + { + return toAjax(baseQuestionService.deleteBaseQuestionById(questionId)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CadMaterialInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CadMaterialInfoController.java new file mode 100644 index 0000000..ca03232 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CadMaterialInfoController.java @@ -0,0 +1,137 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CadMaterialInfo; +import com.ruoyi.project.management.service.ICadMaterialInfoService; + +import springfox.documentation.spring.web.json.Json; + +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * CAD物料明细Controller + * + * @author zhukangchao + * @date 2023-06-13 + */ +@RestController +@RequestMapping("/management/cadMaterialInfo") +public class CadMaterialInfoController extends BaseController +{ + @Autowired + private ICadMaterialInfoService cadMaterialInfoService; + + /** + * 查询CAD物料明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:cadMaterialInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CadMaterialInfo cadMaterialInfo) + { + startPage(); + List list = cadMaterialInfoService.selectCadMaterialInfoList(cadMaterialInfo); + return getDataTable(list); + } + + /** + * 导出CAD物料明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:cadMaterialInfo:export')") + @Log(title = "CAD物料明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CadMaterialInfo cadMaterialInfo) + { + List list = cadMaterialInfoService.selectCadMaterialInfoList(cadMaterialInfo); + ExcelUtil util = new ExcelUtil(CadMaterialInfo.class); + return util.exportExcel(list, "cadMaterialInfo"); + } + + /** + * 获取CAD物料明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cadMaterialInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cadMaterialInfoService.selectCadMaterialInfoById(id)); + } + + /** + * 新增CAD物料明细 + */ + @PreAuthorize("@ss.hasPermi('management:cadMaterialInfo:add')") + @Log(title = "CAD物料明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CadMaterialInfo cadMaterialInfo){ + return toAjax(cadMaterialInfoService.insertCadMaterialInfo(cadMaterialInfo)); + } + + /** + * 修改CAD物料明细 + */ + @PreAuthorize("@ss.hasPermi('management:cadMaterialInfo:edit')") + @Log(title = "CAD物料明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CadMaterialInfo cadMaterialInfo) + { + return toAjax(cadMaterialInfoService.updateCadMaterialInfo(cadMaterialInfo)); + } + + /** + * 删除CAD物料明细 + */ + @PreAuthorize("@ss.hasPermi('management:cadMaterialInfo:remove')") + @Log(title = "CAD物料明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cadMaterialInfoService.deleteCadMaterialInfoByIds(ids)); + } + + /** + * 校验数据 + */ + @RequestMapping("/verify") + public AjaxResult verify(@RequestBody String json){ + if(null == json ||"".equals(json)){ + return AjaxResult.error("请传入参数"); + } + //需要返回的数据集合 + List list = new ArrayList<>(); + JSONArray jn =(JSONArray) JSONArray.parse(json); + for (Object object : jn) { + JSONObject jsonObject = JSONObject.parseObject(object.toString()); + String name = jsonObject.getString("name"); + String figureNumber = jsonObject.getString("figureNumber"); + //根据名称和图号查询 + CadMaterialInfo cadMaterialInfo = cadMaterialInfoService.selectCadMaterialInfoByNameAndFigureNumber(name,figureNumber); + if(null == cadMaterialInfo){ + //说明数据库中没有此物料,拼接json返回 + cadMaterialInfo = new CadMaterialInfo(); + cadMaterialInfo.setName(name); + cadMaterialInfo.setFigureNumber(figureNumber); + list.add(cadMaterialInfo); + } + } + return AjaxResult.success(list); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceController.java new file mode 100644 index 0000000..a47b602 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceController.java @@ -0,0 +1,208 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.management.domain.CwAttendance; +import com.ruoyi.project.management.domain.CwEmployeeInformation; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.service.ICwAttendanceService; +import com.ruoyi.project.management.service.ICwEmployeeInformationService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.management.utils.ExcelUs; + +/** + * 考勤记录Controller + * + * @author zhukangchao + * @date 2021-11-02 + */ +@RestController +@RequestMapping("/management/cwAttendance") +public class CwAttendanceController extends BaseController +{ + @Autowired + private ICwAttendanceService cwAttendanceService; + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + + /** + * 查询考勤记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendance:list')") + @GetMapping("/list") + public TableDataInfo list(CwAttendance cwAttendance) + { + startPage(); + List list = cwAttendanceService.selectCwAttendanceList(cwAttendance); + return getDataTable(list); + } + + /** + * 导出考勤记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendance:export')") + @Log(title = "考勤记录", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwAttendance cwAttendance) + { + List list = cwAttendanceService.selectCwAttendanceList(cwAttendance); + ExcelUtil util = new ExcelUtil(CwAttendance.class); + return util.exportExcel(list, "cwAttendance"); + } + + /** + * 获取考勤记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendance:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwAttendanceService.selectCwAttendanceById(id)); + } + + /** + * 新增考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendance:add')") + @Log(title = "考勤记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwAttendance cwAttendance) + { + return toAjax(cwAttendanceService.insertCwAttendance(cwAttendance)); + } + + /** + * 修改考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendance:edit')") + @Log(title = "考勤记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwAttendance cwAttendance) + { + return toAjax(cwAttendanceService.updateCwAttendance(cwAttendance)); + } + + /** + * 删除考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendance:remove')") + @Log(title = "考勤记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwAttendanceService.deleteCwAttendanceByIds(ids)); + } + + /** + * 上传考勤记录信息 + */ + @RequestMapping("/uploadAttendanceFile") + @ResponseBody + public AjaxResult uploadAttendanceFile(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelUs.readExcel(files); + for (int i = 1; i < result.size(); i++) { + //根据员工姓名查询员工信息 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(result.get(i).get(0).toString()); + if(null!=employeeInformation){ + if(employeeInformation.getVirtualWorkstation()==1){ + //说明是虚拟工位 + continue; + }else{ + //判断表格内没有空数据 + if(null==result.get(i).get(0).toString()||"".equals(result.get(i).get(0).toString().trim())){ + return AjaxResult.error("姓名不能为空"); + } + if(null==result.get(i).get(1).toString()||"".equals(result.get(i).get(1).toString().trim())){ + return AjaxResult.error("应出勤天数不能为空"); + } + if(null==result.get(i).get(2).toString()||"".equals(result.get(i).get(2).toString().trim())){ + return AjaxResult.error("实出勤天数不能为空"); + } + if(null==result.get(i).get(3).toString()||"".equals(result.get(i).get(3).toString().trim())){ + return AjaxResult.error("所属月份不能为空"); + } + //把月份的0去掉 + String string = result.get(i).get(3).toString().substring(result.get(i).get(3).toString().lastIndexOf("-")); + Long valueOf = Long.valueOf(string); + //添加之前先根据名称和日期查询,如果有就修改,如果没有就新增 + CwAttendance cwAttendance2 = cwAttendanceService.selectCwAttendanceByNameAndBelongsToDate(result.get(i).get(0).toString(), result.get(i).get(3).toString().substring(0,result.get(i).get(3).toString().lastIndexOf("-"))+valueOf.toString()); + if(null!=cwAttendance2){ + cwAttendance2.setShouldBeAttendance(Double.valueOf(result.get(i).get(1).toString())); + //保存实出勤 + cwAttendance2.setRealAttendance(Double.valueOf(result.get(i).get(2).toString())); + //保存所属月份 + cwAttendance2.setBelongsToDate(result.get(i).get(3).toString().substring(0,result.get(i).get(3).toString().lastIndexOf("-"))+valueOf.toString()); + cwAttendanceService.updateCwAttendance(cwAttendance2); + }else{ + //创建信息的考勤记录信息 + CwAttendance cwAttendance = new CwAttendance(); + //保存姓名 + cwAttendance.setName(result.get(i).get(0).toString()); + //保存应出勤 + cwAttendance.setShouldBeAttendance(Double.valueOf(result.get(i).get(1).toString())); + //保存实出勤 + cwAttendance.setRealAttendance(Double.valueOf(result.get(i).get(2).toString())); + //保存所属月份 + cwAttendance.setBelongsToDate(result.get(i).get(3).toString().substring(0,result.get(i).get(3).toString().lastIndexOf("-"))+valueOf.toString()); + cwAttendanceService.insertCwAttendance(cwAttendance); + } + } + }else{ + continue; +// return AjaxResult.error("未查询到:"+result.get(i).get(0).toString()+"的基本信息"); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceRecordDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceRecordDetailController.java new file mode 100644 index 0000000..f131e89 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceRecordDetailController.java @@ -0,0 +1,744 @@ +package com.ruoyi.project.management.controller; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetail; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetailData; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetailVo; +import com.ruoyi.project.management.domain.CwAttendanceUser; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.service.ICwAttendanceRecordDetailService; +import com.ruoyi.project.management.service.ICwAttendanceUserService; +import com.ruoyi.project.management.service.ICwNewAttendanceService; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 考勤记录Controller + * + * @author zhukangchao + * @date 2022-10-21 + */ +@RestController +@RequestMapping("/api/v1") +public class CwAttendanceRecordDetailController extends BaseController +{ + @Autowired + private ICwAttendanceRecordDetailService cwAttendanceRecordDetailService; + @Autowired + private ICwAttendanceUserService cwAttendanceUserService; + //考勤记录详情信息 + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + //考勤记录统计信息 + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + + /** + * 查询考勤记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceRecordDetail:list')") + @GetMapping("/list") + public TableDataInfo list(CwAttendanceRecordDetail cwAttendanceRecordDetail){ + startPage(); + if(null!=cwAttendanceRecordDetail.getDateTime()){ + //说明带着时间,需要格式化时间 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String format = sdf.format(cwAttendanceRecordDetail.getDateTime()); + cwAttendanceRecordDetail.setDateTime(null); + cwAttendanceRecordDetail.setSparedOne(format); + } + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailList(cwAttendanceRecordDetail); + return getDataTable(list); + } + + /** + * 导出考勤记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceRecordDetail:export')") + @Log(title = "考勤记录", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwAttendanceRecordDetail cwAttendanceRecordDetail) + { + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailList(cwAttendanceRecordDetail); + ExcelUtil util = new ExcelUtil(CwAttendanceRecordDetail.class); + return util.exportExcel(list, "cwAttendanceRecordDetail"); + } + + /** + * 获取考勤记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceRecordDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailById(id)); + } + + /** + * 新增考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceRecordDetail:add')") + @Log(title = "考勤记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwAttendanceRecordDetail cwAttendanceRecordDetail) + { + return toAjax(cwAttendanceRecordDetailService.insertCwAttendanceRecordDetail(cwAttendanceRecordDetail)); + } + + /** + * 修改考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceRecordDetail:edit')") + @Log(title = "考勤记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwAttendanceRecordDetail cwAttendanceRecordDetail) + { + return toAjax(cwAttendanceRecordDetailService.updateCwAttendanceRecordDetail(cwAttendanceRecordDetail)); + } + + /** + * 删除考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceRecordDetail:remove')") + @Log(title = "考勤记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwAttendanceRecordDetailService.deleteCwAttendanceRecordDetailByIds(ids)); + } + + /** + * 刷脸获取打卡按钮权限 + * sn 设备号 + * type 设备识别类型 + * user_id 用户id + * card 人员信息中的卡号 + * confidence 人脸算法识别到的相识度 + * temperature 测量到的温度,未开启测温的设备为空 + * + * 响应: Result 返回请求类型:0:可以打卡,其它值表示无法打卡 + * Msg 对应 Result 的状态,可为空 + * Content 识别后返回的详细信息 + * button 9位长度的字符串,0 表示不可以点击 1 表示可以点击 + * + * String sn,String type,String userId,String card,String confidence + */ + @RequestMapping("/verify_user") + public String verifyUser(@RequestBody String json){ + + //解析收到的数据 + JSONObject jsonObject = JSONObject.parseObject(json); + String userId = jsonObject.get("user_id").toString(); + + //需要推送的数据 + String message = ""; + //需要返回的对象 + CwAttendanceRecordDetailVo cardV = new CwAttendanceRecordDetailVo(); + CwAttendanceRecordDetailData cardD = new CwAttendanceRecordDetailData(); + + //根据id查询当前员工是否是员工列表中的人 + CwAttendanceUser user = cwAttendanceUserService.selectCwAttendanceUserById(Long.valueOf(userId)); + if(null==user){ + cardV.setResult(1); + cardV.setMsg("验证失败,未设置考勤权限"); + //下班卡和撤销权限 + cardD.setButton("000000000"); + cardV.setContent(cardD); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cardV); + System.out.println("返回数据:"+message); + return message; + } + + //根据人员id查询 + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCode(userId); + //获取list中的最后一条数据 + if(list.size()>0){ + //判断list中最后一条数据,如果最后一条数据的打卡类型为 上班卡(单班制),上班卡(双班制),上班卡(三班制)和加班卡,则返回 下班卡权限和撤销权限 + CwAttendanceRecordDetail attendanceRecordDetail = list.get(list.size()-1); + if(null!=attendanceRecordDetail&&null!=attendanceRecordDetail.getButtonType()&&(attendanceRecordDetail.getButtonType().equals("上班卡(单班制)")||attendanceRecordDetail.getButtonType().equals("上班卡(双班制)")||attendanceRecordDetail.getButtonType().equals("上班卡(三班制)")||attendanceRecordDetail.getButtonType().equals("加班卡"))){ + cardV.setResult(0); + cardV.setMsg("验证通过"); + //下班卡和撤销权限 + cardD.setButton("000011000"); + cardV.setContent(cardD); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cardV); + }else if(null!=attendanceRecordDetail&&null!=attendanceRecordDetail.getButtonType()&&(attendanceRecordDetail.getButtonType().equals("下班卡"))){ + //如果最后一条数据的卡类型为下班卡,则返回上班卡和加班卡权限 + cardV.setResult(0); + cardV.setMsg("验证通过"); + //下班卡和撤销权限 + cardD.setButton("111100000"); + cardV.setContent(cardD); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cardV); + }else{ + //说明有最后一条数据,但最后一条数据的打卡类型是null,说明撤销掉了,此时返回上班卡及加班卡,下班卡不允许撤销 + //如果最后一条数据的卡类型为下班卡,则返回上班卡和加班卡权限 + cardV.setResult(0); + cardV.setMsg("验证通过"); + //下班卡和撤销权限 + cardD.setButton("111100000"); + cardV.setContent(cardD); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cardV); + } + }else{ + //未查询到此用户的打卡记录,则直接返回 上班卡(单班制),上班卡(双班制),上班卡(三班制)和加班卡按钮的权限 + cardV.setResult(0); + cardV.setMsg("验证通过"); + //上班卡和加班卡权限 + cardD.setButton("111100000"); + cardV.setContent(cardD); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cardV); + } + System.out.println("返回数据:"+message); + return message; + } + + /** + * 用户点击打卡按钮后请求的接口 + * sn 设备号 + * user_id 人员id + * user_name 用户名 + * user_type 用户类型,对应下发人员时的 user_type + * card_number 卡号 + * recog_type 识别类型: face - 为人脸识别 、card - 刷卡开门,人脸或卡模式 + * recog_time 识别时间(时间格式yyyy-MM-dd HH:mm:ss) + * photo 识别照片,服务端收到后转换成图片步骤请查看 2、服务规范 - 照片解码流程 + * body_temperature 体温 + * confidence 通过的置信度 + * button 1~9 表示点击的是第几个按钮 + * + * 响应:Result 返回请求类型:0成功,其它失败 + * Msg 对应 Result 的文本信息 + * + * String sn,String userId,String userName,String userType,String cardNumber,String recog_type,String recog_time,String photo,String body_temperature,String confidence,String button + */ + @RequestMapping("record/face") + public String face(@RequestBody String json){ + + long time3 = new Date().getTime(); + System.out.println("开始时间:"+time3); + + //解析收到的数据 + JSONObject jsonObject = JSONObject.parseObject(json); +// System.out.println(json); + String userId = jsonObject.get("user_id").toString(); + String button = jsonObject.get("button").toString(); + String recog_type = jsonObject.get("recog_type").toString(); + String sn = jsonObject.get("sn").toString(); + String recog_time = jsonObject.get("recog_time").toString(); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + //返回设备端的信息 + String message = ""; + + //根据员工打卡类型判断今日是否已打卡 + if("1".equals(button)){ + //上班卡(单班制),查询今日是否已打上班卡单班制的卡 + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(userId,new Date(),"上班卡(单班制)"); + if(list.size() > 0){ + //说明已经打过此班制的卡,则不允许再打卡 + message = "{\"Result\":1,\"Msg\":\"今日已打卡,不允许重复打卡\"}"; + return message; + } + + }else if("2".equals(button)){ + //上班卡(双班制) + //上班卡(双班制),查询今日是否已打上班卡单班制的卡 + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(userId,new Date(),"上班卡(双班制)"); + if(list.size() > 0){ + //说明已经打过此班制的卡,则不允许再打卡 + message = "{\"Result\":1,\"Msg\":\"今日已打卡,不允许重复打卡\"}"; + return message; + } + }else if("3".equals(button)){ + //上班卡(三班制) + //上班卡(三班制),查询今日是否已打上班卡单班制的卡 + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(userId,new Date(),"上班卡(三班制)"); + if(list.size() > 0){ + //说明已经打过此班制的卡,则不允许再打卡 + message = "{\"Result\":1,\"Msg\":\"今日已打卡,不允许重复打卡\"}"; + return message; + } + }else if("4".equals(button)){ + //加班卡 + //加班卡,查询今日是否已打上班卡单班制的卡 + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(userId,new Date(),"加班卡"); + if(list.size() > 0){ + //说明已经打过此班制的卡,则不允许再打卡 + message = "{\"Result\":1,\"Msg\":\"今日已打卡,不允许重复打卡\"}"; + return message; + } + } + + //根据用户id查询最后一条记录是否是撤销状态,如果是撤销状态,则修改当前记录的打卡类型,时间不再重置 + //根据人员id查询 + List list = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCode(userId); + if(list.size()>0){ + CwAttendanceRecordDetail attendanceRecordDetail = list.get(list.size()-1); + if(null==attendanceRecordDetail.getButtonType()){ + //说明为撤销状态,重置打卡类型 + //按钮类型 + switch (button) { + case "1": + attendanceRecordDetail.setButtonType("上班卡(单班制)"); + break; + case "2": + attendanceRecordDetail.setButtonType("上班卡(双班制)"); + break; + case "3": + attendanceRecordDetail.setButtonType("上班卡(三班制)"); + break; + case "4": + attendanceRecordDetail.setButtonType("加班卡"); + break; + case "5": + attendanceRecordDetail.setButtonType("下班卡"); + break; + } + int i = cwAttendanceRecordDetailService.updateCwAttendanceRecordDetail(attendanceRecordDetail); + if(i>0){ + //修改成功,返回打卡成功 + message = "{\"Result\":0,\"Msg\":\"打卡成功\"}"; + + //重新打卡后需要重置考勤记录详情中的打卡类型 + return message; + } + } + } + //打卡信息储存对象 + CwAttendanceRecordDetail cwAttendanceRecordDetail = new CwAttendanceRecordDetail(); + //设备编号 + cwAttendanceRecordDetail.setEquipmentCode(sn); + //用户id + cwAttendanceRecordDetail.setCode(userId); + //根据用户id查询用户姓名 + CwAttendanceUser user = cwAttendanceUserService.selectCwAttendanceUserById(Long.valueOf(userId)); + if(null!=user){ + //用户姓名 + cwAttendanceRecordDetail.setName(user.getName()); + }else{ + //添加失败,返回打卡失败 + message = "{\"Result\":1,\"Msg\":\"打卡失败\"}"; + //直接返回 + return message; + } + //识别类型 face - 为人脸识别 、card - 刷卡开门 人脸或卡模式 + if(recog_type.equals("face")){ + cwAttendanceRecordDetail.setType(1); + }else{ + cwAttendanceRecordDetail.setType(2); + } + //打卡时间 + try { + cwAttendanceRecordDetail.setDateTime(sdf.parse(recog_time)); + } catch (ParseException e) { + e.printStackTrace(); + } + //按钮类型 + switch (button) { + case "1": + cwAttendanceRecordDetail.setButtonType("上班卡(单班制)"); + break; + case "2": + cwAttendanceRecordDetail.setButtonType("上班卡(双班制)"); + break; + case "3": + cwAttendanceRecordDetail.setButtonType("上班卡(三班制)"); + break; + case "4": + cwAttendanceRecordDetail.setButtonType("加班卡"); + break; + case "5": + cwAttendanceRecordDetail.setButtonType("下班卡"); + break; + case "6": + //当按钮类型为撤销的时候,则修改当前用户的上一条打卡记录,前提是上一条打卡记录必须为上班卡或者加班卡 + //根据用户id查询用户的上一条打卡记录 + //根据人员id查询 + List lists = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCode(userId); + if(lists.size()>0){ + CwAttendanceRecordDetail attendanceRecordDetail = list.get(list.size()-1); + if(null!=attendanceRecordDetail.getButtonType()){ + attendanceRecordDetail.setButtonType(null); + int i = cwAttendanceRecordDetailService.updateCwAttendanceRecordDetail(attendanceRecordDetail); + if(i>0){ + message = "{\"Result\":0,\"Msg\":\"撤销成功\"}"; + } + }else{ + message = "{\"Result\":1,\"Msg\":\"未查询到需要撤销的记录\"}"; + } + + //撤销员工的考勤记录详情中的打卡类型 + //格式化时间 +// SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd"); +// //员工姓名 +// String name = cwAttendanceRecordDetail.getName(); +// //查询考勤记录详情信息 +// String format = sdfDate.format(attendanceRecordDetail.getDateTime()); +// CwNewAttendance newAttendance = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format); +// //如果查询到的打卡记录的打卡类型是null,说明撤销的时间是第二天,所以此时应该去查询前一天的考勤记录 +// if(null==newAttendance.getRules()||"".equals(newAttendance.getRules())){ +// +// }else{ +// +// } + + }else{ + message = "{\"Result\":1,\"Msg\":\"未查询到需要撤销的记录\"}"; + } + + return message; + case "7": + cwAttendanceRecordDetail.setButtonType(null); + break; + case "8": + cwAttendanceRecordDetail.setButtonType(null); + break; + case "9": + cwAttendanceRecordDetail.setButtonType(null); + break; + } + + int i = cwAttendanceRecordDetailService.insertCwAttendanceRecordDetail(cwAttendanceRecordDetail); + if(i>0){ + //添加成功,返回打卡成功 + message = "{\"Result\":0,\"Msg\":\"打卡成功\"}"; + + //打卡成功后把打卡数据添加到考勤记录详情中 + //格式化时间 + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd"); + //员工姓名 + String name = cwAttendanceRecordDetail.getName(); + //打卡时间 + Date dateTime = cwAttendanceRecordDetail.getDateTime(); + //按钮类型 + String buttonType = cwAttendanceRecordDetail.getButtonType(); + + + //根据按钮类型把打卡时间添加到考勤记录详情中 + if(buttonType.equals("上班卡(单班制)")||buttonType.equals("上班卡(双班制)")||buttonType.equals("上班卡(三班制)")){ + //查询考勤记录详情信息 + String format = sdfDate.format(dateTime); + CwNewAttendance newAttendance = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format); + //上班卡(单班制),上班卡(双班制),上班卡(三班制)不做处理,直接把打卡时间添加到对应的考勤记录详情中 + //考勤规则(按钮类型) + newAttendance.setRules(buttonType); + //上班打卡时间 + newAttendance.setWorkStartTime(dateTime); + + //需要计算迟到情况(暂不处理) + + cwNewAttendanceService.updateCwNewAttendance(newAttendance); + }else if(buttonType.equals("加班卡")){ + //加班卡不需要处理 + + }else if(buttonType.equals("下班卡")){ + //下班卡需要判断,当前员工的上一条打卡记录是什么类型 + //查询当前员工的上一条打卡记录是什么类型 + List list2 = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCode(userId); + if(list2.size()>0){ + //获取上一条记录 + CwAttendanceRecordDetail attendanceRecordDetail = list.get(list.size()-1); + //如果为单班制,则直接把下班时间添加到考勤记录详情中 + //如果为双班制,则需要判断是白班还是中班,中班的需要把打卡时间的日期减1(下班时间在次日)查询考勤信息,然后把下班时间添加到对应的考勤记录详情中 + //如果为三班制,则需要判断是白班还是夜班,夜班的需要把打卡时间的日期减1(下班时间在次日)查询考勤信息,然后把下班时间添加到对应的考勤记录详情中 + //如果为加班卡,则 + if(attendanceRecordDetail.getButtonType().equals("上班卡(单班制)")){ + //格式化打卡时间,把下班时间添加到和上班时间一致的考勤记录中 + String format = sdfDate.format(attendanceRecordDetail.getDateTime()); + CwNewAttendance newAttendance = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format); + //下班时间 + newAttendance.setWorkEndTime(dateTime); + //计算上下班时间的工作时长(超出时间按照8小时计算) + //计算考勤时长 如果上班卡不为null且下班卡不为null时计算考勤时长 + if(null!=newAttendance.getWorkStartTime()&&null!=newAttendance.getWorkEndTime()){ + + //计算上班时间和下班时间的差额(小时数) + //下班时间 + Date workEndTime = newAttendance.getWorkEndTime(); + //上班时间 + Date workStartTime = newAttendance.getWorkStartTime(); + //时间差(毫秒值) + long time = workEndTime.getTime(); + long time2 = workStartTime.getTime(); + Long cha = time-time2; + Double miao = (double) (cha/1000); + Double fenhzong = (double) (miao/60); + Double xiaoshi = (double) (fenhzong/60); + + if(xiaoshi>5.5){ + if(xiaoshi-1>8){ + newAttendance.setWorkSum(8.0); + }else{ + if(xiaoshi-1<0){ + newAttendance.setWorkSum(0.0); + }else{ + newAttendance.setWorkSum(xiaoshi-1); + } + } + }else{ + newAttendance.setWorkSum(xiaoshi); + } + }else{ + newAttendance.setWorkSum(0.0); + } + + //判断是否是早退(暂时不处理) + + cwNewAttendanceService.updateCwNewAttendance(newAttendance); + + }else if(attendanceRecordDetail.getButtonType().equals("上班卡(双班制)")){ + //根据名称和打卡时间查询考勤记录详情,如果查出来的考勤记录,上班的打卡时间是null,则说明上的是中班,需要查询上一天的考勤记录 + //查询考勤记录详情信息(打卡当天的记录) + String format = sdfDate.format(dateTime); + CwNewAttendance newAttendance = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format); + if(null==newAttendance.getWorkStartTime()||"".equals(newAttendance.getWorkStartTime())){ + //说明上的是中班,打卡时间在次日,所以需要查询前一天的记录 + //格式化打卡时间,把下班时间添加到和上班时间一致的考勤记录中(打卡前一天的记录) + String format2 = sdfDate.format(attendanceRecordDetail.getDateTime()); + CwNewAttendance newAttendance2 = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format2); + + //中班次数+1 + newAttendance2.setMiddleShiftNumber(1L); + //下班时间 + newAttendance2.setWorkEndTime(dateTime); + //计算上下班时间的工作时长(超出时间按照8小时计算) + //计算考勤时长 如果上班卡不为null且下班卡不为null时计算考勤时长 + if(null!=newAttendance2.getWorkStartTime()&&null!=newAttendance2.getWorkEndTime()){ + + //计算上班时间和下班时间的差额(小时数) + //下班时间 + Date workEndTime = newAttendance2.getWorkEndTime(); + //上班时间 + Date workStartTime = newAttendance2.getWorkStartTime(); + //时间差(毫秒值) + Long cha = workEndTime.getTime()-workStartTime.getTime(); + Double miao = (double) (cha/1000); + Double fenhzong = (double) (miao/60); + Double xiaoshi = (double) (fenhzong/60); + + //双班制的没有中间休息的1小时,所以工作时长为实际工作时长 + if(xiaoshi>8){ + newAttendance2.setWorkSum(8.0); + }else{ + newAttendance2.setWorkSum(xiaoshi); + } + }else{ + newAttendance2.setWorkSum(0.0); + } + //判断是否是早退(暂时不处理) + + cwNewAttendanceService.updateCwNewAttendance(newAttendance2); + }else{ + //下班时间 + newAttendance.setWorkEndTime(dateTime); + //计算上下班时间的工作时长(超出时间按照8小时计算) + //计算考勤时长 如果上班卡不为null且下班卡不为null时计算考勤时长 + if(null!=newAttendance.getWorkStartTime()&&null!=newAttendance.getWorkEndTime()){ + //计算上班时间和下班时间的差额(小时数) + //下班时间 + Date workEndTime = newAttendance.getWorkEndTime(); + //上班时间 + Date workStartTime = newAttendance.getWorkStartTime(); + //时间差(毫秒值) + Long cha = workEndTime.getTime()-workStartTime.getTime(); + Double miao = (double) (cha/1000); + Double fenhzong = (double) (miao/60); + Double xiaoshi = (double) (fenhzong/60); + + //双班制的没有中间休息的1小时,所以工作时长为实际工作时长 + if(xiaoshi>8){ + newAttendance.setWorkSum(8.0); + }else{ + newAttendance.setWorkSum(xiaoshi); + } + }else{ + newAttendance.setWorkSum(0.0); + } + + //判断是否是早退(暂时不处理) + + cwNewAttendanceService.updateCwNewAttendance(newAttendance); + } + + }else if(attendanceRecordDetail.getButtonType().equals("上班卡(三班制)")){ + //根据名称和打卡时间查询考勤记录详情,如果查出来的考勤记录,上班的打卡时间是null,则说明上的是中班,需要查询上一天的考勤记录 + //查询考勤记录详情信息(打卡当天的记录) + String format = sdfDate.format(dateTime); + CwNewAttendance newAttendance = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format); + if(null==newAttendance.getWorkStartTime()||"".equals(newAttendance.getWorkStartTime())){ + //说明上的是中班,打卡时间在次日,所以需要查询前一天的记录 + //格式化打卡时间,把下班时间添加到和上班时间一致的考勤记录中(打卡前一天的记录) + String format2 = sdfDate.format(attendanceRecordDetail.getDateTime()); + CwNewAttendance newAttendance2 = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format2); + + //夜班次数+1 + newAttendance2.setNightNumber(1L); + //下班时间 + newAttendance2.setWorkEndTime(dateTime); + //计算上下班时间的工作时长(超出时间按照8小时计算) + + //计算上班时间和下班时间的差额(小时数) + //下班时间 + Date workEndTime = newAttendance2.getWorkEndTime(); + //上班时间 + Date workStartTime = newAttendance2.getWorkStartTime(); + //时间差(毫秒值) + Long cha = workEndTime.getTime()-workStartTime.getTime(); + Double miao = (double) (cha/1000); + Double fenhzong = (double) (miao/60); + Double xiaoshi = (double) (fenhzong/60); + + //三班制不存在中间休息的1小时,所以工作时长为实际工作时长 + if(xiaoshi>12){ + newAttendance2.setWorkSum(11.0); + }else{ + if(xiaoshi-1<0){ + newAttendance2.setWorkSum(0.0); + }else{ + newAttendance2.setWorkSum(xiaoshi-1); + } + } + + //判断是否是早退(暂时不处理) + + cwNewAttendanceService.updateCwNewAttendance(newAttendance2); + }else{ + //下班时间 + newAttendance.setWorkEndTime(dateTime); + //计算上下班时间的工作时长(超出时间按照8小时计算) + //下班时间 + Date workEndTime = newAttendance.getWorkEndTime(); + //上班时间 + Date workStartTime = newAttendance.getWorkStartTime(); + //时间差(毫秒值) + Long cha = workEndTime.getTime()-workStartTime.getTime(); + Double miao = (double) (cha/1000); + Double fenhzong = (double) (miao/60); + Double xiaoshi = (double) (fenhzong/60); + + //三班制不存在中间休息的1小时,所以工作时长为实际工作时长 + if(xiaoshi>12){ + newAttendance.setWorkSum(11.0); + }else{ + if(xiaoshi-1<0){ + newAttendance.setWorkSum(0.0); + }else{ + newAttendance.setWorkSum(xiaoshi-1); + } + } + + //判断是否是早退(暂时不处理) + + cwNewAttendanceService.updateCwNewAttendance(newAttendance); + } + }else{ + //说明是加班卡,加班卡直接查询上一条记录,和当前记录计算加班时长,把加班时长添加到上一条记录的打卡时间上 + //格式化打卡时间,把下班时间添加到和上班时间一致的考勤记录中 + String format = sdfDate.format(attendanceRecordDetail.getDateTime()); + //需要记录加班时长的记录 + CwNewAttendance newAttendance = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name, format); + //计算加班时长 + //下班时间 + Date workEndTime = cwAttendanceRecordDetail.getDateTime(); + //上班时间 + Date workStartTime = attendanceRecordDetail.getDateTime(); + + //时间差(毫秒值) + Long cha = workEndTime.getTime()-workStartTime.getTime(); + Double miao = (double) (cha/1000); + Double fenhzong = (double) (miao/60); + Double xiaoshi = (double) (fenhzong/60); + +// if(xiaoshi>12){ +// xiaoshi = 12.0; +// } + newAttendance.setLeaveDays(newAttendance.getLeaveDays()+xiaoshi); + + cwNewAttendanceService.updateCwNewAttendance(newAttendance); + } + } + }else{ + //说明是撤销按钮(撤销) + + } + + //更新考勤记录统计信息 + //格式化时间 + SimpleDateFormat sdfDateYue = new SimpleDateFormat("yyyy-MM"); + String format = sdfDateYue.format(dateTime); + //根据姓名和所属月份查询考勤统计记录信息 + CwNewAttendanceStatistical attendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(name, format); + if(null!=attendanceStatistical){ + //根据名称和月份查询整月的记录,累加后统计到统计记录中 + List list2 = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDate(name, format); + //实出勤 + Double shichuqin = 0.0; + //加班时长 + Double jiaban = 0.0; + //夜班次数 + Long yeban = 0L; + //中班次数 + Long zhongban = 0L; + + for (CwNewAttendance cwNewAttendance : list2) { + //实出勤 + shichuqin += cwNewAttendance.getWorkSum(); + //加班时长 + jiaban += cwNewAttendance.getLeaveDays(); + + //夜班次数 + yeban += cwNewAttendance.getNightNumber(); + //中班次数 + zhongban += cwNewAttendance.getMiddleShiftNumber(); + } + //应出勤(没有意义) + + //实出勤 + attendanceStatistical.setEssentialAttendance(shichuqin.longValue()); + //加班时长 + attendanceStatistical.setWorkOvertimeNumber(jiaban.longValue()); + //夜班次数 + attendanceStatistical.setNightNumber(yeban); + //中班次数 + attendanceStatistical.setMiddleShiftNumber(zhongban); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(attendanceStatistical); + }else{ + + } + } + long time = new Date().getTime(); + System.out.println("结束时间:"+new Date().getTime()); + + System.out.println("处理时长:"+(time-time3)); + + return message; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceUserController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceUserController.java new file mode 100644 index 0000000..fbeb58a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwAttendanceUserController.java @@ -0,0 +1,384 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import javax.websocket.Session; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwAttendanceUser; +import com.ruoyi.project.management.domain.CwAttendanceUserData; +import com.ruoyi.project.management.domain.CwAttendanceUserVo; +import com.ruoyi.project.management.domain.CwSnDetail; +import com.ruoyi.project.management.domain.CyConsumptionInfo; +import com.ruoyi.project.management.domain.CyStatisticsInfo; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.PwBomNumber; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.service.ICwAttendanceUserService; +import com.ruoyi.project.management.service.ICwSnDetailService; +import com.ruoyi.project.management.service.ICyConsumptionInfoService; +import com.ruoyi.project.management.service.ICyStatisticsInfoService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.framework.websocket.WebSocketUsers; + +/** + * 员工信息Controller + * + * @author zhukangchao + * @date 2022-10-21 + */ +@RestController +@RequestMapping("/management/cwAttendanceUser") +public class CwAttendanceUserController extends BaseController +{ + @Autowired + private ICwAttendanceUserService cwAttendanceUserService; + //设备信息 + @Autowired + private ICwSnDetailService cwSnDetailService; + //餐饮消费统计信息 + @Autowired + private ICyStatisticsInfoService cyStatisticsInfoService; + //每日消费统计 + @Autowired + private ICyConsumptionInfoService cyConsumptionInfoService; + + /** + * 查询员工信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceUser:list')") + @GetMapping("/list") + public TableDataInfo list(CwAttendanceUser cwAttendanceUser) + { + startPage(); + List list = cwAttendanceUserService.selectCwAttendanceUserList(cwAttendanceUser); + return getDataTable(list); + } + + /** + * 导出员工信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceUser:export')") + @Log(title = "员工信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwAttendanceUser cwAttendanceUser) + { + List list = cwAttendanceUserService.selectCwAttendanceUserList(cwAttendanceUser); + ExcelUtil util = new ExcelUtil(CwAttendanceUser.class); + return util.exportExcel(list, "cwAttendanceUser"); + } + + /** + * 获取员工信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceUser:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwAttendanceUserService.selectCwAttendanceUserById(id)); + } + + /** + * 新增员工信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceUser:add')") + @Log(title = "员工信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwAttendanceUser cwAttendanceUser){ + + if(null==cwAttendanceUser.getName()||"".equals(cwAttendanceUser.getName().trim())){ + return AjaxResult.error("请输入员工姓名"); + } + //根据员工姓名查询是否有重复的姓名 +// if(null==cwAttendanceUser.getFaceTemplate()||"".equals(cwAttendanceUser.getFaceTemplate())){ +// return AjaxResult.error("请输入员工照片地址"); +// } + CwAttendanceUser attendanceUser = cwAttendanceUserService.selectCwAttendanceUserByName(cwAttendanceUser.getName()); + if(null!=attendanceUser){ + return AjaxResult.error(cwAttendanceUser.getName()+" 名称已存在"); + } + //新增人员信息 + int i2 = cwAttendanceUserService.insertCwAttendanceUser(cwAttendanceUser); + + + //新增餐饮统计信息 + + //获取当前月份 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + String yue = sdf.format(new Date()); + //根据姓名和月份查询餐饮统计信息中是否有了此数据 + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoByNameAndDate(cwAttendanceUser.getName(), yue); + if(null==statisticsInfo){ + //格式化每天的日期 + SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd"); + + //获取当前月份的自然日天数 + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.roll(Calendar.DAY_OF_MONTH, -1); + String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); + // 得今天是2022年10月13号,所以这个月的最大天数是 31 + int tianshu = Integer.parseInt(format.substring((format.lastIndexOf("-") + 1))); + + //餐饮统计信息 + CyStatisticsInfo cyStatisticsInfo = new CyStatisticsInfo(); + + CyConsumptionInfo cyConsumptionInfo = new CyConsumptionInfo(); + + //所属月份 + cyStatisticsInfo.setDate(yue); + //姓名 + cyStatisticsInfo.setName(cwAttendanceUser.getName()); + + cyStatisticsInfoService.insertCyStatisticsInfo(cyStatisticsInfo); + + for (int i = 0; i < tianshu; i++) { + cyConsumptionInfo = new CyConsumptionInfo(); + //考勤统计记录id + cyConsumptionInfo.setStatisticsId(cyStatisticsInfo.getId()); + //员工姓名 + cyConsumptionInfo.setName(cwAttendanceUser.getName()); + //日期(每天一条记录) + int s = 0; + s = i+1; + String day = yue+"-"+s; + try { + cyConsumptionInfo.setDateTime(sdfDay.parse(day)); + } catch (ParseException e) { + e.printStackTrace(); + } + cyConsumptionInfoService.insertCyConsumptionInfo(cyConsumptionInfo); + } + } + + return toAjax(i2); + } + + /** + * 修改员工信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceUser:edit')") + @Log(title = "员工信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwAttendanceUser cwAttendanceUser){ + if(null==cwAttendanceUser.getName()||"".equals(cwAttendanceUser.getName().trim())){ + return AjaxResult.error("请输入员工姓名"); + } + //根据员工姓名查询是否有重复的姓名 + CwAttendanceUser attendanceUser = cwAttendanceUserService.selectCwAttendanceUserByName(cwAttendanceUser.getName()); + if(null!=attendanceUser){ + if(!attendanceUser.getId().equals(cwAttendanceUser.getId())){ + return AjaxResult.error(cwAttendanceUser.getName()+" 名称已存在"); + } + } + //执行修改 + int i = cwAttendanceUserService.updateCwAttendanceUser(cwAttendanceUser); + +// //需要推送的数据 +// String message = ""; +// //需要返回的对象 +// CwAttendanceUserVo cau = new CwAttendanceUserVo(); +// //发送的数据 +// CwAttendanceUserData caud = new CwAttendanceUserData(); +// +// //获取所有设备 +// CwSnDetail cwSnDetail = new CwSnDetail(); +// List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); +// for (CwSnDetail cwSnDetail2 : list) { +// //该接口固定为to_device,发送给设备用于识别对应哪个指令 +// cau.setCmd("to_device"); +// //无用值,空串 +// cau.setForm(""); +// //设备号 +// cau.setTo(cwSnDetail2.getSn()); +// //给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回 +// cau.setExtra(""); +// //发送的数据 +// caud.setCmd("editUser"); +// caud.setUser_id(cwAttendanceUser.getId().toString()); +// caud.setName(cwAttendanceUser.getName()); +// caud.setTts_name(cwAttendanceUser.getTtsName()); +// //修改类型 +// caud.setEdit_mode(1); +// caud.setFace_template(""); +// caud.setEffect_time(""); +// caud.setId_valid(""); +// caud.setIc(""); +// caud.setPhone(""); +// caud.setMode(0); +// cau.setData(caud); +// //Java对象转换成JSON字符串 +// message = JSONObject.toJSONString(cau); +// //调用websocket,推送给设备 +// WebSocketUsers.sendMessageToUsersByText(message); +// } + + return toAjax(i); + } + + /** + * 删除员工信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwAttendanceUser:remove')") + @Log(title = "员工信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + + for (Long long1 : ids) { + //需要推送的数据 + String message = ""; + //需要返回的对象 + CwAttendanceUserVo cau = new CwAttendanceUserVo(); + //发送的数据 + CwAttendanceUserData caud = new CwAttendanceUserData(); + + //获取所有设备 + CwSnDetail cwSnDetail = new CwSnDetail(); + List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); + for (CwSnDetail cwSnDetail2 : list) { + //该接口固定为to_device,发送给设备用于识别对应哪个指令 + cau.setCmd("to_device"); + //无用值,空串 + cau.setForm(""); + //设备号 + cau.setTo(cwSnDetail2.getSn()); + //发送的数据 + caud.setCmd("delUser"); + caud.setUser_type(0); + //用户id + caud.setUser_id(long1.toString()); + cau.setData(caud); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cau); + //调用websocket,推送给设备 + WebSocketUsers.sendMessageToUsersByText(message); + } + + //根据员工照片地址,删除员工照片 + CwAttendanceUser attendanceUser = cwAttendanceUserService.selectCwAttendanceUserById(long1); + File file = new File(attendanceUser.getFaceTemplate()); + if(file.exists()){ + file.delete(); + } + } + return toAjax(cwAttendanceUserService.deleteCwAttendanceUserByIds(ids)); + } + + /** + * 上传员工照片 + */ + @RequestMapping("/uploadDispatchings") + @ResponseBody + public AjaxResult uploadPDF(@RequestParam("id") String id,@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); // 输出 "txt" + //判断是否是图片文件 + if(!"jpg".equals(suffix)&&!"jpeg".equals(suffix)&&!"png".equals(suffix)){ + + return AjaxResult.error("非法文件不允许上传"); + }else{ + //根据id获取员工信息 + CwAttendanceUser attendanceUser = cwAttendanceUserService.selectCwAttendanceUserById(Long.valueOf(id)); + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/java/image/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + attendanceUser.setFaceTemplate("http://localhost:8088/image/"+originalFilename); + cwAttendanceUserService.updateCwAttendanceUser(attendanceUser); + + //需要推送的数据 + String message = ""; + //需要返回的对象 + CwAttendanceUserVo cau = new CwAttendanceUserVo(); + //发送的数据 + CwAttendanceUserData caud = new CwAttendanceUserData(); + + //获取所有员工 + CwAttendanceUser users = new CwAttendanceUser(); + List list2 = cwAttendanceUserService.selectCwAttendanceUserList(users); + //获取所有设备 + CwSnDetail cwSnDetail = new CwSnDetail(); + List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); + for (CwAttendanceUser cwAttendanceUser2 : list2) { + for (CwSnDetail cwSnDetail2 : list) { + //该接口固定为to_device,发送给设备用于识别对应哪个指令 + cau.setCmd("to_device"); + //无用值,空串 + cau.setForm(""); + //设备号 + cau.setTo(cwSnDetail2.getSn()); + //给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回 + cau.setExtra(""); + //发送的数据 + caud.setCmd("addUser"); + caud.setUser_id(cwAttendanceUser2.getId().toString()); + caud.setName(cwAttendanceUser2.getName()); + caud.setTts_name(cwAttendanceUser2.getTtsName()); + caud.setFace_template(cwAttendanceUser2.getFaceTemplate()); + caud.setEffect_time(""); + caud.setId_valid(""); + caud.setIc(""); + caud.setPhone(""); + caud.setMode(0); + cau.setData(caud); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cau); + //调用websocket,推送给设备 + WebSocketUsers.sendMessageToUsersByText(message); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwButtonController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwButtonController.java new file mode 100644 index 0000000..73affa0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwButtonController.java @@ -0,0 +1,170 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +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.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwBottonDto; +import com.ruoyi.project.management.domain.CwButton; +import com.ruoyi.project.management.domain.CwButtonData; +import com.ruoyi.project.management.domain.CwButtonVo; +import com.ruoyi.project.management.domain.CwSnDetail; +import com.ruoyi.project.management.domain.CwTypeTimeData; +import com.ruoyi.project.management.domain.CwTypeTimeVo; +import com.ruoyi.project.management.service.ICwButtonService; +import com.ruoyi.project.management.service.ICwSnDetailService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.framework.websocket.WebSocketUsers; + +/** + * 按钮信息Controller + * + * @author zhukangchao + * @date 2022-10-31 + */ +@RestController +@RequestMapping("/management/cwButton") +public class CwButtonController extends BaseController +{ + @Autowired + private ICwButtonService cwButtonService; + //设备信息 + @Autowired + private ICwSnDetailService cwSnDetailService; + + /** + * 查询按钮信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwButton:list')") + @GetMapping("/list") + public TableDataInfo list(CwButton cwButton) + { + startPage(); + List list = cwButtonService.selectCwButtonList(cwButton); + return getDataTable(list); + } + + /** + * 导出按钮信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwButton:export')") + @Log(title = "按钮信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwButton cwButton) + { + List list = cwButtonService.selectCwButtonList(cwButton); + ExcelUtil util = new ExcelUtil(CwButton.class); + return util.exportExcel(list, "cwButton"); + } + + /** + * 获取按钮信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwButton:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwButtonService.selectCwButtonById(id)); + } + + /** + * 新增按钮信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwButton:add')") + @Log(title = "按钮信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwButton cwButton){ + + //需要推送的数据 + String message = ""; + //需要返回的对象 + CwButtonVo cbv = new CwButtonVo(); + //发送的数据 + CwButtonData cbd = new CwButtonData(); + + int i = cwButtonService.insertCwButton(cwButton); + + //获取所有的打卡按钮(一次性下发到设备) + cwButton = new CwButton(); + List list3 = cwButtonService.selectCwButtonList(cwButton); + + //获取所有设备 + CwSnDetail cwSnDetail = new CwSnDetail(); + List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); + + for (CwSnDetail cwSnDetail2 : list) { + List list2 = new ArrayList(); + HashMap map = new HashMap(); + //该接口固定为to_device,发送给设备用于识别对应哪个指令 + cbv.setCmd("to_device"); + //无用值,空串 + cbv.setForm(""); + //设备号 + cbv.setTo(cwSnDetail2.getSn()); + + //发送的数据 + cbd.setCmd("setButtons"); + + for (CwButton cwButton2 : list3) { + CwBottonDto cwBottonDto = new CwBottonDto(); + cwBottonDto.setIcon(cwButton2.getImage()); + list2.add(cwBottonDto); + } + cbd.setValue(list2); + cbv.setData(cbd); + + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cbv); + //调用websocket,推送给设备 + WebSocketUsers.sendMessageToUsersByText(message); + } + return toAjax(i); + } + + /** + * 修改按钮信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwButton:edit')") + @Log(title = "按钮信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwButton cwButton) + { + return toAjax(cwButtonService.updateCwButton(cwButton)); + } + + /** + * 删除按钮信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwButton:remove')") + @Log(title = "按钮信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwButtonService.deleteCwButtonByIds(ids)); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwCostAnalysisController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwCostAnalysisController.java new file mode 100644 index 0000000..d67d48c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwCostAnalysisController.java @@ -0,0 +1,593 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwCostAnalysis; +import com.ruoyi.project.management.domain.CwNewPayroll; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoLingliao; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.service.ICwCostAnalysisService; +import com.ruoyi.project.management.service.ICwNewPayrollService; +import com.ruoyi.project.management.service.IPwBomNumberTwoLingliaoService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwProductionBillProductService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 成本分析信息Controller + * + * @author zhukangchao + * @date 2023-08-11 + */ +@RestController +@RequestMapping("/management/cwCostAnalysis") +public class CwCostAnalysisController extends BaseController +{ + @Autowired + private ICwCostAnalysisService cwCostAnalysisService; + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //领料专用bom + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //执行单详情信息 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //工资信息 + @Autowired + private ICwNewPayrollService cwNewPayrollService; + + /** + * 查询成本分析信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostAnalysis:list')") + @GetMapping("/list") + public TableDataInfo list(CwCostAnalysis cwCostAnalysis) + { + startPage(); + List list = cwCostAnalysisService.selectCwCostAnalysisList(cwCostAnalysis); + for (CwCostAnalysis cwCostAnalysis2 : list) { + List list2 = cwCostAnalysisService.selectCwCostAnalysisByUuid(cwCostAnalysis2.getUuid()); + cwCostAnalysis2.setChildren(list2); + } + return getDataTable(list); + } + + /** + * 导出成本分析信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostAnalysis:export')") + @Log(title = "成本分析信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwCostAnalysis cwCostAnalysis){ + + List list5 = new ArrayList(); + + List list = cwCostAnalysisService.selectCwCostAnalysisList(cwCostAnalysis); + for (CwCostAnalysis cwCostAnalysis2 : list) { + list5.add(cwCostAnalysis2); + List list2 = cwCostAnalysisService.selectCwCostAnalysisByUuid(cwCostAnalysis2.getUuid()); + for (CwCostAnalysis cwCostAnalysis3 : list2) { + list5.add(cwCostAnalysis3); + } + } + ExcelUtil util = new ExcelUtil(CwCostAnalysis.class); + return util.exportExcel(list5, "cwCostAnalysis"); + } + + /** + * 获取成本分析信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostAnalysis:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwCostAnalysisService.selectCwCostAnalysisById(id)); + } + + /** + * 新增成本分析信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostAnalysis:add')") + @Log(title = "成本分析信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwCostAnalysis cwCostAnalysis){ + if(null==cwCostAnalysis.getCode()||"".equals(cwCostAnalysis.getCode())){ + return AjaxResult.error("请选择令号"); + } + if(null==cwCostAnalysis.getProductName()||"".equals(cwCostAnalysis.getProductName())){ + return AjaxResult.error("请选择产品型号"); + } + //获取上月的月份,用于获取上月的工资 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MONTH, -1); + Date lastMonth = calendar.getTime(); + String format = sdf.format(lastMonth); + + //获取上上个月的日期,用于获取上月工资信息时,如果工资未计算出来,则获取上上个月的工资信息 + calendar.add(Calendar.MONTH, -1); + Date lastMonth2 = calendar.getTime(); + String format2 = sdf.format(lastMonth2); + + CwNewPayroll cwNewPayroll = new CwNewPayroll(); + + //计算制造车间的工时单价 + //铆焊工段 + /*cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("装配一工段"); + cwNewPayroll.setAffiliationMonth(format); + List list4 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list4.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list4 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe = 0.0; + Long shichang = 0L; + for (CwNewPayroll cwNewPayroll2 : list4) { + zonghe += cwNewPayroll2.getSalary().doubleValue(); + shichang += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double maohandanjia = zonghe/shichang/60;*/ + + //机一工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("机一工段"); + cwNewPayroll.setAffiliationMonth(format); + List list5 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list5.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list5 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe2 = 0.0; + Long shichang2 = 0L; + for (CwNewPayroll cwNewPayroll2 : list5) { + zonghe2 += cwNewPayroll2.getSalary().doubleValue(); + shichang2 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double jiyidanjia = zonghe2/shichang2/60; + + //机二工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("机二工段"); + cwNewPayroll.setAffiliationMonth(format); + List list6 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list6.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list6 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe3 = 0.0; + Long shichang3 = 0L; + for (CwNewPayroll cwNewPayroll2 : list6) { + zonghe3 += cwNewPayroll2.getSalary().doubleValue(); + shichang3 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double jierdanjia = zonghe3/shichang3/60; + + //机三工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("机三工段"); + cwNewPayroll.setAffiliationMonth(format); + List list7 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list7.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list7 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe4 = 0.0; + Long shichang4 = 0L; + for (CwNewPayroll cwNewPayroll2 : list7) { + zonghe4 += cwNewPayroll2.getSalary().doubleValue(); + shichang4 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double jisandanjia = zonghe4/shichang4/60; + + //装配车间 + /*cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("装配车间"); + cwNewPayroll.setAffiliationMonth(format); + List list8 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list8.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list8 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe5 = 0.0; + Long shichang5 = 0L; + for (CwNewPayroll cwNewPayroll2 : list8) { + zonghe5 += cwNewPayroll2.getSalary().doubleValue(); + shichang5 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double zhuangpeidanjia = zonghe5/shichang5/60; + + //企标工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list9 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list9.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list9 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe6 = 0.0; + Long shichang6 = 0L; + for (CwNewPayroll cwNewPayroll2 : list9) { + zonghe6 += cwNewPayroll2.getSalary().doubleValue(); + shichang6 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double qibiaogongduandanjia = zonghe6/shichang6/60; + + //销齿链组 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list10 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list10.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list10 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe7 = 0.0; + Long shichang7 = 0L; + for (CwNewPayroll cwNewPayroll2 : list10) { + zonghe7 += cwNewPayroll2.getSalary().doubleValue(); + shichang7 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double xiaochilianzudanjia = zonghe7/shichang7/60; + + //非标设备组 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list11 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list11.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list11 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe8 = 0.0; + Long shichang8 = 0L; + for (CwNewPayroll cwNewPayroll2 : list11) { + zonghe8 += cwNewPayroll2.getSalary().doubleValue(); + shichang8 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double feibiaoshebeizudanjia = zonghe8/shichang8/60; + + //综合工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list12 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list12.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list12 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe9 = 0.0; + Long shichang9 = 0L; + for (CwNewPayroll cwNewPayroll2 : list12) { + zonghe9 += cwNewPayroll2.getSalary().doubleValue(); + shichang9 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double zonghegongduandanjia = zonghe9/shichang9/60;*/ + + //综合工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("研发部"); + cwNewPayroll.setAffiliationMonth(format); + List list13 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list13.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list13 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe10 = 0.0; + Long shichang10 = 0L; + for (CwNewPayroll cwNewPayroll2 : list13) { + zonghe10 += cwNewPayroll2.getSalary().doubleValue(); + shichang10 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double yanfabudanjia = zonghe10/shichang10/60; + + //查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(cwCostAnalysis.getCode()); + //查询数量 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductByProductionBillIdAndName(productionBill.getId(), cwCostAnalysis.getProductName()); + cwCostAnalysis.setNumber(productionBillProduct.getQuantity()); + cwCostAnalysisService.insertCwCostAnalysis(cwCostAnalysis); + List list3 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndProductType(cwCostAnalysis.getCode(), cwCostAnalysis.getProductName()); + //创建批量操作的集合 + List list2 = new ArrayList(); + CwCostAnalysis cwCostAnalysis2 = new CwCostAnalysis(); + CwCostAnalysis cwCostAnalysis3 = new CwCostAnalysis(); + //单价 + Double d2 = 0.0; + //总价 + Double d = 0.0; + for (PwBomNumberTwoLingliao pwBomNumberTwo : list3) { + UUID uuid = UUID.randomUUID(); + cwCostAnalysis2 = new CwCostAnalysis(); + //uuid标识 + cwCostAnalysis2.setUuid(uuid.toString()); + cwCostAnalysis2.setSparedFour(cwCostAnalysis.getId()); + cwCostAnalysis2.setCostStatisticsId(cwCostAnalysis.getCostStatisticsId()); + cwCostAnalysis2.setMaterialName(pwBomNumberTwo.getName()); + cwCostAnalysis2.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + cwCostAnalysis2.setType(pwBomNumberTwo.getType()); + cwCostAnalysis2.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + cwCostAnalysis2.setOneNumber(pwBomNumberTwo.getOneNumber()); + cwCostAnalysis2.setSumNumber(pwBomNumberTwo.getSumNumber()); + list2.add(cwCostAnalysis2); + + //记录零件的总费用(所有序相加的费用) + Double lingjiandanjia = 0.0; + //查询物料的工序 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(cwCostAnalysis.getCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(cwCostAnalysis.getCode(), bomNumberTwo.getId()); + if(list.size()>0){ + //说明有序,则计算序的价格 + for (PwBomNumberTwo pwBomNumberTwo2 : list) { + cwCostAnalysis3 = new CwCostAnalysis(); + //uuid标识 + cwCostAnalysis3.setSuperiorId(uuid.toString()); + cwCostAnalysis3.setSparedFour(cwCostAnalysis.getId()); + cwCostAnalysis3.setCostStatisticsId(cwCostAnalysis.getCostStatisticsId()); + cwCostAnalysis3.setMaterialName(pwBomNumberTwo2.getName()); + cwCostAnalysis3.setFigureNumber(pwBomNumberTwo2.getFigureNumber()); + cwCostAnalysis3.setType(pwBomNumberTwo2.getType()); + cwCostAnalysis3.setPieceWeight(pwBomNumberTwo2.getPieceWeight()); + cwCostAnalysis3.setOneNumber(pwBomNumberTwo2.getOneNumber()); + cwCostAnalysis3.setSumNumber(pwBomNumberTwo2.getSumNumber()); + if(null==pwBomNumberTwo2.getXuTime()||"".equals(pwBomNumberTwo2.getXuTime())){ + //序工时。从bom中获取 + cwCostAnalysis3.setManHour(0.0); + }else{ + //序工时。从bom中获取 + cwCostAnalysis3.setManHour(pwBomNumberTwo2.getXuTime()); + } + + //如果序中带材料,则把材料添加上 + if(null!=pwBomNumberTwo2.getMaterialId()&&!"".equals(pwBomNumberTwo2.getMaterialId())){ + cwCostAnalysis3.setMaterialsName(pwBomNumberTwo2.getMaterialsName()); + cwCostAnalysis3.setMaterialsSpecification(pwBomNumberTwo2.getMaterialsSpecification()); + cwCostAnalysis3.setMeasure(Long.valueOf(pwBomNumberTwo2.getMeasure())); + cwCostAnalysis3.setWorkblank(pwBomNumberTwo2.getWorkblank()); + + //计算材料总价 + //查询材料库存信息 + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo2.getMaterialsName(), pwBomNumberTwo2.getMaterialsSpecification()); + if(null!=inventoryDetail3){ + if("毫米".equals(inventoryDetail3.getUnit())){ + cwCostAnalysis3.setMaterialsUnitPrice(inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwBomNumberTwo2.getMeasure()).divide(new BigDecimal("1000.0"),6,RoundingMode.HALF_UP))).multiply(new BigDecimal(pwBomNumberTwo2.getWorkblank())).doubleValue()); + }else if("平方毫米".equals(inventoryDetail3.getUnit())){ + //单价*(下料尺寸/1000000) + cwCostAnalysis3.setMaterialsUnitPrice(inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwBomNumberTwo2.getMeasure()).divide(new BigDecimal("1000000.0"),7,RoundingMode.HALF_UP))).multiply(new BigDecimal(pwBomNumberTwo2.getWorkblank())).doubleValue()); + }else{ + cwCostAnalysis3.setMaterialsUnitPrice(inventoryDetail3.getUnivalence().doubleValue()); + } + }else{ + cwCostAnalysis3.setMaterialsUnitPrice(0.0); + } + }else{ + cwCostAnalysis3.setMaterialsUnitPrice(0.0); + } + + //计算每道序的工时费,获取上月加工部门的应发工资总额,除以总出勤分钟,得到每分钟的单价 + //查询当前序的派工部门 + String departmentName = pwBomNumberTwo2.getDepartmentName(); + if(null==cwCostAnalysis3.getManHour()){ + cwCostAnalysis3.setManHour(0.0); + } + if("外协部".equals(departmentName)||"采购部".equals(departmentName)){ + //直接获取库存中的单价,然后加上加工费(库存中的价格+材料费) + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + if(null!=inventoryDetail){ + cwCostAnalysis3.setUnivalence(inventoryDetail.getUnivalence().doubleValue()+cwCostAnalysis3.getMaterialsUnitPrice()); + }else{ + cwCostAnalysis3.setUnivalence(0.0); + } + //总价(材料费+库存单价*本批数量) + cwCostAnalysis3.setTotalPrices(cwCostAnalysis3.getMaterialsUnitPrice()+(inventoryDetail.getUnivalence().doubleValue()*cwCostAnalysis2.getSumNumber())); + }else{ + /*if("铆焊工段".equals(departmentName)){ + if(maohandanjia.isNaN(maohandanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.3991); + }else{ + cwCostAnalysis3.setManHourUnitPrice(maohandanjia); + } + }else */if("机一工段".equals(departmentName)){ + if(jiyidanjia.isNaN(jiyidanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.4065); + }else{ + cwCostAnalysis3.setManHourUnitPrice(jiyidanjia); + } + }else if("机二工段".equals(departmentName)){ + if(jierdanjia.isNaN(jierdanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.4218); + }else{ + cwCostAnalysis3.setManHourUnitPrice(jierdanjia); + } + }else if("机三工段".equals(departmentName)){ + if(jisandanjia.isNaN(jisandanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.4005); + }else{ + cwCostAnalysis3.setManHourUnitPrice(jisandanjia); + } + }/*else if("装配车间".equals(departmentName)){ + if(zhuangpeidanjia.isNaN(zhuangpeidanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.4); + }else{ + cwCostAnalysis3.setManHourUnitPrice(zhuangpeidanjia); + } + }else if("企标工段".equals(departmentName)){ + if(qibiaogongduandanjia.isNaN(qibiaogongduandanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.3181); + }else{ + cwCostAnalysis3.setManHourUnitPrice(qibiaogongduandanjia); + } + }else if("销齿链组".equals(departmentName)){ + if(xiaochilianzudanjia.isNaN(xiaochilianzudanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.304); + }else{ + cwCostAnalysis3.setManHourUnitPrice(xiaochilianzudanjia); + } + }else if("非标设备组".equals(departmentName)){ + if(feibiaoshebeizudanjia.isNaN(feibiaoshebeizudanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.3605); + }else{ + cwCostAnalysis3.setManHourUnitPrice(feibiaoshebeizudanjia); + } + }else if("综合工段".equals(departmentName)){ + if(zonghegongduandanjia.isNaN(zonghegongduandanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.4136); + }else{ + cwCostAnalysis3.setManHourUnitPrice(zonghegongduandanjia); + } + }*/else if("研发部".equals(departmentName)){ + if(yanfabudanjia.isNaN(yanfabudanjia)){ + cwCostAnalysis3.setManHourUnitPrice(0.4); + }else{ + cwCostAnalysis3.setManHourUnitPrice(yanfabudanjia); + } + } + + //合并价格 , 需要累加材料总价和加工费 + if(null==cwCostAnalysis3.getMaterialsUnitPrice()||"".equals(cwCostAnalysis3.getMaterialsUnitPrice())){ + cwCostAnalysis3.setMaterialsUnitPrice(0.0); + } + if(null==cwCostAnalysis3.getManHour()||"".equals(cwCostAnalysis3.getManHour())){ + cwCostAnalysis3.setManHour(0.0); + } + if(null==cwCostAnalysis3.getManHourUnitPrice()||"".equals(cwCostAnalysis3.getManHourUnitPrice())){ + cwCostAnalysis3.setManHourUnitPrice(0.0); + } + //加工费 + 材料费 cwCostAnalysis3.getManHour()*cwCostAnalysis3.getManHourUnitPrice()(new BigDecimal().divide(new BigDecimal(cwCostAnalysis2.getSumNumber()),4,BigDecimal.ROUND_UP)).add() + cwCostAnalysis3.setUnivalence((new BigDecimal(cwCostAnalysis3.getMaterialsUnitPrice()).divide(new BigDecimal(cwCostAnalysis2.getSumNumber()),4,RoundingMode.HALF_UP)).add(new BigDecimal(cwCostAnalysis3.getManHour()*cwCostAnalysis3.getManHourUnitPrice())).doubleValue()); + + //总价(材料费+工时*工时单价*本批数量) + cwCostAnalysis3.setTotalPrices(cwCostAnalysis3.getMaterialsUnitPrice()+(cwCostAnalysis3.getManHour()*cwCostAnalysis3.getManHourUnitPrice()*cwCostAnalysis2.getSumNumber())); + } + + //累加单价 + lingjiandanjia += cwCostAnalysis3.getUnivalence(); + list2.add(cwCostAnalysis3); + } + }else{ + //没有序,说明可能用的是库存,则直接获取库存中的价格 + //查询物料的价格 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + cwCostAnalysis2.setUnivalence(inventoryDetail.getUnivalence().doubleValue()); + }else{ + cwCostAnalysis2.setUnivalence(0.0); + } + //总价 + cwCostAnalysis2.setTotalPrices(cwCostAnalysis2.getUnivalence()*cwCostAnalysis2.getSumNumber()); + } + + //累加每道序的费用,添加到零件成品上 + if(list.size()>0){ + cwCostAnalysis2.setUnivalence(lingjiandanjia); + } + //零件总价 + cwCostAnalysis2.setTotalPrices(cwCostAnalysis2.getUnivalence()*cwCostAnalysis2.getSumNumber()); + d2 += cwCostAnalysis2.getUnivalence(); + d += cwCostAnalysis2.getTotalPrices(); + } + CwCostAnalysis costAnalysis = cwCostAnalysisService.selectCwCostAnalysisById(cwCostAnalysis.getId()); + costAnalysis.setUnivalence(d/costAnalysis.getNumber()); + costAnalysis.setTotalPrices(d); + cwCostAnalysisService.updateCwCostAnalysis(costAnalysis); + //批量添加 + cwCostAnalysisService.insertCwCostAnalysiss(list2); + //创建合计对象 + CwCostAnalysis cwCostAnalysis4 = new CwCostAnalysis(); + cwCostAnalysis4.setSparedFour(cwCostAnalysis.getId()); + cwCostAnalysis4.setCode("总计"); + //单价 + cwCostAnalysis4.setUnivalence(d2); + cwCostAnalysis4.setTotalPrices(d); + return toAjax(cwCostAnalysisService.insertCwCostAnalysis(cwCostAnalysis4)); + } + + /** + * 修改成本分析信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostAnalysis:edit')") + @Log(title = "成本分析信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwCostAnalysis cwCostAnalysis) + { + return toAjax(cwCostAnalysisService.updateCwCostAnalysis(cwCostAnalysis)); + } + + /** + * 删除成本分析信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostAnalysis:remove')") + @Log(title = "成本分析信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long long1 : ids) { + cwCostAnalysisService.deleteCwCostAnalysisBySparedFour(long1); + } + return toAjax(cwCostAnalysisService.deleteCwCostAnalysisByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwCostStatisticsController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwCostStatisticsController.java new file mode 100644 index 0000000..74fd03c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwCostStatisticsController.java @@ -0,0 +1,167 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwCostAnalysis; +import com.ruoyi.project.management.domain.CwCostStatistics; +import com.ruoyi.project.management.service.ICwCostAnalysisService; +import com.ruoyi.project.management.service.ICwCostStatisticsService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 成本统计信息Controller + * + * @author zhukangchao + * @date 2023-08-12 + */ +@RestController +@RequestMapping("/management/cwCostStatistics") +public class CwCostStatisticsController extends BaseController +{ + @Autowired + private ICwCostStatisticsService cwCostStatisticsService; + //成本分析详情 + @Autowired + private ICwCostAnalysisService cwCostAnalysisService; + + /** + * 查询成本统计信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostStatistics:list')") + @GetMapping("/list") + public TableDataInfo list(CwCostStatistics cwCostStatistics) + { + startPage(); + List list = cwCostStatisticsService.selectCwCostStatisticsList(cwCostStatistics); + return getDataTable(list); + } + + /** + * 导出成本统计信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostStatistics:export')") + @Log(title = "成本统计信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwCostStatistics cwCostStatistics) + { + List list = cwCostStatisticsService.selectCwCostStatisticsList(cwCostStatistics); + ExcelUtil util = new ExcelUtil(CwCostStatistics.class); + return util.exportExcel(list, "cwCostStatistics"); + } + + /** + * 获取成本统计信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostStatistics:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwCostStatisticsService.selectCwCostStatisticsById(id)); + } + + /** + * 新增成本统计信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostStatistics:add')") + @Log(title = "成本统计信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwCostStatistics cwCostStatistics) + { + return toAjax(cwCostStatisticsService.insertCwCostStatistics(cwCostStatistics)); + } + + /** + * 修改成本统计信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostStatistics:edit')") + @Log(title = "成本统计信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwCostStatistics cwCostStatistics) + { + return toAjax(cwCostStatisticsService.updateCwCostStatistics(cwCostStatistics)); + } + + /** + * 删除成本统计信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwCostStatistics:remove')") + @Log(title = "成本统计信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwCostStatisticsService.deleteCwCostStatisticsByIds(ids)); + } + + /** + * 分摊费用 + */ + @DeleteMapping("/apportions/{ids}") + public AjaxResult apportions(@PathVariable Long[] ids){ + for (Long id : ids) { + CwCostStatistics statistics = cwCostStatisticsService.selectCwCostStatisticsById(id); + //计算出总费用 + Double d = statistics.getFactoryDepreciationCosts()+statistics.getDepreciationCost()+statistics.getArticleOfConsumption()+statistics.getElectricCharge()+statistics.getCostOfLabor()+statistics.getOtherCharges(); + List list = cwCostAnalysisService.selectCwCostAnalysisByStatisticsId(id); + //记录总费用 + Double zong = 0.0; + for (CwCostAnalysis cwCostAnalysis : list) { + if(null!=cwCostAnalysis.getCode()&&!"".equals(cwCostAnalysis.getProductName())){ + zong += cwCostAnalysis.getTotalPrices(); + } + } + //单个产品的总价 + Double totalPrices = 0.0; + //需要分摊的费用 + Double shareExpenses = 0.0; + List list2 = new ArrayList(); + for (CwCostAnalysis cwCostAnalysis : list) { + if(null!=cwCostAnalysis.getCode()&&!"".equals(cwCostAnalysis.getProductName())){ + Double quanzhong = cwCostAnalysis.getTotalPrices()/zong; + //保留权重 + cwCostAnalysis.setProportionOfAllocation(quanzhong); + //计算制造费用 + Double zhizao = d * quanzhong; + if(null==cwCostAnalysis.getShareExpenses()){ + cwCostAnalysis.setShareExpenses(0.0); + } + cwCostAnalysis.setShareExpenses(cwCostAnalysis.getShareExpenses()+zhizao); + } + + //把单个产品上的制造费用分摊到每个带有费用的零件上 + if(null!=cwCostAnalysis.getCode()&&!"".equals(cwCostAnalysis.getProductName())){ + totalPrices = cwCostAnalysis.getTotalPrices(); + shareExpenses = cwCostAnalysis.getShareExpenses(); + } + if(null==cwCostAnalysis.getSuperiorId()&&null==cwCostAnalysis.getCode()){ + //获取其零件的总价 + Double bili = cwCostAnalysis.getTotalPrices()/totalPrices; + //分摊的比例 + cwCostAnalysis.setProportionOfAllocation(bili); + //分摊的制造费用 + cwCostAnalysis.setShareExpenses(shareExpenses*bili); + //批量修改集合 + } +// list2.add(cwCostAnalysis); + cwCostAnalysisService.updateCwCostAnalysis(cwCostAnalysis); + } +// cwCostAnalysisService.updateCwCostAnalysiss(list2); + + } + return toAjax(1); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwDepartmentController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwDepartmentController.java new file mode 100644 index 0000000..972293e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwDepartmentController.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwDepartment; +import com.ruoyi.project.management.service.ICwDepartmentService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 财务部门Controller + * + * @author zhukangchao + * @date 2021-10-25 + */ +@RestController +@RequestMapping("/management/cwDepartment") +public class CwDepartmentController extends BaseController +{ + @Autowired + private ICwDepartmentService cwDepartmentService; + + /** + * 查询财务部门列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwDepartment:list')") + @GetMapping("/list") + public TableDataInfo list(CwDepartment cwDepartment) + { + startPage(); + List list = cwDepartmentService.selectCwDepartmentList(cwDepartment); + return getDataTable(list); + } + + /** + * 导出财务部门列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwDepartment:export')") + @Log(title = "财务部门", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwDepartment cwDepartment) + { + List list = cwDepartmentService.selectCwDepartmentList(cwDepartment); + ExcelUtil util = new ExcelUtil(CwDepartment.class); + return util.exportExcel(list, "cwDepartment"); + } + + /** + * 获取财务部门详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwDepartment:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwDepartmentService.selectCwDepartmentById(id)); + } + + /** + * 新增财务部门 + */ + @PreAuthorize("@ss.hasPermi('management:cwDepartment:add')") + @Log(title = "财务部门", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwDepartment cwDepartment) + { + List list = cwDepartmentService.selectCwDepartmentList(cwDepartment); + if(null != list && list.size() > 0) { + return AjaxResult.error("部门数据重复!"); + } + return toAjax(cwDepartmentService.insertCwDepartment(cwDepartment)); + } + + /** + * 修改财务部门 + */ + @PreAuthorize("@ss.hasPermi('management:cwDepartment:edit')") + @Log(title = "财务部门", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwDepartment cwDepartment) + { + return toAjax(cwDepartmentService.updateCwDepartment(cwDepartment)); + } + + /** + * 删除财务部门 + */ + @PreAuthorize("@ss.hasPermi('management:cwDepartment:remove')") + @Log(title = "财务部门", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwDepartmentService.deleteCwDepartmentByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwDimissionController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwDimissionController.java new file mode 100644 index 0000000..f428b2c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwDimissionController.java @@ -0,0 +1,260 @@ +package com.ruoyi.project.management.controller; + +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwDimission; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwWageSummary; +import com.ruoyi.project.management.service.ICwDimissionService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 员工离职单Controller + * + * @author zhukangchao + * @date 2022-04-09 + */ +@RestController +@RequestMapping("/management/cwDimission") +public class CwDimissionController extends BaseController +{ + @Autowired + private ICwDimissionService cwDimissionService; + //用户信息 + @Autowired + private TokenService tokenService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + + /** + * 查询员工离职单列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwDimission:list')") + @GetMapping("/list") + public TableDataInfo list(CwDimission cwDimission) + { + startPage(); + List list = cwDimissionService.selectCwDimissionList(cwDimission); + return getDataTable(list); + } + + /** + * 导出员工离职单列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwDimission:export')") + @Log(title = "员工离职单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwDimission cwDimission) + { + List list = cwDimissionService.selectCwDimissionList(cwDimission); + ExcelUtil util = new ExcelUtil(CwDimission.class); + return util.exportExcel(list, "cwDimission"); + } + + /** + * 获取员工离职单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwDimission:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwDimissionService.selectCwDimissionById(id)); + } + + /** + * 新增员工离职单 + */ + @PreAuthorize("@ss.hasPermi('management:cwDimission:add')") + @Log(title = "员工离职单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwDimission cwDimission) + { + return toAjax(cwDimissionService.insertCwDimission(cwDimission)); + } + + /** + * 修改员工离职单 + */ + @PreAuthorize("@ss.hasPermi('management:cwDimission:edit')") + @Log(title = "员工离职单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwDimission cwDimission) + { + return toAjax(cwDimissionService.updateCwDimission(cwDimission)); + } + + /** + * 删除员工离职单 + */ + @PreAuthorize("@ss.hasPermi('management:cwDimission:remove')") + @Log(title = "员工离职单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwDimissionService.deleteCwDimissionByIds(ids)); + } + + /** + * 审核按钮操作(部门领导审核) + */ + @RequestMapping("/approveOnes/{ids}") + public AjaxResult approveOnes(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwDimission dimission = cwDimissionService.selectCwDimissionById(long1); + if(null!=dimission){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + dimission.setDeptAudit(user.getNickName()); + dimission.setDeptAuditDate(new Date()); + }else{ + return AjaxResult.error("未查询到数据"); + } + int i = cwDimissionService.updateCwDimission(dimission); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } + + /** + * 审核按钮操作(主管审核) + */ + @RequestMapping("/approveTwos/{ids}") + public AjaxResult approveTwos(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwDimission dimission = cwDimissionService.selectCwDimissionById(long1); + if(null!=dimission){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + dimission.setCompetentDeptAudit(user.getNickName()); + dimission.setCompetentDeptAuditDate(new Date()); + }else{ + return AjaxResult.error("未查询到数据"); + } + int i = cwDimissionService.updateCwDimission(dimission); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } + + /** + * 审核按钮操作(人事审核) + */ + @RequestMapping("/approveThrees/{ids}") + public AjaxResult approveThrees(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwDimission dimission = cwDimissionService.selectCwDimissionById(long1); + if(null!=dimission){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + dimission.setPersonnelAudit(user.getNickName()); + dimission.setPersonnelAuditDate(new Date()); + }else{ + return AjaxResult.error("未查询到数据"); + } + int i = cwDimissionService.updateCwDimission(dimission); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } + + /** + * 审核按钮操作(总经理审核) + */ + @RequestMapping("/approveFours/{ids}") + public AjaxResult approveFours(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwDimission dimission = cwDimissionService.selectCwDimissionById(long1); + if(null!=dimission){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + dimission.setLeadershipAudit(user.getNickName()); + dimission.setLeadershipAuditDate(new Date()); + }else{ + return AjaxResult.error("未查询到数据"); + } + int i = cwDimissionService.updateCwDimission(dimission); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } + + /** + * 审核按钮操作(财务审核,财务审核后要删除其员工基本信息) + */ + @RequestMapping("/approveFives/{ids}") + public AjaxResult approveFives(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwDimission dimission = cwDimissionService.selectCwDimissionById(long1); + if(null!=dimission){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + dimission.setFinanceAudit(user.getNickName()); + dimission.setFinanceAuditDate(new Date()); + }else{ + return AjaxResult.error("未查询到数据"); + } + int i = cwDimissionService.updateCwDimission(dimission); + //删除其员工基本信息 + CwNewEmployeeInformation newEmployeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(dimission.getName()); + cwNewEmployeeInformationService.deleteCwNewEmployeeInformationById(newEmployeeInformation.getId()); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwEvectionController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwEvectionController.java new file mode 100644 index 0000000..1134a8b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwEvectionController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwEvection; +import com.ruoyi.project.management.service.ICwEvectionService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 出差申请Controller + * + * @author zhukangchao + * @date 2021-12-28 + */ +@RestController +@RequestMapping("/management/cwEvection") +public class CwEvectionController extends BaseController +{ + @Autowired + private ICwEvectionService cwEvectionService; + + /** + * 查询出差申请列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwEvection:list')") + @GetMapping("/list") + public TableDataInfo list(CwEvection cwEvection) + { + startPage(); + List list = cwEvectionService.selectCwEvectionList(cwEvection); + return getDataTable(list); + } + + /** + * 导出出差申请列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwEvection:export')") + @Log(title = "出差申请", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwEvection cwEvection) + { + List list = cwEvectionService.selectCwEvectionList(cwEvection); + ExcelUtil util = new ExcelUtil(CwEvection.class); + return util.exportExcel(list, "cwEvection"); + } + + /** + * 获取出差申请详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwEvection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwEvectionService.selectCwEvectionById(id)); + } + + /** + * 新增出差申请 + */ + @PreAuthorize("@ss.hasPermi('management:cwEvection:add')") + @Log(title = "出差申请", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwEvection cwEvection) + { + return toAjax(cwEvectionService.insertCwEvection(cwEvection)); + } + + /** + * 修改出差申请 + */ + @PreAuthorize("@ss.hasPermi('management:cwEvection:edit')") + @Log(title = "出差申请", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwEvection cwEvection) + { + return toAjax(cwEvectionService.updateCwEvection(cwEvection)); + } + + /** + * 删除出差申请 + */ + @PreAuthorize("@ss.hasPermi('management:cwEvection:remove')") + @Log(title = "出差申请", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwEvectionService.deleteCwEvectionByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwExpenseReimbursementController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwExpenseReimbursementController.java new file mode 100644 index 0000000..fe82239 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwExpenseReimbursementController.java @@ -0,0 +1,349 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwExpenseReimbursement; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.service.ICwExpenseReimbursementService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 费用报销信息Controller + * + * @author zhukangchao + * @date 2023-11-30 + */ +@RestController +@RequestMapping("/management/cwExpenseReimbursement") +public class CwExpenseReimbursementController extends BaseController +{ + @Autowired + private ICwExpenseReimbursementService cwExpenseReimbursementService; + //用户信息 + @Autowired + private TokenService tokenService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + + /** + * 查询费用报销信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwExpenseReimbursement:list')") + @GetMapping("/list") + public TableDataInfo list(CwExpenseReimbursement cwExpenseReimbursement) + { + startPage(); + List list = cwExpenseReimbursementService.selectCwExpenseReimbursementList(cwExpenseReimbursement); + return getDataTable(list); + } + + /** + * 导出费用报销信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwExpenseReimbursement:export')") + @Log(title = "费用报销信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwExpenseReimbursement cwExpenseReimbursement) + { + List list = cwExpenseReimbursementService.selectCwExpenseReimbursementList(cwExpenseReimbursement); + ExcelUtil util = new ExcelUtil(CwExpenseReimbursement.class); + return util.exportExcel(list, "cwExpenseReimbursement"); + } + + /** + * 获取费用报销信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwExpenseReimbursement:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwExpenseReimbursementService.selectCwExpenseReimbursementById(id)); + } + + /** + * 新增费用报销信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwExpenseReimbursement:add')") + @Log(title = "费用报销信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwExpenseReimbursement cwExpenseReimbursement){ + //校验金额不能为null + if(null==cwExpenseReimbursement.getMoney()||0>cwExpenseReimbursement.getMoney()){ + return AjaxResult.error("请填写正确的金额"); + } + //校验发票类型 + if(null==cwExpenseReimbursement.getSparedOne()||"".equals(cwExpenseReimbursement.getSparedOne())){ + return AjaxResult.error("请选择发票类型"); + } + //校验税率 + if(null==cwExpenseReimbursement.getSparedThree()||"".equals(cwExpenseReimbursement.getSparedThree())){ + return AjaxResult.error("请选择税率"); + } + //生成申请单编号 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + cwExpenseReimbursement.setCode("BX-"+sdf.format(new Date())); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //报销人姓名 + cwExpenseReimbursement.setUserName(user.getNickName()); + //部门 + cwExpenseReimbursement.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwExpenseReimbursement.setDateTime(new Date()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwExpenseReimbursement.getMoney()+""); + cwExpenseReimbursement.setBigMoney(chinese); + + //校验是否抵充借款,如果为null,则默认为不抵扣 + if(null==cwExpenseReimbursement.getOffsettingDeduction()){ + cwExpenseReimbursement.setOffsettingDeduction("否"); + } + //校验原借款金额 +// if(null!=cwExpenseReimbursement.getBorrowMoney()&&0cwExpenseReimbursement.getMoney()){ + return AjaxResult.error("请填写正确的金额"); + } + //校验发票类型 + if(null==cwExpenseReimbursement.getSparedOne()||"".equals(cwExpenseReimbursement.getSparedOne())){ + return AjaxResult.error("请选择发票类型"); + } + //校验税率 + if(null==cwExpenseReimbursement.getSparedThree()||"".equals(cwExpenseReimbursement.getSparedThree())){ + return AjaxResult.error("请选择税率"); + } + + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwExpenseReimbursement.getMoney()+""); + cwExpenseReimbursement.setBigMoney(chinese); + + //校验原借款金额 +// if(null!=cwExpenseReimbursement.getBorrowMoney()&&0 list = cwJobsService.selectCwJobsList(cwJobs); + return getDataTable(list); + } + + /** + * 导出岗位列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwJobs:export')") + @Log(title = "岗位", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwJobs cwJobs) + { + List list = cwJobsService.selectCwJobsList(cwJobs); + ExcelUtil util = new ExcelUtil(CwJobs.class); + return util.exportExcel(list, "cwJobs"); + } + + /** + * 获取岗位详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwJobs:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwJobsService.selectCwJobsById(id)); + } + + /** + * 新增岗位 + */ + @PreAuthorize("@ss.hasPermi('management:cwJobs:add')") + @Log(title = "岗位", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwJobs cwJobs){ + if(null==cwJobs.getJobsName()||"".equals(cwJobs.getJobsName())){ + return AjaxResult.error("请输入岗位名称"); + } + if(null==cwJobs.getDeptName()||"".equals(cwJobs.getDeptName())){ + return AjaxResult.error("请选择所属部门"); + } + if(null==cwJobs.getWorkHours()||"".equals(cwJobs.getWorkHours())){ + return AjaxResult.error("请输入工作时长"); + } + if(cwJobs.getWorkHours()==0){ + return AjaxResult.error("工作时长不可为0"); + } + if(cwJobs.getWorkHours()>24){ + return AjaxResult.error("工作时长不可大于24小时"); + } + //判断是否重复 + CwJobs gw = new CwJobs(); + gw.setDeptName(cwJobs.getDeptName()); + gw.setJobsName(cwJobs.getJobsName()); + List list = cwJobsService.selectCwJobsList(gw); + if(null != list && list.size() > 0){ + return AjaxResult.error("添加岗位重复!"); + } + return toAjax(cwJobsService.insertCwJobs(cwJobs)); + } + + /** + * 修改岗位 + */ + @PreAuthorize("@ss.hasPermi('management:cwJobs:edit')") + @Log(title = "岗位", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwJobs cwJobs) + { + return toAjax(cwJobsService.updateCwJobs(cwJobs)); + } + + /** + * 删除岗位 + */ + @PreAuthorize("@ss.hasPermi('management:cwJobs:remove')") + @Log(title = "岗位", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwJobsService.deleteCwJobsByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwLeaveRecordController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwLeaveRecordController.java new file mode 100644 index 0000000..4242c6a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwLeaveRecordController.java @@ -0,0 +1,200 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwLeaveRecord; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.service.ICwLeaveRecordService; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 请假记录Controller + * + * @author zhukangchao + * @date 2021-12-22 + */ +@RestController +@RequestMapping("/management/cwLeaveRecord") +public class CwLeaveRecordController extends BaseController +{ + @Autowired + private ICwLeaveRecordService cwLeaveRecordService; + //考勤统计信息 + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + //用户信息 + @Autowired + private TokenService tokenService; + //部门信息 + @Autowired + private ISysDeptService deptService; + + /** + * 查询请假记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLeaveRecord:list')") + @GetMapping("/list") + public TableDataInfo list(CwLeaveRecord cwLeaveRecord){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据员工信息的部门id查询部门信息 + SysDept dept = deptService.selectDeptById(user.getDeptId()); + List list = new ArrayList(); + //除了财务部和综合管理的账号和管理员的账号,其他的一律用令一套查询方式 + if(user.getUserName().equals("zhanglili")||user.getUserName().equals("lihongye")||user.getUserName().equals("huyipeng")||user.getUserName().equals("zhaofenjing")||user.getUserName().equals("admin")){ + startPage(); + list = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + }else if(user.getUserName().equals("chenshitian")){ + cwLeaveRecord.setDeptName("生产部门"); + //只能查询本部门的员工姓名 + list = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + cwLeaveRecord.setDeptName("采购部门"); + List list2 = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + for (CwLeaveRecord cwLeaveRecord2 : list2) { + list.add(cwLeaveRecord2); + } + cwLeaveRecord.setDeptName("库房部门"); + List list3 = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + for (CwLeaveRecord cwLeaveRecord2 : list3) { + list.add(cwLeaveRecord2); + } + cwLeaveRecord.setDeptName("质检部门"); + List list4 = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + for (CwLeaveRecord cwLeaveRecord2 : list4) { + list.add(cwLeaveRecord2); + } + }else if(user.getUserName().equals("yinguofeng")){ + cwLeaveRecord.setDeptName("工艺部门"); + list = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + cwLeaveRecord.setDeptName("质检部门"); + List list2 = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + for (CwLeaveRecord cwLeaveRecord2 : list2) { + list.add(cwLeaveRecord2); + } + }else{ + cwLeaveRecord.setDeptName(dept.getDeptName()); + startPage(); + list = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + } + return getDataTable(list); + } + + /** + * 导出请假记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLeaveRecord:export')") + @Log(title = "请假记录", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwLeaveRecord cwLeaveRecord) + { + List list = cwLeaveRecordService.selectCwLeaveRecordList(cwLeaveRecord); + ExcelUtil util = new ExcelUtil(CwLeaveRecord.class); + return util.exportExcel(list, "cwLeaveRecord"); + } + + /** + * 获取请假记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwLeaveRecord:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwLeaveRecordService.selectCwLeaveRecordById(id)); + } + + /** + * 新增请假记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwLeaveRecord:add')") + @Log(title = "请假记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwLeaveRecord cwLeaveRecord){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + if(null==cwLeaveRecord.getTimeNumber()||cwLeaveRecord.getTimeNumber()==0){ + return AjaxResult.error("请填写请假时间"); + } + if(null==cwLeaveRecord.getName()){ + return AjaxResult.error("请选择请假人"); + } + if(null==cwLeaveRecord.getReasonForLeave()){ + return AjaxResult.error("请选择请假时间"); + } + //新增之前把考勤统计的信息也同步修改 + CwNewAttendanceStatistical cwNewAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(cwLeaveRecord.getName(), sdf.format(cwLeaveRecord.getLeaveDate())); + if(null != cwNewAttendanceStatistical){ + long l = cwNewAttendanceStatistical.getAbsenteeism().longValue() + cwLeaveRecord.getTimeNumber().longValue(); + cwNewAttendanceStatistical.setAbsenteeism(l); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + return toAjax(cwLeaveRecordService.insertCwLeaveRecord(cwLeaveRecord)); + } + + /** + * 修改请假记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwLeaveRecord:edit')") + @Log(title = "请假记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwLeaveRecord cwLeaveRecord){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + CwLeaveRecord leaveRecord = cwLeaveRecordService.selectCwLeaveRecordById(cwLeaveRecord.getId()); + //新增之前把考勤统计的信息也同步修改 + CwNewAttendanceStatistical cwNewAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(cwLeaveRecord.getName(), sdf.format(cwLeaveRecord.getLeaveDate())); + if(null != cwNewAttendanceStatistical){ + cwNewAttendanceStatistical.setAbsenteeism(cwNewAttendanceStatistical.getAbsenteeism()-leaveRecord.getTimeNumber().longValue()+cwLeaveRecord.getTimeNumber().longValue()); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + return toAjax(cwLeaveRecordService.updateCwLeaveRecord(cwLeaveRecord)); + } + + /** + * 删除请假记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwLeaveRecord:remove')") + @Log(title = "请假记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + for (Long long1 : ids) { + CwLeaveRecord leaveRecord = cwLeaveRecordService.selectCwLeaveRecordById(long1); + //新增之前把考勤统计的信息也同步修改 + CwNewAttendanceStatistical cwNewAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(leaveRecord.getName(), sdf.format(leaveRecord.getLeaveDate())); + if(null != cwNewAttendanceStatistical){ + cwNewAttendanceStatistical.setAbsenteeism(cwNewAttendanceStatistical.getAbsenteeism() - leaveRecord.getTimeNumber().longValue()); + if(cwNewAttendanceStatistical.getAbsenteeism() - leaveRecord.getTimeNumber().longValue()<0){ + cwNewAttendanceStatistical.setAbsenteeism(0L); + }else{ + cwNewAttendanceStatistical.setAbsenteeism(cwNewAttendanceStatistical.getAbsenteeism() - leaveRecord.getTimeNumber().longValue()); + } + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + } + return toAjax(cwLeaveRecordService.deleteCwLeaveRecordByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwLevelOfEducationController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwLevelOfEducationController.java new file mode 100644 index 0000000..5a77892 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwLevelOfEducationController.java @@ -0,0 +1,134 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwLevelOfEducation; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.service.ICwLevelOfEducationService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 补助Controller + * + * @author zhukangchao + * @date 2021-12-17 + */ +@RestController +@RequestMapping("/management/cwLevelOfEducation") +public class CwLevelOfEducationController extends BaseController +{ + @Autowired + private ICwLevelOfEducationService cwLevelOfEducationService; + //员工基本信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + + /** + * 查询补助列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLevelOfEducation:list')") + @GetMapping("/list") + public TableDataInfo list(CwLevelOfEducation cwLevelOfEducation) + { + startPage(); + List list = cwLevelOfEducationService.selectCwLevelOfEducationList(cwLevelOfEducation); + return getDataTable(list); + } + + /** + * 导出补助列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLevelOfEducation:export')") + @Log(title = "补助", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwLevelOfEducation cwLevelOfEducation) + { + List list = cwLevelOfEducationService.selectCwLevelOfEducationList(cwLevelOfEducation); + ExcelUtil util = new ExcelUtil(CwLevelOfEducation.class); + return util.exportExcel(list, "cwLevelOfEducation"); + } + + /** + * 获取补助详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwLevelOfEducation:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwLevelOfEducationService.selectCwLevelOfEducationById(id)); + } + + /** + * 新增补助 + */ + @PreAuthorize("@ss.hasPermi('management:cwLevelOfEducation:add')") + @Log(title = "补助", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwLevelOfEducation cwLevelOfEducation) + { + return toAjax(cwLevelOfEducationService.insertCwLevelOfEducation(cwLevelOfEducation)); + } + + /** + * 修改补助 + */ + @PreAuthorize("@ss.hasPermi('management:cwLevelOfEducation:edit')") + @Log(title = "补助", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwLevelOfEducation cwLevelOfEducation){ + //根据修改的id查询修改之前的数据 + CwLevelOfEducation cwLevelOfEducation2 = cwLevelOfEducationService.selectCwLevelOfEducationById(cwLevelOfEducation.getId()); + //修改补助金额时查询出所有的员工修改员工对应的金额 + CwNewEmployeeInformation cwNewEmployeeInformation = new CwNewEmployeeInformation(); + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list) { + //获取补助类型 + String remarks = cwLevelOfEducation.getRemarks(); + if("合同补助".equals(remarks)){ + if(cwNewEmployeeInformation2.getContractSubsidies().intValue()==cwLevelOfEducation2.getSubsidies().intValue()){ + cwNewEmployeeInformation2.setContractSubsidies(cwLevelOfEducation.getSubsidies()); + } + }else if("学历补助".equals(remarks)){ + if(cwNewEmployeeInformation2.getLevelOfEducationSubsidies().intValue()==cwLevelOfEducation2.getSubsidies().intValue()){ + cwNewEmployeeInformation2.setLevelOfEducationSubsidies(cwLevelOfEducation.getSubsidies()); + } + }else if("工龄补助".equals(remarks)){ + if(cwNewEmployeeInformation2.getSenioritySubsidies().intValue()==cwLevelOfEducation2.getSubsidies().intValue()){ + cwNewEmployeeInformation2.setSenioritySubsidies(cwLevelOfEducation.getSubsidies()); + } + }else if("社保补助".equals(remarks)){ + if(cwNewEmployeeInformation2.getSocialSecuritySubsidies().intValue()==cwLevelOfEducation2.getSubsidies().intValue()){ + cwNewEmployeeInformation2.setSocialSecuritySubsidies(cwLevelOfEducation.getSubsidies()); + } + } + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation2); + } + return toAjax(cwLevelOfEducationService.updateCwLevelOfEducation(cwLevelOfEducation)); + } + + /** + * 删除补助 + */ + @PreAuthorize("@ss.hasPermi('management:cwLevelOfEducation:remove')") + @Log(title = "补助", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwLevelOfEducationService.deleteCwLevelOfEducationByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwLogisticsFeesInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwLogisticsFeesInfoController.java new file mode 100644 index 0000000..a14e88b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwLogisticsFeesInfoController.java @@ -0,0 +1,602 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwLogisticsFeesInfo; +import com.ruoyi.project.management.domain.CwLogsotocsFeesMaterial; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwOtherPayment; +import com.ruoyi.project.management.domain.CwOtherPaymentInfo; +import com.ruoyi.project.management.domain.ImCustomer; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImSupplier; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwOtherCorrespondent; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.service.ICwLogisticsFeesInfoService; +import com.ruoyi.project.management.service.ICwLogsotocsFeesMaterialService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwOtherPaymentInfoService; +import com.ruoyi.project.management.service.ICwOtherPaymentService; +import com.ruoyi.project.management.service.IImCustomerService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImSupplierService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwOtherCorrespondentService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物流费用信息Controller + * + * @author zhukangchao + * @date 2023-11-30 + */ +@RestController +@RequestMapping("/management/cwLogisticsFeesInfo") +public class CwLogisticsFeesInfoController extends BaseController +{ + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + //用户信息 + @Autowired + private TokenService tokenService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //产品入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //关联信息表 + @Autowired + private ICwLogsotocsFeesMaterialService cwLogsotocsFeesMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + + /** + * 查询物流费用信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogisticsFeesInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CwLogisticsFeesInfo cwLogisticsFeesInfo) + { + startPage(); + List list = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoList(cwLogisticsFeesInfo); + return getDataTable(list); + } + + /** + * 导出物流费用信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogisticsFeesInfo:export')") + @Log(title = "物流费用信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwLogisticsFeesInfo cwLogisticsFeesInfo) + { + List list = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoList(cwLogisticsFeesInfo); + ExcelUtil util = new ExcelUtil(CwLogisticsFeesInfo.class); + return util.exportExcel(list, "cwLogisticsFeesInfo"); + } + + /** + * 获取物流费用信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogisticsFeesInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(id)); + } + + /** + * 新增物流费用信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogisticsFeesInfo:add')") + @Log(title = "物流费用信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwLogisticsFeesInfo cwLogisticsFeesInfo){ + //校验金额 + if(null==cwLogisticsFeesInfo.getMoney()||"".equals(cwLogisticsFeesInfo.getMoney())||0==cwLogisticsFeesInfo.getMoney()){ + return AjaxResult.error("请输入金额"); + } + //校验事由 + if(null==cwLogisticsFeesInfo.getCause()||"".equals(cwLogisticsFeesInfo.getCause())){ + return AjaxResult.error("请输入事由"); + } + //校验支付方式 + if(null==cwLogisticsFeesInfo.getPayWay()||"".equals(cwLogisticsFeesInfo.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==cwLogisticsFeesInfo.getUnitName()||"".equals(cwLogisticsFeesInfo.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //编号 + cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); + //关联单据编号(此处新增的为 “无”) + cwLogisticsFeesInfo.setRelevanceCode("无"); + //单据类型(此处新增为 “其它”) + cwLogisticsFeesInfo.setRelevanceType("其它"); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwLogisticsFeesInfo.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(cwLogisticsFeesInfo.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(cwLogisticsFeesInfo.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + + + return toAjax(cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo)); + } + + /** + * 修改物流费用信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogisticsFeesInfo:edit')") + @Log(title = "物流费用信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwLogisticsFeesInfo cwLogisticsFeesInfo){ + //修改前校验是否是允许修改的前提 + if(null!=cwLogisticsFeesInfo.getApprover()&&!"".equals(cwLogisticsFeesInfo.getApprover())){ + return AjaxResult.error("已审核的单据不允许修改"); + } + + //校验金额 + if(null==cwLogisticsFeesInfo.getMoney()||"".equals(cwLogisticsFeesInfo.getMoney())||0==cwLogisticsFeesInfo.getMoney()){ + return AjaxResult.error("请输入金额"); + } + //校验事由 + if(null==cwLogisticsFeesInfo.getCause()||"".equals(cwLogisticsFeesInfo.getCause())){ + return AjaxResult.error("请输入事由"); + } + //校验支付方式 + if(null==cwLogisticsFeesInfo.getPayWay()||"".equals(cwLogisticsFeesInfo.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==cwLogisticsFeesInfo.getUnitName()||"".equals(cwLogisticsFeesInfo.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwLogisticsFeesInfo.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(cwLogisticsFeesInfo.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(cwLogisticsFeesInfo.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + return toAjax(cwLogisticsFeesInfoService.updateCwLogisticsFeesInfo(cwLogisticsFeesInfo)); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody CwLogisticsFeesInfo cwLogisticsFeesInfo) { + //校验付款金额 + if (null == cwLogisticsFeesInfo.getPaymentAmount() || "".equals(cwLogisticsFeesInfo.getPaymentAmount()) || 0 == cwLogisticsFeesInfo.getPaymentAmount()) { + return AjaxResult.error("请填写付款金额"); + } + //获取合同id + Long[] ids = cwLogisticsFeesInfo.getIds(); + //供应商名称 + String name = ""; + //合同总金额 + Double d = 0.0; + for (Long id : ids) { + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(id); + //校验当前选中的合同是否为同一个供应商 + if (!"".equals(name)) { + //校验name是否和供应商名称相同 + if (!name.equals(logisticsFeesInfo.getUnitName())) { + return AjaxResult.error("不同供应商不可合并付款"); + } + } else { + name = logisticsFeesInfo.getUnitName(); + } + + //计算合同总金额 + d += logisticsFeesInfo.getMoney(); + } + + //校验付款金额是否大于合同总金额 + if (d < cwLogisticsFeesInfo.getPaymentAmount()) { + return AjaxResult.error("付款金额不能大于合同总金额"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //付款申请单 + CwOtherPayment cwOtherPayment = new CwOtherPayment(); + //申请单编号 + cwOtherPayment.setCode("FKSQ-" + sdf.format(new Date())); + //姓名 + cwOtherPayment.setUserName(user.getNickName()); + //部门 + cwOtherPayment.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwOtherPayment.setDateTime(new Date()); + //金额 + cwOtherPayment.setMoney(cwLogisticsFeesInfo.getPaymentAmount()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = MoneyUtil.toChinese(cwOtherPayment.getMoney() + ""); + cwOtherPayment.setBigMoney(chinese); + //支付类型 + cwOtherPayment.setSparedOne("付款"); + //单位名称 + cwOtherPayment.setUnitName(name); + //未付款金额(初始为填写的金额) + cwOtherPayment.setNotInvoiceAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //未开票金额(初始为填写的金额) + cwOtherPayment.setNotProceedsAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //结算比例(初始为0) + cwOtherPayment.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwOtherPayment.getUnitName()); + if (null != supplier) { + //账号 + cwOtherPayment.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(supplier.getOpeningBank()); + } else { + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwOtherPayment.getUnitName()); + if (null != employeeInformation) { + //账号 + cwOtherPayment.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(employeeInformation.getOpeningBank()); + } else { + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwOtherPayment.getUnitName()); + if (null != customer) { + //账号 + cwOtherPayment.setAccountNumber(customer.getBankNumber()); + //开户行 + cwOtherPayment.setOpeningBank(customer.getBank()); + } else { + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwOtherPayment.getUnitName()); + if (null != otherCorrespondent) { + //账号 + cwOtherPayment.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(otherCorrespondent.getOpeningBank()); + } else { + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwOtherPaymentService.insertCwOtherPayment(cwOtherPayment); + if (i > 0) { + //生成付款申请单及付款申请单明细 + for (Long id : ids) { + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(id); + + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + //付款单id + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + //付款单编号 + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + //关联合同编号 + cwOtherPaymentInfo.setCode(logisticsFeesInfo.getCode()); + //合同金额 + cwOtherPaymentInfo.setContractMoney(logisticsFeesInfo.getMoney()); + //付款金额(计算) 合同金额*(付款金额/总金额) + cwOtherPaymentInfo.setPaymentAmount(logisticsFeesInfo.getMoney() * (cwLogisticsFeesInfo.getPaymentAmount() / d)); + //付款比例(计算) 付款金额/合同金额 + cwOtherPaymentInfo.setProportion(cwOtherPaymentInfo.getPaymentAmount() / logisticsFeesInfo.getMoney() * 100); + //合同类型 + cwOtherPaymentInfo.setSparedOne("物流费用"); + cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + } + return toAjax(i); + } + + /** + * 删除物流费用信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogisticsFeesInfo:remove')") + @Log(title = "物流费用信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(id); + if(null!=logisticsFeesInfo.getApprover()&&!"".equals(logisticsFeesInfo.getApprover())){ + return AjaxResult.error("已审批的单据不允许删除"); + } + } + return toAjax(cwLogisticsFeesInfoService.deleteCwLogisticsFeesInfoByIds(ids)); + } + + /** + * 查询入库单详情信息 + * + */ + @RequestMapping("/listImProductReceiptMaterial/{ids}") + public AjaxResult listImProductReceiptMaterial(@PathVariable Long[] ids){ + //返回数据的集合 + List list = new ArrayList(); + for (Long id : ids) { + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(id); + String relevanceCode = logisticsFeesInfo.getRelevanceCode(); + if(relevanceCode.contains(",")){ + String[] strArr = relevanceCode.split(","); + for (String code : strArr) { + //查询入库单信息 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByContractCode(code); + if(null!=productReceipt){ + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptId(productReceipt.getId()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + list.add(imProductReceiptMaterial); + } + } + } + } + } + return AjaxResult.success(list); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids) { + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(id); + + if (null != logisticsFeesInfo.getApprover()) { + logisticsFeesInfo.setApprover("");; + } else { + logisticsFeesInfo.setApprover(user.getNickName()); + //审批时间 + logisticsFeesInfo.setApproverTime(new Date()); + } + + if(null != logisticsFeesInfo.getApprover() && !"".equals(logisticsFeesInfo.getApprover())){ + //审批时计算存货单价 + //已处理的总价值 + Double yichuli = 0.0; + //计算存货单价 + CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial = new CwLogsotocsFeesMaterial(); + cwLogsotocsFeesMaterial.setLogisticsFeesInfoId(logisticsFeesInfo.getId()); + List list = cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialList(cwLogsotocsFeesMaterial); + //总运费 + for (CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial2 : list) { + //根据物料入库单id查询已处理的数据,加上当前的分摊金额 + List list2 = cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialByProductReceiptMaterialId(cwLogsotocsFeesMaterial2.getProductReceiptMaterialId()); + for (CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial3 : list2) { + //统计已处理的总价值 + yichuli += cwLogsotocsFeesMaterial3.getCostProportion(); + } + //计算入库单存货单价 + Double rukudan = (cwLogsotocsFeesMaterial2.getQuantity() * cwLogsotocsFeesMaterial2.getUnitPrice() + yichuli)/cwLogsotocsFeesMaterial2.getQuantity(); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(cwLogsotocsFeesMaterial2.getName(), cwLogsotocsFeesMaterial2.getFigureNumber()); + if(null != inventoryDetail){ + //还原单价 + BigDecimal decimal = inventoryDetail.getUnivalence().multiply(new BigDecimal("2")).subtract(new BigDecimal(rukudan)); + inventoryDetail.setUnivalence(decimal); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + return AjaxResult.error("未查询到库存信息,审核失败"); + } + //已处理的总价值+本次分摊的价值,再计算入库单存货单价 + Double zong = cwLogsotocsFeesMaterial2.getCostProportion()+yichuli; + //新入库单价值 + Double xindanjia = (cwLogsotocsFeesMaterial2.getQuantity() * cwLogsotocsFeesMaterial2.getUnitPrice()+zong)/cwLogsotocsFeesMaterial2.getQuantity(); + //重新计算单价 + BigDecimal decimal2 = inventoryDetail.getUnivalence().add(new BigDecimal(xindanjia)).divide(new BigDecimal("2"),4, RoundingMode.HALF_UP); + inventoryDetail.setUnivalence(decimal2); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + cwLogsotocsFeesMaterial2.setSparedOne("已处理"); + cwLogsotocsFeesMaterialService.updateCwLogsotocsFeesMaterial(cwLogsotocsFeesMaterial2); + } + }else{ + //还原单价 + //已处理的总价值 + Double yichuli = 0.0; + //计算存货单价 + CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial = new CwLogsotocsFeesMaterial(); + cwLogsotocsFeesMaterial.setLogisticsFeesInfoId(logisticsFeesInfo.getId()); + List list = cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialList(cwLogsotocsFeesMaterial); + //总运费 + for (CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial2 : list) { + //根据物料入库单id查询已处理的数据,加上当前的分摊金额 + List list2 = cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialByProductReceiptMaterialId(cwLogsotocsFeesMaterial2.getProductReceiptMaterialId()); + for (CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial3 : list2) { + //统计已处理的总价值 + yichuli += cwLogsotocsFeesMaterial3.getCostProportion(); + } + //计算入库单存货单价 + Double rukudan = (cwLogsotocsFeesMaterial2.getQuantity() * cwLogsotocsFeesMaterial2.getUnitPrice() + yichuli)/cwLogsotocsFeesMaterial2.getQuantity(); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(cwLogsotocsFeesMaterial2.getName(), cwLogsotocsFeesMaterial2.getFigureNumber()); + if(null != inventoryDetail){ + //还原单价 + BigDecimal decimal = inventoryDetail.getUnivalence().multiply(new BigDecimal("2")).subtract(new BigDecimal(rukudan)); + inventoryDetail.setUnivalence(decimal); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + return AjaxResult.error("未查询到库存信息,审核失败"); + } + //已处理的总价值-本次分摊的价值,再计算入库单存货单价 + Double zong = yichuli - cwLogsotocsFeesMaterial2.getCostProportion(); + //新入库单价值 + Double xindanjia = (cwLogsotocsFeesMaterial2.getQuantity() * cwLogsotocsFeesMaterial2.getUnitPrice()+zong)/cwLogsotocsFeesMaterial2.getQuantity(); + //重新计算单价 + BigDecimal decimal2 = inventoryDetail.getUnivalence().add(new BigDecimal(xindanjia)).divide(new BigDecimal("2"),4, RoundingMode.HALF_UP); + inventoryDetail.setUnivalence(decimal2); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + cwLogsotocsFeesMaterial2.setSparedOne("未处理"); + cwLogsotocsFeesMaterialService.updateCwLogsotocsFeesMaterial(cwLogsotocsFeesMaterial2); + } + } + + i = cwLogisticsFeesInfoService.updateCwLogisticsFeesInfo(logisticsFeesInfo); + //触发金蝶接口 + if (null != logisticsFeesInfo.getApprover() && !"".equals(logisticsFeesInfo.getApprover())) { + //调用金蝶的 费用应付单 + + } else { + //触发反审核动作 + + } + } + return toAjax(i); + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwLogsotocsFeesMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwLogsotocsFeesMaterialController.java new file mode 100644 index 0000000..4c7d600 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwLogsotocsFeesMaterialController.java @@ -0,0 +1,183 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwLogisticsFeesInfo; +import com.ruoyi.project.management.domain.CwLogsotocsFeesMaterial; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.service.ICwLogisticsFeesInfoService; +import com.ruoyi.project.management.service.ICwLogsotocsFeesMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物流费用和入库单关联Controller + * + * @author zhukangchao + * @date 2023-12-13 + */ +@RestController +@RequestMapping("/management/cwLogsotocsFeesMaterial") +public class CwLogsotocsFeesMaterialController extends BaseController +{ + @Autowired + private ICwLogsotocsFeesMaterialService cwLogsotocsFeesMaterialService; + //物流费用单 + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + //入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + + /** + * 查询物流费用和入库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogsotocsFeesMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial) + { + startPage(); + List list = cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialList(cwLogsotocsFeesMaterial); + return getDataTable(list); + } + + /** + * 导出物流费用和入库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogsotocsFeesMaterial:export')") + @Log(title = "物流费用和入库单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial) + { + List list = cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialList(cwLogsotocsFeesMaterial); + ExcelUtil util = new ExcelUtil(CwLogsotocsFeesMaterial.class); + return util.exportExcel(list, "cwLogsotocsFeesMaterial"); + } + + /** + * 获取物流费用和入库单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogsotocsFeesMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialById(id)); + } + + /** + * 新增物流费用和入库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogsotocsFeesMaterial:add')") + @Log(title = "物流费用和入库单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial){ + //校验ids + if(cwLogsotocsFeesMaterial.getIds().length<1){ + return AjaxResult.error("请选择物流费用单"); + } + //校验idsTwo + if(cwLogsotocsFeesMaterial.getIdsTwo().length<1){ + return AjaxResult.error("请选择入库单详情信息"); + } + //物料总价值 + Double totalPrices = 0.0; + //获取ids + Long[] ids = cwLogsotocsFeesMaterial.getIds(); + //获取idsTwo + Long[] idsTwo = cwLogsotocsFeesMaterial.getIdsTwo(); + //根据id查询入库单详情信息 + for (Long id : idsTwo) { + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(id); + //获取入库单中物料的价值 + totalPrices += productReceiptMaterial.getTotalPrices(); + } + + //新增关联表信息 + CwLogsotocsFeesMaterial logsotocsFeesMaterial = new CwLogsotocsFeesMaterial(); + int i = 0; + //计算单颗物料占总价值的百分比,乘以物流费用单总价 = 单颗物料的运费金额 + for (Long id : ids) { + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(id); + for (Long idTwo : idsTwo) { + logsotocsFeesMaterial = new CwLogsotocsFeesMaterial(); + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(idTwo); + //占比金额(含税) + Double bili = productReceiptMaterial.getTotalPrices() / totalPrices * logisticsFeesInfo.getMoney(); + //占比金额(未税) + Double weishuibili = productReceiptMaterial.getTotalPrices() / totalPrices * (logisticsFeesInfo.getMoney() / (1.0+(logisticsFeesInfo.getSparedThree().doubleValue()/100))); + //物流费用单id + logsotocsFeesMaterial.setLogisticsFeesInfoId(id); + //物料入库单id + logsotocsFeesMaterial.setProductReceiptMaterialId(idTwo); + //物料名称 + logsotocsFeesMaterial.setName(productReceiptMaterial.getMaterialName()); + //物料图号 + logsotocsFeesMaterial.setFigureNumber(productReceiptMaterial.getSpecification()); + //物料单价 + logsotocsFeesMaterial.setUnitPrice(productReceiptMaterial.getUnivalence()); + //数量 + logsotocsFeesMaterial.setQuantity(productReceiptMaterial.getActualQuantity().longValue()); + //运费占比(含税) + logsotocsFeesMaterial.setCostProportion(bili); + //运费占比(未税) + logsotocsFeesMaterial.setSparedFive(weishuibili); + //默认未处理,审核之后改为已处理 + logsotocsFeesMaterial.setSparedOne("未处理"); + i = cwLogsotocsFeesMaterialService.insertCwLogsotocsFeesMaterial(logsotocsFeesMaterial); + } + } + + return toAjax(i); + } + + /** + * 修改物流费用和入库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogsotocsFeesMaterial:edit')") + @Log(title = "物流费用和入库单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial) + { + return toAjax(cwLogsotocsFeesMaterialService.updateCwLogsotocsFeesMaterial(cwLogsotocsFeesMaterial)); + } + + /** + * 删除物流费用和入库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:cwLogsotocsFeesMaterial:remove')") + @Log(title = "物流费用和入库单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + CwLogsotocsFeesMaterial logsotocsFeesMaterial = cwLogsotocsFeesMaterialService.selectCwLogsotocsFeesMaterialById(id); + //根据物流费用单id查询 + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoService.selectCwLogisticsFeesInfoById(logsotocsFeesMaterial.getLogisticsFeesInfoId()); + if(null!=logisticsFeesInfo.getApprover()&&!"".equals(logisticsFeesInfo.getApprover())){ + //说明是已审批的单据,则不允许删除 + return AjaxResult.error("已审批的单据不允许删除明细"); + } + } + return toAjax(cwLogsotocsFeesMaterialService.deleteCwLogsotocsFeesMaterialByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwNewAttendanceController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewAttendanceController.java new file mode 100644 index 0000000..ea7df8c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewAttendanceController.java @@ -0,0 +1,373 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwAttendance; +import com.ruoyi.project.management.domain.CwEmployeeInformation; +import com.ruoyi.project.management.domain.CwLeaveRecord; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwRules; +import com.ruoyi.project.management.domain.CwWorkOvertimeRecord; +import com.ruoyi.project.management.domain.CwWorkingDaysConfiguration; +import com.ruoyi.project.management.service.ICwLeaveRecordService; +import com.ruoyi.project.management.service.ICwNewAttendanceService; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwRulesService; +import com.ruoyi.project.management.service.ICwWorkOvertimeRecordService; +import com.ruoyi.project.management.service.ICwWorkingDaysConfigurationService; +import com.ruoyi.project.management.utils.ExcelUs; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 新考勤记录Controller + * + * @author zhukangchao + * @date 2021-12-16 + */ +@RestController +@RequestMapping("/management/cwNewAttendance") +public class CwNewAttendanceController extends BaseController +{ + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //考勤统计信息 + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + //排班信息 + @Autowired + private ICwRulesService cwRulesService; + //工作日配置信息 + @Autowired + private ICwWorkingDaysConfigurationService cwWorkingDaysConfigurationService; + //加班信息 + @Autowired + private ICwWorkOvertimeRecordService cwWorkOvertimeRecordService; + //请假信息 + @Autowired + private ICwLeaveRecordService cwLeaveRecordService; + + /** + * 查询新考勤记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendance:list')") + @GetMapping("/list") + public TableDataInfo list(CwNewAttendance cwNewAttendance) + { + startPage(); + List list = cwNewAttendanceService.selectCwNewAttendanceList(cwNewAttendance); + return getDataTable(list); + } + + /** + * 导出新考勤记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendance:export')") + @Log(title = "新考勤记录", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwNewAttendance cwNewAttendance) + { + List list = cwNewAttendanceService.selectCwNewAttendanceList(cwNewAttendance); + ExcelUtil util = new ExcelUtil(CwNewAttendance.class); + return util.exportExcel(list, "cwNewAttendance"); + } + + /** + * 获取新考勤记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendance:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwNewAttendanceService.selectCwNewAttendanceById(id)); + } + + /** + * 新增新考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendance:add')") + @Log(title = "新考勤记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwNewAttendance cwNewAttendance) + { + return toAjax(cwNewAttendanceService.insertCwNewAttendance(cwNewAttendance)); + } + + /** + * 修改新考勤记录 + */ + @SuppressWarnings("deprecation") + @PreAuthorize("@ss.hasPermi('management:cwNewAttendance:edit')") + @Log(title = "新考勤记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwNewAttendance cwNewAttendance){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + //获取工作时长 + Double workSum = cwNewAttendance.getWorkSum(); + //计算考勤时长 如果上班卡不为null且下班卡不为null时计算考勤时长 + if(null!=cwNewAttendance.getWorkStartTime()&&null!=cwNewAttendance.getWorkEndTime()){ + double d = ((cwNewAttendance.getWorkEndTime().getHours()*60+cwNewAttendance.getWorkEndTime().getMinutes()) - (cwNewAttendance.getWorkStartTime().getHours()*60+cwNewAttendance.getWorkStartTime().getMinutes()))/60.0; + if(d>4.5){ + if(d-1>8){ + cwNewAttendance.setWorkSum(8.0); + }else{ + cwNewAttendance.setWorkSum(d-1); + } + }else{ + cwNewAttendance.setWorkSum(d); + } + }else{ + cwNewAttendance.setWorkSum(0.0); + } + //根据员工姓名查询统计信息 + CwNewAttendanceStatistical attendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(cwNewAttendance.getName(), sdf.format(cwNewAttendance.getAttendanceDate())+""); + if(null != attendanceStatistical){ + attendanceStatistical.setRealAttendance(attendanceStatistical.getRealAttendance()+cwNewAttendance.getWorkSum().longValue()-workSum.longValue()); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(attendanceStatistical); + } + return toAjax(cwNewAttendanceService.updateCwNewAttendance(cwNewAttendance)); + } + + /** + * 删除新考勤记录 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendance:remove')") + @Log(title = "新考勤记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwNewAttendanceService.deleteCwNewAttendanceByIds(ids)); + } + + /** + * 上传考勤记录信息 + */ + @RequestMapping("/uploadAttendanceFile") + @ResponseBody + public AjaxResult uploadAttendanceFile(@RequestParam("file") MultipartFile filePath){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM"); + SimpleDateFormat df = new SimpleDateFormat("HH:mm"); + String originalFilename = filePath.getOriginalFilename(); + + SimpleDateFormat sdfs = new SimpleDateFormat("HH:mm:ss"); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelUs.readExcel(files); + List list = new ArrayList(); + //考勤日期 + String date = null; + //循环导入考勤信息 + List list2 = new ArrayList(); + for (int i = 1; i < result.size(); i++) { + //根据员工姓名查询员工信息 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(result.get(i).get(0).toString()); + if(null == employeeInformation ||employeeInformation.getVirtualWorkstation()==1){ + continue; + }else{ + //说明有此员工 + //查询统计信息 + CwNewAttendanceStatistical newAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(employeeInformation.getName(),sd.format(sd.parse(result.get(i).get(4).toString()))); + if(null==newAttendanceStatistical){ + newAttendanceStatistical = new CwNewAttendanceStatistical(); + //员工姓名 + newAttendanceStatistical.setName(employeeInformation.getName()); + date = sd.format(sd.parse(result.get(i).get(4).toString())); + //所属月份 + newAttendanceStatistical.setDate(sd.format(sd.parse(result.get(i).get(4).toString()))); + //所属部门 + newAttendanceStatistical.setDeptName(employeeInformation.getDeptName()); + //应出勤 + newAttendanceStatistical.setShouldAttendanceNumber(0L); + //实出勤 + newAttendanceStatistical.setRealAttendance(0L); + //加班时长 + newAttendanceStatistical.setWorkOvertimeNumber(0L); + //请假时长 + newAttendanceStatistical.setAbsenteeism(0L); + //迟到 + newAttendanceStatistical.setLateNumber(0L); + //早退 + newAttendanceStatistical.setLeaveEarly(0L); + //缺卡 + newAttendanceStatistical.setLessNumber(0L); + cwNewAttendanceStatisticalService.insertCwNewAttendanceStatistical(newAttendanceStatistical); + } + //创建考勤记录对象 + CwNewAttendance cwNewAttendance = new CwNewAttendance(); + //添加统计id + cwNewAttendance.setStatisticalId(newAttendanceStatistical.getId()); + //添加员工姓名 + cwNewAttendance.setName(result.get(i).get(0).toString()); + //所属部门 + cwNewAttendance.setDeptName(employeeInformation.getDeptName()); + //考勤日期 + cwNewAttendance.setAttendanceDate(sdf.parse(result.get(i).get(4).toString())); + if(null != result.get(i).get(5).toString()&&!"".equals(result.get(i).get(5).toString())&&!"-".equals(result.get(i).get(5).toString())){ + //上班时间 + cwNewAttendance.setWorkStartTime(df.parse(result.get(i).get(5).toString())); + } + if(null != result.get(i).get(6).toString()&&!"".equals(result.get(i).get(6).toString())&&!"-".equals(result.get(i).get(6).toString())){ + //下班时间 + cwNewAttendance.setWorkEndTime(df.parse(result.get(i).get(6).toString())); + } + if(Double.valueOf(result.get(i).get(7).toString())>=8){ + //工作时长 + cwNewAttendance.setWorkSum(8.0); + }else{ + //计算考勤时长 如果上班卡不为null且下班卡不为null时计算考勤时长 + if(null!=cwNewAttendance.getWorkStartTime()&&null!=cwNewAttendance.getWorkEndTime()){ + double d = ((cwNewAttendance.getWorkEndTime().getHours()*60+cwNewAttendance.getWorkEndTime().getMinutes()) - (cwNewAttendance.getWorkStartTime().getHours()*60+cwNewAttendance.getWorkStartTime().getMinutes()))/60.0; + if(d>4.5){ + if(d-1>8){ + cwNewAttendance.setWorkSum(8.0); + }else{ + cwNewAttendance.setWorkSum(d-1); + } + }else{ + cwNewAttendance.setWorkSum(d); + } + }else{ + cwNewAttendance.setWorkSum(0.0); + } + //工作时长 +// cwNewAttendance.setWorkSum(Double.valueOf(result.get(i).get(7).toString())); + } + //迟到次数 + + //早退次数 + list.add(cwNewAttendance); + } + } + //批量添加 + cwNewAttendanceService.insertCwNewAttendanceList(list); + + //根据日期查询考勤统计表中所有数据 + CwNewAttendanceStatistical cwNewAttendanceStatistical = new CwNewAttendanceStatistical(); + cwNewAttendanceStatistical.setDate(date); + List list3 = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalList(cwNewAttendanceStatistical); + for (CwNewAttendanceStatistical cwNewAttendanceStatistical2 : list3) { + //查询当前员工是否有排班记录,如果有,此处则不再统计起考勤信息,则直接添加其考勤详情 + list2 = cwRulesService.selectCwRulesByNameAndDate(cwNewAttendanceStatistical2.getName(),cwNewAttendanceStatistical2.getDate()+"-01"); + //判断有没有排班记录 + if(list2.size()>0){ + //三班制班次数量 + Long banci = 0L; + //两班制班次数量 + Long banci2 = 0L; + for (CwRules cwRules : list2) { + if("三班两倒制".equals(cwRules.getRules())){ + banci++; + }else{ + banci2++; + } + } + // 应出勤天数(如果排班表中有此员工的排班记录,则应出勤为排班记录的数量) + cwNewAttendanceStatistical2.setShouldAttendanceNumber(banci * 12 + banci2 * 8); + }else{ + //根据考勤日期获取应出勤天数(计算应出勤天数) + CwWorkingDaysConfiguration workingDaysConfiguration = cwWorkingDaysConfigurationService.selectCwWorkingDaysConfigurationByDate(date); + if("后勤部门".equals(cwNewAttendanceStatistical2.getDeptName())){ + cwNewAttendanceStatistical2.setShouldAttendanceNumber(workingDaysConfiguration.getWorkingDaysHouqin()*8); + }else if("机加车间".equals(cwNewAttendanceStatistical2.getDeptName())){ + cwNewAttendanceStatistical2.setShouldAttendanceNumber(workingDaysConfiguration.getWorkingDaysJijia()*8); + }/*else if("装配车间".equals(cwNewAttendanceStatistical2.getDeptName())){ + cwNewAttendanceStatistical2.setShouldAttendanceNumber(workingDaysConfiguration.getWorkingDaysZhuangpei()*8); + }*/else if("质检部门".equals(cwNewAttendanceStatistical2.getDeptName())){ + cwNewAttendanceStatistical2.setShouldAttendanceNumber(workingDaysConfiguration.getWorkingDaysZhijian()*8); + }else{ + cwNewAttendanceStatistical2.setShouldAttendanceNumber(workingDaysConfiguration.getWorkingDays()*8); + } + } + //计算加班时长 + //根据名称和加班日期查询 + List list4 = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordByNameAndDate(cwNewAttendanceStatistical2.getName(),cwNewAttendanceStatistical2.getDate()+"-01"); + long i = 0; + for (CwWorkOvertimeRecord cwWorkOvertimeRecord : list4) { + i += cwWorkOvertimeRecord.getWorkOvertimeNumber(); + } + cwNewAttendanceStatistical2.setWorkOvertimeNumber(i); + //计算缺勤时长 + List list5 = cwLeaveRecordService.selectCwLeaveRecordByNameAndDate(cwNewAttendanceStatistical2.getName(),cwNewAttendanceStatistical2.getDate()+"-01"); + long e = 0; + for (CwLeaveRecord cwLeaveRecord : list5) { + e += cwLeaveRecord.getTimeNumber(); + } + cwNewAttendanceStatistical2.setAbsenteeism(e); + //修改当前员工的实出勤 + Long t = 0L; + //根据当前员工的姓名和所属日期查询考勤记录 +// List list6 = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDate(cwNewAttendanceStatistical2.getName(), cwNewAttendanceStatistical2.getDate()+"-01"); + List list6 = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDate(cwNewAttendanceStatistical2.getName(), cwNewAttendanceStatistical2.getDate()); + if(list2.size()>0){ + cwNewAttendanceStatistical2.setRealAttendance(cwNewAttendanceStatistical2.getShouldAttendanceNumber()+cwNewAttendanceStatistical2.getWorkOvertimeNumber()-cwNewAttendanceStatistical2.getAbsenteeism()); + }else{ + for (CwNewAttendance cwNewAttendance2 : list6) { + t += cwNewAttendance2.getWorkSum().longValue(); + } + cwNewAttendanceStatistical2.setRealAttendance(t+cwNewAttendanceStatistical2.getWorkOvertimeNumber()); + } + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical2); + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + public static Date addDay(Date date, int num) { + Calendar startDT = Calendar.getInstance(); + startDT.setTime(date); + startDT.add(Calendar.DATE, num); + return startDT.getTime(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwNewAttendanceStatisticalController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewAttendanceStatisticalController.java new file mode 100644 index 0000000..2fbd692 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewAttendanceStatisticalController.java @@ -0,0 +1,249 @@ +package com.ruoyi.project.management.controller; + +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwLeaveRecord; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.service.ICwNewAttendanceService; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 考勤记录统计Controller + * + * @author zhukangchao + * @date 2022-03-30 + */ +@RestController +@RequestMapping("/management/cwNewAttendanceStatistical") +public class CwNewAttendanceStatisticalController extends BaseController +{ + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + //用户信息 + @Autowired + private TokenService tokenService; + //部门信息 + @Autowired + private ISysDeptService deptService; + //打卡信息 + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + + /** + * 查询考勤记录统计列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendanceStatistical:list')") + @GetMapping("/list") + public TableDataInfo list(CwNewAttendanceStatistical cwNewAttendanceStatistical){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据员工信息的部门id查询部门信息 + SysDept dept = deptService.selectDeptById(user.getDeptId()); + List list = new ArrayList(); + //除了财务部和综合管理的账号和管理员的账号,其他的一律用令一套查询方式 + if(user.getUserName().equals("zhouqingdi")||user.getUserName().equals("lihongye")||user.getUserName().equals("huyipeng")||user.getUserName().equals("zhaofenjing")||user.getUserName().equals("admin") + || user.getUserName().equals("cuijiapei")){ + startPage(); + list = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalList(cwNewAttendanceStatistical); +// for (CwNewAttendanceStatistical cwNewAttendanceStatistical2 : list) { +// //查询当前员工是否在员工信息表中存在 +// CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwNewAttendanceStatistical2.getName()); +// if(null==employeeInformation){ +// //说明离职了 +// cwNewAttendanceStatistical2.setSparedTwo("离职"); +// cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical2); +// } +// } + }else{ + cwNewAttendanceStatistical.setDeptName(dept.getDeptName()); + startPage(); + list = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalList(cwNewAttendanceStatistical); + } + return getDataTable(list); + } + + /** + * 打印当天的考勤 + */ + /** + * 打印单据功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据, + */ + @RequestMapping("/prints") + public AjaxResult prints(){ + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdft= new SimpleDateFormat("yyyy-MM"); + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + SysDept dept = user.getDept(); + //返回获得到的考勤表的信息 + HashMap map = new HashMap<>(); + //获取当前日期 + Date date = new Date(); + //查询当前日期,当前登录者的部门的所有已打卡的员工信息 + List list = cwNewAttendanceService.selectCwNewAttendanceByDeptAndDate(dept.getDeptName(),sdf.format(date)); + + //考勤信息 + map.put("list",list); + //所属月份 + map.put("reportingPeriod",sdft.format(date)); + //所属部门 + map.put("dept",dept.getDeptName()); + //库管 + map.put("date",sdf.format(date)); + return AjaxResult.success("success",map); + } + + /** + * 导出考勤记录统计列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendanceStatistical:export')") + @Log(title = "考勤记录统计", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwNewAttendanceStatistical cwNewAttendanceStatistical) + { + List list = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalList(cwNewAttendanceStatistical); + ExcelUtil util = new ExcelUtil(CwNewAttendanceStatistical.class); + return util.exportExcel(list, "cwNewAttendanceStatistical"); + } + + /** + * 获取考勤记录统计详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendanceStatistical:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalById(id)); + } + + /** + * 新增考勤记录统计 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendanceStatistical:add')") + @Log(title = "考勤记录统计", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwNewAttendanceStatistical cwNewAttendanceStatistical) + { + return toAjax(cwNewAttendanceStatisticalService.insertCwNewAttendanceStatistical(cwNewAttendanceStatistical)); + } + + /** + * 修改考勤记录统计 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendanceStatistical:edit')") + @Log(title = "考勤记录统计", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwNewAttendanceStatistical cwNewAttendanceStatistical){ + //重新计算实出勤 + cwNewAttendanceStatistical.setRealAttendance(cwNewAttendanceStatistical.getEssentialAttendance()+cwNewAttendanceStatistical.getWorkOvertimeNumber()); + return toAjax(cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical)); + } + + /** + * 删除考勤记录统计 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewAttendanceStatistical:remove')") + @Log(title = "考勤记录统计", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwNewAttendanceStatisticalService.deleteCwNewAttendanceStatisticalByIds(ids)); + } + + /** + * 校正数据 + */ + @RequestMapping("/reviseInfos/{date}") + public AjaxResult reviseInfos(@PathVariable String date){ + if(null==date||"".equals(date)||"undefined".equals(date)){ + return AjaxResult.error("请选择要校正的月份"); + } + //根据日期获取当前月的所有人的数据信息 + CwNewAttendanceStatistical cwNewAttendanceStatistical = new CwNewAttendanceStatistical(); + cwNewAttendanceStatistical.setDate(date); + List list = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalList(cwNewAttendanceStatistical); + int i = 0; + for (CwNewAttendanceStatistical cwNewAttendanceStatistical2 : list) { + //记录实出勤 + Double realAttendance = 0.0; + //记录标准时长 + Double essentialAttendance = 0.0; + + //记录加班时长 + Double workOvertimeNumber = 0.0; + + //记录中班次数 + long middleShiftNumber = 0L; + + //记录夜班次数 + long nightNumber = 0L; + + //根据姓名和日期查询 + List list2 = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDate(cwNewAttendanceStatistical2.getName(), date); + for (CwNewAttendance cwNewAttendance : list2) { + //标准时长 + essentialAttendance += cwNewAttendance.getWorkSum(); + //加班时长 + workOvertimeNumber += cwNewAttendance.getLeaveDays(); + //中班次数 + middleShiftNumber += cwNewAttendance.getMiddleShiftNumber(); + //夜班次数 + nightNumber += cwNewAttendance.getNightNumber(); + } + //实出勤 + realAttendance = essentialAttendance + workOvertimeNumber; + cwNewAttendanceStatistical2.setRealAttendance(realAttendance.longValue()); + //标准时长 + cwNewAttendanceStatistical2.setEssentialAttendance(essentialAttendance.longValue()); + //加班时长 + cwNewAttendanceStatistical2.setWorkOvertimeNumber(workOvertimeNumber.longValue()); + //中班次数 + cwNewAttendanceStatistical2.setMiddleShiftNumber(middleShiftNumber); + //夜班次数 + cwNewAttendanceStatistical2.setNightNumber(nightNumber); + i = cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical2); + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwNewEmployeeInformationController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewEmployeeInformationController.java new file mode 100644 index 0000000..43f8be1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewEmployeeInformationController.java @@ -0,0 +1,670 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwJobs; +import com.ruoyi.project.management.domain.CwLevelOfEducation; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.service.ICwDepartmentService; +import com.ruoyi.project.management.service.ICwJobsService; +import com.ruoyi.project.management.service.ICwLevelOfEducationService; +import com.ruoyi.project.management.service.ICwNewAttendanceService; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.utils.ExcelUs; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 新员工基本信息Controller + * + * @author zhukangchao + * @date 2021-12-16 + */ +@RestController +@RequestMapping("/management/cwNewEmployeeInformation") +public class CwNewEmployeeInformationController extends BaseController +{ + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //部门 + @Autowired + private ICwDepartmentService cwDepartmentService; + //岗位信息 + @Autowired + private ICwJobsService cwJobsService; + //补助信息 + @Autowired + private ICwLevelOfEducationService cwLevelOfEducationService; + //用户信息 + @Autowired + private TokenService tokenService; + //部门信息 + @Autowired + private ISysDeptService deptService; + + //考勤记录信息 + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + //考勤记录统计信息 + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + + /** + * 查询新员工基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewEmployeeInformation:list')") + @GetMapping("/list") + public TableDataInfo list(CwNewEmployeeInformation cwNewEmployeeInformation){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据员工信息的部门id查询部门信息 + SysDept dept = deptService.selectDeptById(user.getDeptId()); + List list = new ArrayList(); + //除了财务部和综合管理的账号和管理员的账号,其他的一律用令一套查询方式 + if(user.getUserName().equals("cuijiapei")||user.getUserName().equals("lihongye")||user.getUserName().equals("huyipeng")||user.getUserName().equals("zhaofenjing")||user.getUserName().equals("admin")){ + startPage(); + list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + }else if(user.getUserName().equals("chenshitian")){ + cwNewEmployeeInformation.setDeptName("生产部门"); + //只能查询本部门的员工姓名 + list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationListByName(cwNewEmployeeInformation); + cwNewEmployeeInformation.setDeptName("采购部门"); + List list2 = cwNewEmployeeInformationService.selectCwNewEmployeeInformationListByName(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list2) { + list.add(cwNewEmployeeInformation2); + } + cwNewEmployeeInformation.setDeptName("库房部门"); + List list3 = cwNewEmployeeInformationService.selectCwNewEmployeeInformationListByName(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list3) { + list.add(cwNewEmployeeInformation2); + } + }else if(user.getUserName().equals("yinguofeng")){ + cwNewEmployeeInformation.setDeptName("工艺部门"); + //只能查询本部门的员工姓名 + list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationListByName(cwNewEmployeeInformation); + cwNewEmployeeInformation.setDeptName("质检部门"); + List list4 = cwNewEmployeeInformationService.selectCwNewEmployeeInformationListByName(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list4) { + list.add(cwNewEmployeeInformation2); + } + }else{ + cwNewEmployeeInformation.setDeptName(dept.getDeptName()); + //只能查询本部门的员工姓名 + list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationListByName(cwNewEmployeeInformation); + } + + return getDataTable(list); + } + + /** + * 导出新员工基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewEmployeeInformation:export')") + @Log(title = "新员工基本信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwNewEmployeeInformation cwNewEmployeeInformation) + { + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + ExcelUtil util = new ExcelUtil(CwNewEmployeeInformation.class); + return util.exportExcel(list, "cwNewEmployeeInformation"); + } + + /** + * 获取新员工基本信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewEmployeeInformation:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwNewEmployeeInformationService.selectCwNewEmployeeInformationById(id)); + } + + /** + * 新增新员工基本信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewEmployeeInformation:add')") + @Log(title = "新员工基本信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwNewEmployeeInformation cwNewEmployeeInformation){ + //判断员工名称是否为null + if(null==cwNewEmployeeInformation.getName()||"".equals(cwNewEmployeeInformation.getName())){ + return AjaxResult.error("请输入员工姓名"); + } + //根据名称查询员工信息是否存在 + CwNewEmployeeInformation newEmployeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwNewEmployeeInformation.getName()); + if(null!=newEmployeeInformation){ + return AjaxResult.error("此员工已存在,请核实姓名"); + } + //判断部门是否是外聘人员,如果为外聘人员则没有补助 + if("外聘人员".equals(cwNewEmployeeInformation.getDeptName())){ + //获取岗位信息,根据部门名称和岗位名称查询信息,查询岗位时长 + if(null!=cwNewEmployeeInformation.getJobs()&&!"".equals(cwNewEmployeeInformation.getJobs())){ + //获取岗位时长 + CwJobs cwJobs = cwJobsService.selectCwJobsByJobsName(cwNewEmployeeInformation.getJobs(),cwNewEmployeeInformation.getDeptName()); + cwNewEmployeeInformation.setShiftTheLength(cwJobs.getWorkHours()); + } + //学历补助 + cwNewEmployeeInformation.setLevelOfEducationSubsidies(new BigDecimal("0")); + //合同补助 + cwNewEmployeeInformation.setContractSubsidies(new BigDecimal("0")); + //工龄补助 + cwNewEmployeeInformation.setSenioritySubsidies(new BigDecimal("0")); + //社保补助 + cwNewEmployeeInformation.setSocialSecuritySubsidies(new BigDecimal("0")); + }else{ + //获取岗位信息,根据部门名称和岗位名称查询信息,查询岗位时长 + if(null!=cwNewEmployeeInformation.getJobs()&&!"".equals(cwNewEmployeeInformation.getJobs())){ + //获取岗位时长 + CwJobs cwJobs = cwJobsService.selectCwJobsByJobsName(cwNewEmployeeInformation.getJobs(),cwNewEmployeeInformation.getDeptName()); + cwNewEmployeeInformation.setShiftTheLength(cwJobs.getWorkHours()); + } + //获取学历 + if(!"无".equals(cwNewEmployeeInformation.getLevelOfEducation())){ + //根据学历名称查询补助表的补助金额 + CwLevelOfEducation levelOfEducation = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName(cwNewEmployeeInformation.getLevelOfEducation()); + if(null!=levelOfEducation){ + cwNewEmployeeInformation.setLevelOfEducationSubsidies(levelOfEducation.getSubsidies()); + }else{ + return AjaxResult.error("未查询到学历补助金额"); + } + }else{ + cwNewEmployeeInformation.setLevelOfEducationSubsidies(new BigDecimal("0")); + } + //获取合同期限 + CwLevelOfEducation levelOfEducation = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName(cwNewEmployeeInformation.getContractYear().toString()); + if(null!=levelOfEducation){ + cwNewEmployeeInformation.setContractSubsidies(levelOfEducation.getSubsidies()); + }else{ + cwNewEmployeeInformation.setContractSubsidies(new BigDecimal("0")); + } + //获取社保状态 + if("新农合".equals(cwNewEmployeeInformation.getSocialSecurityStatus())){ + CwLevelOfEducation levelOfEducation2 = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName(cwNewEmployeeInformation.getSocialSecurityStatus()); + if(null!=levelOfEducation2){ + cwNewEmployeeInformation.setSocialSecuritySubsidies(levelOfEducation2.getSubsidies()); + }else{ + cwNewEmployeeInformation.setSocialSecuritySubsidies(new BigDecimal("0")); + } + }else{ + cwNewEmployeeInformation.setSocialSecuritySubsidies(new BigDecimal("0")); + } + //获取入职日期(计算工龄) + //获取入职日期,计算入职日期到当前日期的年份,用于计算工龄 + Date entryDate = cwNewEmployeeInformation.getEntryDate(); + Calendar bef = Calendar.getInstance(); + Calendar aft = Calendar.getInstance(); + bef.setTime(entryDate); + aft.setTime(new Date()); + int surplus = aft.get(Calendar.DATE) - bef.get(Calendar.DATE); + int result = aft.get(Calendar.MONTH) - bef.get(Calendar.MONTH); + int year = aft.get(Calendar.YEAR) - bef.get(Calendar.YEAR); + long i = 0; + if(result<0){ + i = year--; + }else if(result == 0){ + if(surplus>0){ + i = year; + } + }else{ + i = year; + } + if(i<0){ + i = 0; + } + cwNewEmployeeInformation.setSeniority(i); + //获取工龄补助 + if(i==0){ + cwNewEmployeeInformation.setSenioritySubsidies(new BigDecimal("0")); + }else{ + //判断只有签了正式的劳动合同的才有工龄补助 + if(null!=cwNewEmployeeInformation.getContractYear()&&cwNewEmployeeInformation.getContractYear()!=0){ + CwLevelOfEducation levelOfEducation2 = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName("工龄"); + cwNewEmployeeInformation.setSenioritySubsidies(levelOfEducation2.getSubsidies()); + }else{ + //劳务合同的没有工龄补助 + cwNewEmployeeInformation.setSenioritySubsidies(new BigDecimal("0")); + } + } + } + + //判断当前员工是否是真实员工 + if(cwNewEmployeeInformation.getVirtualWorkstation()==0){ + //新增加员工后,查询当前员工是否添加了考勤统计记录(根据姓名和入职日期查询,如果添加了则不再添加,如果没有添加则新建考勤统计记录和考勤详情记录) + String name = cwNewEmployeeInformation.getName(); + //获取入职日期 + Date entryDate = cwNewEmployeeInformation.getEntryDate(); + if(null==entryDate||"".equals(entryDate)){ + return AjaxResult.error("请填写入职日期"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + + //格式化入职日期 + String yue = sdf.format(entryDate); + //根据姓名和入职日期查询是否有了考勤统计信息 + CwNewAttendanceStatistical newAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(name, yue); + if(null==newAttendanceStatistical){ + //格式化每天的日期 + SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd"); + + //获取当前月份的自然日天数 + Calendar cal = Calendar.getInstance(); + cal.setTime(entryDate); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.roll(Calendar.DAY_OF_MONTH, -1); + String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); + // 得今天是2022年10月13号,所以这个月的最大天数是 31 + int tianshu = Integer.parseInt(format.substring((format.lastIndexOf("-") + 1))); + + //说明未查询到考勤统计记录,则需要添加考勤统计记录 + newAttendanceStatistical = new CwNewAttendanceStatistical(); + //所属月份 + newAttendanceStatistical.setDate(yue); + //姓名 + newAttendanceStatistical.setName(cwNewEmployeeInformation.getName()); + //所属部门 + newAttendanceStatistical.setDeptName(cwNewEmployeeInformation.getDeptName()); + //实出勤(初始为0) + newAttendanceStatistical.setRealAttendance(0L); + + cwNewAttendanceStatisticalService.insertCwNewAttendanceStatistical(newAttendanceStatistical); + + for (int i = 0; i < tianshu; i++) { + CwNewAttendance cwNewAttendance = new CwNewAttendance(); + //考勤统计记录id + cwNewAttendance.setStatisticalId(newAttendanceStatistical.getId()); + //员工姓名 + cwNewAttendance.setName(cwNewEmployeeInformation.getName()); + //所属部门 + cwNewAttendance.setDeptName(cwNewEmployeeInformation.getDeptName()); + //日期(每天一条记录) + int s = 0; + s = i+1; + String day = yue+"-"+s; + try { + cwNewAttendance.setAttendanceDate(sdfDay.parse(day)); + } catch (ParseException e) { + e.printStackTrace(); + } + cwNewAttendanceService.insertCwNewAttendance(cwNewAttendance); + } + } + } + return toAjax(cwNewEmployeeInformationService.insertCwNewEmployeeInformation(cwNewEmployeeInformation)); + } + + /** + * 修改新员工基本信息 + */ + @SuppressWarnings("deprecation") + @PreAuthorize("@ss.hasPermi('management:cwNewEmployeeInformation:edit')") + @Log(title = "新员工基本信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwNewEmployeeInformation cwNewEmployeeInformation){ + //判断员工名称是否为null + if(null==cwNewEmployeeInformation.getName()||"".equals(cwNewEmployeeInformation.getName())){ + return AjaxResult.error("请输入员工姓名"); + } +// //根据名称查询员工信息是否存在 +// CwNewEmployeeInformation newEmployeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwNewEmployeeInformation.getName()); +// if(null!=newEmployeeInformation){ +// return AjaxResult.error("此员工已存在,请核实姓名"); +// } + //判断部门是否是外聘人员,如果为外聘人员则没有补助 + if("外聘人员".equals(cwNewEmployeeInformation.getDeptName())){ + //获取岗位信息,根据部门名称和岗位名称查询信息,查询岗位时长 + if(null!=cwNewEmployeeInformation.getJobs()&&!"".equals(cwNewEmployeeInformation.getJobs())){ + //获取岗位时长 + CwJobs cwJobs = cwJobsService.selectCwJobsByJobsName(cwNewEmployeeInformation.getJobs(),cwNewEmployeeInformation.getDeptName()); + cwNewEmployeeInformation.setShiftTheLength(cwJobs.getWorkHours()); + } + //学历补助 + cwNewEmployeeInformation.setLevelOfEducationSubsidies(new BigDecimal("0")); + //合同补助 + cwNewEmployeeInformation.setContractSubsidies(new BigDecimal("0")); + //工龄补助 + cwNewEmployeeInformation.setSenioritySubsidies(new BigDecimal("0")); + //社保补助 + cwNewEmployeeInformation.setSocialSecuritySubsidies(new BigDecimal("0")); + }else{ + //获取岗位信息,根据岗位信息查询岗位时长 + if(null!=cwNewEmployeeInformation.getJobs()&&!"".equals(cwNewEmployeeInformation.getJobs())){ + //获取岗位时长 + CwJobs cwJobs = cwJobsService.selectCwJobsByJobsName(cwNewEmployeeInformation.getJobs(),cwNewEmployeeInformation.getDeptName()); + cwNewEmployeeInformation.setShiftTheLength(cwJobs.getWorkHours()); + } + //获取学历 + if(!"无".equals(cwNewEmployeeInformation.getLevelOfEducation())){ + //根据学历名称查询补助表的补助金额 + CwLevelOfEducation levelOfEducation = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName(cwNewEmployeeInformation.getLevelOfEducation()); + if(null!=levelOfEducation){ + cwNewEmployeeInformation.setLevelOfEducationSubsidies(levelOfEducation.getSubsidies()); + }else{ + cwNewEmployeeInformation.setLevelOfEducationSubsidies(new BigDecimal("0")); + } + }else{ + cwNewEmployeeInformation.setLevelOfEducationSubsidies(new BigDecimal("0")); + } + //获取合同期限 + CwLevelOfEducation levelOfEducation = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName(cwNewEmployeeInformation.getContractYear().toString()); + if(null!=levelOfEducation){ + cwNewEmployeeInformation.setContractSubsidies(levelOfEducation.getSubsidies()); + }else{ + cwNewEmployeeInformation.setContractSubsidies(new BigDecimal("0")); + } + //获取社保状态 + if("新农合".equals(cwNewEmployeeInformation.getSocialSecurityStatus())){ + CwLevelOfEducation levelOfEducation2 = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName(cwNewEmployeeInformation.getSocialSecurityStatus()); + if(null!=levelOfEducation2){ + cwNewEmployeeInformation.setSocialSecuritySubsidies(levelOfEducation2.getSubsidies()); + }else{ + cwNewEmployeeInformation.setSocialSecuritySubsidies(new BigDecimal("0")); + } + }else{ + cwNewEmployeeInformation.setSocialSecuritySubsidies(new BigDecimal("0")); + } + //获取入职日期(计算工龄) + //获取入职日期,计算入职日期到当前日期的年份,用于计算工龄 + Date entryDate = cwNewEmployeeInformation.getEntryDate(); + Calendar bef = Calendar.getInstance(); + Calendar aft = Calendar.getInstance(); + bef.setTime(entryDate); + aft.setTime(new Date()); + int surplus = aft.get(Calendar.DATE) - bef.get(Calendar.DATE); + int result = aft.get(Calendar.MONTH) - bef.get(Calendar.MONTH); + int year = aft.get(Calendar.YEAR) - bef.get(Calendar.YEAR); + if(result < 0){ + result = 0; + }else if(result == 0){ + result = surplus < 0 ? 0 : 1; + }else{ + result = 1; + } + long i = year + result -1; + if(i<0){ + i = 0; + } + cwNewEmployeeInformation.setSeniority(i); + //获取工龄补助 + if(i==0){ + cwNewEmployeeInformation.setSenioritySubsidies(new BigDecimal("0")); + }else{ + //判断只有签了正式的劳动合同的才有工龄补助 + if(null!=cwNewEmployeeInformation.getContractYear()&&cwNewEmployeeInformation.getContractYear()!=0){ + CwLevelOfEducation levelOfEducation2 = cwLevelOfEducationService.selectCwLevelOfEducationBysubsidiesName("工龄"); + cwNewEmployeeInformation.setSenioritySubsidies(levelOfEducation2.getSubsidies()); + }else{ + //劳务合同的没有工龄补助 + cwNewEmployeeInformation.setSenioritySubsidies(new BigDecimal("0")); + } + } + //判断是否离职如果离职则需要添加离职日期 + if(cwNewEmployeeInformation.getDimission()==1){ + //说明离职了 + cwNewEmployeeInformation.setDimissionDate(new Date()); + //判断入职日期+合同年限是否大于当前日期,如果不大于,则说明是未满合同期离职,则需要扣除当前月份*合同补助金额 + Date entryDate2 = cwNewEmployeeInformation.getEntryDate(); + //获取一个Calendar对象 + Calendar cd = Calendar.getInstance(); + //设置calendar日期 + cd.setTime(entryDate2); + //增加年 + cd.add(Calendar.YEAR,cwNewEmployeeInformation.getContractYear()); + Date time = cd.getTime(); + //比较合同到期的日期是否小于当前日期,如果小于则说明过了合同年限,如果大于则说明没有过合同年限 + if(time.getTime()>cwNewEmployeeInformation.getDimissionDate().getTime()){ + //说明没有过合同期限,应当扣除本年的合同补助金额 + //获取离职日期的月份 + int month = cwNewEmployeeInformation.getDimissionDate().getMonth(); + //计算应扣除的金额 + cwNewEmployeeInformation.setSubsidyDeductMoney(cwNewEmployeeInformation.getContractSubsidies().multiply(new BigDecimal(month+1))); + } + } + } + + //修改员工考勤统计表中的部门信息 + List list = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByName(cwNewEmployeeInformation.getName()); + for (CwNewAttendanceStatistical cwNewAttendanceStatistical : list) { + cwNewAttendanceStatistical.setDeptName(cwNewEmployeeInformation.getDeptName()); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + //修改员工考勤信息表中的数据 + List list2 = cwNewAttendanceService.selectCwNewAttendanceByName(cwNewEmployeeInformation.getName()); + for (CwNewAttendance cwNewAttendance : list2) { + cwNewAttendance.setDeptName(cwNewEmployeeInformation.getDeptName()); + cwNewAttendanceService.updateCwNewAttendance(cwNewAttendance); + } + return toAjax(cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation)); + } + + /** + * 删除新员工基本信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewEmployeeInformation:remove')") + @Log(title = "新员工基本信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //考勤统计信息中添加离职标记 + for (Long id : ids) { + CwNewEmployeeInformation information = cwNewEmployeeInformationService.selectCwNewEmployeeInformationById(id); + List list = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByName(information.getName()); + for (CwNewAttendanceStatistical cwNewAttendanceStatistical2 : list) { + cwNewAttendanceStatistical2.setSparedTwo("离职"); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical2); + } + } + return toAjax(cwNewEmployeeInformationService.deleteCwNewEmployeeInformationByIds(ids)); + } + + /** + * 删除新员工基本信息 + */ + @RequestMapping("/qingchuBuZhu") + public AjaxResult qingchuBuZhu(){ + + return toAjax(cwNewEmployeeInformationService.updateCwNewEmployeeInformationByBuZhu()); + } + + /** + * 上传养老信息文件 + */ + @RequestMapping("/uploadEndowmentInsuranceFile") + @ResponseBody + public AjaxResult uploadEndowmentInsuranceFile(@RequestParam("file") MultipartFile filePath){ + + //把所有员工的养老保险置为0 + CwNewEmployeeInformation cwNewEmployeeInformation = new CwNewEmployeeInformation(); + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list) { + cwNewEmployeeInformation2.setEndowmentInsurance(new BigDecimal(0)); + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation2); + } + + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelUs.readExcel(files); + for (int i = 2; i < result.size(); i++) { + //因为有可能是几个月的数据,所以需要累加,首先根据名称查询出来员工信息,然后把养老、医疗、失业的3列置为0,循环累加 + CwNewEmployeeInformation newemployeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(result.get(i).get(2).toString()); + if(null!=newemployeeInformation){ + //累加养老金额 + newemployeeInformation.setEndowmentInsurance(newemployeeInformation.getEndowmentInsurance().add(new BigDecimal(result.get(i).get(6).toString()))); + //更新员工数据 + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(newemployeeInformation); + }else{ + return AjaxResult.error("未查询到:"+result.get(i).get(2).toString()+"的基本信息"); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + /** + * 上传医疗信息文件 + */ + @RequestMapping("/uploadMedicalInsuranceFile") + @ResponseBody + public AjaxResult uploadMedicalInsuranceFile(@RequestParam("file") MultipartFile filePath){ + //把所有员工的养老保险置为0 + CwNewEmployeeInformation cwNewEmployeeInformation = new CwNewEmployeeInformation(); + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list) { + cwNewEmployeeInformation2.setMedicalInsurance(new BigDecimal(0)); + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation2); + } + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelUs.readExcel(files); + for (int i = 2; i < result.size(); i++) { + //因为有可能是几个月的数据,所以需要累加,首先根据名称查询出来员工信息,然后把养老、医疗、失业的3列置为0,循环累加 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(result.get(i).get(2).toString()); + if(null!=employeeInformation){ + //获取补缴金额,如果补缴金额不为null或者是0就添加补缴金额 + if(null!=result.get(i).get(9).toString()&&!"".equals(result.get(i).get(9).toString())){ + employeeInformation.setMedicalInsurance(new BigDecimal(result.get(i).get(9).toString())); + } + //累加医疗金额 + employeeInformation.setMedicalInsurance(employeeInformation.getMedicalInsurance().add(new BigDecimal(result.get(i).get(12).toString()))); + //更新员工数据 + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(employeeInformation); + }else{ + return AjaxResult.error("未查询到:"+result.get(i).get(2).toString()+"的基本信息"); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + /** + * 上传失业保险信息文件 + */ + @RequestMapping("/uploadUnemploymentInsuranceFile") + @ResponseBody + public AjaxResult uploadUnemploymentInsuranceFile(@RequestParam("file") MultipartFile filePath){ + //把所有员工的养老保险置为0 + CwNewEmployeeInformation cwNewEmployeeInformation = new CwNewEmployeeInformation(); + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list) { + cwNewEmployeeInformation2.setUnemploymentInsurance(new BigDecimal(0)); + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation2); + } + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelUs.readExcel(files); + for (int i = 2; i < result.size(); i++) { + //因为有可能是几个月的数据,所以需要累加,首先根据名称查询出来员工信息,然后把养老、医疗、失业的3列置为0,循环累加 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(result.get(i).get(2).toString()); + if(null!=employeeInformation){ + //累加医疗金额 + employeeInformation.setUnemploymentInsurance(employeeInformation.getUnemploymentInsurance().add(new BigDecimal(result.get(i).get(6).toString()))); + //更新员工数据 + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(employeeInformation); + }else{ + return AjaxResult.error("未查询到:"+result.get(i).get(2).toString()+"的基本信息"); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwNewPayrollController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewPayrollController.java new file mode 100644 index 0000000..4f5557a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwNewPayrollController.java @@ -0,0 +1,685 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwDepartment; +import com.ruoyi.project.management.domain.CwEmployeeInformation; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwNewPayroll; +import com.ruoyi.project.management.domain.CwNewPayroll; +import com.ruoyi.project.management.domain.CwWorkingDaysConfiguration; +import com.ruoyi.project.management.service.ICwDepartmentService; +import com.ruoyi.project.management.service.ICwJobsService; +import com.ruoyi.project.management.service.ICwLevelOfEducationService; +import com.ruoyi.project.management.service.ICwNewAttendanceService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwNewPayrollService; +import com.ruoyi.project.management.service.ICwWorkingDaysConfigurationService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysRoleService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.poi.ExcelUtilSs; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 新工资单Controller + * + * @author zhukangchao + * @date 2021-12-16 + */ + +@RestController +@RequestMapping("/management/cwNewPayroll") +public class CwNewPayrollController extends BaseController +{ + @Autowired + private ICwNewPayrollService cwNewPayrollService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //补助信息 + @Autowired + private ICwLevelOfEducationService cwLevelOfEducationService; + //考勤信息 + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + //工作日配置信息 + @Autowired + private ICwWorkingDaysConfigurationService cwWorkingDaysConfigurationService; + //用户信息 + @Autowired + private TokenService tokenService; + //角色信息 + @Autowired + private ISysRoleService roleService; + //部门信息 + @Autowired + private ICwDepartmentService cwDepartmentService; + + + /** + * 查询新工资单列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewPayroll:list')") + @GetMapping("/list") + public TableDataInfo list(CwNewPayroll cwNewPayroll){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据用户id查询角色 + List list2 = roleService.selectRoleListByUserId(user.getUserId()); + int i = 0; + for (Integer integer : list2) { + if(integer==116){ + i = 1; + } + } + List list = new ArrayList(); + if(i==0){ + if("河北伊特".equals(cwNewPayroll.getDepartmentName())){ + cwNewPayroll.setDepartmentName(null); + startPage(); + list = cwNewPayrollService.selectCwNewPayrollListByDepartmentName(cwNewPayroll); + }else{ + startPage(); + list = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + }else{ + cwNewPayroll.setName(user.getNickName()); + startPage(); + list = cwNewPayrollService.selectCwNewPayrollListByName(cwNewPayroll); + } + return getDataTable(list); + } + + /** + * 导出新工资单列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewPayroll:export')") + @Log(title = "新工资单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwNewPayroll cwNewPayroll){ + // 创建excel文件 + ExcelUtilSs util = new ExcelUtilSs(CwNewPayroll.class); + //创建总表 + List list = new ArrayList<>(); + //创建各个部门工资数据集合的集合 + List> lists = new ArrayList<>(); + //创建各个部门sheetname集合 + List sheetNameList = new ArrayList<>(); + //汇总表表头 + String title = cwNewPayroll.getAffiliationMonth()+"月工资汇总表"; + //表尾 + String footer = "制表: "+"审核: "+"经理签字: "+"总经理签字: "; + //创建各个部门的数据集合 + //获取所有部门 + CwDepartment cwDepartment = new CwDepartment(); + List list1 = cwDepartmentService.selectCwDepartmentList(cwDepartment); + for (CwDepartment cwDepartment2 : list1) { + //根据部门名称查询各个部门的工资数据 + cwNewPayroll.setDepartmentName(cwDepartment2.getDepartmentName()); + List list2 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + + //计算总表的数据并存放在list中 + //创建总表的对象 + CwNewPayroll cwNewPayrollZong = new CwNewPayroll(); + if("河北贝西".equals(cwDepartment2.getDepartmentName())){ + cwNewPayrollZong.setDepartmentName("河北贝西总计"); + }else if("元氏兴源达".equals(cwDepartment2.getDepartmentName())){ + cwNewPayrollZong.setDepartmentName("元氏兴源达总计"); + }else if("石家庄伊特".equals(cwDepartment2.getDepartmentName())){ + //这里要做一次小计(小计数据为所有部门除去河北贝西和石家庄伊特的数据,所以在添加石家庄伊特之前要做一次小计,部门数据,石家庄伊特和河北贝西的数据永远保持的最后两位) + CwNewPayroll cwNewPayrollXiaoJi = new CwNewPayroll(); + cwNewPayrollXiaoJi.setDepartmentName("小计"); + for (CwNewPayroll cwNewPayroll2 : list) { + //月工资合计 + if(null==cwNewPayrollXiaoJi.getBasicMonthlySalary()){ + cwNewPayrollXiaoJi.setBasicMonthlySalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getBasicMonthlySalary()){ + cwNewPayroll2.setBasicMonthlySalary(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setBasicMonthlySalary(cwNewPayrollXiaoJi.getBasicMonthlySalary().add(cwNewPayroll2.getBasicMonthlySalary())); + //缺勤工资合计 + if(null==cwNewPayrollXiaoJi.getAbsenteeismSalary()){ + cwNewPayrollXiaoJi.setAbsenteeismSalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getAbsenteeismSalary()){ + cwNewPayroll2.setAbsenteeismSalary(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setAbsenteeismSalary(cwNewPayrollXiaoJi.getAbsenteeismSalary().add(cwNewPayroll2.getAbsenteeismSalary())); + //缺勤补助合计 + if(null==cwNewPayrollXiaoJi.getAbsenteeismSubsidies()){ + cwNewPayrollXiaoJi.setAbsenteeismSubsidies(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getAbsenteeismSubsidies()){ + cwNewPayroll2.setAbsenteeismSubsidies(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setAbsenteeismSubsidies(cwNewPayrollXiaoJi.getAbsenteeismSubsidies().add(cwNewPayroll2.getAbsenteeismSubsidies())); + //各项补助合计 + if(null==cwNewPayrollXiaoJi.getSubsidies()){ + cwNewPayrollXiaoJi.setSubsidies(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSubsidies()){ + cwNewPayroll2.setSubsidies(new BigDecimal("0")); + } +// if(null==cwNewPayroll2.getLevelOfEducationSubsidies()){ +// cwNewPayroll2.setLevelOfEducationSubsidies(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getContractSubsidies()){ +// cwNewPayroll2.setContractSubsidies(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getSenioritySalary()){ +// cwNewPayroll2.setSenioritySalary(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getSocialSecuritySubsidies()){ +// cwNewPayroll2.setSocialSecuritySubsidies(new BigDecimal("0")); +// } +// BigDecimal b = cwNewPayroll2.getLevelOfEducationSubsidies().add(cwNewPayroll2.getContractSubsidies()).add(cwNewPayroll2.getSenioritySalary()).add(cwNewPayroll2.getSocialSecuritySubsidies()); +// cwNewPayroll2.setSubsidies(b); + cwNewPayrollXiaoJi.setSubsidies(cwNewPayrollXiaoJi.getSubsidies().add(cwNewPayroll2.getSubsidies())); + //全勤奖合计 +// if(null==cwNewPayrollXiaoJi.getFullFrequentlySubsidies()){ +// cwNewPayrollXiaoJi.setFullFrequentlySubsidies(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getFullFrequentlySubsidies()){ +// cwNewPayroll2.setFullFrequentlySubsidies(new BigDecimal("0")); +// } +// cwNewPayrollXiaoJi.setFullFrequentlySubsidies(cwNewPayrollXiaoJi.getFullFrequentlySubsidies().add(cwNewPayroll2.getFullFrequentlySubsidies())); + //加班工资合计 + if(null==cwNewPayrollXiaoJi.getOvertimeSalary()){ + cwNewPayrollXiaoJi.setOvertimeSalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getOvertimeSalary()){ + cwNewPayroll2.setOvertimeSalary(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setOvertimeSalary(cwNewPayrollXiaoJi.getOvertimeSalary().add(cwNewPayroll2.getOvertimeSalary())); + //其他补助合计 + if(null==cwNewPayrollXiaoJi.getSubsidyOrBonus()){ + cwNewPayrollXiaoJi.setSubsidyOrBonus(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSubsidyOrBonus()){ + cwNewPayroll2.setSubsidyOrBonus(new BigDecimal("0")); + } + + //其他扣款合计 + if(null==cwNewPayrollXiaoJi.getDeductions()){ + cwNewPayrollXiaoJi.setDeductions(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getDeductions()){ + cwNewPayroll2.setDeductions(new BigDecimal("0")); + } + //餐饮扣款合计 + if(null==cwNewPayrollXiaoJi.getMealFee()){ + cwNewPayrollXiaoJi.setMealFee(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getMealFee()){ + cwNewPayroll2.setMealFee(new BigDecimal("0")); + } + + cwNewPayrollXiaoJi.setSubsidyOrBonus(cwNewPayrollXiaoJi.getSubsidyOrBonus().add(cwNewPayroll2.getSubsidyOrBonus())); + //应发工资合计 + if(null==cwNewPayrollXiaoJi.getSalary()){ + cwNewPayrollXiaoJi.setSalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSalary()){ + cwNewPayroll2.setSalary(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setSalary(cwNewPayrollXiaoJi.getSalary().add(cwNewPayroll2.getSalary())); + //保险合计 + if(null==cwNewPayrollXiaoJi.getPayInsurance()){ + cwNewPayrollXiaoJi.setPayInsurance(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getPayInsurance()){ + cwNewPayroll2.setPayInsurance(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setPayInsurance(cwNewPayrollXiaoJi.getPayInsurance().add(cwNewPayroll2.getPayInsurance())); + //税前工资合计 + if(null==cwNewPayrollXiaoJi.getSalaryBeforeTax()){ + cwNewPayrollXiaoJi.setSalaryBeforeTax(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSalaryBeforeTax()){ + cwNewPayroll2.setSalaryBeforeTax(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setSalaryBeforeTax(cwNewPayrollXiaoJi.getSalaryBeforeTax().add(cwNewPayroll2.getSalaryBeforeTax())); + //本年累计已发工资合计 + if(null==cwNewPayrollXiaoJi.getTotalWages()){ + cwNewPayrollXiaoJi.setTotalWages(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getTotalWages()){ + cwNewPayroll2.setTotalWages(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setTotalWages(cwNewPayrollXiaoJi.getTotalWages().add(cwNewPayroll2.getTotalWages())); + //应纳税所得额合计 + if(null==cwNewPayrollXiaoJi.getTaxableIncome()){ + cwNewPayrollXiaoJi.setTaxableIncome(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getTaxableIncome()){ + cwNewPayroll2.setTaxableIncome(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setTaxableIncome(cwNewPayrollXiaoJi.getTaxableIncome().add(cwNewPayroll2.getTaxableIncome())); + //累计已缴税额合计 + if(null==cwNewPayrollXiaoJi.getAggregatePersonalIncomeTax()){ + cwNewPayrollXiaoJi.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getAggregatePersonalIncomeTax()){ + cwNewPayroll2.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setAggregatePersonalIncomeTax(cwNewPayrollXiaoJi.getAggregatePersonalIncomeTax().add(cwNewPayroll2.getAggregatePersonalIncomeTax())); + //应缴个税合计 + if(null==cwNewPayrollXiaoJi.getTaxPayable()){ + cwNewPayrollXiaoJi.setTaxPayable(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getTaxPayable()){ + cwNewPayroll2.setTaxPayable(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setTaxPayable(cwNewPayrollXiaoJi.getTaxPayable().add(cwNewPayroll2.getTaxPayable())); + //实发工资合计 + if(null==cwNewPayrollXiaoJi.getNetPayroll()){ + cwNewPayrollXiaoJi.setNetPayroll(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getNetPayroll()){ + cwNewPayroll2.setNetPayroll(new BigDecimal("0")); + } + cwNewPayrollXiaoJi.setNetPayroll(cwNewPayrollXiaoJi.getNetPayroll().add(cwNewPayroll2.getNetPayroll())); + } + list.add(cwNewPayrollXiaoJi); + cwNewPayrollZong.setDepartmentName("石家庄伊特总计"); + }else{ + cwNewPayrollZong.setDepartmentName(cwDepartment2.getDepartmentName()); + } + + //遍历list1,计算合计数据 + //创建合计对象 + CwNewPayroll cwNewPayrolls = new CwNewPayroll(); + cwNewPayrolls.setName("合计"); + for (CwNewPayroll cwNewPayroll2 : list2) { + //月工资合计 + if(null==cwNewPayrolls.getBasicMonthlySalary()){ + cwNewPayrolls.setBasicMonthlySalary(new BigDecimal("0")); + } + cwNewPayrolls.setBasicMonthlySalary(cwNewPayrolls.getBasicMonthlySalary().add(cwNewPayroll2.getBasicMonthlySalary())); + cwNewPayrollZong.setBasicMonthlySalary(cwNewPayrolls.getBasicMonthlySalary()); + //缺勤工资合计 + if(null==cwNewPayrolls.getAbsenteeismSalary()){ + cwNewPayrolls.setAbsenteeismSalary(new BigDecimal("0")); + } + cwNewPayrolls.setAbsenteeismSalary(cwNewPayrolls.getAbsenteeismSalary().add(cwNewPayroll2.getAbsenteeismSalary())); + cwNewPayrollZong.setAbsenteeismSalary(cwNewPayrolls.getAbsenteeismSalary()); + //缺勤补助合计 + if(null==cwNewPayrolls.getAbsenteeismSubsidies()){ + cwNewPayrolls.setAbsenteeismSubsidies(new BigDecimal("0")); + } + cwNewPayrolls.setAbsenteeismSubsidies(cwNewPayrolls.getAbsenteeismSubsidies().add(cwNewPayroll2.getAbsenteeismSubsidies())); + cwNewPayrollZong.setAbsenteeismSubsidies(cwNewPayrolls.getAbsenteeismSubsidies()); + //各项补助合计 + if(null==cwNewPayrolls.getSubsidies()){ + cwNewPayrolls.setSubsidies(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getLevelOfEducationSubsidies()){ + cwNewPayroll2.setLevelOfEducationSubsidies(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getContractSubsidies()){ + cwNewPayroll2.setContractSubsidies(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSenioritySalary()){ + cwNewPayroll2.setSenioritySalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSocialSecuritySubsidies()){ + cwNewPayroll2.setSocialSecuritySubsidies(new BigDecimal("0")); + } + //4项补助相加之和 + BigDecimal b = cwNewPayroll2.getLevelOfEducationSubsidies().add(cwNewPayroll2.getContractSubsidies()).add(cwNewPayroll2.getSenioritySalary()).add(cwNewPayroll2.getSocialSecuritySubsidies()); + cwNewPayroll2.setSubsidies(b); + cwNewPayrolls.setSubsidies(cwNewPayrolls.getSubsidies().add(b)); + cwNewPayrollZong.setSubsidies(cwNewPayrolls.getSubsidies()); + //全勤奖合计 +// if(null==cwNewPayrolls.getFullFrequentlySubsidies()){ +// cwNewPayrolls.setFullFrequentlySubsidies(new BigDecimal("0")); +// } +// cwNewPayrolls.setFullFrequentlySubsidies(cwNewPayrolls.getFullFrequentlySubsidies().add(cwNewPayroll2.getFullFrequentlySubsidies())); +// cwNewPayrollZong.setFullFrequentlySubsidies(cwNewPayrolls.getFullFrequentlySubsidies()); + //加班工资合计 + if(null==cwNewPayrolls.getOvertimeSalary()){ + cwNewPayrolls.setOvertimeSalary(new BigDecimal("0")); + } + cwNewPayrolls.setOvertimeSalary(cwNewPayrolls.getOvertimeSalary().add(cwNewPayroll2.getOvertimeSalary())); + cwNewPayrollZong.setOvertimeSalary(cwNewPayrolls.getOvertimeSalary()); + //其他补助合计 + if(null==cwNewPayrolls.getSubsidyOrBonus()){ + cwNewPayrolls.setSubsidyOrBonus(new BigDecimal("0")); + } + cwNewPayrolls.setSubsidyOrBonus(cwNewPayrolls.getSubsidyOrBonus().add(cwNewPayroll2.getSubsidyOrBonus())); + cwNewPayrollZong.setSubsidyOrBonus(cwNewPayrolls.getSubsidyOrBonus()); + + //其他扣款合计 + if(null==cwNewPayrolls.getDeductions()){ + cwNewPayrolls.setDeductions(new BigDecimal("0")); + } + cwNewPayrolls.setDeductions(cwNewPayrolls.getDeductions().add(cwNewPayroll2.getDeductions())); + cwNewPayrollZong.setDeductions(cwNewPayrolls.getDeductions()); + + //餐饮扣款合计 + if(null==cwNewPayrolls.getMealFee()){ + cwNewPayrolls.setMealFee(new BigDecimal("0")); + } + cwNewPayrolls.setMealFee(cwNewPayrolls.getMealFee().add(cwNewPayroll2.getMealFee())); + cwNewPayrollZong.setMealFee(cwNewPayrolls.getMealFee()); + + //应发工资合计 + if(null==cwNewPayrolls.getSalary()){ + cwNewPayrolls.setSalary(new BigDecimal("0")); + } + cwNewPayrolls.setSalary(cwNewPayrolls.getSalary().add(cwNewPayroll2.getSalary())); + cwNewPayrollZong.setSalary(cwNewPayrolls.getSalary()); + //保险合计 + if(null==cwNewPayrolls.getPayInsurance()){ + cwNewPayrolls.setPayInsurance(new BigDecimal("0")); + } + cwNewPayrolls.setPayInsurance(cwNewPayrolls.getPayInsurance().add(cwNewPayroll2.getPayInsurance())); + cwNewPayrollZong.setPayInsurance(cwNewPayrolls.getPayInsurance()); + //税前工资合计 + if(null==cwNewPayrolls.getSalaryBeforeTax()){ + cwNewPayrolls.setSalaryBeforeTax(new BigDecimal("0")); + } + cwNewPayrolls.setSalaryBeforeTax(cwNewPayrolls.getSalaryBeforeTax().add(cwNewPayroll2.getSalaryBeforeTax())); + cwNewPayrollZong.setSalaryBeforeTax(cwNewPayrolls.getSalaryBeforeTax()); + //累计已发工资 + if(null==cwNewPayrolls.getTotalWages()){ + cwNewPayrolls.setTotalWages(new BigDecimal("0")); + } + cwNewPayrolls.setTotalWages(cwNewPayrolls.getTotalWages().add(cwNewPayroll2.getTotalWages())); + cwNewPayrollZong.setTotalWages(cwNewPayrolls.getTotalWages()); + //应纳税所得额 + if(null==cwNewPayrolls.getTaxableIncome()){ + cwNewPayrolls.setTaxableIncome(new BigDecimal("0")); + } + cwNewPayrolls.setTaxableIncome(cwNewPayrolls.getTaxableIncome().add(cwNewPayroll2.getTaxableIncome())); + cwNewPayrollZong.setTaxableIncome(cwNewPayrolls.getTaxableIncome()); + //累计已缴税额 + if(null==cwNewPayrolls.getAggregatePersonalIncomeTax()){ + cwNewPayrolls.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + cwNewPayrolls.setAggregatePersonalIncomeTax(cwNewPayrolls.getAggregatePersonalIncomeTax().add(cwNewPayroll2.getAggregatePersonalIncomeTax())); + cwNewPayrollZong.setAggregatePersonalIncomeTax(cwNewPayrolls.getAggregatePersonalIncomeTax()); + //应缴个税合计 + if(null==cwNewPayrolls.getTaxPayable()){ + cwNewPayrolls.setTaxPayable(new BigDecimal("0")); + } + cwNewPayrolls.setTaxPayable(cwNewPayrolls.getTaxPayable().add(cwNewPayroll2.getTaxPayable())); + cwNewPayrollZong.setTaxPayable(cwNewPayrolls.getTaxPayable()); + //实发工资合计 + if(null==cwNewPayrolls.getNetPayroll()){ + cwNewPayrolls.setNetPayroll(new BigDecimal("0")); + } + cwNewPayrolls.setNetPayroll(cwNewPayrolls.getNetPayroll().add(cwNewPayroll2.getNetPayroll())); + cwNewPayrollZong.setNetPayroll(cwNewPayrolls.getNetPayroll()); + } + list2.add(cwNewPayrolls); + //sheetName集合 + sheetNameList.add(cwDepartment2.getDepartmentName()); + //工资数据集合 + lists.add(list2); + //总表数据 + list.add(cwNewPayrollZong); + } + + //计算总表list中的总计 + CwNewPayroll cwNewPayrollZongJi = new CwNewPayroll(); + cwNewPayrollZongJi.setDepartmentName("总计"); + for (CwNewPayroll cwNewPayroll2 : list) { + if(!cwNewPayroll2.getDepartmentName().equals("小计")){ + //月工资合计 + if(null==cwNewPayrollZongJi.getBasicMonthlySalary()){ + cwNewPayrollZongJi.setBasicMonthlySalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getBasicMonthlySalary()){ + cwNewPayroll2.setBasicMonthlySalary(new BigDecimal("0")); + } + cwNewPayrollZongJi.setBasicMonthlySalary(cwNewPayrollZongJi.getBasicMonthlySalary().add(cwNewPayroll2.getBasicMonthlySalary())); + //缺勤工资合计 + if(null==cwNewPayrollZongJi.getAbsenteeismSalary()){ + cwNewPayrollZongJi.setAbsenteeismSalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getAbsenteeismSalary()){ + cwNewPayroll2.setAbsenteeismSalary(new BigDecimal("0")); + } + cwNewPayrollZongJi.setAbsenteeismSalary(cwNewPayrollZongJi.getAbsenteeismSalary().add(cwNewPayroll2.getAbsenteeismSalary())); + //缺勤补助合计 + if(null==cwNewPayrollZongJi.getAbsenteeismSubsidies()){ + cwNewPayrollZongJi.setAbsenteeismSubsidies(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getAbsenteeismSubsidies()){ + cwNewPayroll2.setAbsenteeismSubsidies(new BigDecimal("0")); + } + cwNewPayrollZongJi.setAbsenteeismSubsidies(cwNewPayrollZongJi.getAbsenteeismSubsidies().add(cwNewPayroll2.getAbsenteeismSubsidies())); + //各项补助合计 + if(null==cwNewPayrollZongJi.getSubsidies()){ + cwNewPayrollZongJi.setSubsidies(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSubsidies()){ + cwNewPayroll2.setSubsidies(new BigDecimal("0")); + } +// if(null==cwNewPayroll2.getLevelOfEducationSubsidies()){ +// cwNewPayroll2.setLevelOfEducationSubsidies(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getContractSubsidies()){ +// cwNewPayroll2.setContractSubsidies(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getSenioritySalary()){ +// cwNewPayroll2.setSenioritySalary(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getSocialSecuritySubsidies()){ +// cwNewPayroll2.setSocialSecuritySubsidies(new BigDecimal("0")); +// } +// BigDecimal b = cwNewPayroll2.getLevelOfEducationSubsidies().add(cwNewPayroll2.getContractSubsidies()).add(cwNewPayroll2.getSenioritySalary()).add(cwNewPayroll2.getSocialSecuritySubsidies()); +// cwNewPayroll2.setSubsidies(b); + cwNewPayrollZongJi.setSubsidies(cwNewPayrollZongJi.getSubsidies().add(cwNewPayroll2.getSubsidies())); + //全勤奖合计 +// if(null==cwNewPayrollZongJi.getFullFrequentlySubsidies()){ +// cwNewPayrollZongJi.setFullFrequentlySubsidies(new BigDecimal("0")); +// } +// if(null==cwNewPayroll2.getFullFrequentlySubsidies()){ +// cwNewPayroll2.setFullFrequentlySubsidies(new BigDecimal("0")); +// } +// cwNewPayrollZongJi.setFullFrequentlySubsidies(cwNewPayrollZongJi.getFullFrequentlySubsidies().add(cwNewPayroll2.getFullFrequentlySubsidies())); + //加班工资合计 + if(null==cwNewPayrollZongJi.getOvertimeSalary()){ + cwNewPayrollZongJi.setOvertimeSalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getOvertimeSalary()){ + cwNewPayroll2.setOvertimeSalary(new BigDecimal("0")); + } + cwNewPayrollZongJi.setOvertimeSalary(cwNewPayrollZongJi.getOvertimeSalary().add(cwNewPayroll2.getOvertimeSalary())); + //其他补助合计 + if(null==cwNewPayrollZongJi.getSubsidyOrBonus()){ + cwNewPayrollZongJi.setSubsidyOrBonus(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSubsidyOrBonus()){ + cwNewPayroll2.setSubsidyOrBonus(new BigDecimal("0")); + } + cwNewPayrollZongJi.setSubsidyOrBonus(cwNewPayrollZongJi.getSubsidyOrBonus().add(cwNewPayroll2.getSubsidyOrBonus())); + + //其他扣款合计 + if(null==cwNewPayrollZongJi.getDeductions()){ + cwNewPayrollZongJi.setDeductions(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getDeductions()){ + cwNewPayroll2.setDeductions(new BigDecimal("0")); + } + cwNewPayrollZongJi.setDeductions(cwNewPayrollZongJi.getDeductions().add(cwNewPayroll2.getDeductions())); + + //餐饮扣款合计 + if(null==cwNewPayrollZongJi.getMealFee()){ + cwNewPayrollZongJi.setMealFee(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getMealFee()){ + cwNewPayroll2.setMealFee(new BigDecimal("0")); + } + cwNewPayrollZongJi.setMealFee(cwNewPayrollZongJi.getMealFee().add(cwNewPayroll2.getMealFee())); + + //应发工资合计 + if(null==cwNewPayrollZongJi.getSalary()){ + cwNewPayrollZongJi.setSalary(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSalary()){ + cwNewPayroll2.setSalary(new BigDecimal("0")); + } + cwNewPayrollZongJi.setSalary(cwNewPayrollZongJi.getSalary().add(cwNewPayroll2.getSalary())); + //保险合计 + if(null==cwNewPayrollZongJi.getPayInsurance()){ + cwNewPayrollZongJi.setPayInsurance(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getPayInsurance()){ + cwNewPayroll2.setPayInsurance(new BigDecimal("0")); + } + cwNewPayrollZongJi.setPayInsurance(cwNewPayrollZongJi.getPayInsurance().add(cwNewPayroll2.getPayInsurance())); + //税前工资合计 + if(null==cwNewPayrollZongJi.getSalaryBeforeTax()){ + cwNewPayrollZongJi.setSalaryBeforeTax(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getSalaryBeforeTax()){ + cwNewPayroll2.setSalaryBeforeTax(new BigDecimal("0")); + } + cwNewPayrollZongJi.setSalaryBeforeTax(cwNewPayrollZongJi.getSalaryBeforeTax().add(cwNewPayroll2.getSalaryBeforeTax())); + //本月应缴个税合计 + if(null==cwNewPayrollZongJi.getTaxPayable()){ + cwNewPayrollZongJi.setTaxPayable(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getTaxPayable()){ + cwNewPayroll2.setTaxPayable(new BigDecimal("0")); + } + cwNewPayrollZongJi.setTaxPayable(cwNewPayrollZongJi.getTaxPayable().add(cwNewPayroll2.getTaxPayable())); + //累计已发工资 + if(null==cwNewPayrollZongJi.getTotalWages()){ + cwNewPayrollZongJi.setTotalWages(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getTotalWages()){ + cwNewPayroll2.setTotalWages(new BigDecimal("0")); + } + cwNewPayrollZongJi.setTotalWages(cwNewPayrollZongJi.getTotalWages().add(cwNewPayroll2.getTotalWages())); + //应纳税所得额 + if(null==cwNewPayrollZongJi.getTaxableIncome()){ + cwNewPayrollZongJi.setTaxableIncome(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getTaxableIncome()){ + cwNewPayroll2.setTaxableIncome(new BigDecimal("0")); + } + cwNewPayrollZongJi.setTaxableIncome(cwNewPayrollZongJi.getTaxableIncome().add(cwNewPayroll2.getTaxableIncome())); + //累计已缴税额 + if(null==cwNewPayrollZongJi.getAggregatePersonalIncomeTax()){ + cwNewPayrollZongJi.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getAggregatePersonalIncomeTax()){ + cwNewPayroll2.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + cwNewPayrollZongJi.setAggregatePersonalIncomeTax(cwNewPayrollZongJi.getAggregatePersonalIncomeTax().add(cwNewPayroll2.getAggregatePersonalIncomeTax())); + //实发工资合计 + if(null==cwNewPayrollZongJi.getNetPayroll()){ + cwNewPayrollZongJi.setNetPayroll(new BigDecimal("0")); + } + if(null==cwNewPayroll2.getNetPayroll()){ + cwNewPayroll2.setNetPayroll(new BigDecimal("0")); + } + cwNewPayrollZongJi.setNetPayroll(cwNewPayrollZongJi.getNetPayroll().add(cwNewPayroll2.getNetPayroll())); + } + } + list.add(cwNewPayrollZongJi); + //参数:总表数据集合,总表sheetName,各个部门数据集合,各个部门sheetName + return util.exportExcel(list,lists,"总表",sheetNameList,title,footer); + } + + /** + * 获取新工资单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewPayroll:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwNewPayrollService.selectCwNewPayrollById(id)); + } + + /** + * 新增新工资单 + */ + @RepeatSubmit + @PreAuthorize("@ss.hasPermi('management:cwNewPayroll:add')") + @Log(title = "新工资单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwNewPayroll cwNewPayroll){ + + //计算工资 + if(null==cwNewPayroll.getAffiliationMonth()||"".equals(cwNewPayroll.getAffiliationMonth().toString().trim())){ + return AjaxResult.error("请选择工资所属月份"); + } + //保存工资信息 + int i = 0; + try { + i = cwNewPayrollService.insertCwNewPayroll(cwNewPayroll); + } catch (Exception e) { + e.printStackTrace(); + } + if(i==205){ + return AjaxResult.error("未查询到员工信息"); + } + return AjaxResult.success(i); + } + + /** + * 修改新工资单 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewPayroll:edit')") + @Log(title = "新工资单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwNewPayroll cwNewPayroll) + { + return toAjax(cwNewPayrollService.updateCwNewPayroll(cwNewPayroll)); + } + + /** + * 删除新工资单 + */ + @PreAuthorize("@ss.hasPermi('management:cwNewPayroll:remove')") + @Log(title = "新工资单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //删除信息之前把员工的本年累计工资和本年累计个税恢复到上个月的金额 + for (Long long1 : ids) { + CwNewPayroll cwNewPayroll = cwNewPayrollService.selectCwNewPayrollById(long1); + //获取员工姓名,根据员工姓名查询员工信息 + CwNewEmployeeInformation cwNewEmployeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwNewPayroll.getName()); + //恢复上个月的本年累计已发工资和本年累计已缴个税 + cwNewEmployeeInformation.setTotalWages(cwNewEmployeeInformation.getTotalWages().subtract(cwNewPayroll.getSalaryBeforeTax())); + //本年累计已缴个税 + cwNewEmployeeInformation.setAggregatePersonalIncomeTax(cwNewEmployeeInformation.getAggregatePersonalIncomeTax().subtract(cwNewPayroll.getTaxPayable())); + //恢复本年累计专项附加扣除 + cwNewEmployeeInformation.setSpecialDeduction(cwNewEmployeeInformation.getSpecialDeduction().subtract(cwNewPayroll.getSpecialDeduction())); + //修改员工信息 + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation); + } + return toAjax(cwNewPayrollService.deleteCwNewPayrollByIds(ids)); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwNonbusinessIncomeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwNonbusinessIncomeController.java new file mode 100644 index 0000000..1204622 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwNonbusinessIncomeController.java @@ -0,0 +1,319 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwNonbusinessIncome; +import com.ruoyi.project.management.domain.CwOtherPayment; +import com.ruoyi.project.management.domain.ImCustomer; +import com.ruoyi.project.management.domain.ImSupplier; +import com.ruoyi.project.management.domain.PwOtherCorrespondent; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwNonbusinessIncomeService; +import com.ruoyi.project.management.service.IImCustomerService; +import com.ruoyi.project.management.service.IImSupplierService; +import com.ruoyi.project.management.service.IPwOtherCorrespondentService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 营业外收入信息Controller + * + * @author zhukangchao + * @date 2023-11-30 + */ +@RestController +@RequestMapping("/management/cwNonbusinessIncome") +public class CwNonbusinessIncomeController extends BaseController +{ + @Autowired + private ICwNonbusinessIncomeService cwNonbusinessIncomeService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //用户信息 + @Autowired + private TokenService tokenService; + + /** + * 查询营业外收入信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNonbusinessIncome:list')") + @GetMapping("/list") + public TableDataInfo list(CwNonbusinessIncome cwNonbusinessIncome) + { + startPage(); + List list = cwNonbusinessIncomeService.selectCwNonbusinessIncomeList(cwNonbusinessIncome); + return getDataTable(list); + } + + /** + * 导出营业外收入信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwNonbusinessIncome:export')") + @Log(title = "营业外收入信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwNonbusinessIncome cwNonbusinessIncome) + { + List list = cwNonbusinessIncomeService.selectCwNonbusinessIncomeList(cwNonbusinessIncome); + ExcelUtil util = new ExcelUtil(CwNonbusinessIncome.class); + return util.exportExcel(list, "cwNonbusinessIncome"); + } + + /** + * 获取营业外收入信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNonbusinessIncome:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwNonbusinessIncomeService.selectCwNonbusinessIncomeById(id)); + } + + /** + * 新增营业外收入信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNonbusinessIncome:add')") + @Log(title = "营业外收入信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwNonbusinessIncome cwNonbusinessIncome){ + //校验类型 + if(null==cwNonbusinessIncome.getType()||"".equals(cwNonbusinessIncome.getType())){ + return AjaxResult.error("请选择收入类型"); + } + //校验金额 + if(null==cwNonbusinessIncome.getMoney()||"".equals(cwNonbusinessIncome.getMoney())||0==cwNonbusinessIncome.getMoney()){ + return AjaxResult.error("请输入正确的金额"); + } + //校验来源 + if(null==cwNonbusinessIncome.getSource()||"".equals(cwNonbusinessIncome.getSource())){ + return AjaxResult.error("请填写收入来源"); + } + //校验往来单位 + if(null==cwNonbusinessIncome.getUnitName()||"".equals(cwNonbusinessIncome.getUnitName())){ + return AjaxResult.error("请选择往来单位"); + } + //校验发票类型 + if(null==cwNonbusinessIncome.getSparedOne()||"".equals(cwNonbusinessIncome.getSparedOne())){ + return AjaxResult.error("请选择发票类型"); + } + //校验税率 + if(null==cwNonbusinessIncome.getSparedThree()||"".equals(cwNonbusinessIncome.getSparedThree())){ + return AjaxResult.error("请选择税率"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //单据编号 + cwNonbusinessIncome.setCode("OE-"+sdf.format(new Date())); + //姓名 + cwNonbusinessIncome.setUserName(user.getNickName()); + //部门 + cwNonbusinessIncome.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwNonbusinessIncome.setDate(new Date()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwNonbusinessIncome.getMoney()+""); + cwNonbusinessIncome.setBigMoney(chinese); + //未付款金额(初始为填写的金额) + cwNonbusinessIncome.setNotInvoiceAmount(new BigDecimal(cwNonbusinessIncome.getMoney())); + //未开票金额(初始为填写的金额) + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal(cwNonbusinessIncome.getMoney())); + //结算比例(初始为0) + cwNonbusinessIncome.setSettlementRatio(new BigDecimal("0")); + + return toAjax(cwNonbusinessIncomeService.insertCwNonbusinessIncome(cwNonbusinessIncome)); + } + + /** + * 修改营业外收入信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNonbusinessIncome:edit')") + @Log(title = "营业外收入信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwNonbusinessIncome cwNonbusinessIncome){ + if(null!=cwNonbusinessIncome.getLeadership()&&!"".equals(cwNonbusinessIncome.getLeadership())){ + return AjaxResult.error("已审批的单据不允许修改"); + }else{ + //校验类型 + if(null==cwNonbusinessIncome.getType()||"".equals(cwNonbusinessIncome.getType())){ + return AjaxResult.error("请选择收入类型"); + } + //校验金额 + if(null==cwNonbusinessIncome.getMoney()||"".equals(cwNonbusinessIncome.getMoney())||0==cwNonbusinessIncome.getMoney()){ + return AjaxResult.error("请输入正确的金额"); + } + //校验来源 + if(null==cwNonbusinessIncome.getSource()||"".equals(cwNonbusinessIncome.getSource())){ + return AjaxResult.error("请填写收入来源"); + } + //校验往来单位 + if(null==cwNonbusinessIncome.getUnitName()||"".equals(cwNonbusinessIncome.getUnitName())){ + return AjaxResult.error("请选择往来单位"); + } + //校验发票类型 + if(null==cwNonbusinessIncome.getSparedOne()||"".equals(cwNonbusinessIncome.getSparedOne())){ + return AjaxResult.error("请选择发票类型"); + } + //校验税率 + if(null==cwNonbusinessIncome.getSparedThree()||"".equals(cwNonbusinessIncome.getSparedThree())){ + return AjaxResult.error("请选择税率"); + } + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //姓名 + cwNonbusinessIncome.setUserName(user.getNickName()); + //部门 + cwNonbusinessIncome.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwNonbusinessIncome.setDate(new Date()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwNonbusinessIncome.getMoney()+""); + cwNonbusinessIncome.setBigMoney(chinese); + //未付款金额(初始为填写的金额) + cwNonbusinessIncome.setNotInvoiceAmount(new BigDecimal(cwNonbusinessIncome.getMoney())); + //未开票金额(初始为填写的金额) + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal(cwNonbusinessIncome.getMoney())); + //结算比例(初始为0) + cwNonbusinessIncome.setSettlementRatio(new BigDecimal("0")); + } + return toAjax(cwNonbusinessIncomeService.updateCwNonbusinessIncome(cwNonbusinessIncome)); + } + + /** + * 删除营业外收入信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwNonbusinessIncome:remove')") + @Log(title = "营业外收入信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + CwNonbusinessIncome nonbusinessIncome = cwNonbusinessIncomeService.selectCwNonbusinessIncomeById(id); + //判断总经理是否已审批,如果总经理已审批,则不允许修改 + if(null!=nonbusinessIncome.getLeadership()&&!"".equals(nonbusinessIncome.getLeadership())){ + return AjaxResult.error("已审批的单据不允许删除"); + } + } + return toAjax(cwNonbusinessIncomeService.deleteCwNonbusinessIncomeByIds(ids)); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + CwNonbusinessIncome nonbusinessIncome = cwNonbusinessIncomeService.selectCwNonbusinessIncomeById(id); + if(null!=nonbusinessIncome.getLeadership()){ + nonbusinessIncome.setLeadership(""); + }else{ + nonbusinessIncome.setLeadership(user.getNickName()); + //审批时间 + nonbusinessIncome.setLeadershipTime(new Date()); + } + i = cwNonbusinessIncomeService.updateCwNonbusinessIncome(nonbusinessIncome); + + //判断往来单位类型 + String type = ""; + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(nonbusinessIncome.getUnitName()); + if(null!=supplier){ + type = "BD_Supplier"; + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(nonbusinessIncome.getUnitName()); + if(null!=employeeInformation){ + type = "BD_Empinfo"; + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(nonbusinessIncome.getUnitName()); + if(null!=customer){ + type = "BD_Customer"; + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(nonbusinessIncome.getUnitName()); + if(null!=otherCorrespondent){ + type = "FIN_OTHERS"; + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + + //判断金蝶的发票类型 + String invoicetype = ""; + if("普通发票".equals(nonbusinessIncome.getSparedOne())){ + invoicetype = "0"; + }else if("增值税发票".equals(nonbusinessIncome.getSparedOne())){ + invoicetype = "1"; + }else if("机票".equals(nonbusinessIncome.getSparedOne())){ + invoicetype = "P"; + }else if("火车票".equals(nonbusinessIncome.getSparedOne())){ + invoicetype = "R"; + }else if("其它运输票".equals(nonbusinessIncome.getSparedOne())){ + invoicetype = "O"; + }else { + invoicetype = "E"; + } + //计算未税金额 + Double weishuiMoney = nonbusinessIncome.getMoney()/1.13; + //计算税额 + Double shuiMoney = nonbusinessIncome.getMoney() - weishuiMoney; + + //触发金蝶接口 + if(null!=nonbusinessIncome.getLeadership()&&!"".equals(nonbusinessIncome.getLeadership())){ + //调用金蝶的 其他应收单 + + }else{ + //触发反审核动作 + + } + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwOtherPaymentController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwOtherPaymentController.java new file mode 100644 index 0000000..505abcb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwOtherPaymentController.java @@ -0,0 +1,507 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Map; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwOtherPayment; +import com.ruoyi.project.management.domain.CwOtherPaymentInfo; +import com.ruoyi.project.management.domain.ImCustomer; +import com.ruoyi.project.management.domain.ImSupplier; +import com.ruoyi.project.management.domain.PwOtherCorrespondent; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwOtherPaymentInfoService; +import com.ruoyi.project.management.service.ICwOtherPaymentService; +import com.ruoyi.project.management.service.IImCustomerService; +import com.ruoyi.project.management.service.IImSupplierService; +import com.ruoyi.project.management.service.IPwOtherCorrespondentService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 其他付款申请单Controller + * + * @author zhukangchao + * @date 2023-11-30 + */ +@RestController +@RequestMapping("/management/cwOtherPayment") +public class CwOtherPaymentController extends BaseController +{ + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单详情信息 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //用户信息 + @Autowired + private TokenService tokenService; + + /** + * 查询其他付款申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPayment:list')") + @GetMapping("/list") + public TableDataInfo list(CwOtherPayment cwOtherPayment) + { + startPage(); + List list = cwOtherPaymentService.selectCwOtherPaymentList(cwOtherPayment); + return getDataTable(list); + } + + /** + * 查询往来单位信息(供应商信息、客户信息、员工信息) + */ + @GetMapping("/listImSuppliers") + public TableDataInfo listImSuppliers(){ + //查询供应商信息 + ImSupplier imSupplier = new ImSupplier(); + List list = imSupplierService.selectImSupplierList(imSupplier); + + //查询客户信息 + ImCustomer imCustomer = new ImCustomer(); + List list2 = imCustomerService.selectImCustomerList(imCustomer); + for (ImCustomer imCustomer2 : list2) { + imSupplier = new ImSupplier(); + imSupplier.setSupplierName(imCustomer2.getCustomerName()); + list.add(imSupplier); + } + //员工信息 + CwNewEmployeeInformation cwNewEmployeeInformation = new CwNewEmployeeInformation(); + List list3 = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list3) { + imSupplier = new ImSupplier(); + imSupplier.setSupplierName(cwNewEmployeeInformation2.getName()); + list.add(imSupplier); + } + + //其他往来单位信息 + PwOtherCorrespondent pwOtherCorrespondent = new PwOtherCorrespondent(); + List list4 = pwOtherCorrespondentService.selectPwOtherCorrespondentList(pwOtherCorrespondent); + for (PwOtherCorrespondent pwOtherCorrespondent2 : list4) { + imSupplier = new ImSupplier(); + imSupplier.setSupplierName(pwOtherCorrespondent2.getName()); + list.add(imSupplier); + } + + return getDataTable(list); + } + + /** + * 导出其他付款申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPayment:export')") + @Log(title = "其他付款申请单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwOtherPayment cwOtherPayment) + { + List list = cwOtherPaymentService.selectCwOtherPaymentList(cwOtherPayment); + ExcelUtil util = new ExcelUtil(CwOtherPayment.class); + return util.exportExcel(list, "cwOtherPayment"); + } + + /** + * 获取其他付款申请单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPayment:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwOtherPaymentService.selectCwOtherPaymentById(id)); + } + + /** + * 新增其他付款申请单 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPayment:add')") + @Log(title = "其他付款申请单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwOtherPayment cwOtherPayment){ + //校验支付方式 + if(null==cwOtherPayment.getPayWay()||"".equals(cwOtherPayment.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验金额 + if(null==cwOtherPayment.getMoney()||"".equals(cwOtherPayment.getMoney())||0==cwOtherPayment.getMoney()){ + return AjaxResult.error("请输入正确的金额"); + } + //校验支出类型 + if(null == cwOtherPayment.getSparedOne()||"".equals(cwOtherPayment.getSparedOne())){ + return AjaxResult.error("请选择支出类型"); + } + //校验单位名称 + if(null == cwOtherPayment.getUnitName()||"".equals(cwOtherPayment.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + //校验发票类型 + if(null==cwOtherPayment.getSparedTwo()||"".equals(cwOtherPayment.getSparedTwo())){ + return AjaxResult.error("请选择发票类型"); + } + //校验税率 + if(null==cwOtherPayment.getSpaerdThree()||"".equals(cwOtherPayment.getSpaerdThree())){ + return AjaxResult.error("请选择税率"); + } + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //单据编号 + cwOtherPayment.setCode("FK-"+sdf.format(new Date())); + //姓名 + cwOtherPayment.setUserName(user.getNickName()); + //部门 + cwOtherPayment.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwOtherPayment.setDateTime(new Date()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwOtherPayment.getMoney()+""); + cwOtherPayment.setBigMoney(chinese); + //未付款金额(初始为填写的金额) + cwOtherPayment.setNotInvoiceAmount(new BigDecimal(cwOtherPayment.getMoney())); + //未开票金额(初始为填写的金额) + cwOtherPayment.setNotProceedsAmount(new BigDecimal(cwOtherPayment.getMoney())); + //结算比例(初始为0) + cwOtherPayment.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwOtherPayment.getUnitName()); + if(null!=supplier){ + //账号 + cwOtherPayment.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwOtherPayment.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwOtherPayment.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwOtherPayment.getUnitName()); + if(null!=customer){ + //账号 + cwOtherPayment.setAccountNumber(customer.getBankNumber()); + //开户行 + cwOtherPayment.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwOtherPayment.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwOtherPayment.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + return toAjax(cwOtherPaymentService.insertCwOtherPayment(cwOtherPayment)); + } + + /** + * 修改其他付款申请单 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPayment:edit')") + @Log(title = "其他付款申请单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwOtherPayment cwOtherPayment){ + //判断总经理是否已审批,如果总经理已审批,则不允许修改 + if(null!=cwOtherPayment.getLeadership()&&!"".equals(cwOtherPayment.getLeadership())){ + return AjaxResult.error("已审批的单据不允许修改"); + }else{ + //校验支付方式 + if(null==cwOtherPayment.getPayWay()||"".equals(cwOtherPayment.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验金额 + if(null==cwOtherPayment.getMoney()||"".equals(cwOtherPayment.getMoney())||0==cwOtherPayment.getMoney()){ + return AjaxResult.error("请输入正确的金额"); + } + //校验支出类型 + if(null == cwOtherPayment.getSparedOne()||"".equals(cwOtherPayment.getSparedOne())){ + return AjaxResult.error("请选择支出类型"); + } + //校验单位名称 + if(null == cwOtherPayment.getUnitName()||"".equals(cwOtherPayment.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + //校验发票类型 + if(null==cwOtherPayment.getSparedTwo()||"".equals(cwOtherPayment.getSparedTwo())){ + return AjaxResult.error("请选择发票类型"); + } + //校验税率 + if(null==cwOtherPayment.getSpaerdThree()||"".equals(cwOtherPayment.getSpaerdThree())){ + return AjaxResult.error("请选择税率"); + } + + //校验如果为上游单据下推的付款申请单,则不允许修改金额及业务类型及单位名称 + CwOtherPayment otherPayment = cwOtherPaymentService.selectCwOtherPaymentById(cwOtherPayment.getId()); + //查询是否有付款单详情信息 + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + List list = cwOtherPaymentInfoService.selectCwOtherPaymentInfoList(cwOtherPaymentInfo); + if(list.size()>0){ + //判断是否修改了金额及业务类型及单位名称 + if(otherPayment.getMoney().doubleValue()!=cwOtherPayment.getMoney().doubleValue()||!otherPayment.getSparedOne().equals(cwOtherPayment.getSparedOne())||!cwOtherPayment.getUnitName().equals(otherPayment.getUnitName())){ + return AjaxResult.error("当前单据不允许修改金额和支出类型及单位名称"); + } + } + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //姓名 + cwOtherPayment.setUserName(user.getNickName()); + //部门 + cwOtherPayment.setDeptName(user.getDept().getDeptName()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cwOtherPayment.getMoney()+""); + cwOtherPayment.setBigMoney(chinese); + //未付款金额(初始为填写的金额) + cwOtherPayment.setNotInvoiceAmount(new BigDecimal(cwOtherPayment.getMoney())); + //未开票金额(初始为填写的金额) + cwOtherPayment.setNotProceedsAmount(new BigDecimal(cwOtherPayment.getMoney())); + //结算比例(初始为0) + cwOtherPayment.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwOtherPayment.getUnitName()); + if(null!=supplier){ + //账号 + cwOtherPayment.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwOtherPayment.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwOtherPayment.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwOtherPayment.getUnitName()); + if(null!=customer){ + //账号 + cwOtherPayment.setAccountNumber(customer.getBankNumber()); + //开户行 + cwOtherPayment.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwOtherPayment.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwOtherPayment.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + //修改之后把复核状态修改为未复核状态 + cwOtherPayment.setReviewer(""); + } + return toAjax(cwOtherPaymentService.updateCwOtherPayment(cwOtherPayment)); + } + + /** + * 删除其他付款申请单 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPayment:remove')") + @Log(title = "其他付款申请单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + CwOtherPayment otherPayment = cwOtherPaymentService.selectCwOtherPaymentById(id); + //判断总经理是否已审批,如果总经理已审批,则不允许修改 + if(null!=otherPayment.getReviewer()&&!"".equals(otherPayment.getReviewer())){ + return AjaxResult.error("已复核的单据不允许删除"); + } + } + return toAjax(cwOtherPaymentService.deleteCwOtherPaymentByIds(ids)); + } + + /** + * 复核人审批 + */ + @RequestMapping("/fuHeRenApprover/{ids}") + public AjaxResult fuHeRenApprover(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + CwOtherPayment otherPayment = cwOtherPaymentService.selectCwOtherPaymentById(id); + //校验会计是否审批了,如果会计没有审批,则复核人不能审批 + if(null!=otherPayment.getReviewer()){ + otherPayment.setReviewer(""); + }else{ + otherPayment.setReviewer(user.getNickName()); + //审批时间 + otherPayment.setReviewerTime(new Date()); + } + i = cwOtherPaymentService.updateCwOtherPayment(otherPayment); + } + return toAjax(i); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + CwOtherPayment otherPayment = cwOtherPaymentService.selectCwOtherPaymentById(id); + if(null==otherPayment.getReviewer()){ + return AjaxResult.error("复核人未审批的单据不允许领导审批"); + } + if(null!=otherPayment.getLeadership()){ + otherPayment.setLeadership(""); + }else{ + otherPayment.setLeadership(user.getNickName()); + //审批时间 + otherPayment.setLeadershipTime(new Date()); + } + i = cwOtherPaymentService.updateCwOtherPayment(otherPayment); + if(i < 1){ + return AjaxResult.error("审核失败!"); + } + //判断往来单位类型 + String type = ""; + //往来单位id + String idTwo = ""; + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(otherPayment.getUnitName()); + if(null!=supplier){ + type = "BD_Supplier"; + idTwo = supplier.getId()+""; + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(otherPayment.getUnitName()); + if(null!=employeeInformation){ + type = "BD_Empinfo"; + idTwo = employeeInformation.getId()+""; + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(otherPayment.getUnitName()); + if(null!=customer){ + type = "BD_Customer"; + idTwo = customer.getId()+""; + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(otherPayment.getUnitName()); + if(null!=otherCorrespondent){ + type = "FIN_OTHERS"; + idTwo = otherCorrespondent.getId()+""; + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + + //判断金蝶的发票类型 + String invoicetype = ""; + if("普通发票".equals(otherPayment.getSparedOne())){ + invoicetype = "0"; + }else if("增值税发票".equals(otherPayment.getSparedOne())){ + invoicetype = "1"; + }else if("机票".equals(otherPayment.getSparedOne())){ + invoicetype = "P"; + }else if("火车票".equals(otherPayment.getSparedOne())){ + invoicetype = "R"; + }else if("其它运输票".equals(otherPayment.getSparedOne())){ + invoicetype = "O"; + }else { + invoicetype = "E"; + } + //计算未税金额 + Double weishuiMoney = otherPayment.getMoney()/1.13; + //计算税额 + Double shuiMoney = otherPayment.getMoney() - weishuiMoney; + + //触发金蝶接口 + if(null!=otherPayment.getLeadership()&&!"".equals(otherPayment.getLeadership())){ + //判断当前付款单是付款申请单还是其他付款单,是借款还是付款 + if("付款".equals(otherPayment.getSparedOne())){ + //判断是采购付款还是其他付款,有明细的为付款申请单,无明细的则是其他应付单 + //查询是否有付款单详情信息 + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + cwOtherPaymentInfo.setOtherPaymentId(otherPayment.getId()); + List list = cwOtherPaymentInfoService.selectCwOtherPaymentInfoList(cwOtherPaymentInfo); + if(list.size()>0){ + //判断是什么单据产生的付款申请,如果是采购类的产生的,则从单据中下推付款申请单,如果为物流费用单据产生的,则直接新增应付单(类型为费用应付单) + String sparedOne = ""; + for (CwOtherPaymentInfo cwOtherPaymentInfo2 : list) { + sparedOne = cwOtherPaymentInfo2.getSparedOne(); + } + if("物流费用".equals(sparedOne)){ + //新增应付单(费用应付单) + + }else{ + //下推付款申请单(标准应付单)(审核状态)TODO + + } + + }else{ + //其他应付单 TODO + + } + }else{ + } + } + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwOtherPaymentInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwOtherPaymentInfoController.java new file mode 100644 index 0000000..b4c8fd4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwOtherPaymentInfoController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwOtherPaymentInfo; +import com.ruoyi.project.management.service.ICwOtherPaymentInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 付款单合同关联信息Controller + * + * @author zhukangchao + * @date 2023-12-10 + */ +@RestController +@RequestMapping("/management/cwOtherPaymentInfo") +public class CwOtherPaymentInfoController extends BaseController +{ + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + + /** + * 查询付款单合同关联信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPaymentInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CwOtherPaymentInfo cwOtherPaymentInfo) + { + startPage(); + List list = cwOtherPaymentInfoService.selectCwOtherPaymentInfoList(cwOtherPaymentInfo); + return getDataTable(list); + } + + /** + * 导出付款单合同关联信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPaymentInfo:export')") + @Log(title = "付款单合同关联信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwOtherPaymentInfo cwOtherPaymentInfo) + { + List list = cwOtherPaymentInfoService.selectCwOtherPaymentInfoList(cwOtherPaymentInfo); + ExcelUtil util = new ExcelUtil(CwOtherPaymentInfo.class); + return util.exportExcel(list, "cwOtherPaymentInfo"); + } + + /** + * 获取付款单合同关联信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPaymentInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwOtherPaymentInfoService.selectCwOtherPaymentInfoById(id)); + } + + /** + * 新增付款单合同关联信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPaymentInfo:add')") + @Log(title = "付款单合同关联信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwOtherPaymentInfo cwOtherPaymentInfo) + { + return toAjax(cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo)); + } + + /** + * 修改付款单合同关联信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPaymentInfo:edit')") + @Log(title = "付款单合同关联信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwOtherPaymentInfo cwOtherPaymentInfo) + { + return toAjax(cwOtherPaymentInfoService.updateCwOtherPaymentInfo(cwOtherPaymentInfo)); + } + + /** + * 删除付款单合同关联信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwOtherPaymentInfo:remove')") + @Log(title = "付款单合同关联信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwOtherPaymentInfoService.deleteCwOtherPaymentInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwPayrollController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwPayrollController.java new file mode 100644 index 0000000..f12de94 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwPayrollController.java @@ -0,0 +1,799 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.poi.ExcelUtilSs; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.management.domain.CwAttendance; +import com.ruoyi.project.management.domain.CwDepartment; +import com.ruoyi.project.management.domain.CwEmployeeInformation; +import com.ruoyi.project.management.domain.CwPayroll; +import com.ruoyi.project.management.service.ICwAttendanceService; +import com.ruoyi.project.management.service.ICwDepartmentService; +import com.ruoyi.project.management.service.ICwEmployeeInformationService; +import com.ruoyi.project.management.service.ICwPayrollService; + +/** + * 工资单Controller + * + * @author zhukangchao + * @date 2021-10-25 + */ +@RestController +@RequestMapping("/management/CwPayroll") +public class CwPayrollController extends BaseController +{ + @Autowired + private ICwPayrollService cwPayrollService; + //员工信息 + @Autowired + private ICwEmployeeInformationService cwEmployeeInformationService; + //考勤记录信息 + @Autowired + private ICwAttendanceService cwAttendanceService; + //部门信息 + @Autowired + private ICwDepartmentService cwDepartmentService; + + /** + * 查询工资单列表 + */ + @PreAuthorize("@ss.hasPermi('management:CwPayroll:list')") + @GetMapping("/list") + public TableDataInfo list(CwPayroll cwPayroll) + { + startPage(); + List list = cwPayrollService.selectCwPayrollList(cwPayroll); + return getDataTable(list); + } + + /** + * 导出工资单列表 + * 参数为工资所属月份 + * + */ + @PreAuthorize("@ss.hasPermi('management:CwPayroll:export')") + @Log(title = "工资单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwPayroll cwPayroll){ + // 创建excel文件 + ExcelUtilSs util = new ExcelUtilSs(CwPayroll.class); + //创建总表 + List list = new ArrayList<>(); + //获取总表的工资数据 +// list = cwPayrollService.selectCwPayrollList(cwPayroll); + //创建各个部门工资数据集合的集合 + List> lists = new ArrayList<>(); + //创建各个部门sheetname集合 + List sheetNameList = new ArrayList<>(); + //汇总表表头 + String title = cwPayroll.getAffiliationMonth()+"月工资汇总表"; + //表尾 + String footer = "制表: "+"审核: "+"经理签字: "+"总经理签字: "; + //创建各个部门的数据集合 + //获取所有部门 + CwDepartment cwDepartment = new CwDepartment(); + List list1 = cwDepartmentService.selectCwDepartmentList(cwDepartment); + for (CwDepartment cwDepartment2 : list1) { + //根据部门名称查询各个部门的工资数据 + cwPayroll.setDepartmentName(cwDepartment2.getDepartmentName()); + List list2 = cwPayrollService.selectCwPayrollList(cwPayroll); + + //计算总表的数据并存放在list中 + //创建总表的对象 + CwPayroll cwPayrollZong = new CwPayroll(); + if("河北贝西".equals(cwDepartment2.getDepartmentName())){ + cwPayrollZong.setDepartmentName("河北贝西总计"); + }else if("石家庄伊特".equals(cwDepartment2.getDepartmentName())){ + //这里要做一次小计(小计数据为所有部门除去河北贝西和石家庄伊特的数据,所以在添加石家庄伊特之前要做一次小计,部门数据,石家庄伊特和河北贝西的数据永远保持的最后两位) + CwPayroll cwPayrollXiaoJi = new CwPayroll(); + cwPayrollXiaoJi.setDepartmentName("小计"); + for (CwPayroll cwPayroll2 : list) { + if(null==cwPayrollXiaoJi.getBasicMonthlySalary()){ + cwPayrollXiaoJi.setBasicMonthlySalary(new BigDecimal("0")); + } + if(null==cwPayroll2.getBasicMonthlySalary()){ + cwPayroll2.setBasicMonthlySalary(new BigDecimal("0")); + } + //月工资合计 + cwPayrollXiaoJi.setBasicMonthlySalary(cwPayrollXiaoJi.getBasicMonthlySalary().add(cwPayroll2.getBasicMonthlySalary())); + if(null==cwPayrollXiaoJi.getDailyWages()){ + cwPayrollXiaoJi.setDailyWages(new BigDecimal("0")); + } + if(null==cwPayroll2.getDailyWages()){ + cwPayroll2.setDailyWages(new BigDecimal("0")); + } + //日工资合计 + cwPayrollXiaoJi.setDailyWages(cwPayrollXiaoJi.getDailyWages().add(cwPayroll2.getDailyWages())); + if(null==cwPayrollXiaoJi.getSubsidyOrBonus()){ + cwPayrollXiaoJi.setSubsidyOrBonus(new BigDecimal("0")); + } + if(null==cwPayroll2.getSubsidyOrBonus()){ + cwPayroll2.setSubsidyOrBonus(new BigDecimal("0")); + } + //补助奖金合计 + cwPayrollXiaoJi.setSubsidyOrBonus(cwPayrollXiaoJi.getSubsidyOrBonus().add(cwPayroll2.getSubsidyOrBonus())); + if(null==cwPayrollXiaoJi.getIncentiveFee()){ + cwPayrollXiaoJi.setIncentiveFee(new BigDecimal("0")); + } + if(null==cwPayroll2.getIncentiveFee()){ + cwPayroll2.setIncentiveFee(new BigDecimal("0")); + } + //计件费合计 + cwPayrollXiaoJi.setIncentiveFee(cwPayrollXiaoJi.getIncentiveFee().add(cwPayroll2.getIncentiveFee())); + if(null==cwPayrollXiaoJi.getSenioritySalary()){ + cwPayrollXiaoJi.setSenioritySalary(new BigDecimal("0")); + } + if(null==cwPayroll2.getSenioritySalary()){ + cwPayroll2.setSenioritySalary(new BigDecimal("0")); + } + //工龄工资合计 + cwPayrollXiaoJi.setSenioritySalary(cwPayrollXiaoJi.getSenioritySalary().add(cwPayroll2.getSenioritySalary())); + if(null==cwPayrollXiaoJi.getTrafficAllowance()){ + cwPayrollXiaoJi.setTrafficAllowance(new BigDecimal("0")); + } + if(null==cwPayroll2.getTrafficAllowance()){ + cwPayroll2.setTrafficAllowance(new BigDecimal("0")); + } + //交通补助合计 + cwPayrollXiaoJi.setTrafficAllowance(cwPayrollXiaoJi.getTrafficAllowance().add(cwPayroll2.getTrafficAllowance())); + if(null==cwPayrollXiaoJi.getSalary()){ + cwPayrollXiaoJi.setSalary(new BigDecimal("0")); + } + if(null==cwPayroll2.getSalary()){ + cwPayroll2.setSalary(new BigDecimal("0")); + } + //应发工资合计 + cwPayrollXiaoJi.setSalary(cwPayrollXiaoJi.getSalary().add(cwPayroll2.getSalary())); + if(null==cwPayrollXiaoJi.getPayInsurance()){ + cwPayrollXiaoJi.setPayInsurance(new BigDecimal("0")); + } + if(null==cwPayroll2.getPayInsurance()){ + cwPayroll2.setPayInsurance(new BigDecimal("0")); + } + //保险合计 + cwPayrollXiaoJi.setPayInsurance(cwPayrollXiaoJi.getPayInsurance().add(cwPayroll2.getPayInsurance())); + if(null==cwPayrollXiaoJi.getSalaryBeforeTax()){ + cwPayrollXiaoJi.setSalaryBeforeTax(new BigDecimal("0")); + } + if(null==cwPayroll2.getSalaryBeforeTax()){ + cwPayroll2.setSalaryBeforeTax(new BigDecimal("0")); + } + //税前工资合计 + cwPayrollXiaoJi.setSalaryBeforeTax(cwPayrollXiaoJi.getSalaryBeforeTax().add(cwPayroll2.getSalaryBeforeTax())); + + if(null==cwPayrollXiaoJi.getTotalWages()){ + cwPayrollXiaoJi.setTotalWages(new BigDecimal("0")); + } + if(null==cwPayroll2.getTotalWages()){ + cwPayroll2.setTotalWages(new BigDecimal("0")); + } + //本年累计已发工资合计 + cwPayrollXiaoJi.setTotalWages(cwPayrollXiaoJi.getTotalWages().add(cwPayroll2.getTotalWages())); + if(null==cwPayrollXiaoJi.getTaxableIncome()){ + cwPayrollXiaoJi.setTaxableIncome(new BigDecimal("0")); + } + if(null==cwPayroll2.getTaxableIncome()){ + cwPayroll2.setTaxableIncome(new BigDecimal("0")); + } + //应纳税所得额合计 + cwPayrollXiaoJi.setTaxableIncome(cwPayrollXiaoJi.getTaxableIncome().add(cwPayroll2.getTaxableIncome())); + if(null==cwPayrollXiaoJi.getAggregatePersonalIncomeTax()){ + cwPayrollXiaoJi.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + if(null==cwPayroll2.getAggregatePersonalIncomeTax()){ + cwPayroll2.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + //累计已缴税额合计 + cwPayrollXiaoJi.setAggregatePersonalIncomeTax(cwPayrollXiaoJi.getAggregatePersonalIncomeTax().add(cwPayroll2.getAggregatePersonalIncomeTax())); + if(null==cwPayrollXiaoJi.getTaxPayable()){ + cwPayrollXiaoJi.setTaxPayable(new BigDecimal("0")); + } + if(null==cwPayroll2.getTaxPayable()){ + cwPayroll2.setTaxPayable(new BigDecimal("0")); + } + //应缴个税合计 + cwPayrollXiaoJi.setTaxPayable(cwPayrollXiaoJi.getTaxPayable().add(cwPayroll2.getTaxPayable())); + if(null==cwPayrollXiaoJi.getNetPayroll()){ + cwPayrollXiaoJi.setNetPayroll(new BigDecimal("0")); + } + if(null==cwPayroll2.getNetPayroll()){ + cwPayroll2.setNetPayroll(new BigDecimal("0")); + } + //实发工资合计 + cwPayrollXiaoJi.setNetPayroll(cwPayrollXiaoJi.getNetPayroll().add(cwPayroll2.getNetPayroll())); + } + list.add(cwPayrollXiaoJi); + cwPayrollZong.setDepartmentName("石家庄伊特总计"); + }else{ + cwPayrollZong.setDepartmentName(cwDepartment2.getDepartmentName()); + } + + //遍历list1,计算合计数据 + //创建合计对象 + CwPayroll cwPayrolls = new CwPayroll(); + cwPayrolls.setName("合计"); + for (CwPayroll cwPayroll2 : list2) { + if(null==cwPayrolls.getBasicMonthlySalary()){ + cwPayrolls.setBasicMonthlySalary(new BigDecimal("0")); + } + //月工资合计 + cwPayrolls.setBasicMonthlySalary(cwPayrolls.getBasicMonthlySalary().add(cwPayroll2.getBasicMonthlySalary())); + cwPayrollZong.setBasicMonthlySalary(cwPayrolls.getBasicMonthlySalary()); + if(null==cwPayrolls.getDailyWages()){ + cwPayrolls.setDailyWages(new BigDecimal("0")); + } + //日工资合计 + cwPayrolls.setDailyWages(cwPayrolls.getDailyWages().add(cwPayroll2.getDailyWages())); + cwPayrollZong.setDailyWages(cwPayrolls.getDailyWages()); + if(null==cwPayrolls.getSubsidyOrBonus()){ + cwPayrolls.setSubsidyOrBonus(new BigDecimal("0")); + } + //补助奖金合计 + cwPayrolls.setSubsidyOrBonus(cwPayrolls.getSubsidyOrBonus().add(cwPayroll2.getSubsidyOrBonus())); + cwPayrollZong.setSubsidyOrBonus(cwPayrolls.getSubsidyOrBonus()); + if(null==cwPayrolls.getIncentiveFee()){ + cwPayrolls.setIncentiveFee(new BigDecimal("0")); + } + //计件费合计 + cwPayrolls.setIncentiveFee(cwPayrolls.getIncentiveFee().add(cwPayroll2.getIncentiveFee())); + cwPayrollZong.setIncentiveFee(cwPayrolls.getIncentiveFee()); + if(null==cwPayrolls.getSenioritySalary()){ + cwPayrolls.setSenioritySalary(new BigDecimal("0")); + } + //工龄工资合计 + cwPayrolls.setSenioritySalary(cwPayrolls.getSenioritySalary().add(cwPayroll2.getSenioritySalary())); + cwPayrollZong.setSenioritySalary(cwPayrolls.getSenioritySalary()); + if(null==cwPayrolls.getTrafficAllowance()){ + cwPayrolls.setTrafficAllowance(new BigDecimal("0")); + } + //交通补助合计 + cwPayrolls.setTrafficAllowance(cwPayrolls.getTrafficAllowance().add(cwPayroll2.getTrafficAllowance())); + cwPayrollZong.setTrafficAllowance(cwPayrolls.getTrafficAllowance()); + if(null==cwPayrolls.getSalary()){ + cwPayrolls.setSalary(new BigDecimal("0")); + } + //应发工资合计 + cwPayrolls.setSalary(cwPayrolls.getSalary().add(cwPayroll2.getSalary())); + cwPayrollZong.setSalary(cwPayrolls.getSalary()); + if(null==cwPayrolls.getPayInsurance()){ + cwPayrolls.setPayInsurance(new BigDecimal("0")); + } + //保险合计 + cwPayrolls.setPayInsurance(cwPayrolls.getPayInsurance().add(cwPayroll2.getPayInsurance())); + cwPayrollZong.setPayInsurance(cwPayrolls.getPayInsurance()); + if(null==cwPayrolls.getSalaryBeforeTax()){ + cwPayrolls.setSalaryBeforeTax(new BigDecimal("0")); + } + //税前工资合计 + cwPayrolls.setSalaryBeforeTax(cwPayrolls.getSalaryBeforeTax().add(cwPayroll2.getSalaryBeforeTax())); + cwPayrollZong.setSalaryBeforeTax(cwPayrolls.getSalaryBeforeTax()); + if(null==cwPayrolls.getTotalWages()){ + cwPayrolls.setTotalWages(new BigDecimal("0")); + } + //累计已发工资 + cwPayrolls.setTotalWages(cwPayrolls.getTotalWages().add(cwPayroll2.getTotalWages())); + cwPayrollZong.setTotalWages(cwPayrolls.getTotalWages()); + if(null==cwPayrolls.getTaxableIncome()){ + cwPayrolls.setTaxableIncome(new BigDecimal("0")); + } + //应纳税所得额 + cwPayrolls.setTaxableIncome(cwPayrolls.getTaxableIncome().add(cwPayroll2.getTaxableIncome())); + cwPayrollZong.setTaxableIncome(cwPayrolls.getTaxableIncome()); + if(null==cwPayrolls.getAggregatePersonalIncomeTax()){ + cwPayrolls.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + //累计已缴税额 + cwPayrolls.setAggregatePersonalIncomeTax(cwPayrolls.getAggregatePersonalIncomeTax().add(cwPayroll2.getAggregatePersonalIncomeTax())); + cwPayrollZong.setAggregatePersonalIncomeTax(cwPayrolls.getAggregatePersonalIncomeTax()); + if(null==cwPayrolls.getTaxPayable()){ + cwPayrolls.setTaxPayable(new BigDecimal("0")); + } + //应缴个税合计 + cwPayrolls.setTaxPayable(cwPayrolls.getTaxPayable().add(cwPayroll2.getTaxPayable())); + cwPayrollZong.setTaxPayable(cwPayrolls.getTaxPayable()); + if(null==cwPayrolls.getNetPayroll()){ + cwPayrolls.setNetPayroll(new BigDecimal("0")); + } + //实发工资合计 + cwPayrolls.setNetPayroll(cwPayrolls.getNetPayroll().add(cwPayroll2.getNetPayroll())); + cwPayrollZong.setNetPayroll(cwPayrolls.getNetPayroll()); + } + list2.add(cwPayrolls); + //sheetName集合 + sheetNameList.add(cwDepartment2.getDepartmentName()); + //工资数据集合 + lists.add(list2); + //总表数据 + list.add(cwPayrollZong); + } + + //计算总表list中的总计 + CwPayroll cwPayrollZongJi = new CwPayroll(); + cwPayrollZongJi.setDepartmentName("总计"); + for (CwPayroll cwPayroll2 : list) { + if(!cwPayroll2.getDepartmentName().equals("小计")){ + if(null==cwPayrollZongJi.getBasicMonthlySalary()){ + cwPayrollZongJi.setBasicMonthlySalary(new BigDecimal("0")); + } + if(null==cwPayroll2.getBasicMonthlySalary()){ + cwPayroll2.setBasicMonthlySalary(new BigDecimal("0")); + } + //月工资合计 + cwPayrollZongJi.setBasicMonthlySalary(cwPayrollZongJi.getBasicMonthlySalary().add(cwPayroll2.getBasicMonthlySalary())); + if(null==cwPayrollZongJi.getDailyWages()){ + cwPayrollZongJi.setDailyWages(new BigDecimal("0")); + } + if(null==cwPayroll2.getDailyWages()){ + cwPayroll2.setDailyWages(new BigDecimal("0")); + } + //日工资合计 + cwPayrollZongJi.setDailyWages(cwPayrollZongJi.getDailyWages().add(cwPayroll2.getDailyWages())); + if(null==cwPayrollZongJi.getSubsidyOrBonus()){ + cwPayrollZongJi.setSubsidyOrBonus(new BigDecimal("0")); + } + if(null==cwPayroll2.getSubsidyOrBonus()){ + cwPayroll2.setSubsidyOrBonus(new BigDecimal("0")); + } + //补助奖金合计 + cwPayrollZongJi.setSubsidyOrBonus(cwPayrollZongJi.getSubsidyOrBonus().add(cwPayroll2.getSubsidyOrBonus())); + if(null==cwPayrollZongJi.getIncentiveFee()){ + cwPayrollZongJi.setIncentiveFee(new BigDecimal("0")); + } + if(null==cwPayroll2.getIncentiveFee()){ + cwPayroll2.setIncentiveFee(new BigDecimal("0")); + } + //计件费合计 + cwPayrollZongJi.setIncentiveFee(cwPayrollZongJi.getIncentiveFee().add(cwPayroll2.getIncentiveFee())); + if(null==cwPayrollZongJi.getSenioritySalary()){ + cwPayrollZongJi.setSenioritySalary(new BigDecimal("0")); + } + if(null==cwPayroll2.getSenioritySalary()){ + cwPayroll2.setSenioritySalary(new BigDecimal("0")); + } + //工龄工资合计 + cwPayrollZongJi.setSenioritySalary(cwPayrollZongJi.getSenioritySalary().add(cwPayroll2.getSenioritySalary())); + if(null==cwPayrollZongJi.getTrafficAllowance()){ + cwPayrollZongJi.setTrafficAllowance(new BigDecimal("0")); + } + if(null==cwPayroll2.getTrafficAllowance()){ + cwPayroll2.setTrafficAllowance(new BigDecimal("0")); + } + //交通补助合计 + cwPayrollZongJi.setTrafficAllowance(cwPayrollZongJi.getTrafficAllowance().add(cwPayroll2.getTrafficAllowance())); + if(null==cwPayrollZongJi.getSalary()){ + cwPayrollZongJi.setSalary(new BigDecimal("0")); + } + if(null==cwPayroll2.getSalary()){ + cwPayroll2.setSalary(new BigDecimal("0")); + } + //应发工资合计 + cwPayrollZongJi.setSalary(cwPayrollZongJi.getSalary().add(cwPayroll2.getSalary())); + if(null==cwPayrollZongJi.getPayInsurance()){ + cwPayrollZongJi.setPayInsurance(new BigDecimal("0")); + } + if(null==cwPayroll2.getPayInsurance()){ + cwPayroll2.setPayInsurance(new BigDecimal("0")); + } + //保险合计 + cwPayrollZongJi.setPayInsurance(cwPayrollZongJi.getPayInsurance().add(cwPayroll2.getPayInsurance())); + if(null==cwPayrollZongJi.getSalaryBeforeTax()){ + cwPayrollZongJi.setSalaryBeforeTax(new BigDecimal("0")); + } + if(null==cwPayroll2.getSalaryBeforeTax()){ + cwPayroll2.setSalaryBeforeTax(new BigDecimal("0")); + } + //税前工资合计 + cwPayrollZongJi.setSalaryBeforeTax(cwPayrollZongJi.getSalaryBeforeTax().add(cwPayroll2.getSalaryBeforeTax())); + if(null==cwPayrollZongJi.getTaxPayable()){ + cwPayrollZongJi.setTaxPayable(new BigDecimal("0")); + } + if(null==cwPayroll2.getTaxPayable()){ + cwPayroll2.setTaxPayable(new BigDecimal("0")); + } + cwPayrollZongJi.setTaxPayable(cwPayrollZongJi.getTaxPayable().add(cwPayroll2.getTaxPayable())); + if(null==cwPayrollZongJi.getTotalWages()){ + cwPayrollZongJi.setTotalWages(new BigDecimal("0")); + } + if(null==cwPayroll2.getTotalWages()){ + cwPayroll2.setTotalWages(new BigDecimal("0")); + } + //累计已发工资 + cwPayrollZongJi.setTotalWages(cwPayrollZongJi.getTotalWages().add(cwPayroll2.getTotalWages())); + if(null==cwPayrollZongJi.getTaxableIncome()){ + cwPayrollZongJi.setTaxableIncome(new BigDecimal("0")); + } + if(null==cwPayroll2.getTaxableIncome()){ + cwPayroll2.setTaxableIncome(new BigDecimal("0")); + } + //应纳税所得额 + cwPayrollZongJi.setTaxableIncome(cwPayrollZongJi.getTaxableIncome().add(cwPayroll2.getTaxableIncome())); + if(null==cwPayrollZongJi.getAggregatePersonalIncomeTax()){ + cwPayrollZongJi.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + if(null==cwPayroll2.getAggregatePersonalIncomeTax()){ + cwPayroll2.setAggregatePersonalIncomeTax(new BigDecimal("0")); + } + //累计已缴税额 + cwPayrollZongJi.setAggregatePersonalIncomeTax(cwPayrollZongJi.getAggregatePersonalIncomeTax().add(cwPayroll2.getAggregatePersonalIncomeTax())); + //实发工资合计 + if(null==cwPayrollZongJi.getNetPayroll()){ + cwPayrollZongJi.setNetPayroll(new BigDecimal("0")); + } + if(null==cwPayroll2.getNetPayroll()){ + cwPayroll2.setNetPayroll(new BigDecimal("0")); + } + //实发工资合计 + cwPayrollZongJi.setNetPayroll(cwPayrollZongJi.getNetPayroll().add(cwPayroll2.getNetPayroll())); + } + } + list.add(cwPayrollZongJi); + //参数:总表数据集合,总表sheetName,各个部门数据集合,各个部门sheetName + return util.exportExcel(list,lists,"总表",sheetNameList,title,footer); + } + + /** + * 获取工资单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:CwPayroll:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwPayrollService.selectCwPayrollById(id)); + } + + /** + * 新增工资单 + */ + @PreAuthorize("@ss.hasPermi('management:CwPayroll:add')") + @Log(title = "工资单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwPayroll cwPayroll){ + //计算工资 + if(null==cwPayroll.getAffiliationMonth()||"".equals(cwPayroll.getAffiliationMonth().toString().trim())){ + return AjaxResult.error("请选择工资所属月份"); + } + String[] strings = cwPayroll.getAffiliationMonth().split("-"); + //获取员工信息表中的所有员工信息 + CwEmployeeInformation cwEmployeeInformation = new CwEmployeeInformation(); + List list = cwEmployeeInformationService.selectCwEmployeeInformationList(cwEmployeeInformation); + if(list.size()==0){ + return AjaxResult.error("未查询到员工信息"); + } + //计算工资时计算员工信息表中的所有员工 + for (CwEmployeeInformation cwEmployeeInformation2 : list) { + //获取员工姓名 + String name = cwEmployeeInformation2.getName(); + //根据日期和名称查询考勤记录 + CwAttendance belongsToDate = cwAttendanceService.selectCwAttendanceByNameAndBelongsToDate(name,cwPayroll.getAffiliationMonth()); + if(null==belongsToDate||"".equals(belongsToDate)){ + continue; +// return AjaxResult.error("未查询到:"+name+"的考勤记录"); + } + //保存应出勤天数 + cwPayroll.setShouldAttendanceNumber(belongsToDate.getShouldBeAttendance().longValue()); + //保存实出勤天数 + cwPayroll.setRealAttendanceNumber(new BigDecimal(belongsToDate.getRealAttendance())); + //本月应发工资 + BigDecimal basicMonthlySalary = new BigDecimal("0"); + //请假扣款工资 + BigDecimal qingjia = new BigDecimal("0"); + //员工信息 + CwEmployeeInformation employeeInformation = cwEmployeeInformationService.selectCwEmployeeInformationByName(name); + //计算员工本月工资 + //判断是月工资还是日工资 + if(employeeInformation.getBasicMonthlySalary().longValue()>0){ + //说明是月工资 + basicMonthlySalary = employeeInformation.getBasicMonthlySalary(); + //如果为月工资,则需要判断是否有实习期,如果有实习期,则需要判断当前工资所属月份,是否在实习期之内,或者 + //和实习期有重叠的部分 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //获取入职日期 + Date entryDate = employeeInformation.getEntryDate(); + //获取当前员工的试用期月数 + int probationPeriod = employeeInformation.getProbationPeriod().intValue(); + //计算试用期结束的日期 + Calendar cals = Calendar.getInstance(); + cals.setTime(entryDate); + cals.add(cals.MONTH,probationPeriod); + //试用期结束日期 + Date newTime = cals.getTime(); + Calendar calsa = Calendar.getInstance(); + calsa.setTime(newTime); + //试用期结束的年份 + int nian = calsa.get(Calendar.YEAR); + //试用期结束的月份 + int yue = calsa.get(Calendar.MONTH); + yue = yue+1; + //试用期结束的天 + int tian = calsa.get(Calendar.DAY_OF_MONTH); + //判断工资所属月份和试用期的时间 + if(nian=belongsToDate.getShouldBeAttendance()){ + //说明是全额工资 + //获取月基本工资 +// basicMonthlySalary = employeeInformation.getBasicMonthlySalary(); + }else{ + //说明非全额工资,需要计算月工资,计算方法为,月工资/应出勤天数*实出勤天数 + basicMonthlySalary = basicMonthlySalary.divide(new BigDecimal(belongsToDate.getShouldBeAttendance()),2).multiply(new BigDecimal(belongsToDate.getRealAttendance())); + } + }else if(employeeInformation.getDailyWages().longValue()>0){ + //说明是日工资 + //本月应发基本工资 = 日工资*实出勤天数 + basicMonthlySalary = employeeInformation.getDailyWages().multiply(new BigDecimal(belongsToDate.getRealAttendance())); + } +// else{ +// //说明基本数据有错误,需要提示录入员工信息 +// return AjaxResult.error("请完善员工基本信息"); +// } + //添加工资单数据 + //员工所属部门 + cwPayroll.setDepartmentName(employeeInformation.getDepartment()); + //员工姓名 + cwPayroll.setName(employeeInformation.getName()); + //月基本工资 + cwPayroll.setBasicMonthlySalary(employeeInformation.getBasicMonthlySalary()); + //日基本工资 + cwPayroll.setDailyWages(employeeInformation.getDailyWages()); + //迟到扣款(暂不计算迟到扣款) + cwPayroll.setLateDeductions(0L); + //计算工龄工资(工龄工资为工龄*本月实出勤天数) TODO 判断工龄年限超过多少年后才计算工龄工资 + if("机加车间".equals(employeeInformation.getDepartment())){ + BigDecimal senioritySalary = new BigDecimal(belongsToDate.getRealAttendance()).multiply(new BigDecimal(employeeInformation.getSeniority())); + cwPayroll.setSenioritySalary(senioritySalary); + }else{ + cwPayroll.setSenioritySalary(new BigDecimal(0)); + } + //补助或奖金 + cwPayroll.setSubsidyOrBonus(employeeInformation.getSubsidyOrBonus()); + //计件费 + cwPayroll.setIncentiveFee(employeeInformation.getIncentiveFee()); + //交通补助(以月为单位) + cwPayroll.setTrafficAllowance(employeeInformation.getTrafficAllowance()); + //通讯补助(通讯补助以月为单位) + cwPayroll.setCommunicateAllowance(employeeInformation.getCommunicateAllowance()); + //住房补助(住房补助以月为单位) + cwPayroll.setHousingAllowance(employeeInformation.getHousingAllowance()); + //饭补(实出勤*一天的金额) + cwPayroll.setMealAllowance(employeeInformation.getMealAllowance().multiply(new BigDecimal(belongsToDate.getRealAttendance()))); + //应发工资(基本工资+补助或奖金+计件费+交通补助+通讯补助+住房补助+饭补-迟到扣款(迟到扣款暂不计入工资)) + cwPayroll.setSalary(basicMonthlySalary.add(cwPayroll.getSubsidyOrBonus()).add(cwPayroll.getTrafficAllowance()).add(cwPayroll.getCommunicateAllowance()).add(cwPayroll.getHousingAllowance()).add(cwPayroll.getMealAllowance()).add(cwPayroll.getSenioritySalary()).add(cwPayroll.getIncentiveFee()).subtract(new BigDecimal(cwPayroll.getLateDeductions()))); + //判断此员工是否有保险 + if(1==employeeInformation.getPayInsurance()){ + //不再计算保险金额,员工信息中的保险基数保存为保险应缴金额,本月应缴保险直接累加三种保险的金额 + //说明有保险,则需要获取各项保险基数后计算各项保险金额 +// //计算养老保险 +// BigDecimal endowmentInsurance = employeeInformation.getEndowmentInsurance().multiply(new BigDecimal("0.08")); +// //计算医疗保险 +// BigDecimal medicalInsurance = employeeInformation.getMedicalInsurance().multiply(new BigDecimal("0.02")); +// //计算失业保险 +// BigDecimal unemploymentInsurance = employeeInformation.getUnemploymentInsurance().multiply(new BigDecimal("0.003")); +// //保存各项保险之和 +// cwPayroll.setPayInsurance(endowmentInsurance.add(medicalInsurance).add(unemploymentInsurance)); + //保存各项保险之和 + cwPayroll.setPayInsurance(employeeInformation.getEndowmentInsurance().add(employeeInformation.getMedicalInsurance()).add(employeeInformation.getUnemploymentInsurance())); + }else{ + //没有保险 + cwPayroll.setPayInsurance(new BigDecimal("0")); + } + //计算税前工资(应发工资-代缴保险) + cwPayroll.setSalaryBeforeTax(cwPayroll.getSalary().subtract(cwPayroll.getPayInsurance())); + //计算个税 + //获取本年累计已发工资(本年累计已发工资+本月的税前工资则为本年累计已发工资) + //获取当前月份 + String yuefen = cwPayroll.getAffiliationMonth().split("-")[1]; + if(Integer.parseInt(yuefen) == 12){ + cwPayroll.setTotalWages(null); + }else{ + cwPayroll.setTotalWages(employeeInformation.getTotalWages().add(cwPayroll.getSalaryBeforeTax())); + } + //计算专项扣除(累计专项扣除) + BigDecimal zhuanxiang = employeeInformation.getChildrenEducation().add(employeeInformation.getSupportTheOld()).add(employeeInformation.getHousingLoans()).add(employeeInformation.getHousingRents()).add(employeeInformation.getAdultEducation()).add(employeeInformation.getTreatmentForSeriousDisease()); + cwPayroll.setSpecialDeduction(employeeInformation.getSpecialDeduction().add(zhuanxiang)); + //获取当前人员的入职日期 + Date entryDate = employeeInformation.getEntryDate(); + //工资所属月份 + String s = cwPayroll.getAffiliationMonth() + "-01"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String format = sdf.format(entryDate); + long monthDiff = 0; + try { + monthDiff = getMonthDiff(format,s); + } catch (Exception e) { + e.printStackTrace(); + } + if(monthDiff>Integer.valueOf(strings[1])){ + //本年累计免征税额 专项扣除+期数*5000+5000(如果大于,则代表入职时间为去年入职的,则需要累加12月份的免征额) + cwPayroll.setAnnualExemptionAmount(cwPayroll.getSpecialDeduction().longValue()+Integer.valueOf(strings[1])*5000+5000); + }else if(monthDiff==Integer.valueOf(strings[1])){ + //本年累计免征税额 专项扣除+期数*5000(如果等于,则代表是1月份入职的,则不需要累加) + cwPayroll.setAnnualExemptionAmount(cwPayroll.getSpecialDeduction().longValue()+Integer.valueOf(strings[1])*5000); + }else{ + //本年累计免征税额 专项扣除+差额月*5000 + cwPayroll.setAnnualExemptionAmount(cwPayroll.getSpecialDeduction().longValue()+monthDiff*5000); + } + //应纳税所得额 + cwPayroll.setTaxableIncome(cwPayroll.getTotalWages().subtract(new BigDecimal(cwPayroll.getAnnualExemptionAmount()))); + //税率 + if(cwPayroll.getTaxableIncome().intValue()>0&&cwPayroll.getTaxableIncome().intValue()<=36000){ + //此阶税率为百分之3,速减数为0 + cwPayroll.setTaxRate("0.03"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(0L); + }else if(cwPayroll.getTaxableIncome().intValue()>36000&&cwPayroll.getTaxableIncome().intValue()<=144000){ + //此阶税率为百分之10,速减数为2520 + cwPayroll.setTaxRate("0.1"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(2520L); + }else if(cwPayroll.getTaxableIncome().intValue()>144000&&cwPayroll.getTaxableIncome().intValue()<=300000){ + //此阶税率为百分之20,速减数为16920 + cwPayroll.setTaxRate("0.2"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(16920L); + }else if(cwPayroll.getTaxableIncome().intValue()>300000&&cwPayroll.getTaxableIncome().intValue()<=420000){ + //此阶税率为百分之25,速减数为31920 + cwPayroll.setTaxRate("0.25"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(31920L); + }else if(cwPayroll.getTaxableIncome().intValue()>420000&&cwPayroll.getTaxableIncome().intValue()<=660000){ + //此阶税率为百分之30,速减数为52920 + cwPayroll.setTaxRate("0.3"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(52920L); + }else if(cwPayroll.getTaxableIncome().intValue()>660000&&cwPayroll.getTaxableIncome().intValue()<=960000){ + //此阶税率为百分之35,速减数为85920 + cwPayroll.setTaxRate("0.35"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(85920L); + }else if(cwPayroll.getTaxableIncome().intValue()>960000){ + //此阶税率为百分之45,速减数为181920 + cwPayroll.setTaxRate("0.45"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(181920L); + }else{ + //应纳税所得额小于0(免征额+专项扣除>应发工资时) + //此阶税率为百分之0,速减数为0 + cwPayroll.setTaxRate("0"); + //速算扣除数 + cwPayroll.setSlowDownTheDeduction(0L); + cwPayroll.setTaxableIncome(new BigDecimal("0")); + } + //本年累计已缴税额 + cwPayroll.setAggregatePersonalIncomeTax(employeeInformation.getAggregatePersonalIncomeTax()); + //判断税前工资是否大于5000,如果小于,则不在计算个税 + if(cwPayroll.getSalaryBeforeTax().intValue()>5000){ + //本月应缴个税(本月应纳税所得额*税率-速减数-本年累计已预缴个税) + cwPayroll.setTaxPayable(cwPayroll.getTaxableIncome().multiply(new BigDecimal(cwPayroll.getTaxRate())).subtract(new BigDecimal(cwPayroll.getSlowDownTheDeduction())).subtract(cwPayroll.getAggregatePersonalIncomeTax())); + if(cwPayroll.getTaxPayable().longValue()<0){ + cwPayroll.setTaxPayable(new BigDecimal(0)); + } + }else{ + //应纳税所得额 + cwPayroll.setTaxableIncome(new BigDecimal("0")); + cwPayroll.setTaxPayable(new BigDecimal("0")); + } + //实发工资(税前工资-本月应缴个人所得税) + cwPayroll.setNetPayroll(cwPayroll.getSalaryBeforeTax().subtract(cwPayroll.getTaxPayable())); + int i = cwPayrollService.insertCwPayroll(cwPayroll); + //把本年累计已发工资保存到员工信息表中 + employeeInformation.setTotalWages(cwPayroll.getTotalWages()); + //把本年累计已缴个税保存到员工信息表中 + employeeInformation.setAggregatePersonalIncomeTax(employeeInformation.getAggregatePersonalIncomeTax().add(cwPayroll.getTaxPayable())); + //把本年累计专项扣除保存到员工信息表中 + employeeInformation.setSpecialDeduction(cwPayroll.getSpecialDeduction()); + int j = cwEmployeeInformationService.updateCwEmployeeInformation(employeeInformation); + } + return AjaxResult.success(); + } + + /** + * 修改工资单 + */ + @PreAuthorize("@ss.hasPermi('management:CwPayroll:edit')") + @Log(title = "工资单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwPayroll cwPayroll) + { + return toAjax(cwPayrollService.updateCwPayroll(cwPayroll)); + } + + /** + * 删除工资单 + */ + @PreAuthorize("@ss.hasPermi('management:CwPayroll:remove')") + @Log(title = "工资单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //删除信息之前把员工的本年累计工资和本年累计个税恢复到上个月的金额 + for (Long long1 : ids) { + CwPayroll cwPayroll = cwPayrollService.selectCwPayrollById(long1); + //获取员工姓名,根据员工姓名查询员工信息 + CwEmployeeInformation employeeInformation = cwEmployeeInformationService.selectCwEmployeeInformationByName(cwPayroll.getName()); + //恢复上个月的本年累计已发工资和本年累计已缴个税 + employeeInformation.setTotalWages(employeeInformation.getTotalWages().subtract(cwPayroll.getSalaryBeforeTax())); + //本年累计已缴个税 + employeeInformation.setAggregatePersonalIncomeTax(employeeInformation.getAggregatePersonalIncomeTax().subtract(cwPayroll.getTaxPayable())); + //本年累计专项附加扣除 + employeeInformation.setSpecialDeduction(employeeInformation.getSpecialDeduction().subtract(cwPayroll.getSpecialDeduction())); + //修改员工信息 + cwEmployeeInformationService.updateCwEmployeeInformation(employeeInformation); + } + return toAjax(cwPayrollService.deleteCwPayrollByIds(ids)); + } + + /** + * 得到两日期相差几个月 + * @param String + * @return + */ + + public static long getMonthDiff(String startDate, String endDate) throws Exception { + + long monthday; + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + Date startDate1 = fmt.parse(startDate); + Calendar starCal = Calendar.getInstance(); + starCal.setTime(startDate1); + int sYear = starCal.get(Calendar.YEAR); + int sMonth = starCal.get(Calendar.MONTH); + int sDay = starCal.get(Calendar.DAY_OF_MONTH); + Date endDate1 = fmt.parse(endDate); + Calendar endCal = Calendar.getInstance(); + endCal.setTime(endDate1); + int eYear = endCal.get(Calendar.YEAR); + int eMonth = endCal.get(Calendar.MONTH); + int eDay = endCal.get(Calendar.DAY_OF_MONTH); + monthday = ((eYear - sYear) * 12 + (eMonth - sMonth)); + // 这里计算零头的情况,根据实际确定是否要加1 还是要减1 +// if (sDay < eDay) { + //无论什么情况都让它加1 + monthday = monthday + 1; +// } + return monthday; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwRulesController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwRulesController.java new file mode 100644 index 0000000..c251a47 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwRulesController.java @@ -0,0 +1,225 @@ +package com.ruoyi.project.management.controller; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwRules; +import com.ruoyi.project.management.service.ICwRulesService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 排班Controller + * + * @author zhukangchao + * @date 2021-12-25 + */ +@RestController +@RequestMapping("/management/cwRules") +public class CwRulesController extends BaseController +{ + @Autowired + private ICwRulesService cwRulesService; + + /** + * 查询排班列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwRules:list')") + @GetMapping("/list") + public TableDataInfo list(CwRules cwRules) + { + startPage(); + List list = cwRulesService.selectCwRulesList(cwRules); + return getDataTable(list); + } + + /** + * 导出排班列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwRules:export')") + @Log(title = "排班", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwRules cwRules) + { + List list = cwRulesService.selectCwRulesList(cwRules); + ExcelUtil util = new ExcelUtil(CwRules.class); + return util.exportExcel(list, "cwRules"); + } + + /** + * 获取排班详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwRules:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwRulesService.selectCwRulesById(id)); + } + + /** + * 新增排班 + */ + @PreAuthorize("@ss.hasPermi('management:cwRules:add')") + @Log(title = "排班", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwRules cwRules){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //获取选中的起始日期 + Date workingDays = cwRules.getWorkingDays(); + String format = sdf.format(workingDays); + String[] split = format.split("-"); + //获取本月有多少天 + int i = getDaysByYearMonth(split[0],split[1]); + //本月天数-起始天数(上12休24的可能会遇到上月最后一天夜班然后次月1号是休息的,所以排班有可能是从2号开始排班,或者是节假日顺延的情况) + int p = i-(Integer.valueOf(split[2])-1); + List list = new ArrayList(); + //周日标记,初始值为0,每遇到一个周日则加1,当标记取模2时不等于0则倒班 + int y = 0; + //班序置换 + int r = 0; + //循环添加排班数据 + //两班两倒制的情况(周日没有班,则不再添加记录) + if("两班两倒制".equals(cwRules.getRules())){ + for (int j = 0; j < p; j++) { + CwRules cwR = new CwRules(); + //拼接日期 + String date = split[0]+"-"+split[1]+"-"+(Integer.valueOf(split[2])+j); + SimpleDateFormat sdfe = new SimpleDateFormat("EEEE"); + try { + String week = sdfe.format(sdf.parse(date)); + if("星期日".equals(week)){ + y++; + } + if(!"星期日".equals(week)){ + //工作日 + cwR.setWorkingDays(sdf.parse(date)); + if(y%2==0){ + //班序(白班还是夜班)一周倒一次 + cwR.setSequence(cwRules.getSequence()); + }else{ + if("白班".equals(cwRules.getSequence())){ + cwR.setSequence("夜班"); + }else{ + cwR.setSequence("白班"); + } + } + //员工姓名 + cwR.setName(cwRules.getName()); + //排班规则 + cwR.setRules(cwRules.getRules()); + //删除标记 + cwR.setDelFlag(0); + //添加到集合中 + list.add(cwR); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } + }else{ + //三班两倒制的情况(除春节外全年无休) + //计算本月一共多少班次 + int t = p * 2; + String date = ""; + for (int k = 0; k < t; k++) { + CwRules cwR = new CwRules(); + if("白班".equals(cwRules.getSequence())){ + if(k%2==0){ + //拼接日期 + date = split[0]+"-"+split[1]+"-"+(Integer.valueOf(split[2])+(k/2)); + } + }else{ + if(k%2==0){ + //拼接日期 + date = split[0]+"-"+split[1]+"-"+(Integer.valueOf(split[2])+(k/2)); + }else{ + //拼接日期,如果取模2不为0时,比如说3,班次除以2应+1 + date = split[0]+"-"+split[1]+"-"+(Integer.valueOf(split[2])+(k/2)+1); + } + } + if(k%3==0){ + try { + cwR.setWorkingDays(sdf.parse(date)); + } catch (ParseException e) { + e.printStackTrace(); + } + if(r%2==0){ + //班序 + cwR.setSequence(cwRules.getSequence()); + }else{ + if("白班".equals(cwRules.getSequence())){ + cwR.setSequence("夜班"); + }else{ + cwR.setSequence("白班"); + } + } + r++; + //员工姓名 + cwR.setName(cwRules.getName()); + //排班规则 + cwR.setRules(cwRules.getRules()); + //删除标记 + cwR.setDelFlag(0); + //添加到集合中 + list.add(cwR); + } + } + } + int q = cwRulesService.insertCwRuless(list); + return toAjax(q); + } + + /** + * 修改排班 + */ + @PreAuthorize("@ss.hasPermi('management:cwRules:edit')") + @Log(title = "排班", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwRules cwRules) + { + return toAjax(cwRulesService.updateCwRules(cwRules)); + } + + /** + * 删除排班 + */ + @PreAuthorize("@ss.hasPermi('management:cwRules:remove')") + @Log(title = "排班", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwRulesService.deleteCwRulesByIds(ids)); + } + + /** + * + * 根据年 月 获取对应的月份 天数 + * + */ + public static int getDaysByYearMonth(String year, String month) { + Calendar a = Calendar.getInstance(); + a.set(Calendar.YEAR, Integer.valueOf(year)); + a.set(Calendar.MONTH, Integer.valueOf(month) - 1); + a.set(Calendar.DATE, 1); + a.roll(Calendar.DATE, -1); + int maxDate = a.get(Calendar.DATE); + return maxDate; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwSnDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwSnDetailController.java new file mode 100644 index 0000000..3bad6c9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwSnDetailController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwSnDetail; +import com.ruoyi.project.management.service.ICwSnDetailService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 考勤设备信息Controller + * + * @author zhukangchao + * @date 2022-11-01 + */ +@RestController +@RequestMapping("/management/cwSnDetail") +public class CwSnDetailController extends BaseController +{ + @Autowired + private ICwSnDetailService cwSnDetailService; + + /** + * 查询考勤设备信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwSnDetail:list')") + @GetMapping("/list") + public TableDataInfo list(CwSnDetail cwSnDetail) + { + startPage(); + List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); + return getDataTable(list); + } + + /** + * 导出考勤设备信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwSnDetail:export')") + @Log(title = "考勤设备信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwSnDetail cwSnDetail) + { + List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); + ExcelUtil util = new ExcelUtil(CwSnDetail.class); + return util.exportExcel(list, "cwSnDetail"); + } + + /** + * 获取考勤设备信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwSnDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwSnDetailService.selectCwSnDetailById(id)); + } + + /** + * 新增考勤设备信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwSnDetail:add')") + @Log(title = "考勤设备信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwSnDetail cwSnDetail) + { + return toAjax(cwSnDetailService.insertCwSnDetail(cwSnDetail)); + } + + /** + * 修改考勤设备信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwSnDetail:edit')") + @Log(title = "考勤设备信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwSnDetail cwSnDetail) + { + return toAjax(cwSnDetailService.updateCwSnDetail(cwSnDetail)); + } + + /** + * 删除考勤设备信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwSnDetail:remove')") + @Log(title = "考勤设备信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwSnDetailService.deleteCwSnDetailByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwTaxRateInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwTaxRateInfoController.java new file mode 100644 index 0000000..67bfea0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwTaxRateInfoController.java @@ -0,0 +1,119 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwTaxRateInfo; +import com.ruoyi.project.management.service.ICwTaxRateInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 税率信息Controller + * + * @author zhukangchao + * @date 2023-12-18 + */ +@RestController +@RequestMapping("/management/cwTaxRateInfo") +public class CwTaxRateInfoController extends BaseController +{ + @Autowired + private ICwTaxRateInfoService cwTaxRateInfoService; + + /** + * 查询税率信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwTaxRateInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CwTaxRateInfo cwTaxRateInfo) + { + startPage(); + List list = cwTaxRateInfoService.selectCwTaxRateInfoList(cwTaxRateInfo); + return getDataTable(list); + } + + /** + * 导出税率信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwTaxRateInfo:export')") + @Log(title = "税率信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwTaxRateInfo cwTaxRateInfo) + { + List list = cwTaxRateInfoService.selectCwTaxRateInfoList(cwTaxRateInfo); + ExcelUtil util = new ExcelUtil(CwTaxRateInfo.class); + return util.exportExcel(list, "cwTaxRateInfo"); + } + + /** + * 获取税率信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwTaxRateInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwTaxRateInfoService.selectCwTaxRateInfoById(id)); + } + + /** + * 新增税率信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwTaxRateInfo:add')") + @Log(title = "税率信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwTaxRateInfo cwTaxRateInfo){ + if(null==cwTaxRateInfo.getName()||"".equals(cwTaxRateInfo.getName())){ + return AjaxResult.error("请填写名称"); + } + if(null==cwTaxRateInfo.getTaxRate()||"".equals(cwTaxRateInfo.getTaxRate())){ + return AjaxResult.error("请填写税率"); + } + int i = cwTaxRateInfoService.insertCwTaxRateInfo(cwTaxRateInfo); + if (i > 0) { + if ("是".equals(cwTaxRateInfo.getMakeOutAnInvoice())) { + cwTaxRateInfo.setMakeOutAnInvoice("1"); + } else if ("否".equals(cwTaxRateInfo.getMakeOutAnInvoice())) { + cwTaxRateInfo.setMakeOutAnInvoice("0"); + } + } else { + AjaxResult.error("新增税率信息失败"); + } + return AjaxResult.error("新增税率信息失败"); + } + + /** + * 修改税率信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwTaxRateInfo:edit')") + @Log(title = "税率信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwTaxRateInfo cwTaxRateInfo) + { + return toAjax(cwTaxRateInfoService.updateCwTaxRateInfo(cwTaxRateInfo)); + } + + /** + * 删除税率信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwTaxRateInfo:remove')") + @Log(title = "税率信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwTaxRateInfoService.deleteCwTaxRateInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwTypeTimeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwTypeTimeController.java new file mode 100644 index 0000000..b2bf9fc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwTypeTimeController.java @@ -0,0 +1,205 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwAttendanceUserData; +import com.ruoyi.project.management.domain.CwAttendanceUserVo; +import com.ruoyi.project.management.domain.CwSnDetail; +import com.ruoyi.project.management.domain.CwTypeTime; +import com.ruoyi.project.management.domain.CwTypeTimeData; +import com.ruoyi.project.management.domain.CwTypeTimeVo; +import com.ruoyi.project.management.service.ICwSnDetailService; +import com.ruoyi.project.management.service.ICwTypeTimeService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.framework.websocket.WebSocketUsers; + +/** + * 状态等待时间Controller + * + * @author zhukangchao + * @date 2022-10-31 + */ +@RestController +@RequestMapping("/management/cwTypeTime") +public class CwTypeTimeController extends BaseController +{ + @Autowired + private ICwTypeTimeService cwTypeTimeService; + //设备信息 + @Autowired + private ICwSnDetailService cwSnDetailService; + + /** + * 查询状态等待时间列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwTypeTime:list')") + @GetMapping("/list") + public TableDataInfo list(CwTypeTime cwTypeTime) + { + startPage(); + List list = cwTypeTimeService.selectCwTypeTimeList(cwTypeTime); + return getDataTable(list); + } + + /** + * 导出状态等待时间列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwTypeTime:export')") + @Log(title = "状态等待时间", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwTypeTime cwTypeTime) + { + List list = cwTypeTimeService.selectCwTypeTimeList(cwTypeTime); + ExcelUtil util = new ExcelUtil(CwTypeTime.class); + return util.exportExcel(list, "cwTypeTime"); + } + + /** + * 获取状态等待时间详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwTypeTime:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwTypeTimeService.selectCwTypeTimeById(id)); + } + + /** + * 新增状态等待时间 + */ + @PreAuthorize("@ss.hasPermi('management:cwTypeTime:add')") + @Log(title = "状态等待时间", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwTypeTime cwTypeTime){ + + //需要推送的数据 + String message = ""; + //需要返回的对象 + CwTypeTimeVo cttv = new CwTypeTimeVo(); + //发送的数据 + CwTypeTimeData cttd = new CwTypeTimeData(); + + //获取所有设备 + CwSnDetail cwSnDetail = new CwSnDetail(); + List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); + for (CwSnDetail cwSnDetail2 : list) { + //该接口固定为to_device,发送给设备用于识别对应哪个指令 + cttv.setCmd("to_device"); + //无用值,空串 + cttv.setForm(""); + //设备号 + cttv.setTo(cwSnDetail2.getSn()); + + //发送的数据 + cttd.setCmd("setTimeout"); + if("待机状态".equals(cwTypeTime.getType())){ + cttd.setType_1(cwTypeTime.getTime().intValue()); + }else if("人脸识别状态".equals(cwTypeTime.getType())){ + cttd.setType_2(cwTypeTime.getTime().intValue()); + }else if("功能选择状态".equals(cwTypeTime.getType())){ + cttd.setType_3(cwTypeTime.getTime().intValue()); + }else if("打卡等待状态".equals(cwTypeTime.getType())){ + cttd.setType_4(cwTypeTime.getTime().intValue()); + }else if("打卡完成状态".equals(cwTypeTime.getType())){ + cttd.setType_5(cwTypeTime.getTime().intValue()); + }else if("打卡失败状态".equals(cwTypeTime.getType())){ + cttd.setType_6(cwTypeTime.getTime().intValue()); + }else{ + cttd.setType_7(cwTypeTime.getTime().intValue()); + } + cttv.setData(cttd); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cttv); + //调用websocket,推送给设备 + WebSocketUsers.sendMessageToUsersByText(message); + } + return toAjax(cwTypeTimeService.insertCwTypeTime(cwTypeTime)); + } + + /** + * 修改状态等待时间 + */ + @PreAuthorize("@ss.hasPermi('management:cwTypeTime:edit')") + @Log(title = "状态等待时间", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwTypeTime cwTypeTime){ + + //需要推送的数据 + String message = ""; + //需要返回的对象 + CwTypeTimeVo cttv = new CwTypeTimeVo(); + //发送的数据 + CwTypeTimeData cttd = new CwTypeTimeData(); + + int i = cwTypeTimeService.updateCwTypeTime(cwTypeTime); + + cwTypeTime = new CwTypeTime(); + //获取所有的状态 + List list2 = cwTypeTimeService.selectCwTypeTimeList(cwTypeTime); + + //获取所有设备 + CwSnDetail cwSnDetail = new CwSnDetail(); + List list = cwSnDetailService.selectCwSnDetailList(cwSnDetail); + for (CwSnDetail cwSnDetail2 : list) { + //该接口固定为to_device,发送给设备用于识别对应哪个指令 + cttv.setCmd("to_device"); + //无用值,空串 + cttv.setForm(""); + //设备号 + cttv.setTo(cwSnDetail2.getSn()); + + //发送的数据 + cttd.setCmd("setTimeout"); + + for (CwTypeTime cwTypeTime2 : list2) { + if("待机状态".equals(cwTypeTime2.getType())){ + cttd.setType_1(cwTypeTime2.getTime().intValue()); + }else if("人脸识别状态".equals(cwTypeTime2.getType())){ + cttd.setType_2(cwTypeTime2.getTime().intValue()); + }else if("功能选择状态".equals(cwTypeTime2.getType())){ + cttd.setType_3(cwTypeTime2.getTime().intValue()); + }else if("打卡完成状态".equals(cwTypeTime2.getType())){ + cttd.setType_4(cwTypeTime2.getTime().intValue()); + }else if("打卡失败状态".equals(cwTypeTime2.getType())){ + cttd.setType_5(cwTypeTime2.getTime().intValue()); + }else if("网络异常状态".equals(cwTypeTime2.getType())){ + cttd.setType_6(cwTypeTime2.getTime().intValue()); + }else{ + cttd.setType_7(cwTypeTime2.getTime().intValue()); + } + } + cttv.setData(cttd); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cttv); + //调用websocket,推送给设备 + WebSocketUsers.sendMessageToUsersByText(message); + } + return toAjax(i); + } + + /** + * 删除状态等待时间 + */ + @PreAuthorize("@ss.hasPermi('management:cwTypeTime:remove')") + @Log(title = "状态等待时间", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwTypeTimeService.deleteCwTypeTimeByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwWageSummaryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwWageSummaryController.java new file mode 100644 index 0000000..b12b7f9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwWageSummaryController.java @@ -0,0 +1,340 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import java.util.Properties; + +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwNewPayroll; +import com.ruoyi.project.management.domain.CwWageSummary; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwNewPayrollService; +import com.ruoyi.project.management.service.ICwWageSummaryService; +import com.ruoyi.project.management.utils.SendEmail; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 工资汇总Controller + * + * @author zhukangchao + * @date 2021-12-23 + */ +@RestController +@RequestMapping("/management/cwWageSummary") +public class CwWageSummaryController extends BaseController +{ + @Autowired + private ICwWageSummaryService cwWageSummaryService; + //用户信息 + @Autowired + private TokenService tokenService; + //工资单信息 + @Autowired + private ICwNewPayrollService cwNewPayrollService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + + /** + * 查询工资汇总列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwWageSummary:list')") + @GetMapping("/list") + public TableDataInfo list(CwWageSummary cwWageSummary) + { + startPage(); + List list = cwWageSummaryService.selectCwWageSummaryList(cwWageSummary); + return getDataTable(list); + } + + /** + * 导出工资汇总列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwWageSummary:export')") + @Log(title = "工资汇总", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwWageSummary cwWageSummary) + { + List list = cwWageSummaryService.selectCwWageSummaryList(cwWageSummary); + ExcelUtil util = new ExcelUtil(CwWageSummary.class); + return util.exportExcel(list, "cwWageSummary"); + } + + /** + * 获取工资汇总详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwWageSummary:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwWageSummaryService.selectCwWageSummaryById(id)); + } + + /** + * 新增工资汇总 + */ + @PreAuthorize("@ss.hasPermi('management:cwWageSummary:add')") + @Log(title = "工资汇总", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwWageSummary cwWageSummary) + { + return toAjax(cwWageSummaryService.insertCwWageSummary(cwWageSummary)); + } + + /** + * 修改工资汇总 + */ + @PreAuthorize("@ss.hasPermi('management:cwWageSummary:edit')") + @Log(title = "工资汇总", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwWageSummary cwWageSummary){ + //获取修改人账号名称,添加到驳回原因中 + //获取当前账号的name + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + cwWageSummary.setRemarks(user.getNickName()+"-已驳回此单据!原因:"+cwWageSummary.getRemarks()); + return toAjax(cwWageSummaryService.updateCwWageSummary(cwWageSummary)); + } + + /** + * 删除工资汇总 + */ + @PreAuthorize("@ss.hasPermi('management:cwWageSummary:remove')") + @Log(title = "工资汇总", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long long1 : ids) { + CwWageSummary selectCwWageSummaryById = cwWageSummaryService.selectCwWageSummaryById(long1); + //获取工资所属月 + String affiliationMonth = selectCwWageSummaryById.getAffiliationMonth(); + List list = cwNewPayrollService.selectCwNewPayrollByAffiliationMonth(affiliationMonth); + for (CwNewPayroll cwNewPayroll : list) { + if(cwNewPayroll.getName().equals("祝康超")){ + System.out.println("11111111"); + } + //获取员工姓名,根据员工姓名查询员工信息 + CwNewEmployeeInformation cwNewEmployeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwNewPayroll.getName()); + if(null!=cwNewEmployeeInformation){ + //恢复上个月的本年累计已发工资和本年累计已缴个税 + cwNewEmployeeInformation.setTotalWages(cwNewEmployeeInformation.getTotalWages().subtract(cwNewPayroll.getSalaryBeforeTax())); + //本年累计已缴个税 + cwNewEmployeeInformation.setAggregatePersonalIncomeTax(cwNewEmployeeInformation.getAggregatePersonalIncomeTax().subtract(cwNewPayroll.getTaxPayable())); + //恢复本年累计专项附加扣除 + cwNewEmployeeInformation.setSpecialDeduction(cwNewEmployeeInformation.getSpecialDeduction().subtract(cwNewPayroll.getSpecialDeduction())); + //修改员工信息 + cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation); + //删除工资信息 + cwNewPayrollService.deleteCwNewPayrollById(cwNewPayroll.getId()); + } + } + } + return toAjax(cwWageSummaryService.deleteCwWageSummaryByIds(ids)); + } + + /** + * 财务审核按钮操作 + */ + @RequestMapping("/auditOnes/{ids}") + public AjaxResult auditOnes(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwWageSummary summary = cwWageSummaryService.selectCwWageSummaryById(long1); + if(null!=summary){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + summary.setReviewOne(user.getNickName()); + }else{ + return AjaxResult.error("未查询到工资汇总表数据"); + } + int i = cwWageSummaryService.updateCwWageSummary(summary); + if(i<1){ + return AjaxResult.error("审核失败"); + } + //根据工资所属月份查询所有的工资单数据 + CwNewPayroll cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setAffiliationMonth(summary.getAffiliationMonth()); + List list = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + for (CwNewPayroll cwNewPayroll2 : list) { + //根据员工姓名查询员工基本信息 + CwNewEmployeeInformation newEmployeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwNewPayroll2.getName()); + //获取其邮箱 + if(null!=newEmployeeInformation.getEmail()&&!"".equals(newEmployeeInformation.getEmail())){ + //拼接邮件内容 + String content = "尊敬的同事:您"+cwNewPayroll2.getAffiliationMonth()+"月工资明细如下,如有疑问请及时联系相关人员核实:"+ + "\n
"+"工资所属月:"+cwNewPayroll2.getAffiliationMonth()+"\n
"+"部门名称:"+cwNewPayroll2.getDepartmentName()+"\n
"+"员工姓名:"+cwNewPayroll2.getName()+ + "\n
"+"基本工资:"+cwNewPayroll2.getBasicSalary()+"\n
"+"岗位工资:"+cwNewPayroll2.getJobsSalary()+"\n
"+"日薪:"+cwNewPayroll2.getDailyWage()+ + "\n
"+"时薪:"+cwNewPayroll2.getHoursSalary()+"\n
"+"月工资:"+cwNewPayroll2.getBasicMonthlySalary()+"\n
"+"应出勤:"+cwNewPayroll2.getShouldAttendanceNumber()+ + "\n
"+"实出勤:"+cwNewPayroll2.getRealAttendanceNumber()+"\n
"+"缺勤工资扣款:"+cwNewPayroll2.getAbsenteeismSalary()+"\n
"+"缺勤补助扣款:"+cwNewPayroll2.getAbsenteeismSubsidies()+ + "\n
"+"学历补助:"+cwNewPayroll2.getLevelOfEducationSubsidies()+"\n
"+"合同补助:"+cwNewPayroll2.getContractSubsidies()+"\n
"+"工龄工资:"+cwNewPayroll2.getSenioritySalary()+ + "\n
"+"社保补助:"+cwNewPayroll2.getSocialSecuritySubsidies()+"\n
"+"全勤奖:"+cwNewPayroll2.getFullFrequentlySubsidies()+"\n
"+"加班工资:"+cwNewPayroll2.getOvertimeSalary()+ + "\n
"+"夜班补助:"+cwNewPayroll2.getNightShiftSubsidies()+"\n
"+"夜餐补助:"+cwNewPayroll2.getDinnerSubsidies()+"\n
"+"其他补助:"+cwNewPayroll2.getSubsidyOrBonus()+ + "\n
"+"应发工资:"+cwNewPayroll2.getSalary()+"\n
"+"代缴保险:"+cwNewPayroll2.getPayInsurance()+"\n
"+"税前工资:"+cwNewPayroll2.getSalaryBeforeTax()+ + "\n
"+"本年累计已发工资:"+cwNewPayroll2.getTotalWages()+"\n
"+"年度免征额:"+cwNewPayroll2.getAnnualExemptionAmount()+"\n
"+"专项附加扣除:"+cwNewPayroll2.getSpecialDeduction()+ + "\n
"+"应纳税所得额:"+cwNewPayroll2.getTaxableIncome()+"\n
"+"税率:"+cwNewPayroll2.getTaxRate()+"\n
"+"速算扣除数:"+cwNewPayroll2.getSlowDownTheDeduction()+ + "\n
"+"本年累计已缴税额:"+cwNewPayroll2.getAggregatePersonalIncomeTax()+"\n
"+"本月应缴个税:"+cwNewPayroll2.getTaxPayable()+"\n
"+"实发工资:"+cwNewPayroll2.getNetPayroll(); + //发送邮件 + try { + SendEmail send = new SendEmail(); + try { + send.sendEmail(summary.getAffiliationMonth()+"月工资明细",content,newEmployeeInformation.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + return AjaxResult.success(); + } + + /** + * 审核按钮操作 + */ + @RequestMapping("/auditTwos/{ids}") + public AjaxResult auditTwos(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwWageSummary summary = cwWageSummaryService.selectCwWageSummaryById(long1); + if(null!=summary){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + summary.setReviewTwo(user.getNickName()); + }else{ + return AjaxResult.error("未查询到工资汇总表数据"); + } + int i = cwWageSummaryService.updateCwWageSummary(summary); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } + + /** + * 审核按钮操作 + */ + @RequestMapping("/auditThrees/{ids}") + public AjaxResult auditThrees(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwWageSummary summary = cwWageSummaryService.selectCwWageSummaryById(long1); + if(null!=summary){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + summary.setReviewThree(user.getNickName()); + }else{ + return AjaxResult.error("未查询到工资汇总表数据"); + } + int i = cwWageSummaryService.updateCwWageSummary(summary); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } + + /** + * 审核按钮操作 + */ + @RequestMapping("/auditFours/{ids}") + public AjaxResult auditFours(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据工资汇总表id查询 + CwWageSummary summary = cwWageSummaryService.selectCwWageSummaryById(long1); + if(null!=summary){ + //获取当前账号的name,审核栏填写审核人的姓名 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //修改状态(当前账号的名称) + summary.setReviewFour(user.getNickName()); + }else{ + return AjaxResult.error("未查询到工资汇总表数据"); + } + int i = cwWageSummaryService.updateCwWageSummary(summary); + if(i<1){ + return AjaxResult.error("审核失败"); + } + } + return AjaxResult.success(); + } + +// /** +// * 发送QQ邮件 +// * @param title +// * @param content +// * @param eMail +// * @throws Exception +// */ +// public void sendEmail(String title,String content,String eMail) throws Exception{ +// Properties properties = new Properties(); +// properties.put("mail.transport.protocol", "smtp");// 连接协议 +// properties.put("mail.smtp.host", "smtp.qq.com");// 主机名 +// properties.put("mail.smtp.port", 465);// 端口号 +// properties.put("mail.smtp.auth", "true"); +// properties.put("mail.smtp.ssl.enable", "true");// 设置是否使用ssl安全连接 ---一般都使用 +// properties.put("mail.debug", "true");// 设置是否显示debug信息 true 会在控制台显示相关信息 +// // 得到回话对象 +// Session session = Session.getInstance(properties); +// // 获取邮件对象 +// Message message = new MimeMessage(session); +// // 设置发件人邮箱地址 +// message.setFrom(new InternetAddress("1092820132@qq.com")); +// // 设置收件人邮箱地址 +//// message.setRecipients(Message.RecipientType.TO, new InternetAddress[]{new InternetAddress("1092820132@qq.com"),new InternetAddress("1092820132@qq.com"),new InternetAddress("1092820132@qq.com")}); +// message.setRecipient(Message.RecipientType.TO, new InternetAddress(eMail));//一个收件人 +// // 设置邮件标题 +// message.setSubject(title); +// // 设置邮件内容 +// message.setText(content); +// // 得到邮差对象 +// Transport transport = session.getTransport(); +// // 连接自己的邮箱账户 +// transport.connect("1092820132@qq.com", "bfpmudsuznfnjchd");// 密码为QQ邮箱开通的stmp服务后得到的客户端授权码 +// // 发送邮件 +// transport.sendMessage(message, message.getAllRecipients()); +// transport.close(); +// } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwWorkOvertimeRecordController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwWorkOvertimeRecordController.java new file mode 100644 index 0000000..63d824c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwWorkOvertimeRecordController.java @@ -0,0 +1,191 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwLeaveRecord; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.domain.CwWorkOvertimeRecord; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.project.management.service.ICwWorkOvertimeRecordService; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 加班申请Controller + * + * @author zhukangchao + * @date 2021-12-22 + */ +@RestController +@RequestMapping("/management/cwWorkOvertimeRecord") +public class CwWorkOvertimeRecordController extends BaseController +{ + @Autowired + private ICwWorkOvertimeRecordService cwWorkOvertimeRecordService; + //考勤统计信息 + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + //用户信息 + @Autowired + private TokenService tokenService; + //部门信息 + @Autowired + private ISysDeptService deptService; + + /** + * 查询加班申请列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkOvertimeRecord:list')") + @GetMapping("/list") + public TableDataInfo list(CwWorkOvertimeRecord cwWorkOvertimeRecord){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据员工信息的部门id查询部门信息 + SysDept dept = deptService.selectDeptById(user.getDeptId()); + List list = new ArrayList(); + //除了财务部和综合管理的账号和管理员的账号,其他的一律用令一套查询方式 + if(user.getUserName().equals("zhanglili")||user.getUserName().equals("lihongye")||user.getUserName().equals("huyipeng")||user.getUserName().equals("zhaofenjing")||user.getUserName().equals("admin")){ + startPage(); + list = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + }else if(user.getUserName().equals("chenshitian")){ + cwWorkOvertimeRecord.setDeptName("生产部门"); + //只能查询本部门的员工姓名 + list = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + cwWorkOvertimeRecord.setDeptName("采购部门"); + List list2 = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + for (CwWorkOvertimeRecord cwWorkOvertimeRecord2 : list2) { + list.add(cwWorkOvertimeRecord2); + } + cwWorkOvertimeRecord.setDeptName("库房部门"); + List list3 = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + for (CwWorkOvertimeRecord cwWorkOvertimeRecord2 : list3) { + list.add(cwWorkOvertimeRecord2); + } + cwWorkOvertimeRecord.setDeptName("质检部门"); + List list4 = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + for (CwWorkOvertimeRecord cwWorkOvertimeRecord2 : list4) { + list.add(cwWorkOvertimeRecord2); + } + }else if(user.getUserName().equals("yinguofeng")){ + cwWorkOvertimeRecord.setDeptName("工艺部门"); + list = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + cwWorkOvertimeRecord.setDeptName("质检部门"); + List list2 = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + for (CwWorkOvertimeRecord cwWorkOvertimeRecord2 : list2) { + list.add(cwWorkOvertimeRecord2); + } + }else{ + cwWorkOvertimeRecord.setDeptName(dept.getDeptName()); + startPage(); + list = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + } + + return getDataTable(list); + } + + /** + * 导出加班申请列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkOvertimeRecord:export')") + @Log(title = "加班申请", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwWorkOvertimeRecord cwWorkOvertimeRecord) + { + List list = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + ExcelUtil util = new ExcelUtil(CwWorkOvertimeRecord.class); + return util.exportExcel(list, "cwWorkOvertimeRecord"); + } + + /** + * 获取加班申请详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkOvertimeRecord:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordById(id)); + } + + /** + * 新增加班申请 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkOvertimeRecord:add')") + @Log(title = "加班申请", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwWorkOvertimeRecord cwWorkOvertimeRecord){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + //新增之前把考勤统计的信息也同步修改 + CwNewAttendanceStatistical cwNewAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(cwWorkOvertimeRecord.getName(), sdf.format(cwWorkOvertimeRecord.getWorkOvertimeDate())); + if(null != cwNewAttendanceStatistical){ + cwNewAttendanceStatistical.setWorkOvertimeNumber(cwNewAttendanceStatistical.getWorkOvertimeNumber()+cwWorkOvertimeRecord.getWorkOvertimeNumber()); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + return toAjax(cwWorkOvertimeRecordService.insertCwWorkOvertimeRecord(cwWorkOvertimeRecord)); + } + + /** + * 修改加班申请 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkOvertimeRecord:edit')") + @Log(title = "加班申请", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwWorkOvertimeRecord cwWorkOvertimeRecord){ + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + //根据id查询信息 + CwWorkOvertimeRecord workOvertimeRecord = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordById(cwWorkOvertimeRecord.getId()); + //新增之前把考勤统计的信息也同步修改 + CwNewAttendanceStatistical cwNewAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(cwWorkOvertimeRecord.getName(), sdf.format(cwWorkOvertimeRecord.getWorkOvertimeDate())); + if(null != cwNewAttendanceStatistical){ + //先减去修改之前的,再加上修改的数 + cwNewAttendanceStatistical.setWorkOvertimeNumber(cwNewAttendanceStatistical.getWorkOvertimeNumber()-workOvertimeRecord.getWorkOvertimeNumber()+cwWorkOvertimeRecord.getWorkOvertimeNumber()); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + return toAjax(cwWorkOvertimeRecordService.updateCwWorkOvertimeRecord(cwWorkOvertimeRecord)); + } + + /** + * 删除加班申请 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkOvertimeRecord:remove')") + @Log(title = "加班申请", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + for (Long long1 : ids) { + //根据id查询信息 + CwWorkOvertimeRecord workOvertimeRecord = cwWorkOvertimeRecordService.selectCwWorkOvertimeRecordById(long1); + //新增之前把考勤统计的信息也同步修改 + CwNewAttendanceStatistical cwNewAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(workOvertimeRecord.getName(), sdf.format(workOvertimeRecord.getWorkOvertimeDate())); + if(null != cwNewAttendanceStatistical){ + //先减去修改之前的,再加上修改的数 + cwNewAttendanceStatistical.setWorkOvertimeNumber(cwNewAttendanceStatistical.getWorkOvertimeNumber() - workOvertimeRecord.getWorkOvertimeNumber()); + cwNewAttendanceStatisticalService.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + } + return toAjax(cwWorkOvertimeRecordService.deleteCwWorkOvertimeRecordByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CwWorkingDaysConfigurationController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CwWorkingDaysConfigurationController.java new file mode 100644 index 0000000..5088ead --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CwWorkingDaysConfigurationController.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwWorkingDaysConfiguration; +import com.ruoyi.project.management.service.ICwWorkingDaysConfigurationService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 工作日配置Controller + * + * @author zhukangchao + * @date 2021-12-21 + */ +@RestController +@RequestMapping("/management/cwWorkingDaysConfiguration") +public class CwWorkingDaysConfigurationController extends BaseController +{ + @Autowired + private ICwWorkingDaysConfigurationService cwWorkingDaysConfigurationService; + + /** + * 查询工作日配置列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkingDaysConfiguration:list')") + @GetMapping("/list") + public TableDataInfo list(CwWorkingDaysConfiguration cwWorkingDaysConfiguration) + { + startPage(); + List list = cwWorkingDaysConfigurationService.selectCwWorkingDaysConfigurationList(cwWorkingDaysConfiguration); + return getDataTable(list); + } + + /** + * 导出工作日配置列表 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkingDaysConfiguration:export')") + @Log(title = "工作日配置", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CwWorkingDaysConfiguration cwWorkingDaysConfiguration) + { + List list = cwWorkingDaysConfigurationService.selectCwWorkingDaysConfigurationList(cwWorkingDaysConfiguration); + ExcelUtil util = new ExcelUtil(CwWorkingDaysConfiguration.class); + return util.exportExcel(list, "cwWorkingDaysConfiguration"); + } + + /** + * 获取工作日配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkingDaysConfiguration:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cwWorkingDaysConfigurationService.selectCwWorkingDaysConfigurationById(id)); + } + + /** + * 新增工作日配置 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkingDaysConfiguration:add')") + @Log(title = "工作日配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CwWorkingDaysConfiguration cwWorkingDaysConfiguration){ + //根据所属月份查询是否存在了 + CwWorkingDaysConfiguration daysConfiguration = cwWorkingDaysConfigurationService.selectCwWorkingDaysConfigurationByDate(cwWorkingDaysConfiguration.getDate()); + if(null!=daysConfiguration){ + return AjaxResult.error(cwWorkingDaysConfiguration.getDate()+"月,已存在"); + } + + return toAjax(cwWorkingDaysConfigurationService.insertCwWorkingDaysConfiguration(cwWorkingDaysConfiguration)); + } + + /** + * 修改工作日配置 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkingDaysConfiguration:edit')") + @Log(title = "工作日配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CwWorkingDaysConfiguration cwWorkingDaysConfiguration){ + return toAjax(cwWorkingDaysConfigurationService.updateCwWorkingDaysConfiguration(cwWorkingDaysConfiguration)); + } + + /** + * 删除工作日配置 + */ + @PreAuthorize("@ss.hasPermi('management:cwWorkingDaysConfiguration:remove')") + @Log(title = "工作日配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cwWorkingDaysConfigurationService.deleteCwWorkingDaysConfigurationByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CyConsumptionInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CyConsumptionInfoController.java new file mode 100644 index 0000000..859571b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CyConsumptionInfoController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CyConsumptionInfo; +import com.ruoyi.project.management.service.ICyConsumptionInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 餐饮消费明细Controller + * + * @author zhukangchao + * @date 2023-10-05 + */ +@RestController +@RequestMapping("/management/cyConsumptionInfo") +public class CyConsumptionInfoController extends BaseController +{ + @Autowired + private ICyConsumptionInfoService cyConsumptionInfoService; + + /** + * 查询餐饮消费明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:cyConsumptionInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CyConsumptionInfo cyConsumptionInfo) + { + startPage(); + List list = cyConsumptionInfoService.selectCyConsumptionInfoList(cyConsumptionInfo); + return getDataTable(list); + } + + /** + * 导出餐饮消费明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:cyConsumptionInfo:export')") + @Log(title = "餐饮消费明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CyConsumptionInfo cyConsumptionInfo) + { + List list = cyConsumptionInfoService.selectCyConsumptionInfoList(cyConsumptionInfo); + ExcelUtil util = new ExcelUtil(CyConsumptionInfo.class); + return util.exportExcel(list, "cyConsumptionInfo"); + } + + /** + * 获取餐饮消费明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyConsumptionInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cyConsumptionInfoService.selectCyConsumptionInfoById(id)); + } + + /** + * 新增餐饮消费明细 + */ + @PreAuthorize("@ss.hasPermi('management:cyConsumptionInfo:add')") + @Log(title = "餐饮消费明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CyConsumptionInfo cyConsumptionInfo) + { + return toAjax(cyConsumptionInfoService.insertCyConsumptionInfo(cyConsumptionInfo)); + } + + /** + * 修改餐饮消费明细 + */ + @PreAuthorize("@ss.hasPermi('management:cyConsumptionInfo:edit')") + @Log(title = "餐饮消费明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CyConsumptionInfo cyConsumptionInfo) + { + return toAjax(cyConsumptionInfoService.updateCyConsumptionInfo(cyConsumptionInfo)); + } + + /** + * 删除餐饮消费明细 + */ + @PreAuthorize("@ss.hasPermi('management:cyConsumptionInfo:remove')") + @Log(title = "餐饮消费明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cyConsumptionInfoService.deleteCyConsumptionInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CyFaceInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CyFaceInfoController.java new file mode 100644 index 0000000..b83200f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CyFaceInfoController.java @@ -0,0 +1,247 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetail; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetailData; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetailVo; +import com.ruoyi.project.management.domain.CwAttendanceUser; +import com.ruoyi.project.management.domain.CyFaceInfo; +import com.ruoyi.project.management.domain.CyFaceInfoData; +import com.ruoyi.project.management.domain.CyFaceInfoVo; +import com.ruoyi.project.management.service.ICwAttendanceRecordDetailService; +import com.ruoyi.project.management.service.ICwAttendanceUserService; +import com.ruoyi.project.management.service.ICyFaceInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 餐饮刷脸详情信息Controller + * + * @author zhukangchao + * @date 2023-10-05 + */ +@RestController +@RequestMapping("/api/v2") +public class CyFaceInfoController extends BaseController +{ + @Autowired + private ICyFaceInfoService cyFaceInfoService; + //员工信息 + @Autowired + private ICwAttendanceUserService cwAttendanceUserService; + + /** + * 查询餐饮刷脸详情信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cyFaceInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CyFaceInfo cyFaceInfo) + { + startPage(); + List list = cyFaceInfoService.selectCyFaceInfoList(cyFaceInfo); + return getDataTable(list); + } + + /** + * 导出餐饮刷脸详情信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cyFaceInfo:export')") + @Log(title = "餐饮刷脸详情信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CyFaceInfo cyFaceInfo) + { + List list = cyFaceInfoService.selectCyFaceInfoList(cyFaceInfo); + ExcelUtil util = new ExcelUtil(CyFaceInfo.class); + return util.exportExcel(list, "cyFaceInfo"); + } + + /** + * 获取餐饮刷脸详情信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyFaceInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cyFaceInfoService.selectCyFaceInfoById(id)); + } + + /** + * 新增餐饮刷脸详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyFaceInfo:add')") + @Log(title = "餐饮刷脸详情信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CyFaceInfo cyFaceInfo){ + return toAjax(cyFaceInfoService.insertCyFaceInfo(cyFaceInfo)); + } + + /** + * 修改餐饮刷脸详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyFaceInfo:edit')") + @Log(title = "餐饮刷脸详情信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CyFaceInfo cyFaceInfo) + { + return toAjax(cyFaceInfoService.updateCyFaceInfo(cyFaceInfo)); + } + + /** + * 删除餐饮刷脸详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyFaceInfo:remove')") + @Log(title = "餐饮刷脸详情信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cyFaceInfoService.deleteCyFaceInfoByIds(ids)); + } + + /** + * 刷脸获取打卡按钮权限 + * sn 设备号 + * type 设备识别类型 + * user_id 用户id + * card 人员信息中的卡号 + * confidence 人脸算法识别到的相识度 + * temperature 测量到的温度,未开启测温的设备为空 + * + * 响应: Result 返回请求类型:0:可以打卡,其它值表示无法打卡 + * Msg 对应 Result 的状态,可为空 + * Content 识别后返回的详细信息 + * button 9位长度的字符串,0 表示不可以点击 1 表示可以点击 + * clock in count 打卡次数 + * + * String sn,String type,String userId,String card,String confidence + */ + @RequestMapping("/verify_user_yt") + public String verifyUser(@RequestBody String json){ + //需要推送的数据 + String message = ""; + //需要返回的对象 + CyFaceInfoVo cfiv = new CyFaceInfoVo(); + CyFaceInfoData cfd = new CyFaceInfoData(); + + //获取当前时间,如果未在就餐时间之内,则统计打卡记录 + // 使用Calendar类获取当前时间 + Calendar calendar = Calendar.getInstance(); + // 获取小时数 + int hour = calendar.get(Calendar.HOUR_OF_DAY); + + //判断是否在就餐时间,如果在就餐时间打卡有效,否则打卡无效 + if(hour==7||hour==8||hour==11||hour==12||hour==18||hour==19){ + + long time = new Date().getTime(); + //解析收到的数据 + JSONObject jsonObject = JSONObject.parseObject(json); + //获取用户id + String userId = jsonObject.get("user_id").toString(); + String isSure = ""; + + System.out.println(json); + + //根据id查询当前员工是否是员工列表中的人 + CwAttendanceUser user = cwAttendanceUserService.selectCwAttendanceUserById(Long.valueOf(userId)); + if(null==user){ + cfiv.setResult(2); + cfiv.setMsg("验证失败,未录入系统"); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cfiv); + return message; + }else{ + //查询刷脸记录表,判断近一小时内是否有过刷脸记录,如果有则返回近1小时内的刷脸次数,如果没有则返回0 + List list = cyFaceInfoService.selectCyFaceInfoByNameAndTime(user.getName()); + if(list.size()==0){ + //第一次打卡,是否确认默认置为0(确认) + isSure = "0"; + }else{ + //如果不是第一次打卡,则弹窗提示 + cfiv.setResult(1); + if(null!=jsonObject.get("is_sure")){ + //是否确认不为null时,获取其值,判断用户是确认还是取消,如果确认则添加打卡记录,如果取消则不添加 + isSure = jsonObject.get("is_sure").toString(); + System.out.println("isSure:"+isSure); + if("1".equals(isSure)){ + //如果用户选择的取消,则返回打卡失败 + cfiv.setResult(2); + } + } + } + cfiv.setMsg("验证通过"); + //返回打卡次数 + cfd.setClock_in_count(list.size()+1); + cfiv.setContent(cfd); + } + if("0".equals(isSure)){ + //增加打卡记录 + CyFaceInfo cyFaceInfo = new CyFaceInfo(); + cyFaceInfo.setDate(new Date()); + cyFaceInfo.setName(user.getName()); + cyFaceInfo.setTime(new Date()); + //判断刷脸时间是早餐还是午餐还是晚餐 + if(hour>=6&&hour<=8){ + //说明是早餐 + cyFaceInfo.setSign("早餐"); + }else if(hour>=11&&hour<=13){ + //说明是午餐 + cyFaceInfo.setSign("午餐"); + }else if(hour>=18&&hour<=20){ + //说明是晚餐 + cyFaceInfo.setSign("晚餐"); + } + int i = cyFaceInfoService.insertCyFaceInfo(cyFaceInfo); + if(i<1){ + cfiv.setResult(2); + }else{ + cfiv.setResult(0); + } + } + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cfiv); + System.out.println("返回数据:"+message); + + long time2 = new Date().getTime(); + System.out.println("处理时间:"+(time2-time)); + }else{ + cfiv.setResult(2); + cfiv.setMsg("非就餐时间,打卡无效"); + //Java对象转换成JSON字符串 + message = JSONObject.toJSONString(cfiv); + return message; + } + return message; + } + + + /** + * 手动刷新刷脸记录 + */ + @RequestMapping("/flushData") + public TableDataInfo flushData(){ + CyFaceInfo cyFaceInfo = new CyFaceInfo(); + //获取刷脸记录中的最后一条数据 + List list = cyFaceInfoService.selectCyFaceInfoByDate(new Date()); + cyFaceInfo.setDate(new Date()); + cyFaceInfo.setSign(list.get(list.size()-1).getSign()); + List list2 = cyFaceInfoService.selectCyFaceInfoList(cyFaceInfo); + return getDataTable(list2); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/CyStatisticsInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/CyStatisticsInfoController.java new file mode 100644 index 0000000..cd59640 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/CyStatisticsInfoController.java @@ -0,0 +1,382 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwOtherPayment; +import com.ruoyi.project.management.domain.CyConsumptionInfo; +import com.ruoyi.project.management.domain.CyFaceInfo; +import com.ruoyi.project.management.domain.CyStatisticsInfo; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwOtherPaymentInfoService; +import com.ruoyi.project.management.service.ICwOtherPaymentService; +import com.ruoyi.project.management.service.ICyConsumptionInfoService; +import com.ruoyi.project.management.service.ICyFaceInfoService; +import com.ruoyi.project.management.service.ICyStatisticsInfoService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 餐饮消费统计信息Controller + * + * @author zhukangchao + * @date 2023-10-05 + */ +@RestController +@RequestMapping("/management/cyStatisticsInfo") +public class CyStatisticsInfoController extends BaseController +{ + @Autowired + private ICyStatisticsInfoService cyStatisticsInfoService; + //每日消费统计 + @Autowired + private ICyConsumptionInfoService cyConsumptionInfoService; + //餐饮刷脸信息 + @Autowired + private ICyFaceInfoService cyFaceInfoService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + + + /** + * 查询餐饮消费统计信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cyStatisticsInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CyStatisticsInfo cyStatisticsInfo) + { + startPage(); + List list = cyStatisticsInfoService.selectCyStatisticsInfoList(cyStatisticsInfo); + return getDataTable(list); + } + + /** + * 导出餐饮消费统计信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:cyStatisticsInfo:export')") + @Log(title = "餐饮消费统计信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(CyStatisticsInfo cyStatisticsInfo) + { + List list = cyStatisticsInfoService.selectCyStatisticsInfoList(cyStatisticsInfo); + ExcelUtil util = new ExcelUtil(CyStatisticsInfo.class); + return util.exportExcel(list, "cyStatisticsInfo"); + } + + /** + * 获取餐饮消费统计信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyStatisticsInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(cyStatisticsInfoService.selectCyStatisticsInfoById(id)); + } + + /** + * 新增餐饮消费统计信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyStatisticsInfo:add')") + @Log(title = "餐饮消费统计信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CyStatisticsInfo cyStatisticsInfo) + { + return toAjax(cyStatisticsInfoService.insertCyStatisticsInfo(cyStatisticsInfo)); + } + + /** + * 修改餐饮消费统计信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyStatisticsInfo:edit')") + @Log(title = "餐饮消费统计信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CyStatisticsInfo cyStatisticsInfo) + { + return toAjax(cyStatisticsInfoService.updateCyStatisticsInfo(cyStatisticsInfo)); + } + + /** + * 删除餐饮消费统计信息 + */ + @PreAuthorize("@ss.hasPermi('management:cyStatisticsInfo:remove')") + @Log(title = "餐饮消费统计信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(cyStatisticsInfoService.deleteCyStatisticsInfoByIds(ids)); + } + + /** + * 校正餐饮消费统计信息 + */ + @RequestMapping("/jiaozhengs/{ids}") + public AjaxResult jiaozhengs(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + int i = 0; + for (Long id : ids) { + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoById(id); + //重置当前员工的的早餐次数,午餐次数,晚餐次数,及补助和消费,总消费 + statisticsInfo.setBreakfastNumber(0L); + statisticsInfo.setBreakfastSubsidy(0.0); + statisticsInfo.setBreakfastPersonalConsumption(0.0); + statisticsInfo.setBreakfastSumConsumption(0.0); + + statisticsInfo.setLunchNumber(0L); + statisticsInfo.setLunchSubsidy(0.0); + statisticsInfo.setLunchPresonalConsumption(0.0); + statisticsInfo.setLunchSumConsumption(0.0); + + statisticsInfo.setSupperNumber(0L); + statisticsInfo.setSupperSubsidy(0.0); + statisticsInfo.setSupperPersonalConsumption(0.0); + statisticsInfo.setSupperSumConsumption(0.0); + + statisticsInfo.setSumSubsidy(0.0); + statisticsInfo.setPersonalSumConsumption(0.0); + statisticsInfo.setSumConsumption(0.0); + + //获取当前所属月 + String date = statisticsInfo.getDate(); + Date parse = null; + try { + parse = sdf.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + } + List list = cyConsumptionInfoService.selectCyConsumptionInfoByYue(parse,statisticsInfo.getName()); + + for (CyConsumptionInfo cyConsumptionInfo : list) { + + //查询员工信息 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cyConsumptionInfo.getName()); + //获取当前天,查询当天的刷脸记录 + Date dateTime = cyConsumptionInfo.getDateTime(); + //早餐次数 + Long zaocan = 0L; + //午餐次数 + Long wucan = 0L; + //晚餐次数 + Long wancan = 0L; + List list2 = cyFaceInfoService.selectCyFaceInfoByNameAndDate(cyConsumptionInfo.getName(), dateTime); + for (CyFaceInfo cyFaceInfo : list2) { + int hour = cyFaceInfo.getTime().getHours(); + //判断刷脸时间是早餐还是午餐还是晚餐 + if(hour>=6&&hour<=8){ + //说明是早餐 + zaocan++; + }else if(hour>=11&&hour<=13){ + //说明是午餐 + wucan++; + }else if(hour>=18&&hour<=20){ + //说明是晚餐 + wancan++; + }else{ + //超出的不处理 + } + } + + //早餐次数 + cyConsumptionInfo.setBreakfastNumber(zaocan); + //判断如果早餐次数为0 ,则不没有补助,没有个人消费,没有总消费 + if(cyConsumptionInfo.getBreakfastNumber()>0){ + //早餐补助(获取员工信息表中的数据),如果工作时长不足8小时,则没有补助 + if(null!=employeeInformation){ + cyConsumptionInfo.setBreakfastSubsidy(employeeInformation.getBreakfastSubsidy()); + }else{ + cyConsumptionInfo.setBreakfastSubsidy(0.0); + } + //早餐个人消费(早餐总消费-补助) + cyConsumptionInfo.setBreakfastPersonalConsumption((cyConsumptionInfo.getBreakfastNumber().doubleValue()*4)-cyConsumptionInfo.getBreakfastSubsidy()); + //早餐总消费(次数*固定的金额4元)后改为5元 + cyConsumptionInfo.setBreakfastSumConsumption(cyConsumptionInfo.getBreakfastNumber().doubleValue()*4); + } + + //午餐次数 + cyConsumptionInfo.setLunchNumber(wucan); + if(cyConsumptionInfo.getLunchNumber()>0){ + //午餐补助(获取员工信息表中的数据) + if(null!=employeeInformation){ + cyConsumptionInfo.setLunchSubsidy(employeeInformation.getLunchSubsidy()); + }else{ + cyConsumptionInfo.setLunchSubsidy(0.0); + } + //午餐个人消费(午餐总消费-补助) + cyConsumptionInfo.setLunchPresonalConsumption((cyConsumptionInfo.getLunchNumber().doubleValue()*8)-cyConsumptionInfo.getLunchSubsidy()); + //午餐总消费(次数*固定的金额10元) + cyConsumptionInfo.setLunchSumConsumption(cyConsumptionInfo.getLunchNumber().doubleValue()*8); + } + + //晚餐次数 + cyConsumptionInfo.setSupperNumber(wancan); + if(cyConsumptionInfo.getSupperNumber()>0){ + //晚餐补助(获取员工信息表中的数据) + if(null!=employeeInformation){ + cyConsumptionInfo.setSupperSubsidy(employeeInformation.getSupperSubsidy()); + }else{ + cyConsumptionInfo.setSupperSubsidy(0.0); + } + //晚餐个人消费 + cyConsumptionInfo.setSupperPersonalConsumption((cyConsumptionInfo.getSupperNumber().doubleValue()*8)-cyConsumptionInfo.getSupperSubsidy()); + //晚餐总消费 + cyConsumptionInfo.setSupperSumConsumption(cyConsumptionInfo.getSupperNumber().doubleValue()*8); + } + //总补贴(早餐补贴+午餐补贴+晚餐补贴) + cyConsumptionInfo.setSumSubsidy(cyConsumptionInfo.getBreakfastSubsidy()+cyConsumptionInfo.getLunchSubsidy()+cyConsumptionInfo.getSupperSubsidy()); + //个人总消费(早餐个人消费+午餐个人消费+晚餐个人消费) + cyConsumptionInfo.setPersonalSumConsumption(cyConsumptionInfo.getBreakfastPersonalConsumption()+cyConsumptionInfo.getLunchPresonalConsumption()+cyConsumptionInfo.getSupperPersonalConsumption()); + //总消费(早餐总消费+午餐总消费+晚餐总消费) + cyConsumptionInfo.setSumConsumption(cyConsumptionInfo.getBreakfastSumConsumption()+cyConsumptionInfo.getLunchSumConsumption()+cyConsumptionInfo.getSupperSumConsumption()); + cyConsumptionInfoService.updateCyConsumptionInfo(cyConsumptionInfo); + } + + List list3 = cyConsumptionInfoService.selectCyConsumptionInfoByYue(parse,statisticsInfo.getName()); + for (CyConsumptionInfo cyConsumptionInfo2 : list3) { + //早餐次数 + statisticsInfo.setBreakfastNumber(statisticsInfo.getBreakfastNumber()+cyConsumptionInfo2.getBreakfastNumber()); + if(statisticsInfo.getBreakfastNumber()>0){ + //早餐补助 + statisticsInfo.setBreakfastSubsidy(statisticsInfo.getBreakfastSubsidy()+cyConsumptionInfo2.getBreakfastSubsidy()); + //早餐个人消费 + statisticsInfo.setBreakfastPersonalConsumption(statisticsInfo.getBreakfastPersonalConsumption()+cyConsumptionInfo2.getBreakfastPersonalConsumption()); + //早餐总消费 + statisticsInfo.setBreakfastSumConsumption(statisticsInfo.getBreakfastSumConsumption()+cyConsumptionInfo2.getBreakfastSumConsumption()); + } + //午餐次数 + statisticsInfo.setLunchNumber(statisticsInfo.getLunchNumber()+cyConsumptionInfo2.getLunchNumber()); + if(statisticsInfo.getLunchNumber()>0){ + //午餐补助 + statisticsInfo.setLunchSubsidy(statisticsInfo.getLunchSubsidy()+cyConsumptionInfo2.getLunchSubsidy()); + //午餐个人消费 + statisticsInfo.setLunchPresonalConsumption(statisticsInfo.getLunchPresonalConsumption()+cyConsumptionInfo2.getLunchPresonalConsumption()); + //午餐总消费 + statisticsInfo.setLunchSumConsumption(statisticsInfo.getLunchSumConsumption()+cyConsumptionInfo2.getLunchSumConsumption()); + } + //晚餐次数 + statisticsInfo.setSupperNumber(statisticsInfo.getSupperNumber()+cyConsumptionInfo2.getSupperNumber()); + if(statisticsInfo.getSupperNumber()>0){ + //晚餐补助 + statisticsInfo.setSupperSubsidy(statisticsInfo.getSupperSubsidy()+cyConsumptionInfo2.getSupperSubsidy()); + //晚餐个人消费 + statisticsInfo.setSupperPersonalConsumption(statisticsInfo.getSupperPersonalConsumption()+cyConsumptionInfo2.getSupperPersonalConsumption()); + //晚餐总消费 + statisticsInfo.setSupperSumConsumption(statisticsInfo.getSupperSumConsumption()+cyConsumptionInfo2.getSupperSumConsumption()); + } + //总补贴 + statisticsInfo.setSumSubsidy(statisticsInfo.getSumSubsidy()+cyConsumptionInfo2.getSumSubsidy()); + //个人总消费 + statisticsInfo.setPersonalSumConsumption(statisticsInfo.getPersonalSumConsumption()+cyConsumptionInfo2.getPersonalSumConsumption()); + //总消费 + statisticsInfo.setSumConsumption(statisticsInfo.getSumConsumption()+cyConsumptionInfo2.getSumConsumption()); + } + + i = cyStatisticsInfoService.updateCyStatisticsInfo(statisticsInfo); + } + return toAjax(i); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody CyStatisticsInfo cyStatisticsInfo){ + //校验付款金额 + if(null==cyStatisticsInfo.getDateTwo()||"".equals(cyStatisticsInfo.getDateTwo())){ + return AjaxResult.error("请选择需付款的月份"); + } + + //计算当前月份的总金额 + CyStatisticsInfo cyStatisticsInfo2 = new CyStatisticsInfo(); + cyStatisticsInfo2.setDate(cyStatisticsInfo.getDateTwo()); + List list = cyStatisticsInfoService.selectCyStatisticsInfoList(cyStatisticsInfo); + Double d = 0.0; + for (CyStatisticsInfo cyStatisticsInfo3 : list) { + d += cyStatisticsInfo3.getSumConsumption(); + } + if(d == 0.0){ + return AjaxResult.error("当前月份没有产生费用,无法申请付款"); + } + //供应商名称 +// String name = ""; + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //付款申请单 + CwOtherPayment cwOtherPayment = new CwOtherPayment(); + //申请单编号 + cwOtherPayment.setCode("FKSQ-"+sdf.format(new Date())); + //姓名 + cwOtherPayment.setUserName(user.getNickName()); + //部门 + cwOtherPayment.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwOtherPayment.setDateTime(new Date()); + //金额 + cwOtherPayment.setMoney(d); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = MoneyUtil.toChinese(cwOtherPayment.getMoney()+""); + cwOtherPayment.setBigMoney(chinese); + //支付类型 + cwOtherPayment.setSparedOne("付款"); + //单位名称 +// cwOtherPayment.setUnitName(name); + //付款事由 + cwOtherPayment.setCause(cyStatisticsInfo.getDateTwo()+"份餐费"); + //未付款金额(初始为填写的金额) + cwOtherPayment.setNotInvoiceAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //未开票金额(初始为填写的金额) + cwOtherPayment.setNotProceedsAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //结算比例(初始为0) + cwOtherPayment.setSettlementRatio(new BigDecimal("0")); + int i = cwOtherPaymentService.insertCwOtherPayment(cwOtherPayment); + return toAjax(i); + } + + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file) throws Exception + { + ExcelUtil util = new ExcelUtil(CyStatisticsInfo.class); + List cystatisList = util.importExcel(file.getInputStream()); + int i = cyStatisticsInfoService.updateCyStatisticsInfoByNameAndDate(cystatisList); + if(i < 1){ + AjaxResult.error("导入失败!!"); + } + return AjaxResult.success("导入成功!!"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/EvoInOutStorageManagementController.java b/evo/src/main/java/com/ruoyi/project/management/controller/EvoInOutStorageManagementController.java new file mode 100644 index 0000000..d29987e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/EvoInOutStorageManagementController.java @@ -0,0 +1,128 @@ +package com.ruoyi.project.management.controller; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.EvoInOutStorageManagement; +import com.ruoyi.project.management.service.IEvoInOutStorageManagementService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物品出入库管理Controller + * + * @author chenyongjiang + * @date 2023-12-26 + */ +@RestController +@RequestMapping("/management/inoutstorage") +public class EvoInOutStorageManagementController extends BaseController +{ + @Autowired + private IEvoInOutStorageManagementService evoInOutStorageManagementService; + + /** + * 查询物品出入库管理列表 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:list')") + @GetMapping("/list") + public TableDataInfo list(EvoInOutStorageManagement evoInOutStorageManagement) + { + startPage(); + List list = evoInOutStorageManagementService.selectEvoInOutStorageManagementList(evoInOutStorageManagement); + return getDataTable(list); + } + + /** + * 导出物品出入库管理列表 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:export')") + @Log(title = "物品出入库管理", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(EvoInOutStorageManagement evoInOutStorageManagement) + { + List list = evoInOutStorageManagementService.selectEvoInOutStorageManagementList(evoInOutStorageManagement); + ExcelUtil util = new ExcelUtil(EvoInOutStorageManagement.class); + return util.exportExcel(list, "inoutstorage"); + } + + /** + * 获取物品出入库管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(evoInOutStorageManagementService.selectEvoInOutStorageManagementById(id)); + } + + /** + * 新增物品出入库管理 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:add')") + @Log(title = "物品出入库管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EvoInOutStorageManagement evoInOutStorageManagement) + { + evoInOutStorageManagement.setAppliyTime(new Date()); + return evoInOutStorageManagementService.insertEvoInOutStorageManagement(evoInOutStorageManagement); + } + + /** + * 删除物品出入库管理 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:remove')") + @Log(title = "物品出入库管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return evoInOutStorageManagementService.deleteEvoInOutStorageManagementById(id); + } + + /** + * 审核 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:audit')") + @GetMapping("/audit/{id}") + public AjaxResult audit(@PathVariable Long id) + { + String name = SecurityUtils.getLoginUser().getUser().getNickName(); + return evoInOutStorageManagementService.audit(id,name); + } + + /** + * 出入库 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:inoutstorage')") + @GetMapping("/determine/{id}") + public AjaxResult determine(@PathVariable Long id) + { + String name = SecurityUtils.getLoginUser().getUser().getNickName(); + return evoInOutStorageManagementService.determine(id,name); + } + + /** + * 退料质检 + */ + @PreAuthorize("@ss.hasPermi('management:inoutstorage:qualityInspection')") + @GetMapping("/materialReturn/{id}") + public AjaxResult materialReturn(@PathVariable Long id) + { + String name = SecurityUtils.getLoginUser().getUser().getNickName(); + return evoInOutStorageManagementService.materialReturn(id,name); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/EvoInvalidLibraryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/EvoInvalidLibraryController.java new file mode 100644 index 0000000..b2ccab2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/EvoInvalidLibraryController.java @@ -0,0 +1,105 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.EvoInvalidLibrary; +import com.ruoyi.project.management.service.IEvoInvalidLibraryService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 【请填写功能名称】Controller + * + * @author zhukangchao + * @date 2024-01-12 + */ +@SuppressWarnings("checkstyle:RequireEmptyLineBeforeBlockTagGroup") +@RestController +@RequestMapping("/management/library") +public class EvoInvalidLibraryController extends BaseController +{ + @Autowired + private IEvoInvalidLibraryService evoInvalidLibraryService; + + /** + * 查询【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('management:library:list')") + @GetMapping("/list") + public TableDataInfo list(EvoInvalidLibrary evoInvalidLibrary) + { + startPage(); + List list = evoInvalidLibraryService.selectEvoInvalidLibraryList(evoInvalidLibrary); + return getDataTable(list); + } + + /** + * 导出【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('management:library:export')") + @Log(title = "【不良库导出】", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(EvoInvalidLibrary evoInvalidLibrary) + { + List list = evoInvalidLibraryService.selectEvoInvalidLibraryList(evoInvalidLibrary); + ExcelUtil util = new ExcelUtil(EvoInvalidLibrary.class); + return util.exportExcel(list, "library"); + } + + /** + * 获取【请填写功能名称】详细信息 + */ + @SuppressWarnings("checkstyle:LeftCurly") + @PreAuthorize("@ss.hasPermi('management:library:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(evoInvalidLibraryService.selectEvoInvalidLibraryById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('management:library:add')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EvoInvalidLibrary evoInvalidLibrary) + { + return toAjax(evoInvalidLibraryService.insertEvoInvalidLibrary(evoInvalidLibrary)); + } + + /** + * 修改【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('management:library:edit')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EvoInvalidLibrary evoInvalidLibrary) + { + return toAjax(evoInvalidLibraryService.updateEvoInvalidLibrary(evoInvalidLibrary)); + } + + /** + * 删除【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('management:library:remove')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(evoInvalidLibraryService.deleteEvoInvalidLibraryByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/EvoOperatorTypeJdController.java b/evo/src/main/java/com/ruoyi/project/management/controller/EvoOperatorTypeJdController.java new file mode 100644 index 0000000..436a355 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/EvoOperatorTypeJdController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.EvoOperatorTypeJd; +import com.ruoyi.project.management.service.IEvoOperatorTypeJdService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 操作员类型Controller + * + * @author zhukangchao + * @date 2023-12-17 + */ +@RestController +@RequestMapping("/management/evoOperatorType") +public class EvoOperatorTypeJdController extends BaseController +{ + @Autowired + private IEvoOperatorTypeJdService evoOperatorTypeJdService; + + /** + * 查询操作员类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:evoOperatorType:list')") + @GetMapping("/list") + public TableDataInfo list(EvoOperatorTypeJd evoOperatorTypeJd) + { + startPage(); + List list = evoOperatorTypeJdService.selectEvoOperatorTypeJdList(evoOperatorTypeJd); + return getDataTable(list); + } + + /** + * 导出操作员类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:evoOperatorType:export')") + @Log(title = "操作员类型", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(EvoOperatorTypeJd evoOperatorTypeJd) + { + List list = evoOperatorTypeJdService.selectEvoOperatorTypeJdList(evoOperatorTypeJd); + ExcelUtil util = new ExcelUtil(EvoOperatorTypeJd.class); + return util.exportExcel(list, "jd"); + } + + /** + * 获取操作员类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:evoOperatorType:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(evoOperatorTypeJdService.selectEvoOperatorTypeJdById(id)); + } + + /** + * 新增操作员类型 + */ + @PreAuthorize("@ss.hasPermi('management:evoOperatorType:add')") + @Log(title = "操作员类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EvoOperatorTypeJd evoOperatorTypeJd) + { + return toAjax(evoOperatorTypeJdService.insertEvoOperatorTypeJd(evoOperatorTypeJd)); + } + + /** + * 修改操作员类型 + */ + @PreAuthorize("@ss.hasPermi('management:evoOperatorType:edit')") + @Log(title = "操作员类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EvoOperatorTypeJd evoOperatorTypeJd) + { + return toAjax(evoOperatorTypeJdService.updateEvoOperatorTypeJd(evoOperatorTypeJd)); + } + + /** + * 删除操作员类型 + */ + @PreAuthorize("@ss.hasPermi('management:evoOperatorType:remove')") + @Log(title = "操作员类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(evoOperatorTypeJdService.deleteEvoOperatorTypeJdByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/EvoStagnantStorageController.java b/evo/src/main/java/com/ruoyi/project/management/controller/EvoStagnantStorageController.java new file mode 100644 index 0000000..d0c7629 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/EvoStagnantStorageController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.EvoStagnantStorage; +import com.ruoyi.project.management.service.IEvoStagnantStorageService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 呆滞库Controller + * + * @author zhukangchao + * @date 2023-12-27 + */ +@RestController +@RequestMapping("/management/storage") +public class EvoStagnantStorageController extends BaseController +{ + @Autowired + private IEvoStagnantStorageService evoStagnantStorageService; + + /** + * 查询呆滞库列表 + */ + @PreAuthorize("@ss.hasPermi('management:storage:list')") + @GetMapping("/list") + public TableDataInfo list(EvoStagnantStorage evoStagnantStorage) + { + startPage(); + List list = evoStagnantStorageService.selectEvoStagnantStorageList(evoStagnantStorage); + return getDataTable(list); + } + + /** + * 导出呆滞库列表 + */ + @PreAuthorize("@ss.hasPermi('management:storage:export')") + @Log(title = "呆滞库", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(EvoStagnantStorage evoStagnantStorage) + { + List list = evoStagnantStorageService.selectEvoStagnantStorageList(evoStagnantStorage); + ExcelUtil util = new ExcelUtil(EvoStagnantStorage.class); + return util.exportExcel(list, "storage"); + } + + /** + * 获取呆滞库详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:storage:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(evoStagnantStorageService.selectEvoStagnantStorageById(id)); + } + + /** + * 新增呆滞库 + */ + @PreAuthorize("@ss.hasPermi('management:storage:add')") + @Log(title = "呆滞库", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EvoStagnantStorage evoStagnantStorage) + { + return toAjax(evoStagnantStorageService.insertEvoStagnantStorage(evoStagnantStorage)); + } + + /** + * 修改呆滞库 + */ + @PreAuthorize("@ss.hasPermi('management:storage:edit')") + @Log(title = "呆滞库", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EvoStagnantStorage evoStagnantStorage) + { + return toAjax(evoStagnantStorageService.updateEvoStagnantStorage(evoStagnantStorage)); + } + + /** + * 删除呆滞库 + */ + @PreAuthorize("@ss.hasPermi('management:storage:remove')") + @Log(title = "呆滞库", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(evoStagnantStorageService.deleteEvoStagnantStorageByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImCustomerController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImCustomerController.java new file mode 100644 index 0000000..ef7437b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImCustomerController.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.controller; import java.util.List; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.project.management.constant.Constants; import com.ruoyi.project.management.service.IImCustomerTypeService; import com.ruoyi.project.system.domain.SysUser; import com.ruoyi.project.system.service.ISysPostService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.project.management.domain.ImCustomer; import com.ruoyi.project.management.service.IImCustomerService; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.web.page.TableDataInfo; /** * 客户维护Controller * * @author chenyj * @date 2023-10-26 */ @RestController @RequestMapping("/management/customer") public class ImCustomerController extends BaseController { @Autowired private IImCustomerService imCustomerService; @Autowired private ISysPostService postService; @Autowired private IImCustomerTypeService imCustomerTypeService; /** * 查询客户维护列表 */ @PreAuthorize("@ss.hasPermi('management:customer:list')") @GetMapping("/list") public TableDataInfo list(ImCustomer imCustomer) { SysUser user = SecurityUtils.getLoginUser().getUser(); //判断用户是否是管理员,查看全部数据 if(SecurityUtils.isAdmin(user.getUserId())){ imCustomer.setCreateBy(""); }else{ //获取岗位编码 List posts = postService.queryPostListByUserId(user.getUserId()); boolean flag = false; for(String post : posts){ /* if(Constants.CUSTOMER_AUTH.equals(post)){ flag = true; }*/ } if(flag){ imCustomer.setCreateBy(""); }else{ imCustomer.setCreateBy(user.getUserName()); } } startPage(); List list = imCustomerService.selectImCustomerList(imCustomer); return getDataTable(list); } /** * 导出客户维护列表 */ @PreAuthorize("@ss.hasPermi('management:customer:export')") @Log(title = "客户维护", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ImCustomer imCustomer) { List list = imCustomerService.selectImCustomerList(imCustomer); ExcelUtil util = new ExcelUtil(ImCustomer.class); return util.exportExcel(list, "customer"); } /** * 获取客户维护详细信息 */ @PreAuthorize("@ss.hasPermi('management:customer:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(imCustomerService.selectImCustomerById(id)); } /** * 新增客户维护 */ @PreAuthorize("@ss.hasPermi('management:customer:add')") @Log(title = "客户维护", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ImCustomer imCustomer) { ImCustomer cust = imCustomerService.selectImCustomerByCustomerName(imCustomer.getCustomerName()); if(null != cust){ return AjaxResult.error("添加客户重复!"); } SysUser user = SecurityUtils.getLoginUser().getUser(); imCustomer.setCreateBy(user.getUserName()); return toAjax(imCustomerService.insertImCustomer(imCustomer)); } /** * 修改客户维护 */ @PreAuthorize("@ss.hasPermi('management:customer:edit')") @Log(title = "客户维护", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ImCustomer imCustomer) { return toAjax(imCustomerService.updateImCustomer(imCustomer)); } /** * 删除客户维护 */ @PreAuthorize("@ss.hasPermi('management:customer:remove')") @Log(title = "客户维护", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(imCustomerService.deleteImCustomerByIds(ids)); } /** * 获取所有客户 */ @GetMapping(value = "/queryCustomers") public List queryCustomers() { return imCustomerService.queryCustomers(); } } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImCustomerTypeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImCustomerTypeController.java new file mode 100644 index 0000000..e84d1e2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImCustomerTypeController.java @@ -0,0 +1,121 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; + +import com.ruoyi.common.utils.SecurityUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImCustomerType; +import com.ruoyi.project.management.service.IImCustomerTypeService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 客户类型Controller + * + * @author zhukangchao + * @date 2023-12-04 + */ +@RestController +@RequestMapping("/management/type") +public class ImCustomerTypeController extends BaseController +{ + @Autowired + private IImCustomerTypeService imCustomerTypeService; + + /** + * 查询客户类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:type:list')") + @GetMapping("/list") + public TableDataInfo list(ImCustomerType imCustomerType) + { + startPage(); + List list = imCustomerTypeService.selectImCustomerTypeList(imCustomerType); + return getDataTable(list); + } + + /** + * 导出客户类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:type:export')") + @Log(title = "客户类型", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImCustomerType imCustomerType) + { + List list = imCustomerTypeService.selectImCustomerTypeList(imCustomerType); + ExcelUtil util = new ExcelUtil(ImCustomerType.class); + return util.exportExcel(list, "type"); + } + + /** + * 获取客户类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:type:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imCustomerTypeService.selectImCustomerTypeById(id)); + } + + /** + * 新增客户类型 + */ + @PreAuthorize("@ss.hasPermi('management:type:add')") + @Log(title = "客户类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImCustomerType imCustomerType) + { + List list = imCustomerTypeService.selectImCustomerTypeList(imCustomerType); + if(null != list && list.size() > 0){ + return AjaxResult.error("客户分组数据重复!"); + } + imCustomerType.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName()); + return toAjax(imCustomerTypeService.insertImCustomerType(imCustomerType)); + } + + /** + * 修改客户类型 + */ + @PreAuthorize("@ss.hasPermi('management:type:edit')") + @Log(title = "客户类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImCustomerType imCustomerType) + { + return toAjax(imCustomerTypeService.updateImCustomerType(imCustomerType)); + } + + /** + * 删除客户类型 + */ + @PreAuthorize("@ss.hasPermi('management:type:remove')") + @Log(title = "客户类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imCustomerTypeService.deleteImCustomerTypeByIds(ids)); + } + + /** + * 获取客户分组信息 + * @return + */ + @GetMapping("/customerGroupList") + public List list() + { + List list = imCustomerTypeService.queryImCustomerTypeList(); + return list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImDeliveryUnitController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImDeliveryUnitController.java new file mode 100644 index 0000000..65e2cc3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImDeliveryUnitController.java @@ -0,0 +1,121 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.management.domain.ImDeliveryUnit; +import com.ruoyi.project.management.service.IImDeliveryUnitService; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.service.ISysDeptService; + +/** + * 交货单位Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imDeliveryUnit") +public class ImDeliveryUnitController extends BaseController +{ + @Autowired + private IImDeliveryUnitService imDeliveryUnitService; + @Autowired + private ISysDeptService deptService; + + /** + * 查询交货单位列表 + */ + @PreAuthorize("@ss.hasPermi('management:imDeliveryUnit:list')") + @GetMapping("/list") + public TableDataInfo list(ImDeliveryUnit imDeliveryUnit) + { + startPage(); + List list = imDeliveryUnitService.selectImDeliveryUnitList(imDeliveryUnit); + return getDataTable(list); + } + + /** + * 导出交货单位列表 + */ + @PreAuthorize("@ss.hasPermi('management:imDeliveryUnit:export')") + @Log(title = "交货单位", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImDeliveryUnit imDeliveryUnit) + { + List list = imDeliveryUnitService.selectImDeliveryUnitList(imDeliveryUnit); + ExcelUtil util = new ExcelUtil(ImDeliveryUnit.class); + return util.exportExcel(list, "imDeliveryUnit"); + } + + /** + * 获取交货单位详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imDeliveryUnit:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imDeliveryUnitService.selectImDeliveryUnitById(id)); + } + + /** + * 新增交货单位 + */ + @PreAuthorize("@ss.hasPermi('management:imDeliveryUnit:add')") + @Log(title = "交货单位", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImDeliveryUnit imDeliveryUnit){ + //判断单位名称是否为null + if(null==imDeliveryUnit.getUnitName()||"".equals(imDeliveryUnit.getUnitName())){ + return AjaxResult.error("请输入单位名称"); + } + //获取部门id + Long departmentId = imDeliveryUnit.getDepartmentId(); + //根据部门id查询部门信息 + SysDept dept = deptService.selectDeptById(departmentId); + //把部门名称保存到交货单位信息表中 + imDeliveryUnit.setDepartmentName(dept.getDeptName()); + //删除标记(默认是0,未删除) + imDeliveryUnit.setDelFlag(0); + return toAjax(imDeliveryUnitService.insertImDeliveryUnit(imDeliveryUnit)); + } + + /** + * 修改交货单位 + */ + @PreAuthorize("@ss.hasPermi('management:imDeliveryUnit:edit')") + @Log(title = "交货单位", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImDeliveryUnit imDeliveryUnit) + { + return toAjax(imDeliveryUnitService.updateImDeliveryUnit(imDeliveryUnit)); + } + + /** + * 删除交货单位 + */ + @PreAuthorize("@ss.hasPermi('management:imDeliveryUnit:remove')") + @Log(title = "交货单位", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imDeliveryUnitService.deleteImDeliveryUnitByIds(ids)); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImLogisticsController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImLogisticsController.java new file mode 100644 index 0000000..2c578a1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImLogisticsController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImLogistics; +import com.ruoyi.project.management.service.IImLogisticsService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物流Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imLogistics") +public class ImLogisticsController extends BaseController +{ + @Autowired + private IImLogisticsService imLogisticsService; + + /** + * 查询物流列表 + */ + @PreAuthorize("@ss.hasPermi('management:imLogistics:list')") + @GetMapping("/list") + public TableDataInfo list(ImLogistics imLogistics) + { + startPage(); + List list = imLogisticsService.selectImLogisticsList(imLogistics); + return getDataTable(list); + } + + /** + * 导出物流列表 + */ + @PreAuthorize("@ss.hasPermi('management:imLogistics:export')") + @Log(title = "物流", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImLogistics imLogistics) + { + List list = imLogisticsService.selectImLogisticsList(imLogistics); + ExcelUtil util = new ExcelUtil(ImLogistics.class); + return util.exportExcel(list, "imLogistics"); + } + + /** + * 获取物流详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imLogistics:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imLogisticsService.selectImLogisticsById(id)); + } + + /** + * 新增物流 + */ + @PreAuthorize("@ss.hasPermi('management:imLogistics:add')") + @Log(title = "物流", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImLogistics imLogistics) + { + return toAjax(imLogisticsService.insertImLogistics(imLogistics)); + } + + /** + * 修改物流 + */ + @PreAuthorize("@ss.hasPermi('management:imLogistics:edit')") + @Log(title = "物流", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImLogistics imLogistics) + { + return toAjax(imLogisticsService.updateImLogistics(imLogistics)); + } + + /** + * 删除物流 + */ + @PreAuthorize("@ss.hasPermi('management:imLogistics:remove')") + @Log(title = "物流", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imLogisticsService.deleteImLogisticsByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialController.java new file mode 100644 index 0000000..9622bda --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialController.java @@ -0,0 +1,754 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.math.BigDecimal; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.BaseDataTool; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料(零件)Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imMaterial") +public class ImMaterialController extends BaseController +{ + @Autowired + private IImMaterialService imMaterialService; + //物料类型 + @Autowired + private IImMaterialTypeService imMaterialTypeService; + //计量单位 + @Autowired + private IImMeteringUnitService imMeteringUnitService; + //仓库信息 + @Autowired + private IImWarehouseService imWarehouseService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + //采购单详情信息 + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //bom + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //领料专用bom + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //安全库存信息 + @Autowired + private IPwSafetyInventoryService pwSafetyInventoryService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //企标单信息 + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //物料工序信息 + @Autowired + private IPwMaterialProcessService pwMaterialProcessService; + //零部件关联信息 + @Autowired + private IPwModulePartService pwModulePartService; + @Autowired + private IPcRigidChainService pcRigidChainService; + //物料分组 + @Autowired + private IImMaterialGroupService imMaterialGroupService; + /** + * 清洗系统中的GB开头的标准件 + * 名称中的汉字去掉 + * x修改为X + * 图号后边年代号去掉 + * @return + * @throws NoSuchAlgorithmException + */ + @RequestMapping("/updateAll") + public AjaxResult updateAll() throws NoSuchAlgorithmException{ + //查询物料信息 + ImMaterial imMaterial = new ImMaterial(); + List list = imMaterialService.selectImMaterialList(imMaterial); + for (ImMaterial imMaterial2 : list) { + //判断是否有单价,如果有单价,则计算未税单价 + if(imMaterial2.getUnitPrice().compareTo(BigDecimal.ZERO) > 0){ + //计算未税单价 含税单价-(含税单价/1.13) + imMaterial2.setUnivalence(imMaterial2.getUnitPrice().divide(new BigDecimal("1.13"),4)); + } + imMaterialService.updateImMaterial(imMaterial2); + + //同步库存信息表中的数据 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imMaterial2.getMaterialName(), imMaterial2.getFigureNumber()); + if(null!=inventoryDetail){ + + //判断是否有单价,如果有单价,则计算未税单价 + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) > 0){ + //计算未税单价 含税单价-(含税单价/1.13) + inventoryDetail.setUnitPrice(inventoryDetail.getUnivalence().divide(new BigDecimal("1.13"),4)); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + + return toAjax(1); + } + + /** + * 导出有在途的物料数据,包括企标单的,执行单的,采购单的,和原材料采购单的 + */ + @RequestMapping("/downLoadZaiTu") + public AjaxResult downLoadZaiTu(){ + //查询企标单未关闭的单据 + List list8 = new ArrayList(); + + //查询采购单未完成的信息 + PwPurchaseContract pwPurchaseContract = new PwPurchaseContract(); + pwPurchaseContract.setContractStatus(1L); + List list2 = pwPurchaseContractService.selectPwPurchaseContractList(pwPurchaseContract); + for (PwPurchaseContract pwPurchaseContract2 : list2) { + LinShiDaoChu daochu = new LinShiDaoChu(); + List list3 = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractId(pwPurchaseContract2.getId()); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial : list3) { + daochu = new LinShiDaoChu(); + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwPurchaseContract2.getContractCode(), pwPurchaseContractMaterial.getMaterialName(), pwPurchaseContractMaterial.getFigureNumber()); + Long yiru = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + yiru += imProductReceiptMaterial.getReceived().longValue(); + } + //令号 + daochu.setProductionCode(pwPurchaseContract2.getContractCode()); + //图号 + daochu.setFigureNumber(pwPurchaseContractMaterial.getFigureNumber()); + //名称 + daochu.setName(pwPurchaseContractMaterial.getMaterialName()); + //下单数量 + daochu.setSumNumber(pwPurchaseContractMaterial.getAmount()); + //入库数量 + daochu.setRuKuNumber(yiru); + //在途数量(下单-入库) + daochu.setZaituNumber(pwPurchaseContractMaterial.getAmount()-yiru); + + //派工部门默认为采购部 + daochu.setDeptName("采购部"); + list8.add(daochu); + } + } + + //查询未生成采购合同的标准件 + List list3 = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractIdList(); + LinShiDaoChu daochu = new LinShiDaoChu(); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial : list3) { + daochu = new LinShiDaoChu(); + //令号 + daochu.setProductionCode("未生成采购合同"); + //图号 + daochu.setFigureNumber(pwPurchaseContractMaterial.getFigureNumber()); + //名称 + daochu.setName(pwPurchaseContractMaterial.getMaterialName()); + //下单数量 + daochu.setSumNumber(pwPurchaseContractMaterial.getAmount()); + //入库数量 + daochu.setRuKuNumber(0L); + //在途数量(下单-入库) + daochu.setZaituNumber(pwPurchaseContractMaterial.getAmount()); + + //派工部门默认为采购部 + daochu.setDeptName("采购部"); + list8.add(daochu); + } + + //查询原材料未完成的信息 + + + + ExcelUtil util = new ExcelUtil(LinShiDaoChu.class); + return util.exportExcel(list8, "在途信息"); + } + + /** + * 查询物料(零件)列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(ImMaterial imMaterial){ + startPage(); + List list = imMaterialService.selectImMaterialList(imMaterial); + return getDataTable(list); + } + + /** + * 查询物料(零件)列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:list')") + @GetMapping("/listImMaterialByType") + public TableDataInfo listImMaterialByType(ImMaterial imMaterial){ + startPage(); + List list = imMaterialService.selectImMaterialListImMaterialByType(imMaterial); + return getDataTable(list); + } + + /** + * 查询原材料列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:list')") + @GetMapping("/getImMaterialListByYuanCaiLiao") + public TableDataInfo getImMaterialListByYuanCaiLiao(ImMaterial imMaterial){ + List res_list = new ArrayList(); + try{ + List list = imMaterialService.selectImMaterialListImMaterialByYuanCaiLiao(imMaterial); + ImMaterialData materialData = null; + for(ImMaterial material : list){ + materialData = new ImMaterialData(); + materialData.setMaterialName(material.getFigureNumber() +" "+material.getMaterialName()); + materialData.setFigureNumber(material.getFigureNumber()); + materialData.setMaterials(material.getMaterials()); + res_list.add(materialData); + } + + //添加余料 + ImMaterialData material = new ImMaterialData(); + material.setMaterialName("余料"); + material.setFigureNumber("015000000"); + res_list.add(material); + }catch (Exception e){ + e.printStackTrace(); + } + return getDataTable(res_list); + } + + /** + * 查询原材料列表 王炎程序用 + */ + @RequestMapping("/imMaterialList") + public TableDataInfo imMaterialList(){ + ImMaterial imMaterial = new ImMaterial(); + List list = imMaterialService.selectImMaterialListImMaterialByYuanCaiLiao(imMaterial); + for (ImMaterial imMaterial2 : list) { + imMaterial2.setMaterialName(imMaterial2.getMaterialName()+"<"+imMaterial2.getQuantity()+">"); + } + return getDataTable(list); + } + + /** + * 查询基建材料列表 + */ + @GetMapping("/getImMaterialListByJiJian") + public TableDataInfo getImMaterialListByJiJian(ImMaterial imMaterial){ +// startPage(); + List list = imMaterialService.selectImMaterialListImMaterialByJiJian(imMaterial); + return getDataTable(list); + } + + /** + * 查询易耗品列表 + */ + @GetMapping("/getImMaterialByYHP") + public TableDataInfo getImMaterialByYHP(ImMaterial imMaterial){ +// startPage(); + List list = imMaterialService.selectImMaterialListImMaterialByYHP(imMaterial); + return getDataTable(list); + } + + /** + * 查询库存制作单列表(根据库存表的在途数量) + */ + @RequestMapping("/listImMaterialByInventoryDetailId/{inventoryDetailId}") + public TableDataInfo listImMaterialByInventoryDetailId(@PathVariable Long inventoryDetailId){ + //根据库存表的id查询库存表信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(inventoryDetailId); + //根据物料名称和图号查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + List list = new ArrayList(); + //根据令号查询 + if(null!=imMaterial){ + list.add(imMaterial); + } + return getDataTable(list); + } + + /** + * 导出物料(零件)列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:export')") + @Log(title = "物料(零件)", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImMaterial imMaterial) + { + List list = imMaterialService.selectImMaterialList(imMaterial); + ExcelUtil util = new ExcelUtil(ImMaterial.class); + return util.exportExcel(list, "imMaterial"); + } + + /** + * 获取物料(零件)详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imMaterialService.selectImMaterialById(id)); + } + + /** + * 新增物料(零件) + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:add')") + @Log(title = "物料(零件)", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImMaterial imMaterial){ + //增加物料的同时,把物料也添加到库存表中 + PwInventoryDetail inventoryDetail = new PwInventoryDetail(); + //判断物料名称是否为null + if(null==imMaterial.getMaterialName()||"".equals(imMaterial.getMaterialName())){ + return AjaxResult.error("请输入物料名称"); + } + //判断图号是否为null + if(null==imMaterial.getFigureNumber()||"".equals(imMaterial.getFigureNumber())){ + return AjaxResult.error("请输入物料图号"); + } + //判断是否已经添加了此物料 + ImMaterial imMaterial2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(imMaterial.getMaterialName(),imMaterial.getFigureNumber()); + if(null!=imMaterial2){ + return AjaxResult.error("已存在此物料,无需重复添加"); + } + inventoryDetail.setName(imMaterial.getMaterialName()); + inventoryDetail.setFigureNumber(imMaterial.getFigureNumber()); + inventoryDetail.setCategory(imMaterial.getCategory()); + inventoryDetail.setQuantity(0L); + //最低最高库存 + inventoryDetail.setMinimum(imMaterial.getMinimum()); + inventoryDetail.setHighest(imMaterial.getHighest()); + //材料 + inventoryDetail.setMaterials(imMaterial.getMaterials()); + //单重 + inventoryDetail.setPieceWeight(imMaterial.getPieceWeight()); + //未税单价 + if(null!=imMaterial.getUnivalence()){ + inventoryDetail.setUnivalence(imMaterial.getUnivalence()); + } + //仓库名称 + if(null!=imMaterial.getWarehouseId()){ + ImWarehouse warehouse = imWarehouseService.selectImWarehouseById(Long.valueOf(imMaterial.getWarehouseId())); + imMaterial.setWarehouseName(warehouse.getWarehouseName()); + inventoryDetail.setWarehouseName(warehouse.getWarehouseName()); + } + if(null!=imMaterial.getMaterialTypeId()){ + //根据物料类型id查询物料类型信息 + ImMaterialType materialType = imMaterialTypeService.selectImMaterialTypeById(imMaterial.getMaterialTypeId()); + //保存物料类型名称 + imMaterial.setMaterialTypeName(materialType.getMaterialTypeName()); + inventoryDetail.setType(materialType.getMaterialTypeName()); + } + if(null!=imMaterial.getUnitOfMeasurementId()){ + //根据计量单位id查询计量单位信息 + ImMeteringUnit meteringUnit = imMeteringUnitService.selectImMeteringUnitById(imMaterial.getUnitOfMeasurementId()); + //保存计量单位名称 + imMaterial.setUnitOfMeasurementName(meteringUnit.getUnitName()); + inventoryDetail.setUnit(meteringUnit.getUnitName()); + } + if(null!=imMaterial.getPreferentialSupplierId()){ + //根据供应商id查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierById(imMaterial.getPreferentialSupplierId()); + //保存供应商名称 + imMaterial.setPreferentialOriginName(supplier.getSupplierName()); + } + //判断原材料是否添加了采购标记 + + if("原材料".equals(imMaterial.getMaterialTypeName())||"毛坯".equals(imMaterial.getMaterialTypeName())){ + if(null==imMaterial.getPurchaseMark()||"".equals(imMaterial.getPurchaseMark())){ + return AjaxResult.error("请选择材料的采购标记"); + } + } + //删除标记(默认为0,未删除) + imMaterial.setDelFlag(0); + inventoryDetail.setDelFlag(0); + if(imMaterial.getMaterialTypeName().equals("易耗品")){ + if(null==imMaterial.getProportion()||imMaterial.getProportion().equals("")||imMaterial.getProportion()==0){ + return AjaxResult.error("请输入换算比例"); + } + if(imMaterial.getProportion()==1){ + //说明采购和领用单位一致 + imMaterial.setStockRequisitionUnit(imMaterial.getUnitOfMeasurementName()); + }else{ + //判断领用单位是否为null + if(null==imMaterial.getStockRequisitionUnit()||"".equals(imMaterial.getStockRequisitionUnit())){ + return AjaxResult.error("请选择领用单位"); + } + } + } + + //查询物料分组 + ImMaterialGroup imMaterialGroup = new ImMaterialGroup(); + imMaterialGroup.setGroupName(imMaterial.getCategory()); + List group_list = imMaterialGroupService.selectImMaterialGroupList(imMaterialGroup); + if(null != group_list && group_list.size() > 0){ + imMaterial.setCategory(group_list.get(0).getId().toString()); + } + if("自制".equals(imMaterial.getPurchaseMark())){ + imMaterial.setPurchaseMark("2"); + }else if("外采".equals(imMaterial.getPurchaseMark())){ + imMaterial.setPurchaseMark("1"); + } + int insertImMaterial = imMaterialService.insertImMaterial(imMaterial); + //保存物料信息的同时把库存信息也添加上 + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail); + return toAjax(insertImMaterial); + } + + /** + * 修改物料(零件) + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:edit')") + @Log(title = "物料(零件)", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImMaterial imMaterial){ + //判断物料名称是否为null + if(null==imMaterial.getMaterialName()||"".equals(imMaterial.getMaterialName())){ + return AjaxResult.error("请输入物料名称"); + } + //判断图号是否为null + if(null==imMaterial.getFigureNumber()||"".equals(imMaterial.getFigureNumber())){ + return AjaxResult.error("请输入物料图号"); + } + //判断原材料是否添加了采购标记 + if("原材料".equals(imMaterial.getMaterialTypeName())||"毛坯".equals(imMaterial.getMaterialTypeName())){ + if(null==imMaterial.getPurchaseMark()||"".equals(imMaterial.getPurchaseMark())){ + return AjaxResult.error("请选择材料的采购标记"); + } + } + int i = 0; + //修改之前先查询修改之前的数据 + ImMaterial material = imMaterialService.selectImMaterialById(imMaterial.getId()); + //如果修改之前的名称和图号 和 修改之后的名称和图号一致,则直接修改当前数据,如果不一致,则需要根据新名称和新图号查询是否已经存在此名称和图号 + if(material.getMaterialName().equals(imMaterial.getMaterialName())&&material.getFigureNumber().equals(imMaterial.getFigureNumber())){ + //根据物料图号和名称查询物料信息 + PwInventoryDetail pwInventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(),material.getFigureNumber()); + if(null!=pwInventoryDetail){ + pwInventoryDetail.setName(imMaterial.getMaterialName()); + pwInventoryDetail.setFigureNumber(imMaterial.getFigureNumber()); + } + if(null!=imMaterial.getMaterialTypeId()){ + //根据物料类型id查询物料类型信息 + ImMaterialType materialType = imMaterialTypeService.selectImMaterialTypeById(imMaterial.getMaterialTypeId()); + //保存物料类型名称 + imMaterial.setMaterialTypeName(materialType.getMaterialTypeName()); + if(null!=pwInventoryDetail){ + pwInventoryDetail.setType(materialType.getMaterialTypeName()); + } + } + if(null!=imMaterial.getUnitOfMeasurementId()){ + //根据计量单位id查询计量单位信息 + ImMeteringUnit meteringUnit = imMeteringUnitService.selectImMeteringUnitById(imMaterial.getUnitOfMeasurementId()); + //保存计量单位名称 + imMaterial.setUnitOfMeasurementName(meteringUnit.getUnitName()); + if(null!=pwInventoryDetail){ + pwInventoryDetail.setUnit(meteringUnit.getUnitName()); + } + } + //仓库名称 + if(null!=imMaterial.getWarehouseId()){ + ImWarehouse warehouse = imWarehouseService.selectImWarehouseById(Long.valueOf(imMaterial.getWarehouseId())); + imMaterial.setWarehouseName(warehouse.getWarehouseName()); + pwInventoryDetail.setWarehouseName(warehouse.getWarehouseName()); + } + if(null!=imMaterial.getPreferentialSupplierId()){ + //根据供应商id查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierById(imMaterial.getPreferentialSupplierId()); + //保存供应商名称 + imMaterial.setPreferentialOriginName(supplier.getSupplierName()); + } + //最低最高库存 + if(null!=pwInventoryDetail){ + pwInventoryDetail.setMinimum(imMaterial.getMinimum()); + pwInventoryDetail.setHighest(imMaterial.getHighest()); + } + //材料和单重 + pwInventoryDetail.setMaterials(imMaterial.getMaterials()); + pwInventoryDetail.setCategory(imMaterial.getCategory()); + pwInventoryDetail.setPieceWeight(imMaterial.getPieceWeight()); + + //直接修改 + i = imMaterialService.updateImMaterial(imMaterial); + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail); + }else{ + //先查询新名称和新图号是否已经存在 + ImMaterial imMaterial2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + if(null!=imMaterial2){ + //说明已经存在,此时应该删除修改之前的物料,库存信息在删除时,需要把库存数量,在途数量和预定数量添加到已经存在的物料上 + return AjaxResult.error("名称和图号已经存在"); + }else{ + + //根据物料图号和名称查询物料信息 + PwInventoryDetail pwInventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(),material.getFigureNumber()); + if(null!=pwInventoryDetail){ + pwInventoryDetail.setName(imMaterial.getMaterialName()); + pwInventoryDetail.setFigureNumber(imMaterial.getFigureNumber()); + } + if(null!=imMaterial.getMaterialTypeId()){ + //根据物料类型id查询物料类型信息 + ImMaterialType materialType = imMaterialTypeService.selectImMaterialTypeById(imMaterial.getMaterialTypeId()); + //保存物料类型名称 + imMaterial.setMaterialTypeName(materialType.getMaterialTypeName()); + if(null!=pwInventoryDetail){ + pwInventoryDetail.setType(materialType.getMaterialTypeName()); + } + } + if(null!=imMaterial.getUnitOfMeasurementId()){ + //根据计量单位id查询计量单位信息 + ImMeteringUnit meteringUnit = imMeteringUnitService.selectImMeteringUnitById(imMaterial.getUnitOfMeasurementId()); + //保存计量单位名称 + imMaterial.setUnitOfMeasurementName(meteringUnit.getUnitName()); + if(null!=pwInventoryDetail){ + pwInventoryDetail.setUnit(meteringUnit.getUnitName()); + } + } + //仓库名称 + if(null!=imMaterial.getWarehouseId()){ + ImWarehouse warehouse = imWarehouseService.selectImWarehouseById(Long.valueOf(imMaterial.getWarehouseId())); + imMaterial.setWarehouseName(warehouse.getWarehouseName()); + pwInventoryDetail.setWarehouseName(warehouse.getWarehouseName()); + } + if(null!=imMaterial.getPreferentialSupplierId()){ + //根据供应商id查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierById(imMaterial.getPreferentialSupplierId()); + //保存供应商名称 + imMaterial.setPreferentialOriginName(supplier.getSupplierName()); + } + //最低最高库存 + if(null!=pwInventoryDetail){ + pwInventoryDetail.setMinimum(imMaterial.getMinimum()); + pwInventoryDetail.setHighest(imMaterial.getHighest()); + } + //材料和单重 + pwInventoryDetail.setMaterials(imMaterial.getMaterials()); + pwInventoryDetail.setPieceWeight(imMaterial.getPieceWeight()); + pwInventoryDetail.setCategory(imMaterial.getCategory()); + //直接修改 + i = imMaterialService.updateImMaterial(imMaterial); + + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail); + } + } + + + //当安全库存为0时,根据安全库存数量查询安全库存信息表中是否有此数据,如果有则删除 + if(imMaterial.getMinimum()==0||imMaterial.getHighest()==0){ + PwSafetyInventory safetyInventory = pwSafetyInventoryService.selectPwSafetyInventoryByNameAndFigureNumber(imMaterial.getMaterialName(),imMaterial.getFigureNumber()); + if(null!=safetyInventory){ + pwSafetyInventoryService.deletePwSafetyInventoryById(safetyInventory.getId()); + } + } + return toAjax(i); + } + + /** + * 删除物料(零件) + */ + @PreAuthorize("@ss.hasPermi('management:imMaterial:remove')") + @Log(title = "物料(零件)", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //删除物料时判断此物料是否还有库存,如果有则不允许删除 + for (Long long1 : ids) { + //根据id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(long1); + //根据物料名称和图号查询库存信息 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + try { + pwInventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imMaterial.getMaterialName(),imMaterial.getFigureNumber()); + } catch (Exception e) { + return AjaxResult.error("查询到库存信息有多条数据,不知道需要删除哪条,请手动删除库存信息"); + } + if(null!=pwInventoryDetail){ + if(pwInventoryDetail.getQuantity()!=0||pwInventoryDetail.getPreliminaryInventory()!=0){ + return AjaxResult.error("有库存的物料不可删除"); + }else{ + pwInventoryDetailService.deletePwInventoryDetailById(pwInventoryDetail.getId()); + } + } + } + return toAjax(imMaterialService.deleteImMaterialByIds(ids)); + } + + /** + * 根据物料名称查询所有的规格型号 + */ + @RequestMapping("/getMaterialType") + public AjaxResult getMaterialType(String materialName){ + ImMaterial imMaterial = new ImMaterial(); + imMaterial.setMaterialName(materialName); + List list = imMaterialService.selectImMaterialList(imMaterial); + return AjaxResult.success("成功",list); + } + + /** + * 查询物料(零件)列表 + */ + @RequestMapping("/listImMaterialByBuJianAndLingJian") + public TableDataInfo listImMaterialByBuJianAndLingJian(ImMaterial imMaterial){ + List list = imMaterialService.selectImMaterialListImMaterialByBuJianAndLingJian(); + return getDataTable(list); + } + + /** + * 批量上传物料信息 + */ + @RequestMapping("/upload") + @ResponseBody + public AjaxResult uploadLableNumber(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring1 = originalFilename.substring(originalFilename.length()-4); + + //编号 + String str = ""; + //型号 + String str2 = ""; + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + //年份 + String substring2 = ss.substring(2); + List list = new ArrayList(); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring1)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + for (int i = 1; i < result.size(); i++) { +// //名称 + String name2 = result.get(i).get(1).toString(); + //图号 + String figureNumber2 = result.get(i).get(0).toString(); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name2,figureNumber2); + if(null==inventoryDetail){ + System.out.println("未查询到库存信息"); + }else{ + inventoryDetail.setUnivalence(new BigDecimal(result.get(i).get(2).toString())); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + + System.out.println("开始没有库存信息的-------------"); + for (ImMaterial imMaterial : list) { + System.out.println(imMaterial.getMaterialName()+"----"+imMaterial.getFigureNumber()); + } + System.out.println("结束没有库存信息的-------------"); + + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + /** + * 判断一个字符串是整数还是小数 + */ + public Boolean type(String str){ + if(null==str||"".equals(str)){ + return false; + } + boolean b = str.matches("-?\\d+(\\.\\d+)?"); + if(!b){ + return false; + } + Double valueOf = Double.valueOf(str); + if(valueOf%1==0.0){ + return true; + } + return false; + } + + private static String REGEX_CHINESE = "[\u4e00-\u9fa5]";// 中文正则 + + /** + * 根据名称查询物料信息 + * @param materialName + * @return + */ + @GetMapping(value = "/getImMaterialByMaterialName/{materialName}") + public List getImMaterialByMaterialName(@PathVariable("materialName") String materialName) + { + List res_list = new ArrayList(); + try{ + List list = imMaterialService.getImMaterialByMaterialName(materialName); + ImMaterialData materialData = null; + for(ImMaterial material : list){ + materialData = new ImMaterialData(); + materialData.setMaterialName(material.getFigureNumber() +" "+material.getMaterialName()); + materialData.setFigureNumber(material.getFigureNumber()); + materialData.setMaterials(material.getMaterials()); + res_list.add(materialData); + } + }catch (Exception e){ + e.printStackTrace(); + } + return res_list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialGroupController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialGroupController.java new file mode 100644 index 0000000..e604dad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialGroupController.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterialGroup; +import com.ruoyi.project.management.service.IImMaterialGroupService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料分组Controller + * + * @author zhukangchao + * @date 2023-12-15 + */ +@RestController +@RequestMapping("/management/materialgroup") +public class ImMaterialGroupController extends BaseController +{ + @Autowired + private IImMaterialGroupService imMaterialGroupService; + + /** + * 查询物料分组列表 + */ + @PreAuthorize("@ss.hasPermi('management:materialgroup:list')") + @GetMapping("/list") + public TableDataInfo list(ImMaterialGroup imMaterialGroup) + { + startPage(); + List list = imMaterialGroupService.selectImMaterialGroupList(imMaterialGroup); + return getDataTable(list); + } + + /** + * 导出物料分组列表 + */ + @PreAuthorize("@ss.hasPermi('management:materialgroup:export')") + @Log(title = "物料分组", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImMaterialGroup imMaterialGroup) + { + List list = imMaterialGroupService.selectImMaterialGroupList(imMaterialGroup); + ExcelUtil util = new ExcelUtil(ImMaterialGroup.class); + return util.exportExcel(list, "group"); + } + + /** + * 获取物料分组详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:materialgroup:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imMaterialGroupService.selectImMaterialGroupById(id)); + } + + /** + * 新增物料分组 + */ + @PreAuthorize("@ss.hasPermi('management:materialgroup:add')") + @Log(title = "物料分组", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImMaterialGroup imMaterialGroup) + { + //查询物料分组是否重复 + List list = imMaterialGroupService.selectImMaterialGroupList(imMaterialGroup); + if(null != list && list.size() > 0){ + return AjaxResult.error("添加数据重复!"); + } + return toAjax(imMaterialGroupService.insertImMaterialGroup(imMaterialGroup)); + } + + /** + * 修改物料分组 + */ + @PreAuthorize("@ss.hasPermi('management:materialgroup:edit')") + @Log(title = "物料分组", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImMaterialGroup imMaterialGroup) + { + return toAjax(imMaterialGroupService.updateImMaterialGroup(imMaterialGroup)); + } + + /** + * 删除物料分组 + */ + @PreAuthorize("@ss.hasPermi('management:materialgroup:remove')") + @Log(title = "物料分组", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imMaterialGroupService.deleteImMaterialGroupByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialTypeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialTypeController.java new file mode 100644 index 0000000..1c4096d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImMaterialTypeController.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterialType; +import com.ruoyi.project.management.service.IImMaterialTypeService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料(零件)类型Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imMaterialType") +public class ImMaterialTypeController extends BaseController +{ + @Autowired + private IImMaterialTypeService imMaterialTypeService; + + /** + * 查询物料(零件)类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterialType:list')") + @GetMapping("/list") + public TableDataInfo list(ImMaterialType imMaterialType) + { + startPage(); + List list = imMaterialTypeService.selectImMaterialTypeList(imMaterialType); + return getDataTable(list); + } + + /** + * 导出物料(零件)类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterialType:export')") + @Log(title = "物料(零件)类型", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImMaterialType imMaterialType) + { + List list = imMaterialTypeService.selectImMaterialTypeList(imMaterialType); + ExcelUtil util = new ExcelUtil(ImMaterialType.class); + return util.exportExcel(list, "imMaterialType"); + } + + /** + * 获取物料(零件)类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterialType:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imMaterialTypeService.selectImMaterialTypeById(id)); + } + + /** + * 新增物料(零件)类型 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterialType:add')") + @Log(title = "物料(零件)类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImMaterialType imMaterialType) + { + List list = imMaterialTypeService.selectImMaterialTypeList(imMaterialType); + if(null != list && list.size() > 0){ + return AjaxResult.error("物料分组数据重复!"); + } + return toAjax(imMaterialTypeService.insertImMaterialType(imMaterialType)); + } + + /** + * 修改物料(零件)类型 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterialType:edit')") + @Log(title = "物料(零件)类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImMaterialType imMaterialType) + { + return toAjax(imMaterialTypeService.updateImMaterialType(imMaterialType)); + } + + /** + * 删除物料(零件)类型 + */ + @PreAuthorize("@ss.hasPermi('management:imMaterialType:remove')") + @Log(title = "物料(零件)类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imMaterialTypeService.deleteImMaterialTypeByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImMeteringUnitController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImMeteringUnitController.java new file mode 100644 index 0000000..e7e00ef --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImMeteringUnitController.java @@ -0,0 +1,117 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMeteringUnit; +import com.ruoyi.project.management.service.IImMeteringUnitService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 计量单位Controller + * + * @author zhukangchao + * @date 2020-06-23 + */ +@RestController +@RequestMapping("/management/imMeteringUnit") +public class ImMeteringUnitController extends BaseController +{ + @Autowired + private IImMeteringUnitService imMeteringUnitService; + + /** + * 查询计量单位列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMeteringUnit:list')") + @GetMapping("/list") + public TableDataInfo list(ImMeteringUnit imMeteringUnit) + { + startPage(); + List list = imMeteringUnitService.selectImMeteringUnitList(imMeteringUnit); + return getDataTable(list); + } + + /** + * 导出计量单位列表 + */ + @PreAuthorize("@ss.hasPermi('management:imMeteringUnit:export')") + @Log(title = "计量单位", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImMeteringUnit imMeteringUnit) + { + List list = imMeteringUnitService.selectImMeteringUnitList(imMeteringUnit); + ExcelUtil util = new ExcelUtil(ImMeteringUnit.class); + return util.exportExcel(list, "imMeteringUnit"); + } + + /** + * 获取计量单位详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imMeteringUnit:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return AjaxResult.success(imMeteringUnitService.selectImMeteringUnitById(id)); + } + + /** + * 新增计量单位 + */ + @PreAuthorize("@ss.hasPermi('management:imMeteringUnit:add')") + @Log(title = "计量单位", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImMeteringUnit imMeteringUnit){ + imMeteringUnit.setDelFlag(0); + List list = imMeteringUnitService.selectImMeteringUnitList(imMeteringUnit); + if(null != list && list.size() > 0){ + return AjaxResult.error("新增数据重复!"); + } + imMeteringUnit.setDelFlag(0); + return toAjax(imMeteringUnitService.insertImMeteringUnit(imMeteringUnit)); + } + + /** + * 修改计量单位 + */ + @PreAuthorize("@ss.hasPermi('management:imMeteringUnit:edit')") + @Log(title = "计量单位", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImMeteringUnit imMeteringUnit){ + return toAjax(imMeteringUnitService.updateImMeteringUnit(imMeteringUnit)); + } + + /** + * 删除计量单位 + */ + @PreAuthorize("@ss.hasPermi('management:imMeteringUnit:remove')") + @Log(title = "计量单位", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imMeteringUnitService.deleteImMeteringUnitByIds(ids)); + } + + /** + * 获取计量单位列表 + * @return + */ + @GetMapping("/getUnitList") + public List getUnitList() + { + return imMeteringUnitService.selectImMeteringUnitList(null); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImProductReceiptController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductReceiptController.java new file mode 100644 index 0000000..ce4fecd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductReceiptController.java @@ -0,0 +1,125 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImDeliveryUnit; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.service.IImDeliveryUnitService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IPwContractService; +import com.ruoyi.project.management.service.IPwOutsourcingContractService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品(半成品)入库单Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imProductReceipt") +public class ImProductReceiptController extends BaseController +{ + @Autowired + private IImProductReceiptService imProductReceiptService; + //交货单位信息 + @Autowired + private IImDeliveryUnitService imDeliveryUnitService; +// //销售合同信息 +// @Autowired +// private IPwContractService pwContractService; +// //外协合同信息 +// @Autowired +// private IPwOutsourcingContractService pwOutsourcingContractService; + + /** + * 查询产品(半成品)入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceipt:list')") + @GetMapping("/list") + public TableDataInfo list(ImProductReceipt imProductReceipt) + { + startPage(); + List list = imProductReceiptService.selectImProductReceiptList(imProductReceipt); + return getDataTable(list); + } + + /** + * 导出产品(半成品)入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceipt:export')") + @Log(title = "产品(半成品)入库单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImProductReceipt imProductReceipt) + { + List list = imProductReceiptService.selectImProductReceiptList(imProductReceipt); + ExcelUtil util = new ExcelUtil(ImProductReceipt.class); + return util.exportExcel(list, "imProductReceipt"); + } + + /** + * 获取产品(半成品)入库单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceipt:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imProductReceiptService.selectImProductReceiptById(id)); + } + + /** + * 新增产品(半成品)入库单 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceipt:add')") + @Log(title = "产品(半成品)入库单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImProductReceipt imProductReceipt){ + //根据交货单位id查询交货单位信息 + ImDeliveryUnit deliveryUnit = imDeliveryUnitService.selectImDeliveryUnitById(imProductReceipt.getDeliveryUnitId()); + imProductReceipt.setDeliveryUnit(deliveryUnit.getUnitName()); + // TODO + //产品入库后根据合同中的产品型号及数量核对,数量及型号完全相符后,需要把合同的状态修改掉 + + //删除状态为0---未删除 + imProductReceipt.setDelFlag(0); + return toAjax(imProductReceiptService.insertImProductReceipt(imProductReceipt)); + } + + /** + * 修改产品(半成品)入库单 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceipt:edit')") + @Log(title = "产品(半成品)入库单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImProductReceipt imProductReceipt){ + //根据交货单位id查询交货单位信息 + ImDeliveryUnit deliveryUnit = imDeliveryUnitService.selectImDeliveryUnitById(imProductReceipt.getDeliveryUnitId()); + imProductReceipt.setDeliveryUnit(deliveryUnit.getUnitName()); + return toAjax(imProductReceiptService.updateImProductReceipt(imProductReceipt)); + } + + /** + * 删除产品(半成品)入库单 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceipt:remove')") + @Log(title = "产品(半成品)入库单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imProductReceiptService.deleteImProductReceiptByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImProductReceiptMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductReceiptMaterialController.java new file mode 100644 index 0000000..d6423a4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductReceiptMaterialController.java @@ -0,0 +1,2404 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.management.utils.SendEmail; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料产品入库单关联Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imProductReceiptMaterial") +public class ImProductReceiptMaterialController extends BaseController +{ + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //产品入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //合同信息 + @Autowired + private IPwContractService pwContractService; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + @Autowired + private IPwTaskService pwTaskService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //Bom表信息 + @Autowired + private IPwBomService pwBomService; + //用户信息 + @Autowired + private TokenService tokenService; + //预制单信息 + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + //预制单详情信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //采购合同明细信息 + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //采购合同信息 + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + //发运通知单明细 + @Autowired + private IPwLetterOfAdviceProductService pwLetterOfAdviceProductService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //执行单和产品关联表信息 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //采购单信息 + @Autowired + private IPwBuyingRequisitionService pwBuyingRequisitionService; + //采购单详情信息 + @Autowired + private IPwBuyingRequisitionMaterialService pwBuyingRequisitionMaterialService; + //采购单信息 + @Autowired + private IPwBuyingRequisitionTwoService pwBuyingRequisitionTwoService; + //采购单详情信息 + @Autowired + private IPwBuyingRequisitionMaterialTwoService pwBuyingRequisitionMaterialTwoService; + //用户邮箱信息 + @Autowired + private IPwUserEmailService pwUserEmailService; + //外购单预采购详情 + @Autowired + private IPwPredictPurchaseTwoService pwPredictPurchaseTwoService; + //外购件预采购单 + @Autowired + private IPwPredictPurchaseService pwPredictPurchaseService; + //外协合同详情信息 + @Autowired + private IPwOutsourceContractDetailService pwOutsourceContractDetailService; + //外协合同信息 + @Autowired + private IPwOutsourceContractService pwOutsourceContractService; + //借条信息 + @Autowired + private IPwMaterialBorrowInfoService pwMaterialBorrowInfoService; + //生产订单信息 + @Autowired + private IPwProductionOrderService pwProductionOrderService; + //计量单位 + @Autowired + private IImMeteringUnitService imMeteringUnitService; + + /** + * 查询物料产品入库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceiptMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(ImProductReceiptMaterial imProductReceiptMaterial){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(null!=imProductReceiptMaterial.getBeginTime()&&!"".equals(imProductReceiptMaterial.getBeginTime())&&null!=imProductReceiptMaterial.getEndTime()&&!"".equals(imProductReceiptMaterial.getEndTime())){ + try { + Date start = sdf.parse(imProductReceiptMaterial.getBeginTime()); + Date end = sdf.parse(imProductReceiptMaterial.getEndTime()); + imProductReceiptMaterial.setStart(start); + imProductReceiptMaterial.setEnd(end); + } catch (Exception e) { + // TODO: handle exception + } + } + startPage(); + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialList(imProductReceiptMaterial); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list) { + PwInventoryDetail inventoryDetail = new PwInventoryDetail(); + if(null==imProductReceiptMaterial2.getMaterialName()||"".equals(imProductReceiptMaterial2.getMaterialName())){ + inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(imProductReceiptMaterial2.getSpecification()); + }else{ + inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imProductReceiptMaterial2.getMaterialName(), imProductReceiptMaterial2.getSpecification()); + } + if(null!=inventoryDetail){ + imProductReceiptMaterial2.setInventoryQuantity(inventoryDetail.getQuantity()); + }else{ + imProductReceiptMaterial2.setInventoryQuantity(0L); + } + } + return getDataTable(list); + } + + /** + * 导出物料产品入库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceiptMaterial:export')") + @Log(title = "物料产品入库单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImProductReceiptMaterial imProductReceiptMaterial){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(null!=imProductReceiptMaterial.getBeginTime()&&!"".equals(imProductReceiptMaterial.getBeginTime())&&null!=imProductReceiptMaterial.getEndTime()&&!"".equals(imProductReceiptMaterial.getEndTime())){ + try { + Date start = sdf.parse(imProductReceiptMaterial.getBeginTime()); + Date end = sdf.parse(imProductReceiptMaterial.getEndTime()); + imProductReceiptMaterial.setStart(start); + imProductReceiptMaterial.setEnd(end); + } catch (Exception e) { + // TODO: handle exception + } + } + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialListTwo(imProductReceiptMaterial); + //添加序号,添加合计行 + long i = 1; + //创建合计行对象 +// ImProductReceiptMaterialTwo heji = new ImProductReceiptMaterialTwo(); + for (ImProductReceiptMaterialTwo imProductReceiptMaterial2 : list) { + imProductReceiptMaterial2.setSerialNumber(i); + i++; +// //合计 +// heji.setCode("合计"); +// //合计数量 +// if(null==heji.getActualQuantity()){ +// heji.setActualQuantity(0.0); +// } +// heji.setActualQuantity(heji.getActualQuantity()+imProductReceiptMaterial2.getActualQuantity()); +// //合计单价 +// if(null==heji.getUnivalence()){ +// heji.setUnivalence(0.0); +// } +// if(null==imProductReceiptMaterial2.getUnivalence()){ +// imProductReceiptMaterial2.setUnivalence(0.0); +// } +// heji.setUnivalence(heji.getUnivalence()+imProductReceiptMaterial2.getUnivalence()); +// BigDecimal b = new BigDecimal(heji.getUnivalence()); +// double f1 = b.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue(); +// heji.setUnivalence(f1); +// //合计总价 +// if(null==heji.getTotalPrices()){ +// heji.setTotalPrices(0.0); +// } +// if(null==imProductReceiptMaterial2.getTotalPrices()){ +// imProductReceiptMaterial2.setTotalPrices(0.0); +// } +// heji.setTotalPrices(heji.getTotalPrices()+imProductReceiptMaterial2.getTotalPrices()); +// BigDecimal b2 = new BigDecimal(heji.getTotalPrices()); +// double f2 = b2.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue(); +// heji.setTotalPrices(f2); + + try { + if(null!=imProductReceiptMaterial2.getCheckoutTime()&&!"".equals(imProductReceiptMaterial2.getCheckoutTime())){ + imProductReceiptMaterial2.setCheckoutTime(sdf.parse(sdf.format(imProductReceiptMaterial2.getCheckoutTime()))); + } + if(null!=imProductReceiptMaterial2.getStorageDate()&&!"".equals(imProductReceiptMaterial2.getStorageDate())){ + imProductReceiptMaterial2.setStorageDate(sdf.parse(sdf.format(imProductReceiptMaterial2.getStorageDate()))); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } +// list.add(heji); + ExcelUtil util = new ExcelUtil(ImProductReceiptMaterialTwo.class); + return util.exportExcel(list, "imProductReceiptMaterial"); + } + + /** + * 获取物料产品入库单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceiptMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imProductReceiptMaterialService.selectImProductReceiptMaterialById(id)); + } + + /** + * 新增物料产品入库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceiptMaterial:add')") + @Log(title = "物料产品入库单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImProductReceiptMaterial imProductReceiptMaterial) + { + return toAjax(imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial)); + } + + /** + * 打印单据功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据, + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdft= new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(ids.length==0){ + return AjaxResult.error("请选择物料"); + } + List list = new ArrayList(); + Long i = 1L; + //遍历ids + for (Long id : ids) { + //根据id获取物料信息 + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(id); + productReceiptMaterial.setSerialNumber(i); + i++; + list.add(productReceiptMaterial); + } + //供应商名称 + String preferentialOriginName = ""; + //检验员 + String qualityInspector = ""; + //库管 + String kuguan = ""; + ImProductReceiptMaterial productReceiptMaterial = new ImProductReceiptMaterial(); + //遍历统计数量和金额 + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + if(null==preferentialOriginName||"".equals(preferentialOriginName)||"无".equals(preferentialOriginName)){ + if(null!=imProductReceiptMaterial.getPreferentialOriginName()){ + preferentialOriginName = imProductReceiptMaterial.getPreferentialOriginName(); + }else{ + preferentialOriginName = "无"; + } + }else{ + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if(!preferentialOriginName.equals(imProductReceiptMaterial.getPreferentialOriginName())){ + return AjaxResult.error("不同供应商不可合并打印"); + } + } + if(null!=imProductReceiptMaterial.getQualityInspector()){ + qualityInspector = imProductReceiptMaterial.getQualityInspector(); + }else{ + qualityInspector = "无"; + } + if(null!=imProductReceiptMaterial.getRecipient()){ + kuguan = imProductReceiptMaterial.getRecipient(); + }else{ + kuguan = "无"; + } + if(null==productReceiptMaterial.getActualQuantity()){ + productReceiptMaterial.setActualQuantity(0.0); + } + productReceiptMaterial.setActualQuantity(productReceiptMaterial.getActualQuantity()+imProductReceiptMaterial.getActualQuantity()); + if(null==productReceiptMaterial.getTotalPrices()){ + productReceiptMaterial.setTotalPrices(0.0); + } + DecimalFormat df = new DecimalFormat("#.00"); + productReceiptMaterial.setTotalPrices(Double.valueOf(df.format(productReceiptMaterial.getTotalPrices()+imProductReceiptMaterial.getTotalPrices()))); + } + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(productReceiptMaterial.getTotalPrices()+""); + productReceiptMaterial.setCode("合计金额:"); + productReceiptMaterial.setMaterialName(chinese); + list.add(productReceiptMaterial); +// //首先把数据集合生成excel,然后调用打印机打印excel +// // 创建excel文件 +// ExcelUtilPrint util = new ExcelUtilPrint(ImProductReceiptMaterial.class); +// //一级表头 +// String title = "河北伊特机械设备制造有限公司"; +// //二级表头 +// String titleTwo = "入库单"; +// //三级表头 +// String titleThree = "摘要: "+"日期: "+sdf.format(new Date())+" "+"编号: "+sdft.format(new Date()); +// //表尾 +// String footer = "库管: "+kuguan+" 经办: "+"检验员: "+qualityInspector+" 制单: "+user.getNickName(); +// AjaxResult result = util.exportExcel(list,"入库单",title,titleTwo,"供应商:"+preferentialOriginName,titleThree,footer); + //打印文件 + //获取文件路径 +// String filePath = RuoYiConfig.getDownloadPath() + result.get("msg"); +// File file = new File(filePath); +// boolean b = Print.printOfficeFile(file); +// if(b){ +// return AjaxResult.success(); +// }else{ +// return AjaxResult.error(); +// } + //返回获得到的入库单信息 + HashMap godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list); + //供应商 + godownMessage.put("preferentialOriginName",preferentialOriginName); + //检验员 + godownMessage.put("qualityInspector",qualityInspector); + //库管 + godownMessage.put("kuguan",kuguan); + //经办 + godownMessage.put("jingban",""); + //制单人员名称 + godownMessage.put("zhidan",user.getNickName()); + //制单日期 + godownMessage.put("zhidanDate",sdf.format(new Date())); + //编号 + godownMessage.put("number",sdft.format(new Date())); + //合计金额 + godownMessage.put("money",chinese); + //摘要 + godownMessage.put("zhaiyao"," "); + return AjaxResult.success("success",godownMessage); + } + + /** + * 打印单据功能(申请人打印) + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据, + */ + @RequestMapping("/printsProposer/{ids}") + public AjaxResult printsProposer(@PathVariable Long[] ids){ + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdft= new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(ids.length==0){ + return AjaxResult.error("请选择物料"); + } + List list = new ArrayList(); + Long i = 1L; + //遍历ids + for (Long id : ids) { + //根据id获取物料信息 + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(id); + productReceiptMaterial.setReceived(productReceiptMaterial.getActualQuantity()); + productReceiptMaterial.setSerialNumber(i); + i++; + list.add(productReceiptMaterial); + } + //供应商名称 + String preferentialOriginName = ""; + //检验员 + String qualityInspector = ""; + //库管 + String kuguan = ""; + ImProductReceiptMaterial productReceiptMaterial = new ImProductReceiptMaterial(); + //遍历统计数量和金额 + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + if(null==preferentialOriginName||"".equals(preferentialOriginName)||"无".equals(preferentialOriginName)){ + if(null!=imProductReceiptMaterial.getPreferentialOriginName()){ + preferentialOriginName = imProductReceiptMaterial.getPreferentialOriginName(); + }else{ + preferentialOriginName = "无"; + } + }else{ + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if(!preferentialOriginName.equals(imProductReceiptMaterial.getPreferentialOriginName())){ + return AjaxResult.error("不同供应商不可合并打印"); + } + } + if(null!=imProductReceiptMaterial.getQualityInspector()){ + qualityInspector = imProductReceiptMaterial.getQualityInspector(); + }else{ + qualityInspector = "无"; + } + if(null!=imProductReceiptMaterial.getRecipient()){ + kuguan = imProductReceiptMaterial.getRecipient(); + }else{ + kuguan = "无"; + } + if(null==productReceiptMaterial.getActualQuantity()){ + productReceiptMaterial.setActualQuantity(0.0); + } + productReceiptMaterial.setActualQuantity(productReceiptMaterial.getActualQuantity()+imProductReceiptMaterial.getActualQuantity()); + if(null==productReceiptMaterial.getTotalPrices()){ + productReceiptMaterial.setTotalPrices(0.0); + } + DecimalFormat df = new DecimalFormat("#.00"); + productReceiptMaterial.setTotalPrices(Double.valueOf(df.format(productReceiptMaterial.getTotalPrices()+imProductReceiptMaterial.getTotalPrices()))); + } + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(productReceiptMaterial.getTotalPrices()+""); + productReceiptMaterial.setCode("合计金额:"); + productReceiptMaterial.setMaterialName(chinese); + list.add(productReceiptMaterial); +// //首先把数据集合生成excel,然后调用打印机打印excel +// // 创建excel文件 +// ExcelUtilPrint util = new ExcelUtilPrint(ImProductReceiptMaterial.class); +// //一级表头 +// String title = "河北伊特机械设备制造有限公司"; +// //二级表头 +// String titleTwo = "入库单"; +// //三级表头 +// String titleThree = "摘要: "+"日期: "+sdf.format(new Date())+" "+"编号: "+sdft.format(new Date()); +// //表尾 +// String footer = "库管: "+kuguan+" 经办: "+"检验员: "+qualityInspector+" 制单: "+user.getNickName(); +// AjaxResult result = util.exportExcel(list,"入库单",title,titleTwo,"供应商:"+preferentialOriginName,titleThree,footer); + //打印文件 + //获取文件路径 +// String filePath = RuoYiConfig.getDownloadPath() + result.get("msg"); +// File file = new File(filePath); +// boolean b = Print.printOfficeFile(file); +// if(b){ +// return AjaxResult.success(); +// }else{ +// return AjaxResult.error(); +// } + //返回获得到的入库单信息 + HashMap godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list); + //供应商 + godownMessage.put("preferentialOriginName",preferentialOriginName); + //检验员 + godownMessage.put("qualityInspector",qualityInspector); + //库管 + godownMessage.put("kuguan",kuguan); + //经办 + godownMessage.put("jingban",""); + //制单人员名称 + godownMessage.put("zhidan",user.getNickName()); + //制单日期 + godownMessage.put("zhidanDate",sdf.format(new Date())); + //编号 + godownMessage.put("number",sdft.format(new Date())); + //合计金额 + godownMessage.put("money",chinese); + //摘要 + godownMessage.put("zhaiyao"," "); + return AjaxResult.success("success",godownMessage); + } + + + /** + * 修改物料产品入库单关联 + */ +// @PreAuthorize("@ss.hasPermi('management:imProductReceiptMaterial:edit')") +// @Log(title = "物料产品入库单关联", businessType = BusinessType.UPDATE) +// @PutMapping +// public AjaxResult edit(@RequestBody ImProductReceiptMaterial imProductReceiptMaterial){ +// //如果实收数量大于等于应收数量,把入库状态设置成入库已完成2,如果大于0且小于应收数量把状态设置为1正在入库 +// if(imProductReceiptMaterial.getReceivableQuantity()<=imProductReceiptMaterial.getActualQuantity()){ +// imProductReceiptMaterial.setInventoryStatus(2); +// }else if(imProductReceiptMaterial.getActualQuantity()>0&&imProductReceiptMaterial.getReceivableQuantity()>imProductReceiptMaterial.getActualQuantity()){ +// imProductReceiptMaterial.setInventoryStatus(1); +// } +// //修改实收数量 +// int i = imProductReceiptMaterialService.updateImProductReceiptMaterial(imProductReceiptMaterial); +// //添加库存明细 +// if(imProductReceiptMaterial.getActualQuantity()>0){ +// //先根据物料名称和规格型号查询库中是否有此物品,如果有直接修改其数量,如果没有则添加新数据 +// PwInventoryDetail pwInventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imProductReceiptMaterial.getMaterialName(),imProductReceiptMaterial.getSpecification()); +// //如果不等于null,说明库中有此物品,直接修改数量即可 +// if(null!=pwInventoryDetail){ +// //添加数量 +// pwInventoryDetail.setQuantity(imProductReceiptMaterial.getActualQuantity()); +// pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail); +// }else{ +// //说明有物料入库了,此时库存明细表中需记录库存数量 +// PwInventoryDetail inventoryDetail = new PwInventoryDetail(); +// //物品名称 +// inventoryDetail.setName(imProductReceiptMaterial.getMaterialName()); +// //规格型号 +// inventoryDetail.setTypeName(imProductReceiptMaterial.getSpecification()); +// //仓库id +// inventoryDetail.setWarehouseId(imProductReceiptMaterial.getWarehouseId()); +// //仓库名称 +// inventoryDetail.setWarehouseName(imProductReceiptMaterial.getWarehouseName()); +// //计量单位 +// inventoryDetail.setUnit(imProductReceiptMaterial.getUnit()); +// //数量 +// inventoryDetail.setQuantity(imProductReceiptMaterial.getActualQuantity()); +// //删除标记 +// inventoryDetail.setDelFlag(0); +// pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail); +// } +// } +// //获取入库单的id +// ImProductReceiptMaterial prm = new ImProductReceiptMaterial(); +// prm.setProductReceiptId(imProductReceiptMaterial.getProductReceiptId()); +// //获取当前合同的所有物料 +// List list = imProductReceiptMaterialService.selectImProductReceiptMaterialList(prm); +// //查询入库已完成的数据 +// prm = new ImProductReceiptMaterial(); +// prm.setProductReceiptId(imProductReceiptMaterial.getProductReceiptId()); +// prm.setInventoryStatus(2); +// List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(prm); +// //如果物料的数据集合等于入库已完成的数据集合,说明入库已全部完成 +// if(list.size()==list2.size()){ +// //根据入库单id查询入库单信息 +// ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptById(imProductReceiptMaterial.getProductReceiptId()); +// //获取入库单的合同编号 +// if(null!=productReceipt.getCode()){ +// //说明是销售合同 +// //根据code查询合同信息 +// PwContract pwContract2 = pwContractService.selectByContractCode(productReceipt.getCode()); +// //把合同状态置位2,已完成 +// pwContract2.setContractStatus(6); +// pwContractService.updatePwContract(pwContract2); +// }else if(null!=productReceipt.getWorksheetCode()){ +// //说明是外协合同 +// //根据code查询合同信息 +// PwOutsourcingContract pwOutsourcingContract = pwOutsourcingContractService.selectByOutsourcingContractCode(productReceipt.getWorksheetCode()); +// pwOutsourcingContract.setContractStatus(2); +// pwOutsourcingContractService.updatePwOutsourcingContract(pwOutsourcingContract); +// }else if(null!=productReceipt.getProductiveTaskCode()){ +// //说明是生产任务 +// // TODO +// } +// } +// return toAjax(i); +// } + + /** + * 修改物料产品入库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:imProductReceiptMaterial:edit')") + @Log(title = "物料产品入库单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImProductReceiptMaterial imProductReceiptMaterial){ + + if(imProductReceiptMaterial.getReceivableQuantity()productReceiptMaterial.getActualQuantity()){ +// return AjaxResult.error("申请数量不可大于原申请数量"); +// }else if(imProductReceiptMaterial.getActualQuantity() list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumbers(code, makeDocumentsDetail.getParentLevelName(), makeDocumentsDetail.getParentLevelFigureNumber()); + //截取当前物料的最后一个-之后的字符 + String specification = productReceiptMaterial.getSpecification(); + String string = specification.substring(specification.lastIndexOf("-")+1); + //如果最后一个字符的值等于list的长度,则代表是最后一道序,则处理它上级物料的库存数量及在途数量 + if(list.size()==Integer.valueOf(string)){ + //说明是最后一道序,需要把上级物料的信息也重置 + PwInventoryDetail inventoryDetails = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(makeDocumentsDetail.getParentLevelName(), makeDocumentsDetail.getParentLevelFigureNumber()); + if(null!=inventoryDetails){ + if(inventoryDetails.getQuantity()-productReceiptMaterial.getActualQuantity()<0){ + //重新计算库存数量 + inventoryDetails.setQuantity(0L); + }else{ + //重新计算库存数量 + inventoryDetails.setQuantity(inventoryDetails.getQuantity()-productReceiptMaterial.getActualQuantity().longValue()); + } + //重新计算在途数量 + //inventoryDetails.setPreliminaryInventory(inventoryDetails.getPreliminaryInventory()+productReceiptMaterial.getActualQuantity().longValue()); + //重新计算可用数量 + if(inventoryDetails.getQuantity()-inventoryDetails.getLockNumber()<0){ + inventoryDetails.setAvailableNumber(0L); + }else{ + inventoryDetails.setAvailableNumber(inventoryDetails.getQuantity()-inventoryDetails.getLockNumber()); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetails); + } + } + }else{ + //根据执行单code和物料名称和图号查询bomtwo表中当前物料的上级 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(code, productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //根据执行单code和图号和名称查询其所有子集 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumbers(code, pwBomNumberTwo.getParentLevelName(), pwBomNumberTwo.getParentLevelFigureNumber()); + //截取当前物料的最后一个-之后的字符 + String specification = productReceiptMaterial.getSpecification(); + String string = specification.substring(specification.lastIndexOf("-")+1); + //如果最后一个字符的值等于list的长度,则代表是最后一道序,则处理它上级物料的库存数量及在途数量 + if(list.size()==Integer.valueOf(string)){ + //说明是最后一道序,需要把上级物料的信息也重置 + PwInventoryDetail inventoryDetails = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(pwBomNumberTwo.getParentLevelName(), pwBomNumberTwo.getParentLevelFigureNumber()); + if(null!=inventoryDetails){ + if(inventoryDetails.getQuantity()-productReceiptMaterial.getActualQuantity()<0){ + //重新计算库存数量 + inventoryDetails.setQuantity(0L); + }else{ + //重新计算库存数量 + inventoryDetails.setQuantity(inventoryDetails.getQuantity()-productReceiptMaterial.getActualQuantity().longValue()); + } + //重新计算在途数量 + //inventoryDetails.setPreliminaryInventory(inventoryDetails.getPreliminaryInventory()+productReceiptMaterial.getActualQuantity().longValue()); + //重新计算可用数量 + if(inventoryDetails.getQuantity()-inventoryDetails.getLockNumber()<0){ + inventoryDetails.setAvailableNumber(0L); + }else{ + inventoryDetails.setAvailableNumber(inventoryDetails.getQuantity()-inventoryDetails.getLockNumber()); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetails); + } + } + } + } + } + return toAjax(i); + } + + /** + * 根据产品入库单id查询该入库单下所有的产品或物料 + * 参数:入库单id + */ +// @RequestMapping("/getProductReceiptMaterialList") +// public AjaxResult getProductReceiptMaterialList(Long id){ +// //根据此入库单id查询此入库单下所有的产品或半成品 +// ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); +// imProductReceiptMaterial.setProductReceiptId(id); +// List list = imProductReceiptMaterialService.selectImProductReceiptMaterialList(imProductReceiptMaterial); +// //如果小于1,说明是第一次查询,应该先根据入库单中的编号去查询 +// if(list.size()<1){ +// //根据入库单id查询入库单信息 +// ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptById(id); +// //判断入库单中合同编号和外协合同编号和生成任务编号,分别到不同的表中查询 +// if(null!=productReceipt.getCode()){ +// //说明是销售合同,根据code查询合同信息 +// PwContract pwContract = pwContractService.selectByContractCode(productReceipt.getCode()); +// //获取报价单id +// String quotationId = pwContract.getQuotationId(); +// //根据报价单id查询产品 +// PwProductQuotation pwProductQuotation = new PwProductQuotation(); +// pwProductQuotation.setQuotationId(Long.valueOf(quotationId)); +// List quotationList = pwProductQuotationService.selectPwProductQuotationList(pwProductQuotation); +// //把报价单中的产品添加到产品和入库单关联表中 +// for (PwProductQuotation pwProductQuotation2 : quotationList) { +// //创建产品和入库单关联对象 +// imProductReceiptMaterial = new ImProductReceiptMaterial(); +// //入库单id +// imProductReceiptMaterial.setProductReceiptId(id); +// //产品id +// imProductReceiptMaterial.setMaterialId(pwProductQuotation2.getProductId()); +// //产品名称 +// imProductReceiptMaterial.setMaterialName(pwProductQuotation2.getProductName()); +// //规格型号 +// imProductReceiptMaterial.setSpecification(pwProductQuotation2.getTypeName()); +// //收货仓库名称 +// imProductReceiptMaterial.setWarehouseName("成品库"); +// //计量单位 +// imProductReceiptMaterial.setUnit(pwProductQuotation2.getUnit()); +// //应收数量 +// imProductReceiptMaterial.setReceivableQuantity(pwProductQuotation2.getNumber()); +// //入库状态默认为未入库 +// imProductReceiptMaterial.setInventoryStatus(0); +// //删除标记0默认为未删除 +// imProductReceiptMaterial.setDelFlag(0); +// imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); +// } +// }else if(null!=productReceipt.getWorksheetCode()){ +// //说明是外协合同 +// //根据外协合同code查询外协合同信息 +// PwOutsourcingContract outsourcingContract = pwOutsourcingContractService.selectByOutsourcingContractCode(productReceipt.getWorksheetCode()); +// //根据外协合同id查询所有物料信息 +// PwOutsourcingContractMaterial pwOutsourcingContractMaterial = new PwOutsourcingContractMaterial(); +// pwOutsourcingContractMaterial.setOutsourcingContractId(outsourcingContract.getId()); +// List contractMaterialList = pwOutsourcingContractMaterialService.selectPwOutsourcingContractMaterialList(pwOutsourcingContractMaterial); +// for (PwOutsourcingContractMaterial pwOutsourcingContractMaterial2 : contractMaterialList) { +// //创建产品和入库单关联对象 +// imProductReceiptMaterial = new ImProductReceiptMaterial(); +// //入库单id +// imProductReceiptMaterial.setProductReceiptId(id); +// //产品id +// imProductReceiptMaterial.setMaterialId(pwOutsourcingContractMaterial2.getMaterialId()); +// //产品名称 +// imProductReceiptMaterial.setMaterialName(pwOutsourcingContractMaterial2.getMaterialName()); +// //规格型号 +// imProductReceiptMaterial.setSpecification(pwOutsourcingContractMaterial2.getTypeName()); +// //计量单位 +// imProductReceiptMaterial.setUnit(pwOutsourcingContractMaterial2.getUnit()); +// //应收数量 +// imProductReceiptMaterial.setReceivableQuantity(pwOutsourcingContractMaterial2.getQuantity()); +// //入库状态默认为未入库 +// imProductReceiptMaterial.setInventoryStatus(0); +// //删除标记0默认为未删除 +// imProductReceiptMaterial.setDelFlag(0); +// imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); +// } +// }else{ +// //说明是生产任务 +// //根据任务编号查询任务信息 +// PwTask pwTask = pwTaskService.selectPwTaskByTaskCode(productReceipt.getProductiveTaskCode()); +// //根据图号查询Bom表中的数据 +// String partGather = pwTask.getPartGather(); +// PwBom pwBom = new PwBom(); +// pwBom.setFigureNumber(partGather); +// List bomList = pwBomService.selectPwBomList(pwBom); +// +// //创建产品和入库单关联对象 +// imProductReceiptMaterial = new ImProductReceiptMaterial(); +// if(bomList.size()>0){ +// imProductReceiptMaterial.setMaterialName(bomList.get(0).getName()); +//// //计量单位 +//// imProductReceiptMaterial.setUnit(imMaterial.getUnitOfMeasurementName()); +// } +// //入库单id +// imProductReceiptMaterial.setProductReceiptId(id); +// //规格型号 +// imProductReceiptMaterial.setSpecification(pwTask.getPartGather()); +// //应收数量 +// imProductReceiptMaterial.setReceivableQuantity(pwTask.getQuantity()); +// //入库状态默认为未入库 +// imProductReceiptMaterial.setInventoryStatus(0); +// imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); +// } +// //添加完了之后再根据产品入库单查询一次,把数据返回 +// imProductReceiptMaterial = new ImProductReceiptMaterial(); +// imProductReceiptMaterial.setProductReceiptId(id); +// list = imProductReceiptMaterialService.selectImProductReceiptMaterialList(imProductReceiptMaterial); +// } +// return AjaxResult.success("成功",list); +// } + + /** + * 确认入库 + * @param ids + * @return + */ + @RequestMapping("/affirms/{ids}") + public AjaxResult affirms(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + + SysUser user = loginUser.getUser(); + for (Long id : ids) { + //根据id查询待入库物料的信息 + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(id); + //已经完成的执行单不允许再出入库 + if(!productReceiptMaterial.getCode().contains("QB")){ + //根据令号查询执行单状态 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(productReceiptMaterial.getCode()); + if(null!=productionBill&&productionBill.getStatus().equals("已完成")){ + return AjaxResult.error("已完成的执行单,不允许再入库,请联系生产部核实"); + } + } + //记录入库数量 + Long l = productReceiptMaterial.getActualQuantity().longValue(); + if("已入库".equals(productReceiptMaterial.getInventoryStatus())){ + return AjaxResult.error("不可重复入库"); + } + + //物料类型标记。标记是否是最后一序入库,如果是企标单中的最后一序,则int = 1,如果是执行单中的最后一序,则int = 2 + int ttr = 0; + + //判断是否是请购单且请购类型为原材料 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptById(productReceiptMaterial.getProductReceiptId()); + + //判断当前物料是否为二级物料,判断条件为名称中包函"(M)" + if(productReceiptMaterial.getMaterialName().contains("(M)")){ + //根据产品入库单id获取执行单code + ImProductReceipt productReceipt2 = imProductReceiptService.selectImProductReceiptById(productReceiptMaterial.getProductReceiptId()); + //获取执行单code + String code = productReceipt2.getMakeDocumentsCode(); + if(code.contains("QB")){ + //根据执行单code和物料名称和图号查询表中当前物料的上级 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(code, productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //根据执行单code和图号和名称查询其所有子集 +// List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumbers(code, makeDocumentsDetail.getParentLevelName(), makeDocumentsDetail.getParentLevelFigureNumber()); + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(code, makeDocumentsDetail.getSuperiorId()); + //截取当前物料的最后一个-之后的字符 + String specification = productReceiptMaterial.getSpecification(); + String string = specification.substring(specification.lastIndexOf("-")+1); + //如果最后一个字符的值等于list的长度,则代表是最后一道序,则处理它上级物料的库存数量及在途数量 + if(list.size()==Integer.valueOf(string)){ + ttr = 1; + //说明是最后一道序,需要处理当前物料的父级物料的数据 + //遍历其所有子集,获取其所有子集的未税单价,合并到父级本身 + //含税单价 + BigDecimal b = new BigDecimal("0"); + //未税单价 + BigDecimal wb = new BigDecimal("0"); + for (PwMakeDocumentsDetail PwMakeDocumentsDetail : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(PwMakeDocumentsDetail.getName(), PwMakeDocumentsDetail.getFigureNumber()); + //获取其含税单价 + BigDecimal univalence = inventoryDetail.getUnivalence(); + b = b.add(univalence); + //获取其未税单价 + BigDecimal unitPrice = inventoryDetail.getUnitPrice(); + wb = wb.add(unitPrice); + } + + //根据父级id查询父级信息 + PwMakeDocumentsDetail detail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(detail.getName(), detail.getFigureNumber()); + //查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(detail.getName(), detail.getFigureNumber()); + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //更新含税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(b)).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(b); + } + + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(wb)).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(wb); + } + + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //未查询到库存信息 + return AjaxResult.error("未查询到库存信息"); + } + //修改上级物料之后,也要修改当前物料本身的在途数量和锁定数量,未税单价 + PwInventoryDetail inventoryDetails = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //查询物料信息 + ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if(null!=inventoryDetails){ + //增加库存数量 +// inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if(inventoryDetails.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetails.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetails.setPreliminaryInventory(inventoryDetails.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + //减少预定数量 + if(inventoryDetails.getLockNumber()-productReceiptMaterial.getActualQuantity()<0){ + inventoryDetails.setLockNumber(0L); + }else{ + inventoryDetails.setLockNumber(inventoryDetails.getLockNumber()-productReceiptMaterial.getActualQuantity().longValue()); + } + //更新未税单价(平均价格) + if(inventoryDetails.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetails.setUnivalence((inventoryDetails.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetails.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + + //仓库名称 + inventoryDetails.setWarehouseName(material2.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetails); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + + } + }else{ + //是二级物料,但不是最后一道序 + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //查询物料信息 + ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //更新含税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + + //仓库名称 + inventoryDetail.setWarehouseName(material2.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + + } + } + }else{ + //根据执行单code和物料名称和图号查询bomtwo表中当前物料的上级 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(code, productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //根据执行单code和图号和名称查询其所有子集 +// pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumbers(code, pwBomNumberTwo.getParentLevelName(), pwBomNumberTwo.getParentLevelFigureNumber()); + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(code, pwBomNumberTwo.getSuperiorId()); + //截取当前物料的最后一个-之后的字符 + String specification = productReceiptMaterial.getSpecification(); + String string = specification.substring(specification.lastIndexOf("-")+1); + //如果最后一个字符的值等于list的长度,则代表是最后一道序,则处理它上级物料的库存数量及在途数量 + if(list.size()==Integer.valueOf(string)){ + ttr = 2; + //说明是最后一道序,需要处理当前物料的父级物料的数据 + //遍历其所有子集,获取其所有子集的未税单价,合并到父级本身 + BigDecimal b = new BigDecimal("0"); + //未税单价 + BigDecimal wb = new BigDecimal("0"); + for (PwBomNumberTwo pwBomNumberTwo2 : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + //获取其未税单价 + BigDecimal univalence = inventoryDetail.getUnivalence(); + b = b.add(univalence); + BigDecimal unitPrice = inventoryDetail.getUnitPrice(); + wb = wb.add(unitPrice); + } + + //根据父级id查询父级信息 + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getSuperiorId()); + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(numberTwo.getName(), numberTwo.getFigureNumber()); + //查询物料信息 + ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(numberTwo.getName(), numberTwo.getFigureNumber()); + + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //更新未税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(b)).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(b); + } + + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(wb)).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(wb); + } + + //仓库名称 + inventoryDetail.setWarehouseName(material2.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //未查询到库存信息 + return AjaxResult.error("未查询到库存信息"); + } + //修改上级物料之后,也要修改当前物料本身的在途数量和锁定数量,未税单价 + PwInventoryDetail inventoryDetails = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if(null!=inventoryDetails){ + //增加库存数量 +// inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if(inventoryDetails.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetails.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetails.setPreliminaryInventory(inventoryDetails.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + //减少预定数量 + if(inventoryDetails.getLockNumber()-productReceiptMaterial.getActualQuantity()<0){ + inventoryDetails.setLockNumber(0L); + }else{ + inventoryDetails.setLockNumber(inventoryDetails.getLockNumber()-productReceiptMaterial.getActualQuantity().longValue()); + } + //更新含税单价(平均价格) + if(inventoryDetails.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetails.setUnivalence((inventoryDetails.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetails.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + + //仓库名称 + inventoryDetails.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetails); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + + } + }else{ + //是二级物料,但不是最后一道序 + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //更新未税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + + } + } + } + }else{ + //物料不是二级物料,则直接入库 + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + + if(productReceipt.getMakeDocumentsCode().contains("QG")){ + //判断入库物料是否为 + if("原材料".equals(material.getMaterialTypeName())){ + //判断入库单物料类型(如果入库单中的类型为Kg,且物料类型为毫米的,则把Kg转为毫米,总重/物料单重,物料单重为每米重量) + if(productReceiptMaterial.getUnit().equals("米")){ + //计算数量 + Long d = (long) (productReceiptMaterial.getActualQuantity() * 1000); + //重量转为毫米,作为库存数量保存 + if(null!=inventoryDetail){ + //增加库存数量(转换米和平方米为毫米和平方毫米) + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+(long)d); + if(null==inventoryDetail.getTheoryQuantity()){ + inventoryDetail.setTheoryQuantity(0.0); + } + //增加库存重量 + inventoryDetail.setTheoryQuantity(inventoryDetail.getTheoryQuantity()+productReceiptMaterial.getPracticalNumber()); + /*if(inventoryDetail.getPreliminaryInventory()-d<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-d); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //当前入库数据有单价,在加权平均,如果单价不为0则加权平均 + if(productReceiptMaterial.getUnivalence()>0){ + //更新含税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + + //更新单位单价 + //计算每米单价 + Double s = productReceiptMaterial.getTotalPrices()/productReceiptMaterial.getActualQuantity(); + + if(inventoryDetail.getUnitUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitUnivalence((inventoryDetail.getUnitUnivalence().add(BigDecimal.valueOf(s))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitUnivalence(BigDecimal.valueOf(s)); + } + } + + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //新增库存信息 + PwInventoryDetail inventoryDetail2 = new PwInventoryDetail(); + //名称 + inventoryDetail2.setName(productReceiptMaterial.getMaterialName()); + //图号 + inventoryDetail2.setFigureNumber(productReceiptMaterial.getSpecification()); + //材料 + inventoryDetail2.setMaterials(productReceiptMaterial.getMaterialType()); + //单价 + inventoryDetail2.setUnivalence(new BigDecimal(productReceiptMaterial.getUnivalence())); + //未税单价 + inventoryDetail2.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnitPrice())); + //数量 + inventoryDetail2.setQuantity(productReceiptMaterial.getActualQuantity().longValue()); + //实际重量 + inventoryDetail2.setTheoryQuantity(productReceiptMaterial.getPracticalNumber()); + //删除标记 + inventoryDetail2.setDelFlag(0); + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail2); + } + + }else if(productReceiptMaterial.getUnit().equals("平方米")){ + //如果为支,则支转为毫米作为库存数量保存 + long s = (long) (productReceiptMaterial.getActualQuantity() * 1000000); + //重量转为毫米,作为库存数量保存 + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity() + s); + if(null==inventoryDetail.getTheoryQuantity()){ + inventoryDetail.setTheoryQuantity(0.0); + } + //增加库存重量 + inventoryDetail.setTheoryQuantity(inventoryDetail.getTheoryQuantity()+productReceiptMaterial.getPracticalNumber()); + /*if(inventoryDetail.getPreliminaryInventory()- s < 0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()- s); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + + //当前入库数据有单价,在加权平均,如果单价不为0则加权平均 + if(productReceiptMaterial.getUnivalence()>0){ + //更新未税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + + //更新单位单价 + //计算每平方米单价 + Double d = productReceiptMaterial.getTotalPrices()/productReceiptMaterial.getActualQuantity(); + + if(inventoryDetail.getUnitUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitUnivalence((inventoryDetail.getUnitUnivalence().add(BigDecimal.valueOf(d))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitUnivalence(BigDecimal.valueOf(d)); + } + } + + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //新增库存信息 + PwInventoryDetail inventoryDetail2 = new PwInventoryDetail(); + //名称 + inventoryDetail2.setName(productReceiptMaterial.getMaterialName()); + //图号 + inventoryDetail2.setFigureNumber(productReceiptMaterial.getSpecification()); + //材料 + inventoryDetail2.setMaterials(productReceiptMaterial.getMaterialType()); + //单价 + inventoryDetail2.setUnivalence(new BigDecimal(productReceiptMaterial.getUnivalence())); + //未税单价 + inventoryDetail2.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnitPrice())); + //数量 + inventoryDetail2.setQuantity(productReceiptMaterial.getActualQuantity().longValue()); + //实际重量 + inventoryDetail2.setTheoryQuantity(productReceiptMaterial.getPracticalNumber()); + //删除标记 + inventoryDetail2.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail2); + } + + }else{ + //重量转为毫米,作为库存数量保存 + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + if(null==inventoryDetail.getTheoryQuantity()){ + inventoryDetail.setTheoryQuantity(0.0); + } + //增加库存重量 + inventoryDetail.setTheoryQuantity(inventoryDetail.getTheoryQuantity()+productReceiptMaterial.getPracticalNumber()); + /*if(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + + //当前入库数据有单价,在加权平均,如果单价不为0则加权平均 + if(productReceiptMaterial.getUnivalence()>0){ + //更新未税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + + //更新单位单价 + //计算每件单价 + Double d = productReceiptMaterial.getTotalPrices()/productReceiptMaterial.getActualQuantity(); + + if(inventoryDetail.getUnitUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitUnivalence((inventoryDetail.getUnitUnivalence().add(BigDecimal.valueOf(d))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitUnivalence(BigDecimal.valueOf(d)); + } + } + + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //新增库存信息 + PwInventoryDetail inventoryDetail2 = new PwInventoryDetail(); + //名称 + inventoryDetail2.setName(productReceiptMaterial.getMaterialName()); + //图号 + inventoryDetail2.setFigureNumber(productReceiptMaterial.getSpecification()); + //材料 + inventoryDetail2.setMaterials(productReceiptMaterial.getMaterialType()); + //含税单价 + inventoryDetail2.setUnivalence(new BigDecimal(productReceiptMaterial.getUnivalence())); + //未税单价 + inventoryDetail2.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnitPrice())); + //数量 + inventoryDetail2.setQuantity(productReceiptMaterial.getActualQuantity().longValue()); + //实际重量 + inventoryDetail2.setTheoryQuantity(productReceiptMaterial.getPracticalNumber()); + //删除标记 + inventoryDetail2.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail2); + } + } + }else{ + //说明是易耗品或者其他,总之不是原材料 + //判断是否是有比例数值 + if(null!=material.getProportion()&&material.getProportion()>1){ + //1:多 + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+(productReceiptMaterial.getActualQuantity().longValue()*material.getProportion())); + if(null==inventoryDetail.getTheoryQuantity()){ + inventoryDetail.setTheoryQuantity(0.0); + } + //增加库存重量 +// inventoryDetail.setTheoryQuantity(inventoryDetail.getTheoryQuantity()+productReceiptMaterial.getPracticalNumber()); + /*if(inventoryDetail.getPreliminaryInventory()-(productReceiptMaterial.getActualQuantity()*material.getProportion())<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-(productReceiptMaterial.getActualQuantity().longValue()*material.getProportion())); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + if(productReceiptMaterial.getUnivalence()>0){ + //更新未税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + } + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //新增库存信息 + PwInventoryDetail inventoryDetail2 = new PwInventoryDetail(); + //名称 + inventoryDetail2.setName(productReceiptMaterial.getMaterialName()); + //图号 + inventoryDetail2.setFigureNumber(productReceiptMaterial.getSpecification()); + //材料 + inventoryDetail2.setMaterials(productReceiptMaterial.getMaterialType()); + //单价 + inventoryDetail2.setUnivalence(new BigDecimal(productReceiptMaterial.getUnivalence())); + //未税单价 + inventoryDetail2.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnitPrice())); + //数量 + inventoryDetail2.setQuantity(productReceiptMaterial.getActualQuantity().longValue()*material.getProportion()); + //实际重量 +// inventoryDetail2.setTheoryQuantity(productReceiptMaterial.getPracticalNumber()); + //删除标记 + inventoryDetail2.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail2); + } + }else{ + //1:1 + //重量转为毫米,作为库存数量保存 + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + if(null==inventoryDetail.getTheoryQuantity()){ + inventoryDetail.setTheoryQuantity(0.0); + } + //增加库存重量 +// inventoryDetail.setTheoryQuantity(inventoryDetail.getTheoryQuantity()+productReceiptMaterial.getPracticalNumber()); + /*if(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + if(productReceiptMaterial.getUnivalence()>0){ + //更新含税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + } + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //新增库存信息 + PwInventoryDetail inventoryDetail2 = new PwInventoryDetail(); + //名称 + inventoryDetail2.setName(productReceiptMaterial.getMaterialName()); + //图号 + inventoryDetail2.setFigureNumber(productReceiptMaterial.getSpecification()); + //材料 + inventoryDetail2.setMaterials(productReceiptMaterial.getMaterialType()); + //单价 + inventoryDetail2.setUnivalence(new BigDecimal(productReceiptMaterial.getUnivalence())); + //未税单价 + inventoryDetail2.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnitPrice())); + //数量 + inventoryDetail2.setQuantity(productReceiptMaterial.getActualQuantity().longValue()); + //实际重量 + inventoryDetail2.setTheoryQuantity(productReceiptMaterial.getPracticalNumber()); + //删除标记 + inventoryDetail2.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail2); + } + } + } + }else{ + if(null!=inventoryDetail){ + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity()<0){ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + }else{ + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + }else{ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //当单价不为0时才加权平均 + if(productReceiptMaterial.getUnivalence()>0){ + //更新含税单价(平均价格) + if(inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + + if(null!=productReceiptMaterial.getUnitPrice()){ + //更新未税单价 + if(inventoryDetail.getUnitPrice().compareTo(BigDecimal.ZERO) != 0){ + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnitPrice((inventoryDetail.getUnitPrice().add(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice()))).divide(BigDecimal.valueOf(2))); + }else{ + inventoryDetail.setUnitPrice(BigDecimal.valueOf(productReceiptMaterial.getUnitPrice())); + } + } + } + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //新增库存信息 + PwInventoryDetail inventoryDetail2 = new PwInventoryDetail(); + //名称 + inventoryDetail2.setName(productReceiptMaterial.getMaterialName()); + //图号 + inventoryDetail2.setFigureNumber(productReceiptMaterial.getSpecification()); + //材料 + inventoryDetail2.setMaterials(productReceiptMaterial.getMaterialType()); + //单价 + inventoryDetail2.setUnivalence(new BigDecimal(productReceiptMaterial.getUnivalence())); + //未税单价 + inventoryDetail2.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnitPrice())); + //数量 + inventoryDetail2.setQuantity(productReceiptMaterial.getActualQuantity().longValue()); + //实际重量 + inventoryDetail2.setTheoryQuantity(productReceiptMaterial.getPracticalNumber()); + //删除标记 + inventoryDetail2.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail2); + } + } + } + //判断实收数量是否等于应收数量,如果等于则把入库状态修改为已入库,否则修改为正在入库 + if(productReceiptMaterial.getActualQuantity().longValue()==productReceiptMaterial.getReceivableQuantity().longValue()){ + productReceiptMaterial.setInventoryStatus("已入库"); + }else{ + productReceiptMaterial.setInventoryStatus("正在入库"); + //得到计量单位 + List list_jldw = imMeteringUnitService.selectImMeteringUnitList(null); + for (ImMeteringUnit jldw : list_jldw) { + if (jldw.getUnitName().equals(productReceiptMaterial.getUnit())) { + productReceiptMaterial.setUnit(jldw.getId().toString()); + } + } + } + productReceiptMaterial.setStorageDate(new Date()); + //已收数量则修改为实收数量 + productReceiptMaterial.setReceived(productReceiptMaterial.getReceived()+productReceiptMaterial.getActualQuantity()); + //实收数量修改为应收数量-已收数量 +// productReceiptMaterial.setActualQuantity(productReceiptMaterial.getReceivableQuantity()-productReceiptMaterial.getReceived()); + if(null!=productReceiptMaterial.getUnivalence()){ + if(null!=productReceiptMaterial.getPracticalNumber()&&productReceiptMaterial.getPracticalNumber().longValue()!=0){ + //计算总价(单价*已收数量) + productReceiptMaterial.setTotalPrices(productReceiptMaterial.getUnivalence()*productReceiptMaterial.getPracticalNumber()); + }else{ + //计算总价(单价*已收数量) + productReceiptMaterial.setTotalPrices(productReceiptMaterial.getUnivalence()*productReceiptMaterial.getReceived()); + } + } + //接收人 + productReceiptMaterial.setRecipient(user.getNickName()); + //修改数据 + int i = imProductReceiptMaterialService.updateImProductReceiptMaterial(productReceiptMaterial); + if(i<1){ + return AjaxResult.error("入库失败"); + } + //修改预制单详情中的入库状态 + //ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptById(productReceiptMaterial.getProductReceiptId()); + //获取企标号 + String makeDocumentsCode = productReceipt.getMakeDocumentsCode(); + String[] split = makeDocumentsCode.split("-"); + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(makeDocumentsCode); + int s = 0; + //判断是企标单还是执行单 + if(!split[0].equals("QB")&&!makeDocumentsCode.contains("CG")&&!makeDocumentsCode.contains("YG")&&!makeDocumentsCode.contains("QG")&&!makeDocumentsCode.contains("JT")){ + //根据令号和物料名称及图号查询bom表的物料,修改其入库状态 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(makeDocumentsCode,productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(pwBomNumberTwo.getName()); + //图号 + im.setSpecification(pwBomNumberTwo.getFigureNumber()); + //材料 + im.setMaterialType(pwBomNumberTwo.getType()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + //说明是执行单 + if(null!=pwBomNumberTwo){ + //判断当前物料的已收数量是否等于应收数量,如果相等则说明已全部入库 + if(s == pwBomNumberTwo.getSumNumber() ){ + pwBomNumberTwo.setInventoryStatus("已入库"); + } + int j = pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + + if(null!=productReceiptMaterial.getSparedFour()&&!"".equals(productReceiptMaterial.getSparedFour())){ + //查询外协合同详情明细 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(productReceiptMaterial.getSparedFour()); + if(null!=outsourceContractDetail){ + //判断入库数量是否等于了本批数量 + if(s == outsourceContractDetail.getQuantity()){ + outsourceContractDetail.setAccomplishStatus("已完成"); + outsourceContractDetail.setAccomplishQuantity((long)s); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + + //根据当前合同信息查询当前合同下,所有的物料是否全部已完成,如果已完成,则修改合同的状态 + PwOutsourceContract contract = pwOutsourceContractService.selectPwOutsourceContractById(outsourceContractDetail.getOutsourceContractId()); + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByOutsourceContractId(outsourceContractDetail.getOutsourceContractId()); + int t = 0; + for (PwOutsourceContractDetail pwOutsourceContractDetail : list) { + if(!"已完成".equals(pwOutsourceContractDetail.getAccomplishStatus())){ + t = 1; + } + } + //说明当前合同下所有的零件都完成了 + if(t == 0){ + contract.setContractStatus("已完成"); + pwOutsourceContractService.updatePwOutsourceContract(contract); + } + } + } + } + + //判断当前物料是否是成品(没有上级名称和上级图号的物料则认为是成品),如果是成品,则生产完工通知单 + if(null!=pwBomNumberTwo.getSparedFive()&&100==pwBomNumberTwo.getSparedFive()){ + //查询父级 + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getSuperiorId()); + + //获取执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(numberTwo.getProductionCode()); + + //获取生产订单编号 + String code = productionBill.getContractCode(); + + PwContract pwContract = new PwContract(); + if(code.contains("PD")){ + pwContract = pwContractService.selectByContractCode(code); + }else{ + //根据生产订单编号查询合同 + PwProductionOrder productionOrder = pwProductionOrderService.selectPwProductionOrderByCode(code); + //根据合同号查询当前合同的业务员 + pwContract = pwContractService.selectByContractCode(productionOrder.getSparedOne()); + } + + String salesman = ""; + if(null!=pwContract){ + salesman = pwContract.getSalesman(); + } + if(null==salesman){ + salesman = ""; + } + //根据令号和图号查询发运单明细中是否有了此产品,如果有,则把库存数量加到上边,如果没有,则新建一条数据 + PwLetterOfAdviceProduct letterOfAdviceProduct = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductByCodeAndFigureNumber(numberTwo.getProductionCode(),numberTwo.getSparedOne()); + if(null!=letterOfAdviceProduct){ + letterOfAdviceProduct.setQuantity(letterOfAdviceProduct.getQuantity()+l); + pwLetterOfAdviceProductService.updatePwLetterOfAdviceProduct(letterOfAdviceProduct); + }else{ + PwLetterOfAdviceProduct pwLetterOfAdviceProduct = new PwLetterOfAdviceProduct(); + //执行单令号 + pwLetterOfAdviceProduct.setProductionBillCode(numberTwo.getProductionCode()); + //产品型号 + pwLetterOfAdviceProduct.setProductType(numberTwo.getSparedOne()); + if(numberTwo.getFigureNumber().contains("(L+R)")){ + //如果图号中包函L+R或者括号L+R则一律替换为R+L + String replaceAll = numberTwo.getFigureNumber().replaceAll("\\(L\\+R\\)", "R\\+L"); + numberTwo.setFigureNumber(replaceAll); + } + if(numberTwo.getFigureNumber().contains("(R+L)")){ + //如果图号中包函L+R或者括号L+R则一律替换为R+L + numberTwo.setFigureNumber(numberTwo.getFigureNumber().replaceAll("\\(R\\+L\\)", "R\\+L")); + } + if(numberTwo.getFigureNumber().contains("L+R")){ + //如果图号中包函L+R或者括号L+R则一律替换为R+L + numberTwo.setFigureNumber(numberTwo.getFigureNumber().replaceAll("L\\+R", "R\\+L")); + } + //根据执行单id查询和型号查询执行单明细表 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductByProductionBillIdAndName(productionBill.getId(),numberTwo.getSparedOne()); + //应发数量(根据令号查询执行单,获取执行单中的合同code,根据合同code获取报价单id,根据报价单id查询型号及数量) + pwLetterOfAdviceProduct.setNumber(productionBillProduct.getQuantity()); + //已发数量,初始值为0 + pwLetterOfAdviceProduct.setSentNumber(0L); + //设备编号 + pwLetterOfAdviceProduct.setEquipmentNumber(productionBillProduct.getEquipmentCode()); + //库存数量 + pwLetterOfAdviceProduct.setQuantity(l); + //生成完工通知单 + pwLetterOfAdviceProductService.insertPwLetterOfAdviceProduct(pwLetterOfAdviceProduct); + } + + + //查询是否当前令号下的成品都已经入库,如果都已经入库,则关闭当前执行单 + List list = pwBomNumberTwoService.selectbycodeAndSparedFive(pwBomNumberTwo.getProductionCode(),100); + int p = 0; + for (PwBomNumberTwo pwBomNumberTwo2 : list) { + if(!"已入库".equals(pwBomNumberTwo2.getInventoryStatus())){ + p = 1; + } + } + //如果p = 0 时,说明没有不入库的了,全部已经入库,则关闭执行单 + if(p == 0){ + PwProductionBill bill = pwProductionBillService.selectPwProductionBillByProductionCode(pwBomNumberTwo.getProductionCode()); + bill.setStatus("已完成"); + pwProductionBillService.updatePwProductionBill(bill); + } + + //通知销售内勤,入库的信息 + //根据申请人名称查询 + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("销售内勤"); + if(null!=userEmail){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + //拼接邮件内容 + String content = "入库信息:"+"\n
"+"合同编号:"+pwContract.getContractCode()+"\n
"+"相关销售员:"+salesman+"\n
"+"生产令号:"+productReceiptMaterial.getCode()+"\n
"+"产品名称:"+numberTwo.getName()+ + "\n
"+"产品图号:"+numberTwo.getFigureNumber()+"\n
"+"应收数量:"+productReceiptMaterial.getReceivableQuantity().longValue()+"台"+ + "\n
"+"实收数量:"+productReceiptMaterial.getReceived().longValue()+"台"+ + "\n
"+"库管员:"+productReceiptMaterial.getRecipient()+"\n
"+"入库时间:"+sdf.format(new Date())+"\n
"+"已入库完毕,等待发运"; + + SendEmail send = new SendEmail(); + try { + send.sendEmail("成品入库通知",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + } + if(j<1){ + return AjaxResult.error("入库失败"); + } + } + }else if(makeDocumentsCode.contains("CG")){ + //说明是采购单 + //根据采购合同code查询 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractByCode(makeDocumentsCode); + //根据令号和物料名称及图号查询采购列表的物料,修改其入库状态 + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractIdAndNameAndFigureNumber(purchaseContract.getId(),productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(purchaseContractMaterial.getMaterialName()); + //图号 + im.setSpecification(purchaseContractMaterial.getFigureNumber()); + //材料 + im.setMaterialType(purchaseContractMaterial.getMaterials()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + if(null!=purchaseContractMaterial){ + if(s == purchaseContractMaterial.getAmount()){ + purchaseContractMaterial.setInventoryStatus("已入库"); + } + int j = pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(purchaseContractMaterial); + if(j<1){ + return AjaxResult.error("入库失败"); + } + } + int o = 0; + List purchaseContractId = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractId(purchaseContract.getId()); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial : purchaseContractId) { + if(("已入库").equals(pwPurchaseContractMaterial.getInventoryStatus())){ + o = 1; + }else{ + o = 0; + } + } + if(o==1){ + purchaseContract.setContractStatus(2L); + pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + } + //修改Bom表中的入库状态 + //根据令号和物料名称及图号查询bom表的物料,修改其入库状态 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(productReceiptMaterial.getCode(),productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + if(null!=pwBomNumberTwo){ + if(s == pwBomNumberTwo.getSumNumber()){ + pwBomNumberTwo.setInventoryStatus("已入库"); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + } + }else if(makeDocumentsCode.contains("QG")){ + //说明是请购单 + //根据采购合同code查询 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionByCode(makeDocumentsCode); + + //如果采购合同查询为null,则查询采购合同2表信息 + if(null==buyingRequisition){ + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoByCode(makeDocumentsCode); + //根据令号和物料名称及图号查询采购列表的物料,修改其入库状态 + PwBuyingRequisitionMaterialTwo buyingRequisitionMaterialTwo = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionIdAndName(buyingRequisitionTwo.getId(),productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(buyingRequisitionMaterialTwo.getMaterialName()); + //图号 + im.setSpecification(buyingRequisitionMaterialTwo.getFigureNumber()); + //材料 + im.setMaterialType(buyingRequisitionMaterialTwo.getMaterials()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + if(null!=buyingRequisitionMaterialTwo){ + if(s == buyingRequisitionMaterialTwo.getNumber()){ + buyingRequisitionMaterialTwo.setInventoryStatus("已入库"); + } + int j = pwBuyingRequisitionMaterialTwoService.updatePwBuyingRequisitionMaterialTwo(buyingRequisitionMaterialTwo); + if(j<1){ + return AjaxResult.error("入库失败"); + } + } + //判断当前请购单是否已全部入库 + int r = 0; + List list = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(buyingRequisitionMaterialTwo.getBuyingRequisitionId()); + for (PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo : list) { + if(!pwBuyingRequisitionMaterialTwo.getInventoryStatus().equals("已入库")){ + r = 1; + } + } + if(r == 0){ + //修改请购单状态 + buyingRequisitionTwo.setStatus(3); + pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + } + }else{ + //根据令号和物料名称及图号查询采购列表的物料,修改其入库状态 + PwBuyingRequisitionMaterial buyingRequisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(buyingRequisition.getId(),productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(buyingRequisitionMaterial.getMaterialName()); + //图号 + im.setSpecification(buyingRequisitionMaterial.getFigureNumber()); + //材料 + im.setMaterialType(buyingRequisitionMaterial.getMaterials()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + if(null!=buyingRequisitionMaterial){ + if(s == buyingRequisitionMaterial.getNumber()){ + buyingRequisitionMaterial.setInventoryStatus("已入库"); + } + int j = pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(buyingRequisitionMaterial); + if(j<1){ + return AjaxResult.error("入库失败"); + } + } + } + if(null!=buyingRequisition){ + int o = 0; + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(buyingRequisition.getId()); + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial : list) { + if(("已入库").equals(pwBuyingRequisitionMaterial.getInventoryStatus())){ + o = 1; + }else{ + o = 0; + } + } + if(o==1){ + buyingRequisition.setStatus(2); + pwBuyingRequisitionService.updatePwBuyingRequisition(buyingRequisition); + } + } + //修改Bom表中的入库状态 + //根据令号和物料名称及图号查询bom表的物料,修改其入库状态 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(productReceiptMaterial.getCode(),productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + if(null!=pwBomNumberTwo){ + if(s == pwBomNumberTwo.getSumNumber()){ + pwBomNumberTwo.setInventoryStatus("已入库"); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + } + + if(null!=productReceiptMaterial.getSparedFour()&&!"".equals(productReceiptMaterial.getSparedFour())){ + //查询外协合同详情明细 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(productReceiptMaterial.getSparedFour()); + if(null!=outsourceContractDetail){ + //判断入库数量是否等于了本批数量 + if(s == outsourceContractDetail.getQuantity()){ + outsourceContractDetail.setAccomplishStatus("已完成"); + outsourceContractDetail.setAccomplishQuantity((long)s); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + + //根据当前合同信息查询当前合同下,所有的物料是否全部已完成,如果已完成,则修改合同的状态 + PwOutsourceContract contract = pwOutsourceContractService.selectPwOutsourceContractById(outsourceContractDetail.getOutsourceContractId()); + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByOutsourceContractId(outsourceContractDetail.getOutsourceContractId()); + int t = 0; + for (PwOutsourceContractDetail pwOutsourceContractDetail : list) { + if(!"已完成".equals(pwOutsourceContractDetail.getAccomplishStatus())){ + t = 1; + } + } + //说明当前合同下所有的零件都完成了 + if(t == 0){ + contract.setContractStatus("已完成"); + pwOutsourceContractService.updatePwOutsourceContract(contract); + } + } + } + } + + }else if(makeDocumentsCode.contains("YG")){ + //说明是外购件预采购单 + //根据采购合同code查询 + PwPredictPurchase purchase = pwPredictPurchaseService.selectPwPredictPurchaseByCode(makeDocumentsCode); + //如果采购合同查询为null,则查询采购合同2表信息 + if(null!=purchase){ + PwPredictPurchaseTwo predictPurchaseTwo = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoByIdAndNameAndFigureNumber(purchase.getId(),productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(predictPurchaseTwo.getMaterialName()); + //图号 + im.setSpecification(predictPurchaseTwo.getFigureNumber()); + //材料 + im.setMaterialType(predictPurchaseTwo.getMaterials()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + if(null!=predictPurchaseTwo){ + if(s == predictPurchaseTwo.getNumber()){ + predictPurchaseTwo.setInventoryStatus("已入库"); + } + int j = pwPredictPurchaseTwoService.updatePwPredictPurchaseTwo(predictPurchaseTwo); + if(j<1){ + return AjaxResult.error("入库失败"); + } + } + //判断当前请购单是否已全部入库 + int r = 0; + List list = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoByPredictPurchaseId(predictPurchaseTwo.getPredictPurchaseId()); + for (PwPredictPurchaseTwo pwPredictPurchaseTwo : list) { + if(!pwPredictPurchaseTwo.getInventoryStatus().equals("已入库")){ + r = 1; + } + } + if(r == 0){ + //修改请购单状态 + purchase.setStatus("已入库"); + pwPredictPurchaseService.updatePwPredictPurchase(purchase); + } + } + }else if(makeDocumentsCode.contains("JT")){ + //修改借条的状态 + PwMaterialBorrowInfo pwMaterialBorrowInfo = new PwMaterialBorrowInfo(); + pwMaterialBorrowInfo.setSparedTwo(makeDocumentsCode); + List list2 = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoList(pwMaterialBorrowInfo); + for (PwMaterialBorrowInfo pwMaterialBorrowInfo2 : list2) { + pwMaterialBorrowInfo2.setStatus("已归还"); + pwMaterialBorrowInfoService.updatePwMaterialBorrowInfo(pwMaterialBorrowInfo2); + } + }else{ + //根据企标号和物料名称及图号查询预制单详情中的物料,修改其入库状态 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(makeDocumentsCode,productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(makeDocumentsDetail.getName()); + //图号 + im.setSpecification(makeDocumentsDetail.getFigureNumber()); + //材料 + im.setMaterialType(makeDocumentsDetail.getMaterialType()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + if(null!=makeDocumentsDetail){ + if(s == makeDocumentsDetail.getQuantity()){ + makeDocumentsDetail.setInventoryStatus("已入库"); + } + int j = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + //查询当前物料信息的单据下的所有信息,判断是否已全部入库,如果已全部入库,则把单据状态改为已入库,否则改为正在入库 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCode(makeDocumentsDetail.getMakeDocumentsCode()); + int o = 0; + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + if(("已入库").equals(pwMakeDocumentsDetail.getInventoryStatus())){ + o = 1; + }else{ + o = 0; + } + } + //说明已全部入库,修改单据状态 + PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(makeDocumentsDetail.getMakeDocumentsCode()); + if(o==1){ + makeDocuments.setStatus("已入库"); + pwMakeDocumentsService.updatePwMakeDocuments(makeDocuments); + }else{ + makeDocuments.setStatus("正在入库"); + pwMakeDocumentsService.updatePwMakeDocuments(makeDocuments); + } + if(j<1){ + return AjaxResult.error("入库失败"); + } + + if(null!=productReceiptMaterial.getSparedFour()&&!"".equals(productReceiptMaterial.getSparedFour())){ + //查询外协合同详情明细 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(productReceiptMaterial.getSparedFour()); + if(null!=outsourceContractDetail){ + //判断入库数量是否等于了本批数量 + if(s >= outsourceContractDetail.getQuantity()){ + outsourceContractDetail.setAccomplishStatus("已完成"); + outsourceContractDetail.setAccomplishQuantity((long)s); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + } + } + } + + } + } + //根据物料图号和名称查询物料信息,把如果有单价,把单价保存到物料信息上 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification()); + if(null == material){ + ImMaterial material2 = new ImMaterial(); + material2.setMaterialName(productReceiptMaterial.getMaterialName()); + material2.setFigureNumber(productReceiptMaterial.getSpecification()); + material2.setMaterials(productReceiptMaterial.getMaterialType()); +// material2.setPieceWeight(pieceWeight); + material2.setMinimum(0L); + material2.setHighest(0L); + material2.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnivalence())); + material2.setDelFlag(0); + + imMaterialService.insertImMaterial(material2); + }else{ + //单价 + material.setUnitPrice(new BigDecimal(productReceiptMaterial.getUnivalence())); + + imMaterialService.updateImMaterial(material); + } + + //发送邮件通知申请质检人和库管人员 + //获取申请人 + String userName = productReceiptMaterial.getProposer(); + //根据申请人名称查询 + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName(userName); + if(null!=userEmail){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + //拼接邮件内容 + String content = "申请入库的物料:"+"\n
"+"令号:"+productReceiptMaterial.getCode()+"\n
"+"名称:"+productReceiptMaterial.getMaterialName()+ + "\n
"+"图号:"+productReceiptMaterial.getSpecification()+"\n
"+"应收数量:"+productReceiptMaterial.getReceivableQuantity()+ + "\n
"+"实收数量:"+productReceiptMaterial.getReceived()+ + "\n
"+"库管员:"+productReceiptMaterial.getRecipient()+"\n
"+"入库时间:"+sdf.format(new Date())+"\n
"+"已入库完毕"; + + SendEmail send = new SendEmail(); + try { + send.sendEmail("入库通知",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + //判断当前物料是否是项目上的物料,如果是项目上的物料,则查询父级是否派给了铆焊工段,如果派给了铆焊工段,则通知铆焊工段 + if(ttr == 2){ + //说明是执行单的最后一序入库,则需要查询父级 + //查询入库的物料 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(productReceiptMaterial.getCode(), productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if(null!=pwBomNumberTwo){ + //查询当前入库的物料的成品物料 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getSuperiorId()); + if(null!=bomNumberTwo){ + //查询零件成品的父级 + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getParentLevelName(), bomNumberTwo.getParentLevelFigureNumber()); + if(null!=numberTwo){ + //查询父级物料的工序 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(numberTwo.getProductionCode(), numberTwo.getId()); + if(list.size()>0){ + /*if("铆焊工段".equals(list.get(0).getDepartmentName())){ + //根据申请人名称查询 + PwUserEmail userEmail2 = pwUserEmailService.selectPwUserEmailByName("铆焊工段"); + if(null!=userEmail2){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + //拼接邮件内容 + String content = "申请入库的物料:"+"\n
"+"令号:"+productReceiptMaterial.getCode()+"\n
"+"名称:"+productReceiptMaterial.getMaterialName()+ + "\n
"+"图号:"+productReceiptMaterial.getSpecification()+"\n
"+"应收数量:"+productReceiptMaterial.getReceivableQuantity()+ + "\n
"+"实收数量:"+productReceiptMaterial.getReceived()+ + "\n
"+"库管员:"+productReceiptMaterial.getRecipient()+"\n
"+"入库时间:"+sdf.format(new Date())+"\n
"+"已入库完毕"; + + SendEmail send = new SendEmail(); + try { + send.sendEmail("入库通知",content,userEmail2.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + }*/ + } + } + } + } + } + } + //查询当前id的入库单id,然后查询所有的相同入库单id,遍历 + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(ids[0]); + //入库单id + Long productReceiptId = productReceiptMaterial.getProductReceiptId(); + //查询入库详情所有相同id的物料 + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptId(productReceiptId); + //未入库数据标识 + int a = 0; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + if(null==imProductReceiptMaterial.getReceivableQuantity()){ + imProductReceiptMaterial.setReceivableQuantity(0.0); + } + if(imProductReceiptMaterial.getReceived().longValue() != imProductReceiptMaterial.getReceivableQuantity()){ + a = 1; + break; + } + } + if(a == 0){ + //说明此单据的物料已经全部入库,届时把入库单的状态改为已入库,否则则该为入库中 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptById(productReceiptId); + //修改入库状态 + productReceipt.setInventoryStatus("已入库"); + //修改接收人 + productReceipt.setRecipient(user.getNickName()); + int i = imProductReceiptService.updateImProductReceipt(productReceipt); + if(i<1){ + return AjaxResult.error("入库失败"); + } + }else{ + //说明此单据的物料已经全部入库,届时把入库单的状态改为已入库,否则则该为入库中 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptById(productReceiptId); + //修改入库状态 + productReceipt.setInventoryStatus("入库中"); + //修改接收人 + productReceipt.setRecipient(user.getNickName()); + int i = imProductReceiptService.updateImProductReceipt(productReceipt); + if(i<1){ + return AjaxResult.error("入库失败"); + } + } + return toAjax(200); + } + public void downloadBlobExcel(String fileName,boolean delete){ + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImProductStockRequistionController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductStockRequistionController.java new file mode 100644 index 0000000..4c9f688 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductStockRequistionController.java @@ -0,0 +1,256 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImLogistics; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImProductStockRequistion; +import com.ruoyi.project.management.domain.ImProductStockRequistionProduct; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwLetterOfAdvice; +import com.ruoyi.project.management.service.IImLogisticsService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImProductStockRequistionProductService; +import com.ruoyi.project.management.service.IImProductStockRequistionService; +import com.ruoyi.project.management.service.IPwContractService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 销售出库单Controller + * + * @author zhukangchao + * @date 2020-06-23 + */ +@RestController +@RequestMapping("/management/imProductStockRequistion") +public class ImProductStockRequistionController extends BaseController +{ + @Autowired + private IImProductStockRequistionService imProductStockRequistionService; + //物流信息 + @Autowired + private IImLogisticsService imLogisticsService; + //用户信息 + @Autowired + private TokenService tokenService; + //合同信息 + @Autowired + private IPwContractService pwContractService; + //产品出库单和产品关联信息 + @Autowired + private IImProductStockRequistionProductService imProductStockRequistionProductService; + //产品入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //产品入库单和产品关联信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //发运通知单信息 + @Autowired + private IPwLetterOfAdviceService pwLetterOfAdviceService; + + /** + * 查询销售出库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imProductStockRequistion:list')") + @GetMapping("/list") + public TableDataInfo list(ImProductStockRequistion imProductStockRequistion) + { + startPage(); + List list = imProductStockRequistionService.selectImProductStockRequistionList(imProductStockRequistion); + return getDataTable(list); + } + + /** + * 导出销售出库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imProductStockRequistion:export')") + @Log(title = "销售出库单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImProductStockRequistion imProductStockRequistion) + { + List list = imProductStockRequistionService.selectImProductStockRequistionList(imProductStockRequistion); + ExcelUtil util = new ExcelUtil(ImProductStockRequistion.class); + return util.exportExcel(list, "imProductStockRequistion"); + } + + /** + * 获取销售出库单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imProductStockRequistion:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imProductStockRequistionService.selectImProductStockRequistionById(id)); + } + + /** + * 新增产品出库单 + */ + @PreAuthorize("@ss.hasPermi('management:imProductStockRequistion:add')") + @Log(title = "产品出库单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImProductStockRequistion imProductStockRequistion){ + if(null==imProductStockRequistion.getTrackingNumber()||"".equals(imProductStockRequistion.getTrackingNumber().trim())){ + return AjaxResult.error("请填写物流单号"); + } + //获取合同编号,根据合同编号查询发运通知单 + PwLetterOfAdvice pwLetterOfAdvice = pwLetterOfAdviceService.selectPwLetterOfAdviceByCode(imProductStockRequistion.getContractCode()); +// //根据物流id查询物流信息 +// ImLogistics logistics = imLogisticsService.selectImLogisticsById(imProductStockRequistion.getLogisticsId()); + //保存物流名称 + imProductStockRequistion.setLogisticsName(pwLetterOfAdvice.getCarrierUnitName()); + //获取当前登录者信息,出库单制单者默认为当前登录者 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + imProductStockRequistion.setWarehouseKeeper(user.getNickName()); + //删除标记默认为未删除0 + imProductStockRequistion.setDelFlag(0); + //扣减相应的库存数量 + //获取合同的编号 + String contractCode = imProductStockRequistion.getContractCode(); + //根据合同编号查询入库单信息 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByContractCode(contractCode); + //根据合同编号查询合同信息 + PwContract pwContract = pwContractService.selectByContractCode(contractCode); + //修改合同状态为已完成状态7 + pwContract.setContractStatus(7); + pwContractService.updatePwContract(pwContract); + //保存客户名称 + imProductStockRequistion.setCustomerName(pwContract.getPurchaser()); + //根据入库单的id查询此入库单下所有的产品 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + imProductReceiptMaterial.setProductReceiptId(productReceipt.getId()); + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialList(imProductReceiptMaterial); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list) { + //根据物品名称和型号查询物品信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imProductReceiptMaterial2.getMaterialName(), imProductReceiptMaterial2.getSpecification()); + if(null==inventoryDetail){ + return AjaxResult.error("名称:"+imProductReceiptMaterial2.getMaterialName()+"型号:"+imProductReceiptMaterial2.getSpecification()+"暂无库存"); + } + //判断库存数量是否充足 + if(imProductReceiptMaterial2.getReceivableQuantity()>inventoryDetail.getQuantity()){ + return AjaxResult.error("名称:"+imProductReceiptMaterial2.getMaterialName()+"型号:"+imProductReceiptMaterial2.getSpecification()+"库存数量不足"); + } + Long l = inventoryDetail.getQuantity() - imProductReceiptMaterial2.getReceivableQuantity().longValue(); + //当库存为0时直接删除当前数据 + if(0==l){ + pwInventoryDetailService.deletePwInventoryDetailById(inventoryDetail.getId()); + } + inventoryDetail.setQuantity(l); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + int i = imProductStockRequistionService.insertImProductStockRequistion(imProductStockRequistion); + if(i>0){ + //修改发运单状态和单号 + pwLetterOfAdvice.setTrackingNumber(imProductStockRequistion.getTrackingNumber()); + //修改状态 + pwLetterOfAdvice.setStatus(2); + pwLetterOfAdviceService.updatePwLetterOfAdvice(pwLetterOfAdvice); + } + return toAjax(i); + } + + /** + * 修改销售出库单 + */ + @PreAuthorize("@ss.hasPermi('management:imProductStockRequistion:edit')") + @Log(title = "销售出库单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImProductStockRequistion imProductStockRequistion) + { + return toAjax(imProductStockRequistionService.updateImProductStockRequistion(imProductStockRequistion)); + } + + /** + * 删除销售出库单 + */ + @PreAuthorize("@ss.hasPermi('management:imProductStockRequistion:remove')") + @Log(title = "销售出库单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imProductStockRequistionService.deleteImProductStockRequistionByIds(ids)); + } + + /** + * 产品出库单查看详情 + * 参数:产品出库单id + */ + @RequestMapping("/getProductList") + public AjaxResult getProductList(Long id){ + //查询此入库单下所有需要出库的产品 + ImProductStockRequistionProduct imProductStockRequistionProduct = new ImProductStockRequistionProduct(); + imProductStockRequistionProduct.setProductStockRequistionId(id); + List list = imProductStockRequistionProductService.selectImProductStockRequistionProductList(imProductStockRequistionProduct); + //如果list的元素小于1,说明是第一次查询,需要到销售合同和产品关联表中查出数据保存到产品出库单和产品关联表中 + if(list.size()<1){ + //根据产品出库单id查询产品出库单详情 + ImProductStockRequistion productStockRequistion = imProductStockRequistionService.selectImProductStockRequistionById(id); + //获取合同的编号 + String contractCode = productStockRequistion.getContractCode(); + //根据合同编号查询入库单信息 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByContractCode(contractCode); + //根据入库单的id查询此入库单下所有的产品 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + imProductReceiptMaterial.setProductReceiptId(productReceipt.getId()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(imProductReceiptMaterial); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + //创建新的产品入库单和产品关联对象 + imProductStockRequistionProduct = new ImProductStockRequistionProduct(); + //产品id + imProductStockRequistionProduct.setProductId(imProductReceiptMaterial2.getMaterialId()); + //物料名称 + imProductStockRequistionProduct.setProductName(imProductReceiptMaterial2.getMaterialName()); + //产品出库单id + imProductStockRequistionProduct.setProductStockRequistionId(id); + //型号 + imProductStockRequistionProduct.setProductType(imProductReceiptMaterial2.getSpecification()); + //发货仓库id + imProductStockRequistionProduct.setDeliveryWarehouseId(imProductReceiptMaterial2.getWarehouseId()); + //发货仓库名称 + imProductStockRequistionProduct.setDeliveryWarehouseName(imProductReceiptMaterial2.getWarehouseName()); + //计量单位 + imProductStockRequistionProduct.setUnit(imProductReceiptMaterial2.getUnit()); + //实发数量 + imProductStockRequistionProduct.setActualQuantityIssued(imProductReceiptMaterial2.getActualQuantity().longValue()); + //删除标记 + imProductStockRequistionProduct.setDelFlag(0); + //保存信息 + imProductStockRequistionProductService.insertImProductStockRequistionProduct(imProductStockRequistionProduct); + } + //添加完成后再查询一次返回给前端 + imProductStockRequistionProduct = new ImProductStockRequistionProduct(); + imProductStockRequistionProduct.setProductStockRequistionId(id); + list = imProductStockRequistionProductService.selectImProductStockRequistionProductList(imProductStockRequistionProduct); + } + return AjaxResult.success("成功",list); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImProductStockRequistionProductController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductStockRequistionProductController.java new file mode 100644 index 0000000..f3742b6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImProductStockRequistionProductController.java @@ -0,0 +1,106 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImProductStockRequistion; +import com.ruoyi.project.management.domain.ImProductStockRequistionProduct; +import com.ruoyi.project.management.service.IImProductStockRequistionProductService; +import com.ruoyi.project.management.service.IImProductStockRequistionService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品和产品出库单关联Controller + * + * @author zhukangchao + * @date 2020-06-23 + */ +@RestController +@RequestMapping("/management/productStockRequistionProduct") +public class ImProductStockRequistionProductController extends BaseController +{ + @Autowired + private IImProductStockRequistionProductService imProductStockRequistionProductService; + //产品出库单信息 + @Autowired + private IImProductStockRequistionService imProductStockRequistionService; + + /** + * 查询产品和产品出库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productStockRequistionProduct:list')") + @GetMapping("/list") + public TableDataInfo list(ImProductStockRequistionProduct imProductStockRequistionProduct){ + startPage(); + List list = imProductStockRequistionProductService.selectImProductStockRequistionProductList(imProductStockRequistionProduct); + return getDataTable(list); + } + + /** + * 导出产品和产品出库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productStockRequistionProduct:export')") + @Log(title = "产品和产品出库单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImProductStockRequistionProduct imProductStockRequistionProduct) + { + List list = imProductStockRequistionProductService.selectImProductStockRequistionProductList(imProductStockRequistionProduct); + ExcelUtil util = new ExcelUtil(ImProductStockRequistionProduct.class); + return util.exportExcel(list, "productStockRequistionProduct"); + } + + /** + * 获取产品和产品出库单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:productStockRequistionProduct:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imProductStockRequistionProductService.selectImProductStockRequistionProductById(id)); + } + + /** + * 新增产品和产品出库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productStockRequistionProduct:add')") + @Log(title = "产品和产品出库单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImProductStockRequistionProduct imProductStockRequistionProduct) + { + return toAjax(imProductStockRequistionProductService.insertImProductStockRequistionProduct(imProductStockRequistionProduct)); + } + + /** + * 修改产品和产品出库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productStockRequistionProduct:edit')") + @Log(title = "产品和产品出库单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImProductStockRequistionProduct imProductStockRequistionProduct){ + return toAjax(imProductStockRequistionProductService.updateImProductStockRequistionProduct(imProductStockRequistionProduct)); + } + + /** + * 删除产品和产品出库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productStockRequistionProduct:remove')") + @Log(title = "产品和产品出库单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imProductStockRequistionProductService.deleteImProductStockRequistionProductByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImPurchaseReceiptController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImPurchaseReceiptController.java new file mode 100644 index 0000000..1b08bbf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImPurchaseReceiptController.java @@ -0,0 +1,204 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImPurchaseReceipt; +import com.ruoyi.project.management.domain.ImPurchaseReceiptMaterial; +import com.ruoyi.project.management.domain.ImSupplier; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImPurchaseReceiptMaterialService; +import com.ruoyi.project.management.service.IImPurchaseReceiptService; +import com.ruoyi.project.management.service.IImSupplierService; +import com.ruoyi.project.management.service.IPwPurchaseContractMaterialService; +import com.ruoyi.project.management.service.IPwPurchaseContractService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 采购入库单Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imPurchaseReceipt") +public class ImPurchaseReceiptController extends BaseController +{ + @Autowired + private IImPurchaseReceiptService imPurchaseReceiptService; + //采购合同信息 + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //物料和采购合同关联信息 + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //采购入库单和物料关联信息 + @Autowired + private IImPurchaseReceiptMaterialService imPurchaseReceiptMaterialService; + + /** + * 查询采购入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceipt:list')") + @GetMapping("/list") + public TableDataInfo list(ImPurchaseReceipt imPurchaseReceipt) + { + startPage(); + List list = imPurchaseReceiptService.selectImPurchaseReceiptList(imPurchaseReceipt); + return getDataTable(list); + } + + /** + * 导出采购入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceipt:export')") + @Log(title = "采购入库单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImPurchaseReceipt imPurchaseReceipt) + { + List list = imPurchaseReceiptService.selectImPurchaseReceiptList(imPurchaseReceipt); + ExcelUtil util = new ExcelUtil(ImPurchaseReceipt.class); + return util.exportExcel(list, "imPurchaseReceipt"); + } + + /** + * 获取采购入库单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceipt:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imPurchaseReceiptService.selectImPurchaseReceiptById(id)); + } + + /** + * 新增采购入库单 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceipt:add')") + @Log(title = "采购入库单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImPurchaseReceipt imPurchaseReceipt){ + //判断采购合同id是否为null,如果不为null,说明是采购合同 + if(null!=imPurchaseReceipt.getContractId()&&!"".equals(imPurchaseReceipt.getContractId())){ + //根据采购合同id查询合同信息 + PwPurchaseContract contract = pwPurchaseContractService.selectPwPurchaseContractById(imPurchaseReceipt.getContractId()); + //保存采购合同编号到采购单中 + imPurchaseReceipt.setContractCode(contract.getContractCode()); + }else if(null!=imPurchaseReceipt.getBuyingRequisitionCode()&&!"".equals(imPurchaseReceipt.getBuyingRequisitionCode())){ + //说明是采购单 + + }else{ + //如果两个都是空,那就得提示它必须选择一个了,不然没法儿搞了 + return AjaxResult.error("请选择合同编号或请购单编号"); + } + //根据供应商id获取供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierById(imPurchaseReceipt.getSupplierId()); + if(null!=supplier){ + //保存供应商名称 + imPurchaseReceipt.setSupplierName(supplier.getSupplierName()); + } + //删除标记(默认未删除0) + imPurchaseReceipt.setDelFlag(0); + return toAjax(imPurchaseReceiptService.insertImPurchaseReceipt(imPurchaseReceipt)); + } + + /** + * 修改采购入库单 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceipt:edit')") + @Log(title = "采购入库单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImPurchaseReceipt imPurchaseReceipt){ + //根据供应商id获取供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierById(imPurchaseReceipt.getSupplierId()); + //保存供应商名称 + imPurchaseReceipt.setSupplierName(supplier.getSupplierName()); + return toAjax(imPurchaseReceiptService.updateImPurchaseReceipt(imPurchaseReceipt)); + } + + /** + * 删除采购入库单 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceipt:remove')") + @Log(title = "采购入库单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imPurchaseReceiptService.deleteImPurchaseReceiptByIds(ids)); + } + + /** + * 查询采购入库单物料详细信息 + * 参数:采购合同id + * Long contractId + */ + @RequestMapping("/getMaterialList") + public AjaxResult getMaterialList(Long contractId){ + //根据采购合同id查询此合同下的所有需入库物料 + ImPurchaseReceiptMaterial purchaseReceiptMaterial = new ImPurchaseReceiptMaterial(); + purchaseReceiptMaterial.setPurchaseReceiptId(contractId); + List list = imPurchaseReceiptMaterialService.selectImPurchaseReceiptMaterialList(purchaseReceiptMaterial); + //判断是否有数据,如果没有,说明是第一次查询,需要去采购合同和物料关联表中查出数据保存到物料和物料入库单关联表中 + if(list.size()<1){ + //根据采购合同id查询采购合同和物料关联表中的所有物料信息 + PwPurchaseContractMaterial pwPurchaseContractMaterial = new PwPurchaseContractMaterial(); + pwPurchaseContractMaterial.setPurchaseContractId(contractId); + List purchaseContractMaterialList = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialList(pwPurchaseContractMaterial); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial2 : purchaseContractMaterialList) { + purchaseReceiptMaterial = new ImPurchaseReceiptMaterial(); + //采购合同id + purchaseReceiptMaterial.setPurchaseReceiptId(pwPurchaseContractMaterial2.getPurchaseContractId()); + //物料id + purchaseReceiptMaterial.setMaterialId(pwPurchaseContractMaterial2.getMaterialId()); + //根据物料id查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialById(pwPurchaseContractMaterial2.getMaterialId()); + //物料名称 + purchaseReceiptMaterial.setMaterialName(material.getMaterialName()); + //规格型号 + purchaseReceiptMaterial.setSpecification(material.getSpecificationType()); + //收货仓库id,根据物料id查询默认的收货仓库 + purchaseReceiptMaterial.setWarehouseId(Long.valueOf(material.getWarehouseId())); + //收货仓库名称 + purchaseReceiptMaterial.setWarehouseName(material.getWarehouseName()); + //计量单位 + purchaseReceiptMaterial.setUnit(material.getUnitOfMeasurementName()); + //应收数量 + purchaseReceiptMaterial.setReceivableQuantity(pwPurchaseContractMaterial2.getAmount()); + //默认为未入库 + purchaseReceiptMaterial.setInventoryStatus(0); + //删除标记0默认为未删除 + purchaseReceiptMaterial.setDelFlag(0); + //保存物料和采购入库单关联信息 + imPurchaseReceiptMaterialService.insertImPurchaseReceiptMaterial(purchaseReceiptMaterial); + } + //添加完成后再查询一次返回给前端 + purchaseReceiptMaterial = new ImPurchaseReceiptMaterial(); + purchaseReceiptMaterial.setPurchaseReceiptId(contractId); + list = imPurchaseReceiptMaterialService.selectImPurchaseReceiptMaterialList(purchaseReceiptMaterial); + } + //如果有数据说明直接返回 + return AjaxResult.success("成功", list); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImPurchaseReceiptMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImPurchaseReceiptMaterialController.java new file mode 100644 index 0000000..baf8e0a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImPurchaseReceiptMaterialController.java @@ -0,0 +1,236 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImPurchaseReceiptMaterial; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImPurchaseReceiptMaterialService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwPurchaseContractService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料采购入库单关联Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imPurchaseReceiptMaterial") +public class ImPurchaseReceiptMaterialController extends BaseController +{ + @Autowired + private IImPurchaseReceiptMaterialService imPurchaseReceiptMaterialService; + //采购合同信息 + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + + /** + * 查询物料采购入库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceiptMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial) + { + startPage(); + List list = imPurchaseReceiptMaterialService.selectImPurchaseReceiptMaterialList(imPurchaseReceiptMaterial); + return getDataTable(list); + } + + /** + * 导出物料采购入库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceiptMaterial:export')") + @Log(title = "物料采购入库单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial) + { + List list = imPurchaseReceiptMaterialService.selectImPurchaseReceiptMaterialList(imPurchaseReceiptMaterial); + ExcelUtil util = new ExcelUtil(ImPurchaseReceiptMaterial.class); + return util.exportExcel(list, "imPurchaseReceiptMaterial"); + } + + /** + * 获取物料采购入库单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceiptMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imPurchaseReceiptMaterialService.selectImPurchaseReceiptMaterialById(id)); + } + + /** + * 新增物料采购入库单关联 + */ + @RepeatSubmit + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceiptMaterial:add')") + @Log(title = "物料采购入库单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImPurchaseReceiptMaterial imPurchaseReceiptMaterial){ + if(null==imPurchaseReceiptMaterial){ + return AjaxResult.error("请输入物料名称"); + } + ImMaterial imMaterial = new ImMaterial(); + if(null!=imPurchaseReceiptMaterial.getMaterialId()&&!"".equals(imPurchaseReceiptMaterial.getMaterialId())){ + //根据物料id查询物料信息 + imMaterial = imMaterialService.selectImMaterialById(imPurchaseReceiptMaterial.getMaterialId()); + }else{ + return AjaxResult.error("请选择需要入库的物料名称"); + } + if(null==imPurchaseReceiptMaterial.getActualQuantity()){ + return AjaxResult.error("请输入数量"); + } + if(imPurchaseReceiptMaterial.getActualQuantity()<1){ + return AjaxResult.error("数量不能小于1"); + } + //添加库存 + PwInventoryDetail inventoryDetail = new PwInventoryDetail(); + //如果规格型号不为null,根据名称和型号查询 + inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imMaterial.getMaterialName(),imMaterial.getSpecificationType()); + if(null!=inventoryDetail){ + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+imPurchaseReceiptMaterial.getActualQuantity()); + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("添加库存失败"); + } + }else{ + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(imMaterial.getMaterialName()); + //型号名称 + pwInventoryDetail.setTypeName(imMaterial.getSpecificationType()); + //图号 + pwInventoryDetail.setFigureNumber(imMaterial.getFigureNumber()); + //收货仓库id + pwInventoryDetail.setWarehouseId(Long.valueOf(imMaterial.getWarehouseId())); + //收货仓库名称 + pwInventoryDetail.setWarehouseName(imMaterial.getWarehouseName()); + //计量单位 + pwInventoryDetail.setUnit(imMaterial.getUnitOfMeasurementName()); + //库存数量 + pwInventoryDetail.setQuantity(imPurchaseReceiptMaterial.getActualQuantity()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + int j = pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + if(j<1){ + return AjaxResult.error("添加库存失败"); + } + } + //添加入库单 + //物料名称 + imPurchaseReceiptMaterial.setMaterialName(imMaterial.getMaterialName()); + //型号名称 + imPurchaseReceiptMaterial.setSpecification(imMaterial.getSpecificationType()); + //收货仓库名称 + imPurchaseReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + //计量单位 + imPurchaseReceiptMaterial.setUnit(imMaterial.getUnitOfMeasurementName()); + imPurchaseReceiptMaterial.setReceivableQuantity(0L); + imPurchaseReceiptMaterial.setDelFlag(0); + int i = imPurchaseReceiptMaterialService.insertImPurchaseReceiptMaterial(imPurchaseReceiptMaterial); + if(i<1){ + return AjaxResult.error("添加失败"); + } + return toAjax(i); + } + + /** + * 修改物料采购入库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceiptMaterial:edit')") + @Log(title = "物料采购入库单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImPurchaseReceiptMaterial imPurchaseReceiptMaterial){ + //如果实收数量大于等于应收数量,把入库状态设置成入库已完成2,如果大于0且小于应收数量把状态设置为1正在入库 + if(imPurchaseReceiptMaterial.getActualQuantity()>=imPurchaseReceiptMaterial.getReceivableQuantity()){ + imPurchaseReceiptMaterial.setInventoryStatus(2); + }else if(imPurchaseReceiptMaterial.getActualQuantity()>0&&imPurchaseReceiptMaterial.getActualQuantity()0){ + //先根据物料名称和规格型号查询库中是否有此物品,如果有直接修改其数量,如果没有则添加新数据 + PwInventoryDetail pwInventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imPurchaseReceiptMaterial.getMaterialName(),imPurchaseReceiptMaterial.getSpecification()); + //如果不等于null,说明库中有此物品,直接修改数量即可 + if(null!=pwInventoryDetail){ + //添加数量 + pwInventoryDetail.setQuantity(pwInventoryDetail.getQuantity()+imPurchaseReceiptMaterial.getActualQuantity()); + pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail); + } + //说明有物料入库了,此时库存明细表中需记录库存数量 + PwInventoryDetail inventoryDetail = new PwInventoryDetail(); + //物品名称 + inventoryDetail.setName(imPurchaseReceiptMaterial.getMaterialName()); + //规格型号 + inventoryDetail.setTypeName(imPurchaseReceiptMaterial.getSpecification()); + //仓库id + inventoryDetail.setWarehouseId(imPurchaseReceiptMaterial.getWarehouseId()); + //仓库名称 + inventoryDetail.setWarehouseName(imPurchaseReceiptMaterial.getWarehouseName()); + //计量单位 + inventoryDetail.setUnit(imPurchaseReceiptMaterial.getUnit()); + //数量 + inventoryDetail.setQuantity(imPurchaseReceiptMaterial.getActualQuantity()); + //删除标记 + inventoryDetail.setDelFlag(0); + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail); + } + //获取合同的id + ImPurchaseReceiptMaterial prm = new ImPurchaseReceiptMaterial(); + prm.setPurchaseReceiptId(imPurchaseReceiptMaterial.getPurchaseReceiptId()); + //获取当前合同的所有物料 + List list = imPurchaseReceiptMaterialService.selectImPurchaseReceiptMaterialList(prm); + //查询入库已完成的数据 + prm = new ImPurchaseReceiptMaterial(); + prm.setInventoryStatus(2); + List list2 = imPurchaseReceiptMaterialService.selectImPurchaseReceiptMaterialList(prm); + //如果物料的数据集合等于入库已完成的数据集合,说明入库已全部完成 + if(list.size()==list2.size()){ + PwPurchaseContract pwPurchaseContract = new PwPurchaseContract(); + //采购合同id + pwPurchaseContract.setId(imPurchaseReceiptMaterial.getPurchaseReceiptId()); + //采购合同状态 + pwPurchaseContract.setContractStatus((long)2); + pwPurchaseContractService.updatePwPurchaseContract(pwPurchaseContract); + } + return toAjax(i); + } + + /** + * 删除物料采购入库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:imPurchaseReceiptMaterial:remove')") + @Log(title = "物料采购入库单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imPurchaseReceiptMaterialService.deleteImPurchaseReceiptMaterialByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImStockRequisitionController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImStockRequisitionController.java new file mode 100644 index 0000000..b0f47bd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImStockRequisitionController.java @@ -0,0 +1,150 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; + +import com.ruoyi.project.system.service.ISysUserService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 领料单Controller + * + * @author zhukangchao + * @date 2020-06-23 + */ +@RestController +@RequestMapping("/management/imStockRequisition") +public class ImStockRequisitionController extends BaseController +{ + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //部门信息 + @Autowired + private ISysDeptService deptService; + //用户信息 + @Autowired + private TokenService tokenService; + @Autowired + //用户信息 + private ISysUserService sysUserService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService imStockRequisitionMaterialService; + + /** + * 查询领料单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisition:list')") + @GetMapping("/list") + public TableDataInfo list(ImStockRequisition imStockRequisition) + { + startPage(); + List list = imStockRequisitionService.selectImStockRequisitionList(imStockRequisition); + return getDataTable(list); + } + + /** + * 导出领料单列表 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisition:export')") + @Log(title = "领料单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImStockRequisition imStockRequisition) + { + List list = imStockRequisitionService.selectImStockRequisitionList(imStockRequisition); + ExcelUtil util = new ExcelUtil(ImStockRequisition.class); + return util.exportExcel(list, "imStockRequisition"); + } + + /** + * 获取领料单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisition:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imStockRequisitionService.selectImStockRequisitionById(id)); + } + + /** + * 新增领料单 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisition:add')") + @Log(title = "领料单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImStockRequisition imStockRequisition){ + //获取部门id,根据部门id查询当前部门信息 + SysDept dept = deptService.selectDeptById(imStockRequisition.getUnitId()); + //保存部门名称 + imStockRequisition.setUnitName(dept.getDeptName()); + //删除标记0---未删除 + imStockRequisition.setDelFlag(0); + //获取领料人id,根据id查询用户信息 + SysUser sysUser = sysUserService.selectUserById(imStockRequisition.getMaterialHandlerId()); + //保存领料人名称 + imStockRequisition.setMaterialHandlerName(sysUser.getNickName()); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + imStockRequisition.setSendingPeopleId(user.getUserId()); + imStockRequisition.setSendingPeopleName(user.getNickName()); + return toAjax(imStockRequisitionService.insertImStockRequisition(imStockRequisition)); + } + + /** + * 修改领料单 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisition:edit')") + @Log(title = "领料单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImStockRequisition imStockRequisition){ + //获取部门id,根据部门id查询当前部门信息 + SysDept dept = deptService.selectDeptById(imStockRequisition.getUnitId()); + //保存部门名称 + imStockRequisition.setUnitName(dept.getDeptName()); + //获取领料人id,根据id查询用户信息 + SysUser sysUser = sysUserService.selectUserById(imStockRequisition.getMaterialHandlerId()); + //保存领料人名称 + imStockRequisition.setMaterialHandlerName(sysUser.getNickName()); + return toAjax(imStockRequisitionService.updateImStockRequisition(imStockRequisition)); + } + + /** + * 删除领料单 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisition:remove')") + @Log(title = "领料单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long long1 : ids) { + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionById(long1); + String code = stockRequisition.getCode(); + imStockRequisitionMaterialService.deleteImStockRequisitionMaterialByCode(code); + } + return toAjax(imStockRequisitionService.deleteImStockRequisitionByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImStockRequisitionMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImStockRequisitionMaterialController.java new file mode 100644 index 0000000..8e7a4d6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImStockRequisitionMaterialController.java @@ -0,0 +1,1208 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料和物料出库单关联Controller + * + * @author zhukangchao + * @date 2020-06-23 + */ +@RestController +@RequestMapping("/management/imStockRequisitionMaterial") +public class ImStockRequisitionMaterialController extends BaseController{ + @Autowired + private IImStockRequisitionMaterialService imStockRequisitionMaterialService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //用户信息 + @Autowired + private TokenService tokenService; + //发运单信息 + @Autowired + private IPwLetterOfAdviceService pwLetterOfAdviceService; + //待发运单详情信息 + @Autowired + private IPwLetterOfAdviceProductService pwLetterOfAdviceProductService; + //发运单详情 + @Autowired + private IPwLetterOfAdviceDetailsService pwLetterOfAdviceDetailsService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //执行单详情信息 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //借条信息 + @Autowired + private IPwMaterialBorrowInfoService pwMaterialBorrowInfoService; + /** + * 查询物料和物料出库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisitionMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(ImStockRequisitionMaterial imStockRequisitionMaterial){ + +// long time = new Date().getTime(); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(null!=imStockRequisitionMaterial.getBeginTime()&&!"".equals(imStockRequisitionMaterial.getBeginTime())&&null!=imStockRequisitionMaterial.getEndTime()&&!"".equals(imStockRequisitionMaterial.getEndTime())){ + try { + Date start = sdf.parse(imStockRequisitionMaterial.getBeginTime()); + Date end = sdf.parse(imStockRequisitionMaterial.getEndTime()); + imStockRequisitionMaterial.setStart(start); + imStockRequisitionMaterial.setEnd(end); + } catch (Exception e) { + + } + } + startPage(); + List list = imStockRequisitionMaterialService.selectImStockRequisitionMaterialList(imStockRequisitionMaterial); + PwInventoryDetail inventoryDetail = new PwInventoryDetail(); + for (ImStockRequisitionMaterial imStockRequisitionMaterial2 : list) { + inventoryDetail = new PwInventoryDetail(); + if(null==imStockRequisitionMaterial2.getMaterialName()||"".equals(imStockRequisitionMaterial2.getMaterialName())){ + inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(imStockRequisitionMaterial2.getFigureNumber()); + if(null!=inventoryDetail){ + imStockRequisitionMaterial2.setQuantity(inventoryDetail.getQuantity()); + }else{ + imStockRequisitionMaterial2.setQuantity(0L); + } + } + } +// for (ImStockRequisitionMaterial imStockRequisitionMaterial2 : list) { +// inventoryDetail = new PwInventoryDetail(); +// if(null==imStockRequisitionMaterial2.getMaterialName()||"".equals(imStockRequisitionMaterial2.getMaterialName())){ +// inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(imStockRequisitionMaterial2.getFigureNumber()); +// }else{ +// inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imStockRequisitionMaterial2.getMaterialName(), imStockRequisitionMaterial2.getFigureNumber()); +// } +// if(null!=inventoryDetail){ +// imStockRequisitionMaterial2.setInventoryQuantity(inventoryDetail.getQuantity()); +// }else{ +// imStockRequisitionMaterial2.setInventoryQuantity(0L); +// } +// } + +// long time2 = new Date().getTime(); +// System.out.println(time2-time); + return getDataTable(list); + } + + /** + * 导出物料和物料出库单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisitionMaterial:export')") + @Log(title = "物料和物料出库单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImStockRequisitionMaterial imStockRequisitionMaterial){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(null!=imStockRequisitionMaterial.getBeginTime()&&!"".equals(imStockRequisitionMaterial.getBeginTime())&&null!=imStockRequisitionMaterial.getEndTime()&&!"".equals(imStockRequisitionMaterial.getEndTime())){ + try { + Date start = sdf.parse(imStockRequisitionMaterial.getBeginTime()); + Date end = sdf.parse(imStockRequisitionMaterial.getEndTime()); + imStockRequisitionMaterial.setStart(start); + imStockRequisitionMaterial.setEnd(end); + } catch (Exception e) { + // TODO: handle exception + } + } + List list = imStockRequisitionMaterialService.selectImStockRequisitionMaterialListTwo(imStockRequisitionMaterial); + //添加序号,添加合计行 + long i = 1; + //创建合计行对象 +// ImStockRequisitionMaterialTwo heji = new ImStockRequisitionMaterialTwo(); + for (ImStockRequisitionMaterialTwo imStockRequisitionMaterial2 : list) { + imStockRequisitionMaterial2.setSerialNumber(i); + i++; +// //合计 +// heji.setCode("合计"); +// //合计数量 +// if(null==heji.getActualQuantityIssued()){ +// heji.setActualQuantityIssued(0L); +// } +// heji.setActualQuantityIssued(heji.getActualQuantityIssued()+imStockRequisitionMaterial2.getActualQuantityIssued()); +// //合计单价 +// if(null==heji.getUnivalence()){ +// heji.setUnivalence(0.0); +// } +// if(null==imStockRequisitionMaterial2.getUnivalence()){ +// imStockRequisitionMaterial2.setUnivalence(0.0); +// } +// heji.setUnivalence(heji.getUnivalence()+imStockRequisitionMaterial2.getUnivalence()); +// BigDecimal b = new BigDecimal(heji.getUnivalence()); +// double f1 = b.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue(); +// heji.setUnivalence(f1); +// //合计总价 +// if(null==heji.getTotalPrices()){ +// heji.setTotalPrices(0.0); +// } +// if(null==imStockRequisitionMaterial2.getTotalPrices()){ +// imStockRequisitionMaterial2.setTotalPrices(0.0); +// } +// heji.setTotalPrices(heji.getTotalPrices()+imStockRequisitionMaterial2.getTotalPrices()); +// BigDecimal b2 = new BigDecimal(heji.getTotalPrices()); +// double f2 = b2.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue(); +// heji.setTotalPrices(f2); + if(null!=imStockRequisitionMaterial2.getOutboundDate()&&!"".equals(imStockRequisitionMaterial2.getOutboundDate())){ + imStockRequisitionMaterial2.setSparedOne(sdf.format(imStockRequisitionMaterial2.getOutboundDate())); + } + } +// list.add(heji); + ExcelUtil util = new ExcelUtil(ImStockRequisitionMaterialTwo.class); + return util.exportExcel(list, "imStockRequisitionMaterial"); + } + + /** + * 打印单据功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据, + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdft= new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(ids.length==0){ + return AjaxResult.error("请选择物料"); + } + List list = new ArrayList(); + Long i = 1L; + //遍历ids + for (Long id : ids) { + //根据id获取物料信息 + ImStockRequisitionMaterial stockRequisitionMaterial = imStockRequisitionMaterialService.selectImStockRequisitionMaterialById(id); + //序号 + stockRequisitionMaterial.setSerialNumber(i); + i++; + list.add(stockRequisitionMaterial); + } + //领料人名称 + String preferentialOriginName = ""; + //供应商名称 + String sparedOne = ""; + //发料人 + String faliao = ""; + ImStockRequisitionMaterial stockRequisitionMaterial = new ImStockRequisitionMaterial(); + //遍历统计数量 + for (ImStockRequisitionMaterial stockRequisitionMaterial2 : list) { + if(null==preferentialOriginName||"".equals(preferentialOriginName)){ + preferentialOriginName = stockRequisitionMaterial2.getMaterialHandlerName(); + }else{ + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if(!preferentialOriginName.equals(stockRequisitionMaterial2.getMaterialHandlerName())){ + return AjaxResult.error("不同领料人不可合并打印"); + } + } + if(null==sparedOne||"".equals(sparedOne)){ + sparedOne = stockRequisitionMaterial2.getSparedOne(); + }else{ + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if(!sparedOne.equals(stockRequisitionMaterial2.getMaterialHandlerName())){ + return AjaxResult.error("不同供应商不可合并打印"); + } + } +// if(null==stockRequisitionMaterial.getAlreadyQuantity()){ +// stockRequisitionMaterial.setAlreadyQuantity(0L); +// } +// stockRequisitionMaterial.setAlreadyQuantity(stockRequisitionMaterial.getAlreadyQuantity()+stockRequisitionMaterial2.getAlreadyQuantity()); + if(null==stockRequisitionMaterial.getActualQuantityIssued()){ + stockRequisitionMaterial.setActualQuantityIssued(0L); + } + stockRequisitionMaterial.setActualQuantityIssued(stockRequisitionMaterial.getActualQuantityIssued()+stockRequisitionMaterial2.getActualQuantityIssued()); + faliao = stockRequisitionMaterial2.getSendingPeopleName(); + } + stockRequisitionMaterial.setCode("合计:"); + list.add(stockRequisitionMaterial); +// //首先把数据集合生成excel,然后调用打印机打印excel +// // 创建excel文件 +// ExcelUtilPrint util = new ExcelUtilPrint(ImStockRequisitionMaterial.class); +// //一级表头 +// String title = "河北伊特机械设备制造有限公司"; +// //二级表头 +// String titleTwo = "领料单"; +// //三级表头 +// String titleThree = "摘要: "+"日期: "+sdf.format(new Date())+" "+"编号: "+sdft.format(new Date()); +// //表尾 +// String footer = "审核: "+"记账: "+"发料: "+faliao+" 制单: "+user.getNickName(); +// +// AjaxResult result = util.exportExcel(list,"领料单",title,titleTwo,"领料人:"+preferentialOriginName,titleThree,footer); + //打印文件 + //获取文件路径 +// String filePath = RuoYiConfig.getDownloadPath() + result.get("msg"); +// File file = new File(filePath); +// boolean b = Print.printOfficeFile(file); +// if(b){ +// return AjaxResult.success(); +// }else{ +// return AjaxResult.error(); +// } + //返回获得到的领料单信息 + HashMap godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list); + //领料人 + godownMessage.put("preferentialOriginName",preferentialOriginName); + //发料 + godownMessage.put("faliao",faliao); + //审核 + godownMessage.put("checkPerson",""); + //记账 + godownMessage.put("jizhang",""); + //制单人员名称 + godownMessage.put("zhidan",user.getNickName()); + //制单日期 + godownMessage.put("zhidanDate",sdf.format(new Date())); + //编号 + godownMessage.put("number",sdft.format(new Date())); + //摘要 + godownMessage.put("zhaiyao"," "); + if(null==sparedOne){ + sparedOne = ""; + } + //供应商 + godownMessage.put("sparedOne", sparedOne); + return AjaxResult.success("success",godownMessage); + } + + /** + * 获取物料和物料出库单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisitionMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imStockRequisitionMaterialService.selectImStockRequisitionMaterialById(id)); + } + + /** + * 新增物料和物料出库单关联 + */ + @RepeatSubmit + @PreAuthorize("@ss.hasPermi('management:imStockRequisitionMaterial:add')") + @Log(title = "物料和物料出库单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImStockRequisitionMaterial imStockRequisitionMaterial){ + //根据物料id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(imStockRequisitionMaterial.getMaterialId()); + if(imStockRequisitionMaterial.getActualQuantityIssued()<1){ + return AjaxResult.error("实发数量不能小于1"); + } + PwInventoryDetail inventoryDetail = new PwInventoryDetail(); + //根据名称和型号查库 + inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imMaterial.getMaterialName(),imMaterial.getSpecificationType()); + if(null==inventoryDetail){ + return AjaxResult.error("暂无库存"); + } + //减少库存 + if(null!=inventoryDetail){ + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-imStockRequisitionMaterial.getActualQuantityIssued()); + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(j<1){ + return AjaxResult.error("减少库存失败"); + } + }else{ + return AjaxResult.error("仓库中没有此物料"); + } + //添加出库单 + //物料名称 + imStockRequisitionMaterial.setMaterialName(imMaterial.getMaterialName()); + //规格型号 + imStockRequisitionMaterial.setSpecification(imMaterial.getSpecificationType()); + //发料仓库 + imStockRequisitionMaterial.setMaterialIssuingWarehouseName(imMaterial.getWarehouseName()); + //计量单位 + imStockRequisitionMaterial.setUnit(imMaterial.getUnitOfMeasurementName()); + imStockRequisitionMaterial.setDelFlag(0); + int i = imStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + return toAjax(i); + } + + /** + * 修改物料和物料出库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisitionMaterial:edit')") + @Log(title = "物料和物料出库单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImStockRequisitionMaterial imStockRequisitionMaterial){ + if(imStockRequisitionMaterial.getActualQuantityIssued()+imStockRequisitionMaterial.getAlreadyQuantity()>imStockRequisitionMaterial.getSalaryQuantity()){ + return AjaxResult.error("实发数量不可以大于应发数量"); + } + return toAjax(imStockRequisitionMaterialService.updateImStockRequisitionMaterial(imStockRequisitionMaterial)); + } + + /** + * 删除物料和物料出库单关联 + */ + @PreAuthorize("@ss.hasPermi('management:imStockRequisitionMaterial:remove')") + @Log(title = "物料和物料出库单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + return toAjax(imStockRequisitionMaterialService.deleteImStockRequisitionMaterialByIds(ids)); + } + + /** + * 退库按钮 + */ + @RequestMapping("/handBacks/{ids}") + public AjaxResult handBacks(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id查询物料出库单详情 + ImStockRequisitionMaterial stockRequisitionMaterial = imStockRequisitionMaterialService.selectImStockRequisitionMaterialById(id); + if(stockRequisitionMaterial.getGetStatus().equals("未出库")){ + return AjaxResult.error("当前物料无需退库"); + }else{ + //退回库存数量,修改出库状态 + PwInventoryDetail inventoryDetail = new PwInventoryDetail(); + if(null==stockRequisitionMaterial.getMaterialName()){ + inventoryDetail =pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(stockRequisitionMaterial.getFigureNumber()); + }else{ + inventoryDetail= pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(stockRequisitionMaterial.getMaterialName(), stockRequisitionMaterial.getFigureNumber()); + } + if(null!=inventoryDetail){ + //加库存 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+stockRequisitionMaterial.getAlreadyQuantity()); + //加锁定 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+stockRequisitionMaterial.getAlreadyQuantity()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //修改实发数量为0和出库状态为未出库 + stockRequisitionMaterial.setAlreadyQuantity(0L);; + stockRequisitionMaterial.setGetStatus("未出库"); + i = imStockRequisitionMaterialService.updateImStockRequisitionMaterial(stockRequisitionMaterial); + }else{ + return AjaxResult.error("退库失败,未查询到当前物料库存信息"); + } + } + } + return AjaxResult.success(i); + } + + /** + * 一键确认出库 + */ + @RequestMapping("/affirms/{code}") + public AjaxResult affirms(@PathVariable String code){ + //根据code查看此单据是否已经出库 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(code); + if("已出库".equals(stockRequisition.getGetStatus())){ + return AjaxResult.error("不可重复出库"); + } + //查询此单据下所有的待出库物料 + List list = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCode(code); + //库存数量是否充足标识 + int i = 1; + //遍历集合(根据图号和名称查询库存表中此物料的数量是否大于或等于本次出库的实际数量,如果小于则直接返回不让出库,判断实际数量是否等于申请数量) + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imStockRequisitionMaterial.getMaterialName(), imStockRequisitionMaterial.getFigureNumber()); + if(null!=inventoryDetail){ + if(inventoryDetail.getQuantity()>=imStockRequisitionMaterial.getActualQuantityIssued()){ + continue; + }else{ + i = 0; + } + }else{ + i = 0; + } + } + if(i==1){ + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imStockRequisitionMaterial.getMaterialName(), imStockRequisitionMaterial.getFigureNumber()); + //减少库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-imStockRequisitionMaterial.getActualQuantityIssued()); + if(inventoryDetail.getLockNumber()-imStockRequisitionMaterial.getActualQuantityIssued()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + //减少预定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-imStockRequisitionMaterial.getActualQuantityIssued()); + } + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(imStockRequisitionMaterial.getSalaryQuantity().longValue()==imStockRequisitionMaterial.getActualQuantityIssued().longValue()+imStockRequisitionMaterial.getAlreadyQuantity().longValue()){ + imStockRequisitionMaterial.setGetStatus("已出库"); + }else{ + imStockRequisitionMaterial.setGetStatus("出库中"); + } + //修改已发数量 + imStockRequisitionMaterial.setAlreadyQuantity(imStockRequisitionMaterial.getAlreadyQuantity()+imStockRequisitionMaterial.getActualQuantityIssued()); + //实发数量置为0 + imStockRequisitionMaterial.setActualQuantityIssued(0L); + //把申请数量置为0 + imStockRequisitionMaterial.setApplyForQuantity(0L); + imStockRequisitionMaterialService.updateImStockRequisitionMaterial(imStockRequisitionMaterial); + } + //修改领料单的领料状态 + imStockRequisitionService.selectImStockRequisitionByCode(code); + //获取当前操作的用户 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //出库数量是否等于实出数量标识 + int j = 1; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + if(imStockRequisitionMaterial.getApplyForQuantity().longValue()!=imStockRequisitionMaterial.getActualQuantityIssued().longValue()+imStockRequisitionMaterial.getAlreadyQuantity().longValue()){ + j = 0; + } + } + if(j==1){ + stockRequisition.setGetStatus("已出库"); + }else{ + stockRequisition.setGetStatus("出库中"); + } + stockRequisition.setSendingPeopleName(user.getNickName()); + imStockRequisitionService.updateImStockRequisition(stockRequisition); + }else{ + return AjaxResult.error("库存数量不足"); + } + return toAjax(200); + } + + /** + * 一键确认出库 + * + */ + @RequestMapping("/affirmsAll/{ids}") + public AjaxResult affirmsAll(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //存储多个id,用,分割 + StringBuilder entityId = new StringBuilder(); + for (Long id : ids) { + //根据id查询物料信息 + ImStockRequisitionMaterial stockRequisitionMaterial = imStockRequisitionMaterialService.selectImStockRequisitionMaterialById(id); + //已经完成的执行单不允许再出入库 + if(!stockRequisitionMaterial.getCode().contains("QB")){ + //根据令号查询执行单状态 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(stockRequisitionMaterial.getCode()); + if(null!=productionBill&&productionBill.getStatus().equals("已完成")){ + return AjaxResult.error("已完成的执行单,不允许再出库,请联系生产部核实"); + } + } + if("已出库".equals(stockRequisitionMaterial.getGetStatus())){ + return AjaxResult.error("不可重复出库"); + } + + //根据物料名称和图号查询当前物料是否设置了安全库存,如果设置了安全库存则不限制出库,如果没有设置安全库存则查询入库单中是否已经入库,如果没有入库,则提示不允许出库 + //此功能是限制不同项目之间借用通用物料(A项目入库了,B项目也需要用此物料,此时B项目领了A项目的料,然后B项目完成了,此时A项目领料发现领不出料了) + //查询物料信息(图号和名称) + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(stockRequisitionMaterial.getMaterialName(), stockRequisitionMaterial.getFigureNumber()); + if(null!=material&&0==material.getMinimum()&&!"原材料".equals(material.getMaterialTypeName())&&!"毛坯".equals(material.getMaterialTypeName())&&!"易耗品".equals(material.getMaterialTypeName())){ + if(!stockRequisitionMaterial.getCode().contains("QB")){ + //查询bom信息,找到最后一道工序的图号和名称 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(stockRequisitionMaterial.getCode(), stockRequisitionMaterial.getMaterialName(), stockRequisitionMaterial.getFigureNumber()); + //根据物料id查询其工序信息 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); + if(list.size()>0){ + PwBomNumberTwo bomNumberTwo2 = list.get(list.size()-1); + if(null!=bomNumberTwo2){ + //查询入库信息(根据令号,图号和名称查询) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo2.getName(), bomNumberTwo2.getFigureNumber()); + //计算其入库数量,如果入库数量小于领料数量,则不允许出库 + Double w = 0.0; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + w += imProductReceiptMaterial.getReceived(); + } + if(w.longValue()=stockRequisitionMaterial.getActualQuantityIssued()){ + //减少库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-stockRequisitionMaterial.getActualQuantityIssued()); + if(inventoryDetail.getLockNumber()-stockRequisitionMaterial.getActualQuantityIssued()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + //减少预定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-stockRequisitionMaterial.getActualQuantityIssued()); + } + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(0L); + + }else{ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(null==stockRequisitionMaterial.getAlreadyQuantity()){ + stockRequisitionMaterial.setAlreadyQuantity(0L); + } + if(stockRequisitionMaterial.getSalaryQuantity().longValue()==stockRequisitionMaterial.getActualQuantityIssued().longValue()+stockRequisitionMaterial.getAlreadyQuantity().longValue()){ + stockRequisitionMaterial.setGetStatus("已出库"); + }else{ + stockRequisitionMaterial.setGetStatus("出库中"); + } + //出库时间 + stockRequisitionMaterial.setOutboundDate(new Date()); + //物料单价 +// stockRequisitionMaterial.setUnivalence(inventoryDetail.getUnivalence().doubleValue()); + //总价 +// stockRequisitionMaterial.setTotalPrices(inventoryDetail.getUnivalence().doubleValue()*stockRequisitionMaterial.getActualQuantityIssued()); + //修改已发数量 + stockRequisitionMaterial.setAlreadyQuantity(stockRequisitionMaterial.getAlreadyQuantity()+stockRequisitionMaterial.getActualQuantityIssued()); + //实发数量置为0 +// stockRequisitionMaterial.setActualQuantityIssued(0L); + //把申请数量置为0 +// stockRequisitionMaterial.setApplyForQuantity(0L); + //出库人 + stockRequisitionMaterial.setSendingPeopleName(user.getNickName()); + imStockRequisitionMaterialService.updateImStockRequisitionMaterial(stockRequisitionMaterial); + //根据物料单详情中的code查询发运单 + List lists = pwLetterOfAdviceService.selectPwLetterOfAdviceByCodeAndStatus(stockRequisitionMaterial.getCode()); + for (PwLetterOfAdvice letterOfAdvice : lists) { + if(null!=letterOfAdvice){ + + //判断当前发运单下所有的成品是否发运 + //根据发运单id和型号查询,修改当前型号的发运状态,添加备用字段3为已出库标识 + if(stockRequisitionMaterial.getFigureNumber().contains("L+R")){ + stockRequisitionMaterial.setFigureNumber(stockRequisitionMaterial.getFigureNumber().replaceAll("L[+]R", "R+L")); + } + PwLetterOfAdviceDetails adviceDetails = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceIdAndTypeName(letterOfAdvice.getId(),stockRequisitionMaterial.getFigureNumber()); + if(null==adviceDetails){ + continue; + } + Long productionBillId = 0L; + if(null!=adviceDetails){ + //修改发运单详情中的发运标识 + adviceDetails.setSparedThree(1L); + pwLetterOfAdviceDetailsService.updatePwLetterOfAdviceDetails(adviceDetails); + //修改执行单中的发运标识 + //查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(adviceDetails.getProductionBillCode()); + //执行单id + productionBillId = productionBill.getId(); + //根据执行单id和产品型号查询 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductByProductionBillIdAndName(productionBill.getId(), adviceDetails.getProductType()); + //判断出库的数量是否等于发运的数量,如果小于则出库标识置为1 + if(null!=productionBillProduct&&productionBillProduct.getQuantity().equals(stockRequisitionMaterial.getAlreadyQuantity())){ + productionBillProduct.setSparedThree(1L); + pwProductionBillProductService.updatePwProductionBillProduct(productionBillProduct); + } + } + //根据发运单id查询发运单详情 + List list2 = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceId(letterOfAdvice.getId()); + //是否发运标识 + int r = 0; + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list2) { + if(null==pwLetterOfAdviceDetails.getSparedThree()||pwLetterOfAdviceDetails.getSparedThree() != 1){ + r = 1; + } + } + if(r==0){ + //修改发运单状态 + letterOfAdvice.setStatus(2); + pwLetterOfAdviceService.updatePwLetterOfAdvice(letterOfAdvice); + } + //查询当前执行单下所有的产品 + List list3 = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(productionBillId); + //是否发运标识 + int t = 0; + for (PwProductionBillProduct pwProductionBillProduct : list3) { + if(null==pwProductionBillProduct.getSparedThree()||pwProductionBillProduct.getSparedThree() != 1){ + t = 1; + } + } + if(t == 0){ + //修改执行单状态为已完成 + //查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(adviceDetails.getProductionBillCode()); + productionBill.setStatus("已完成"); + pwProductionBillService.updatePwProductionBill(productionBill); + } + //修改发运单详情的已发数量(累加)申请数量置为0,库存数量为即时库存 + PwLetterOfAdviceProduct letterOfAdviceProduct = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductByCodeAndFigureNumber(adviceDetails.getProductionBillCode(), stockRequisitionMaterial.getFigureNumber()); + if(null!=letterOfAdviceProduct){ + //修改已发数量 + letterOfAdviceProduct.setSentNumber(letterOfAdviceProduct.getSentNumber()); + //修改申请数量 + letterOfAdviceProduct.setApplyNumber(0L); + //修改库存数量 + letterOfAdviceProduct.setQuantity(inventoryDetail.getQuantity()); + pwLetterOfAdviceProductService.updatePwLetterOfAdviceProduct(letterOfAdviceProduct); + } + } + } + }else{ + return AjaxResult.error("库存数量不足"); + } + //查询此单据下所有的待出库物料 + List list = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCode(stockRequisitionMaterial.getCode()); + int j = 1; + //遍历集合,判断已发数量是否等于申请数量,如果全部等于,则把出库状态改为已出库,如果有小于的则为出库中 + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + if(imStockRequisitionMaterial.getSalaryQuantity().longValue()!=imStockRequisitionMaterial.getAlreadyQuantity().longValue()){ + j = 0; + break; + } + } + //根据申请单id查询申请单 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionById(stockRequisitionMaterial.getStockRequisitionId()); + //获取当前操作的用户 + if(j==1){ + stockRequisition.setGetStatus("已出库"); + }else{ + stockRequisition.setGetStatus("出库中"); + } + stockRequisition.setSendingPeopleName(user.getNickName()); + int i = imStockRequisitionService.updateImStockRequisition(stockRequisition); + + //判断此单据是什么单据 + if(stockRequisition.getCode().contains("JT")){ + //修改借条的状态 + PwMaterialBorrowInfo pwMaterialBorrowInfo = new PwMaterialBorrowInfo(); + pwMaterialBorrowInfo.setSparedTwo(stockRequisition.getCode()); + List list2 = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoList(pwMaterialBorrowInfo); + for (PwMaterialBorrowInfo pwMaterialBorrowInfo2 : list2) { + pwMaterialBorrowInfo2.setStatus("已出库"); + pwMaterialBorrowInfoService.updatePwMaterialBorrowInfo(pwMaterialBorrowInfo2); + } + } + //判断此单据是什么单据 +// if(stockRequisition.getCode().contains("SR")){ +// //查询物料详情 +// ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(stockRequisitionMaterial.getMaterialName(), stockRequisitionMaterial.getFigureNumber()); +// if(null != imMaterial){ +// //如果是领料单申请领料,则查询库存数量是否还大于安全库存数量,如果小于,则自动产生易耗品采购单 +// if(null!=imMaterial.getProportion()&&imMaterial.getProportion()>1){ +// if((inventoryDetail.getQuantity()/imMaterial.getProportion())+(inventoryDetail.getPreliminaryInventory()/imMaterial.getProportion()) lists = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// Double zongjia = 0.0; +// for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : lists) { +// zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); +// } +// //根据采购单id查询采购单 +// PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// buyingRequisitionTwo.setTotalPrices(zongjia); +// pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); +// +// //加上在途数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBuyingRequisitionMaterialTwo.getNumber()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// } +// }else{ +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory() lists = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// Double zongjia = 0.0; +// for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : lists) { +// zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); +// } +// //根据采购单id查询采购单 +// PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// buyingRequisitionTwo.setTotalPrices(zongjia); +// pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); +// +// //加上在途数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBuyingRequisitionMaterialTwo.getNumber()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// } +// } +// +// } +// } + } + return AjaxResult.success(); + } + + /** + * 单个确认出库 + */ + @RequestMapping("/affirmOne/{id}") + public AjaxResult affirmOne(@PathVariable Long id){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据id查询物料信息 + ImStockRequisitionMaterial stockRequisitionMaterial = imStockRequisitionMaterialService.selectImStockRequisitionMaterialById(id); + //已经完成的执行单不允许再出入库 + if(!stockRequisitionMaterial.getCode().contains("QB")){ + //根据令号查询执行单状态 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(stockRequisitionMaterial.getCode()); + if(null!=productionBill&&productionBill.getStatus().equals("已完成")){ + return AjaxResult.error("已完成的执行单,不允许再出库,请联系生产部核实"); + } + } + if("已出库".equals(stockRequisitionMaterial.getGetStatus())){ + return AjaxResult.error("不可重复出库"); + } + + //根据申请单id查询申请单 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionById(stockRequisitionMaterial.getStockRequisitionId()); + + //根据物料名称和图号查询当前物料是否设置了安全库存,如果设置了安全库存则不限制出库,如果没有设置安全库存则查询入库单中是否已经入库,如果没有入库,则提示不允许出库 + //此功能是限制不同项目之间借用通用物料(A项目入库了,B项目也需要用此物料,此时B项目领了A项目的料,然后B项目完成了,此时A项目领料发现领不出料了) + //查询物料信息(图号和名称) + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(stockRequisitionMaterial.getMaterialName(), stockRequisitionMaterial.getFigureNumber()); + if(null!=material&&0==material.getMinimum()&&!"原材料".equals(material.getMaterialTypeName())&&!"毛坯".equals(material.getMaterialTypeName())&&!"易耗品".equals(material.getMaterialTypeName())){ + if(!stockRequisitionMaterial.getCode().contains("QB")){ + //查询bom信息,找到最后一道工序的图号和名称 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(stockRequisitionMaterial.getCode(), stockRequisitionMaterial.getMaterialName(), stockRequisitionMaterial.getFigureNumber()); + if(null != bomNumberTwo){ + //根据物料id查询其工序信息 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); + if(list.size()>0){ + PwBomNumberTwo bomNumberTwo2 = list.get(list.size()-1); + if(null!=bomNumberTwo2){ + //查询入库信息(根据令号,图号和名称查询) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo2.getName(), bomNumberTwo2.getFigureNumber()); + //计算其入库数量,如果入库数量小于领料数量,则不允许出库 + Double w = 0.0; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + w += imProductReceiptMaterial.getReceived(); + } + if(w.longValue()=stockRequisitionMaterial.getActualQuantityIssued()){ + //减少库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-stockRequisitionMaterial.getActualQuantityIssued()); + if(inventoryDetail.getLockNumber()-stockRequisitionMaterial.getActualQuantityIssued()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + //减少预定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-stockRequisitionMaterial.getActualQuantityIssued()); + } + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(0L); + + }else{ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if(null==stockRequisitionMaterial.getAlreadyQuantity()){ + stockRequisitionMaterial.setAlreadyQuantity(0L); + } + if(stockRequisitionMaterial.getSalaryQuantity().longValue()==stockRequisitionMaterial.getActualQuantityIssued().longValue()+stockRequisitionMaterial.getAlreadyQuantity().longValue()){ + stockRequisitionMaterial.setGetStatus("已出库"); + }else{ + stockRequisitionMaterial.setGetStatus("出库中"); + } + //出库时间 + stockRequisitionMaterial.setOutboundDate(new Date()); + //物料单价 +// stockRequisitionMaterial.setUnivalence(inventoryDetail.getUnivalence().doubleValue()); + //总价 +// stockRequisitionMaterial.setTotalPrices(inventoryDetail.getUnivalence().doubleValue()*stockRequisitionMaterial.getActualQuantityIssued()); + //修改已发数量 + stockRequisitionMaterial.setAlreadyQuantity(stockRequisitionMaterial.getAlreadyQuantity()+stockRequisitionMaterial.getActualQuantityIssued()); + //实发数量置为0 +// stockRequisitionMaterial.setActualQuantityIssued(0L); + //把申请数量置为0 +// stockRequisitionMaterial.setApplyForQuantity(0L); + //出库人 + stockRequisitionMaterial.setSendingPeopleName(user.getNickName()); + imStockRequisitionMaterialService.updateImStockRequisitionMaterial(stockRequisitionMaterial); + //根据物料单详情中的code查询发运单 + List lists = pwLetterOfAdviceService.selectPwLetterOfAdviceByCodeAndStatus(stockRequisitionMaterial.getCode()); + for (PwLetterOfAdvice letterOfAdvice : lists) { + if(null!=letterOfAdvice){ + + //判断当前发运单下所有的成品是否发运 + //根据发运单id和型号查询,修改当前型号的发运状态,添加备用字段3为已出库标识 + if(stockRequisitionMaterial.getFigureNumber().contains("L+R")){ + stockRequisitionMaterial.setFigureNumber(stockRequisitionMaterial.getFigureNumber().replaceAll("L[+]R", "R+L")); + } + PwLetterOfAdviceDetails adviceDetails = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceIdAndTypeName(letterOfAdvice.getId(),stockRequisitionMaterial.getFigureNumber()); + if(null==adviceDetails){ + continue; + } + Long productionBillId = 0L; + if(null!=adviceDetails){ + //修改发运单详情中的发运标识 + adviceDetails.setSparedThree(1L); + pwLetterOfAdviceDetailsService.updatePwLetterOfAdviceDetails(adviceDetails); + //修改执行单中的发运标识 + //查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(adviceDetails.getProductionBillCode()); + if(null==productionBill){ + //查询生产订单 + + }else{ + //执行单id + productionBillId = productionBill.getId(); + //根据执行单id和产品型号查询 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductByProductionBillIdAndName(productionBill.getId(), adviceDetails.getProductType()); + + //查询当前型号的发运数量是否和下单数量一致,如果一致则说明发运完成,则关闭执行单 + List list = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(letterOfAdvice.getContractCode(), stockRequisitionMaterial.getFigureNumber()); + Long d = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + d += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断出库的数量是否等于发运的数量,如果小于则出库标识置为1 + if(null!=productionBillProduct&&productionBillProduct.getQuantity().equals(d)){ + productionBillProduct.setSparedThree(1L); + pwProductionBillProductService.updatePwProductionBillProduct(productionBillProduct); + material.setSparedThree(d); + } + } + } + //根据发运单id查询发运单详情 + List list2 = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceId(letterOfAdvice.getId()); + //是否发运标识 + int r = 0; + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list2) { + if(null==pwLetterOfAdviceDetails.getSparedThree()||pwLetterOfAdviceDetails.getSparedThree() != 1){ + r = 1; + } + } + if(r==0){ + //修改发运单状态 + letterOfAdvice.setStatus(2); + pwLetterOfAdviceService.updatePwLetterOfAdvice(letterOfAdvice); + } + //查询当前执行单下所有的产品 + List list3 = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(productionBillId); + //是否发运标识 + int t = 0; + for (PwProductionBillProduct pwProductionBillProduct : list3) { + if(null==pwProductionBillProduct.getSparedThree()||pwProductionBillProduct.getSparedThree() != 1){ + t = 1; + } + } + if(t == 0){ + //修改执行单状态为已完成 + //查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(adviceDetails.getProductionBillCode()); + if(null==productionBill){ + //查询生产订单 + + }else{ + productionBill.setStatus("已完成"); + pwProductionBillService.updatePwProductionBill(productionBill); + } + } + //修改发运单详情的已发数量(累加)申请数量置为0,库存数量为即时库存 + PwLetterOfAdviceProduct letterOfAdviceProduct = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductByCodeAndFigureNumber(adviceDetails.getProductionBillCode(), stockRequisitionMaterial.getFigureNumber()); + if(null!=letterOfAdviceProduct){ + //修改已发数量 + letterOfAdviceProduct.setSentNumber(letterOfAdviceProduct.getSentNumber()); + //修改申请数量 + letterOfAdviceProduct.setApplyNumber(0L); + //修改库存数量 + letterOfAdviceProduct.setQuantity(inventoryDetail.getQuantity()); + pwLetterOfAdviceProductService.updatePwLetterOfAdviceProduct(letterOfAdviceProduct); + } + } + } + }else{ + return AjaxResult.error("库存数量不足"); + } + //查询此单据下所有的待出库物料 + List list = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCode(stockRequisitionMaterial.getCode()); + int j = 1; + //遍历集合,判断已发数量是否等于申请数量,如果全部等于,则把出库状态改为已出库,如果有小于的则为出库中 + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + if(imStockRequisitionMaterial.getSalaryQuantity().longValue()!=imStockRequisitionMaterial.getAlreadyQuantity().longValue()){ + j = 0; + break; + } + } + //获取当前操作的用户 + if(j==1){ + stockRequisition.setGetStatus("已出库"); + }else{ + stockRequisition.setGetStatus("出库中"); + } + stockRequisition.setSendingPeopleName(user.getNickName()); + int i = imStockRequisitionService.updateImStockRequisition(stockRequisition); + + //判断此单据是什么单据 + if(stockRequisition.getCode().contains("JT")){ + //修改借条的状态 + PwMaterialBorrowInfo pwMaterialBorrowInfo = new PwMaterialBorrowInfo(); + pwMaterialBorrowInfo.setSparedTwo(stockRequisition.getCode()); + List list2 = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoList(pwMaterialBorrowInfo); + for (PwMaterialBorrowInfo pwMaterialBorrowInfo2 : list2) { + pwMaterialBorrowInfo2.setStatus("已出库"); + pwMaterialBorrowInfoService.updatePwMaterialBorrowInfo(pwMaterialBorrowInfo2); + } + } +// if(stockRequisition.getCode().contains("SR")){ +// //查询物料详情 +// ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(stockRequisitionMaterial.getMaterialName(), stockRequisitionMaterial.getFigureNumber()); +// if(null != imMaterial){ +// //如果是领料单申请领料,则查询库存数量是否还大于安全库存数量,如果小于,则自动产生易耗品采购单 +// if(null!=imMaterial.getProportion()&&imMaterial.getProportion()>1){ +// if((inventoryDetail.getQuantity()/imMaterial.getProportion())+(inventoryDetail.getPreliminaryInventory()/imMaterial.getProportion()) lists = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// Double zongjia = 0.0; +// for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : lists) { +// zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); +// } +// //根据采购单id查询采购单 +// PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// buyingRequisitionTwo.setTotalPrices(zongjia); +// pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); +// +// //加上在途数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBuyingRequisitionMaterialTwo.getNumber()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// } +// }else{ +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory() lists = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// Double zongjia = 0.0; +// for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : lists) { +// zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); +// } +// //根据采购单id查询采购单 +// PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// buyingRequisitionTwo.setTotalPrices(zongjia); +// pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); +// +// //加上在途数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBuyingRequisitionMaterialTwo.getNumber()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// } +// } +// +// } +// } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImSupplierController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImSupplierController.java new file mode 100644 index 0000000..f63cf72 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImSupplierController.java @@ -0,0 +1,134 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImSupplier; +import com.ruoyi.project.management.domain.ImSupplierType; +import com.ruoyi.project.management.service.IImSupplierService; +import com.ruoyi.project.management.service.IImSupplierTypeService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 供应商Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imSupplier") +public class ImSupplierController extends BaseController +{ + @Autowired + private IImSupplierService imSupplierService; + //供应商类型信息 + @Autowired + private IImSupplierTypeService imSupplierTypeService; + + /** + * 查询供应商列表 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplier:list')") + @GetMapping("/list") + public TableDataInfo list(ImSupplier imSupplier) + { + startPage(); + List list = imSupplierService.selectImSupplierList(imSupplier); + return getDataTable(list); + } + + /** + * 导出供应商列表 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplier:export')") + @Log(title = "供应商", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImSupplier imSupplier) + { + List list = imSupplierService.selectImSupplierList(imSupplier); + ExcelUtil util = new ExcelUtil(ImSupplier.class); + return util.exportExcel(list, "imSupplier"); + } + + /** + * 获取供应商详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplier:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imSupplierService.selectImSupplierById(id)); + } + + /** + * 新增供应商 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplier:add')") + @Log(title = "供应商", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImSupplier imSupplier){ + if(null==imSupplier.getSupplierName()||"".equals(imSupplier.getSupplierName())){ + return AjaxResult.error("请输入供应商名称"); + } + //根据供应商名称查询,是否已存在此供应商 + ImSupplier imSupplier2 = imSupplierService.selectImSupplierByName(imSupplier.getSupplierName()); + if(null!=imSupplier2){ + return AjaxResult.error("此供应商已存在,不可重复添加"); + } + //获取供应商类型id + Long supplierTypeId = imSupplier.getSupplierTypeId(); + //根据供应商类型id查询供应商类型 + ImSupplierType supplierType = imSupplierTypeService.selectImSupplierTypeById(supplierTypeId); + //保存供应商类名称 + imSupplier.setSupplierTypeName(supplierType.getSupplierTypeName()); + //删除标记(默认是0,未删除) + imSupplier.setDelFlag(0); + return toAjax(imSupplierService.insertImSupplier(imSupplier)); + } + + /** + * 修改供应商 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplier:edit')") + @Log(title = "供应商", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImSupplier imSupplier){ + + return toAjax(imSupplierService.updateImSupplier(imSupplier)); + } + + /** + * 删除供应商 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplier:remove')") + @Log(title = "供应商", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imSupplierService.deleteImSupplierByIds(ids)); + } + + /** + * 获取所有供应商 + * @return + */ + @GetMapping("/getImSuppliers") + public List getImSuppliers() + { + List list = imSupplierService.getImSuppliers(); + return list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImSupplierTypeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImSupplierTypeController.java new file mode 100644 index 0000000..249b3ec --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImSupplierTypeController.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImSupplierType; +import com.ruoyi.project.management.service.IImSupplierTypeService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 供应商类型Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imSupplierType") +public class ImSupplierTypeController extends BaseController +{ + @Autowired + private IImSupplierTypeService imSupplierTypeService; + + /** + * 查询供应商类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplierType:list')") + @GetMapping("/list") + public TableDataInfo list(ImSupplierType imSupplierType) + { + startPage(); + List list = imSupplierTypeService.selectImSupplierTypeList(imSupplierType); + return getDataTable(list); + } + + /** + * 导出供应商类型列表 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplierType:export')") + @Log(title = "供应商类型", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImSupplierType imSupplierType) + { + List list = imSupplierTypeService.selectImSupplierTypeList(imSupplierType); + ExcelUtil util = new ExcelUtil(ImSupplierType.class); + return util.exportExcel(list, "imSupplierType"); + } + + /** + * 获取供应商类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplierType:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imSupplierTypeService.selectImSupplierTypeById(id)); + } + + /** + * 新增供应商分组 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplierType:add')") + @Log(title = "供应商类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImSupplierType imSupplierType) + { + List list = imSupplierTypeService.selectImSupplierTypeList(imSupplierType); + if(null != list && list.size() > 0){ + return AjaxResult.error("供应商分组数据重复!"); + } + return toAjax(imSupplierTypeService.insertImSupplierType(imSupplierType)); + } + + /** + * 修改供应商类型 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplierType:edit')") + @Log(title = "供应商类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImSupplierType imSupplierType) + { + return toAjax(imSupplierTypeService.updateImSupplierType(imSupplierType)); + } + + /** + * 删除供应商类型 + */ + @PreAuthorize("@ss.hasPermi('management:imSupplierType:remove')") + @Log(title = "供应商类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imSupplierTypeService.deleteImSupplierTypeByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/ImWarehouseController.java b/evo/src/main/java/com/ruoyi/project/management/controller/ImWarehouseController.java new file mode 100644 index 0000000..5584be6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/ImWarehouseController.java @@ -0,0 +1,115 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImWarehouse; +import com.ruoyi.project.management.service.IImWarehouseService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 仓库Controller + * + * @author zhukangchao + * @date 2020-06-22 + */ +@RestController +@RequestMapping("/management/imWarehouse") +public class ImWarehouseController extends BaseController +{ + @Autowired + private IImWarehouseService imWarehouseService; + + /** + * 查询仓库列表 + */ + @PreAuthorize("@ss.hasPermi('management:imWarehouse:list')") + @GetMapping("/list") + public TableDataInfo list(ImWarehouse imWarehouse) + { + startPage(); + List list = imWarehouseService.selectImWarehouseList(imWarehouse); + return getDataTable(list); + } + + /** + * 导出仓库列表 + */ + @PreAuthorize("@ss.hasPermi('management:imWarehouse:export')") + @Log(title = "仓库", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ImWarehouse imWarehouse) + { + List list = imWarehouseService.selectImWarehouseList(imWarehouse); + ExcelUtil util = new ExcelUtil(ImWarehouse.class); + return util.exportExcel(list, "imWarehouse"); + } + + /** + * 获取仓库详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:imWarehouse:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(imWarehouseService.selectImWarehouseById(id)); + } + + /** + * 新增仓库 + */ + @PreAuthorize("@ss.hasPermi('management:imWarehouse:add')") + @Log(title = "仓库", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ImWarehouse imWarehouse){ + //判断仓库名称是否为null + if(null==imWarehouse.getWarehouseName()||"".equals(imWarehouse.getWarehouseName())){ + return AjaxResult.error("请输入仓库名称"); + } + ImWarehouse house = imWarehouseService.selectImWarehouseByName(imWarehouse.getWarehouseName()); + if(null != house){ + return AjaxResult.error("输入仓库名称重复!"); + } + //删除标记(默认是0,未删除) + imWarehouse.setDelFlag(0); + return toAjax(imWarehouseService.insertImWarehouse(imWarehouse)); + } + + + + + /** + * 修改仓库 + */ + @PreAuthorize("@ss.hasPermi('management:imWarehouse:edit')") + @Log(title = "仓库", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ImWarehouse imWarehouse) + { + return toAjax(imWarehouseService.updateImWarehouse(imWarehouse)); + } + + /** + * 删除仓库 + */ + @PreAuthorize("@ss.hasPermi('management:imWarehouse:remove')") + @Log(title = "仓库", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(imWarehouseService.deleteImWarehouseByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/JDInterfaceController.java b/evo/src/main/java/com/ruoyi/project/management/controller/JDInterfaceController.java new file mode 100644 index 0000000..dc39918 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/JDInterfaceController.java @@ -0,0 +1,600 @@ +package com.ruoyi.project.management.controller; + +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.parameters.P; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@RestController +@RequestMapping("/JDinterFace") +public class JDInterfaceController { + + public static Log logger = LogFactory.getLog(JDInterfaceController.class); + @Autowired + private IImMaterialService imMaterialService; + @Autowired + private IJdBomNumberService jdBomNumberService; + @Autowired + private IPwBomNumberService pwBomNumberService; + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + @Autowired + private IPwProductionBillService pwProductionBillService; + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + + @RequestMapping("/picking") + public String createProductionBillNew(String code) { + //判断参数是否为空 + if(StringUtils.isEmpty(code)){ + logger.error("-------------------------------------------------------------------------参数为空---------------------------------------------------------------------------------"); + return "执行单号不能为空!!"; + } + // 保存零部件明细信息 + List> allRows = null; + //在指定位置读取文件 + Workbook wb = null; + Sheet sheet = null; + try { + logger.info("-------------------------------------------------------------------------------------读取excel地址:"+ "D:/EVO_TECH/EVO程序输出路径/"+code+"/"+code+".xlsx"); + File files = new File("D:/EVO_TECH/EVO程序输出路径/"+code+"/"+code+".xlsx"); + if(null == files){ + return "没有读取到对应执行单的excel 的BOM!!"; + } + wb = WorkbookFactory.create(files); + //获取table页面名称为物料表的页,解析获取bom + int sheetCount = wb.getNumberOfSheets(); + for(int i=0;i bomList = pwBomNumberTwoService.selectPwBomNumberTwoByCode(code); + //判断是企标还是非标 企标单 + if(code.contains("QB")) { + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + for (PwBomNumberTwo pwBomNumberTwo : bomList) { + if (pwBomNumberTwo.getNum().indexOf(".") < 0) { + pwMakeDocuments.setName(pwBomNumberTwo.getName()); + break; + } + } + pwMakeDocuments.setCreateTime(new Date()); + pwMakeDocuments.setCode(code); + pwMakeDocuments.setPrepared("系统出单"); + pwMakeDocuments.setDate(new Date()); + pwMakeDocuments.setDeclares("金蝶读取BOM制单"); + i = pwMakeDocumentsService.newInsertPwMakeDocuments(pwMakeDocuments); + if(i < 1){ + return "---------------生成企标单错误---------------"; + } + //生成明细 + PwMakeDocumentsDetail pwMakeDocumentsDetail = null; + for (PwBomNumberTwo pwBomNumberTwo : bomList) { + pwMakeDocumentsDetail = new PwMakeDocumentsDetail(); + pwMakeDocumentsDetail.setMakeDocumentsCode(code); + pwMakeDocumentsDetail.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + pwMakeDocumentsDetail.setName(pwBomNumberTwo.getName()); + pwMakeDocumentsDetail.setMaterialType(pwBomNumberTwo.getType()); + pwMakeDocumentsDetail.setQuantity(pwBomNumberTwo.getSumNumber()); + pwMakeDocumentsDetail.setDepartmentName(pwBomNumberTwo.getDepartmentName()); + pwMakeDocumentsDetail.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + pwMakeDocumentsDetail.setCompletionDate(pwBomNumberTwo.getCompletionDate()); + pwMakeDocumentsDetail.setParentLevelFigureNumber(pwBomNumberTwo.getParentLevelFigureNumber()); + pwMakeDocumentsDetail.setMaterialsName(pwBomNumberTwo.getMaterialsName()); + pwMakeDocumentsDetail.setMaterialsSpecification(pwBomNumberTwo.getMaterialsSpecification()); + pwMakeDocumentsDetail.setCompletionDate(pwBomNumberTwo.getCompletionDate()); + i = pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail); + if(i < 1){ + return "---------------生成企标明细单错误---------------"; + } + } + }else{ + PwProductionBill pwProductionBill = new PwProductionBill(); + pwProductionBill.setCode(code); + pwProductionBill.setStatus("未完成"); + //项目说明 + pwProductionBill.setIllustrate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + " 金蝶执行单"); + i = pwProductionBillService.insertPwProductionBillWF(pwProductionBill); + if(i < 1){ + return "---------------生成执行单错误---------------"; + } + + // 创建销齿链执行单详情信息 + PwProductionBillProduct pwProductionBillProduct = null; + for (PwBomNumberTwo pwBomNumberTwo : bomList) { + if(pwBomNumberTwo.getNum().indexOf(".") < 0 && pwBomNumberTwo.getName().indexOf("(M)") < 0){ + pwProductionBillProduct = new PwProductionBillProduct(); + // 执行单id + pwProductionBillProduct.setProductionBillId(pwProductionBill.getId()); + // 产品名称 + pwProductionBillProduct.setProductName(pwBomNumberTwo.getName()); + // 数量 + pwProductionBillProduct.setQuantity(pwBomNumberTwo.getSumNumber()); + pwProductionBillProduct.setProductType(pwBomNumberTwo.getSparedOne()); + // 删除标记 + pwProductionBillProduct.setDelFlag(0); + //保存零部件明细文件路径 + i = pwProductionBillProductService.insertPwProductionBillProduct(pwProductionBillProduct); + if(i < 1){ + return "---------------生成执行明细单错误---------------"; + } + } + } + } + return null; + } + + /** + * 同步库存信息 + * @param code 执行单号 + */ + public void selectInventoryDetail(String code){ + int i = 0; + //根据令号查询bom + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndAll(code); + for (PwBomNumberTwo pwBomNumberTwo : list) { + //判断是标准件 + String ch = pwBomNumberTwo.getFigureNumber().substring(3,4); + if(!("009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))&&!ch.matches("[a-zA-Z]+")) && !("017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))&&!ch.matches("[a-zA-Z]+")) + && !" ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2)) && !"成品".equals(pwBomNumberTwo.getType())){ + //判断是第一序 + if("1".equals(pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1))){ + if(StringUtils.isNotEmpty(pwBomNumberTwo.getMaterialsSpecification())){ + pwBomNumberTwo.setName(pwBomNumberTwo.getMaterialsName()); + pwBomNumberTwo.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + } + } + } + //查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(imMaterial == null){ + imMaterial = new ImMaterial(); + imMaterial.setCreateTime(new Date()); + imMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + imMaterial.setMaterialName(pwBomNumberTwo.getName().replaceAll("x","X")); + imMaterial.setMaterials(pwBomNumberTwo.getType()); + imMaterial.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + imMaterialService.insertImMaterial(imMaterial); + } + //根据图号查询库存数量够不够,如果够就添加有库存标记' + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + inventoryDetail.setQuantity(inventoryDetail.getQuantity() + pwBomNumberTwo.getSumNumber()); + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber() + pwBomNumberTwo.getSumNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + inventoryDetail = new PwInventoryDetail(); + //名称 + inventoryDetail.setName(pwBomNumberTwo.getName()); + //图号 + inventoryDetail.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + inventoryDetail.setMaterials(pwBomNumberTwo.getType()); + //单重 + inventoryDetail.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //物料类型 + if(("009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))&&!ch.matches("[a-zA-Z]+")) || ("017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))&&!ch.matches("[a-zA-Z]+")) || " ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2))){ + inventoryDetail.setType("标准件"); + inventoryDetail.setWarehouseName("标准件库"); + }else if(null==pwBomNumberTwo.getParentLevelFigureNumber()){ + inventoryDetail.setType("成品"); + inventoryDetail.setWarehouseName("成品库"); + } + //预定数量 + inventoryDetail.setLockNumber(pwBomNumberTwo.getSumNumber()); + //可用数量 + inventoryDetail.setAvailableNumber(0L); + inventoryDetail.setQuantity(pwBomNumberTwo.getSumNumber()); + //删除标记 + inventoryDetail.setDelFlag(0); + pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail); + } + } + } + + /** + * 解析excel 保存到金蝶临时库中 + * @param sheet + * @param code + */ + private void createJDBomNumber(Sheet sheet,String code){ + JdBomNumber jdBomNumber = null; + List list = new ArrayList(); + //得到行数 + int rowNumbers = sheet.getLastRowNum() + 1; + String typeName = ""; + for(int p=1;p< rowNumbers;p++){ + Row row = sheet.getRow(p); + jdBomNumber = new JdBomNumber(); + if(StringUtils.isEmpty(row.getCell(5).toString())){ + logger.error("-----------------------------------------金蝶BOM错误,"+row.getCell(2).toString()+"缺少材质!!--------------------------------------------"); + return; + } + if("部件".equals(row.getCell(5).toString()) || "成品".equals(row.getCell(5).toString())){ + continue; + } + //材料 + jdBomNumber.setType(row.getCell(5).toString()); + //令号 + jdBomNumber.setProductionCode(code); + jdBomNumber.setCreateTime(new Date()); + if(StringUtils.isEmpty(row.getCell(1).toString())){ + logger.error("-----------------------------------------金蝶BOM错误,"+row.getCell(2).toString()+"缺少序号!!--------------------------------------------"); + return; + } + if(row.getCell(1).toString().indexOf(".0") > 0){ + jdBomNumber.setNum(row.getCell(1).toString().substring(0,row.getCell(1).toString().indexOf(".0"))); + }else{ + jdBomNumber.setNum(row.getCell(1).toString()); + } + if(StringUtils.isEmpty(row.getCell(2).toString())){ + logger.error("-----------------------------------------金蝶BOM错误,"+p+"行缺少图号!!--------------------------------------------"); + return; + } + String substring = row.getCell(2).toString().substring(0, 3); + String substring5 = row.getCell(2).toString().substring(0, 2); + String ch = row.getCell(2).toString().substring(3,4); + if(("009".equals(substring)&&!ch.matches("[a-zA-Z]+")) || ("017".equals(substring)&&!ch.matches("[a-zA-Z]+")) || " ".equals(substring5)){ + //图号 + jdBomNumber.setFigureNumber(row.getCell(2).toString()); + }else{ + if(row.getCell(2).toString().contains("/2-1")){ + jdBomNumber.setFigureNumber(row.getCell(2).toString().replaceAll("/2-1", "")); + }else if(row.getCell(2).toString().contains("/2-2")){ + jdBomNumber.setFigureNumber(row.getCell(2).toString().replaceAll("/2-2", "")); + }else if(row.getCell(2).toString().contains("/3-1")){ + jdBomNumber.setFigureNumber(row.getCell(2).toString().replaceAll("/3-1", "")); + }else if(row.getCell(2).toString().contains("/3-2")){ + jdBomNumber.setFigureNumber(row.getCell(2).toString().replaceAll("/3-2", "")); + }else if(row.getCell(2).toString().contains("/3-3")){ + jdBomNumber.setFigureNumber(row.getCell(2).toString().replaceAll("/3-3", "")); + }else{ + jdBomNumber.setFigureNumber(row.getCell(2).toString()); + } + } + if(jdBomNumber.getNum().indexOf(".") < 0) { + typeName = jdBomNumber.getFigureNumber(); + } + jdBomNumber.setTypeName(typeName); + if(StringUtils.isEmpty(row.getCell(3).toString())){ + logger.error("-----------------------------------------金蝶BOM错误,"+row.getCell(2).toString()+"缺少物料名称!!--------------------------------------------"); + return; + } + jdBomNumber.setName(row.getCell(3).toString().replaceAll("x", "X")); + //单台数量 + if (StringUtils.isEmpty(row.getCell(4).toString())) { + logger.error("-----------------------------------------金蝶BOM错误,"+row.getCell(2).toString()+"缺少单台数量!!--------------------------------------------"); + return; + } + jdBomNumber.setOneNumber(Double.valueOf(row.getCell(4).toString()).longValue()); + //单重 + if (StringUtils.isNotEmpty(row.getCell(6).toString())) { + jdBomNumber.setPieceWeight(Double.valueOf(row.getCell(6).toString())); + } + jdBomNumber.setUnit(row.getCell(9).toString()); + jdBomNumber.setWorkshopSection(row.getCell(10).toString()); + jdBomNumber.setXuTime(Double.valueOf(row.getCell(11).toString())); + list.add(jdBomNumber); + } + jdBomNumberService.insertJdBomNumber(list); + } + + /** + * 临时库中数据转化为BOM + * @param code + */ + private void createPwBomNumber(String code){ + //读取临时库中的数据 + List jdbom_list = jdBomNumberService.selectJdBomNumberByCode(code); + //转化为erp数据 + PwBomNumber pwBomNumber = null; + for (int i=0;i 0){ + jdbom_list.remove(i); + i--; + continue; + } + //查找产品 + if(jdbom_list.get(i).getNum().indexOf(".") < 0){ + pwBomNumber = new PwBomNumber(); + pwBomNumber.setCreateTime(new Date()); + pwBomNumber.setNum(jdbom_list.get(i).getNum()); + pwBomNumber.setProductionCode(code); + pwBomNumber.setOneNumber(1l); + pwBomNumber.setSumNumber(jdbom_list.get(i).getOneNumber()); + pwBomNumber.setFigureNumber(jdbom_list.get(i).getFigureNumber()); + pwBomNumber.setName(jdbom_list.get(i).getName()); + pwBomNumber.setType(jdbom_list.get(i).getType()); + pwBomNumber.setTypeName(jdbom_list.get(i).getTypeName()); + pwBomNumber.setPieceWeight(jdbom_list.get(i).getPieceWeight()); + int p = pwBomNumberService.insertPwBomNumber(pwBomNumber); + if(p < 1){ + logger.info("-----------------------------------添加数据到 PwBomNumber 失败!!!--------------------------------------------------"); + return; + } + jdbom_list.remove(i); + i--; + } + } + recursionBomNumber(jdbom_list,code); + } + + /** + * 递归查找子集 + * @param jdbom_list + * @param code + */ + private void recursionBomNumber(List jdbom_list,String code){ + if(null == jdbom_list || jdbom_list.size() == 0){ + logger.info("-----------------------------------此物料没有子集!!!--------------------------------------------------"); + return; + } + List bomList = pwBomNumberService.queryPwBomNumberByCode(code); + //转化为erp数据 + PwBomNumber pwBomNumber = null; + List in_list = new ArrayList(); + for (PwBomNumber bomNumber : bomList) { + for(int p=0;p 0){ + pwBomNumberService.insertPwBoms(in_list); + } + recursionBomNumber(jdbom_list,code); + } + + /** + * 生成生产BOM + * @param code + */ + private void createBomNumberTwo(String code){ + List bom_list = pwBomNumberService.queryPwBomNumberZTByCode(code); + for (PwBomNumber pwBomNumber : bom_list) { + //把数据保存到数量保存表中 + PwBomNumberTwo pbt = new PwBomNumberTwo(); + pbt.setProductionCode(pwBomNumber.getProductionCode()); + pbt.setNum(pwBomNumber.getNum ()); + pbt.setFigureNumber(pwBomNumber.getFigureNumber()); + pbt.setName(pwBomNumber.getName()); + pbt.setOneNumber(pwBomNumber.getOneNumber()); + pbt.setType(pwBomNumber.getType()); + pbt.setPieceWeight(pwBomNumber.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber.getParentLevelName()); + //把总装图的单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber.getSumNumber()); + pbt.setSparedOne(pwBomNumber.getTypeName()); + pbt.setRemarks(pwBomNumber.getRemarks()); + pbt.setDelFlag(0); + //计算后的bom表添加数据bom + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + + PwBomNumberTwoLingliao pbtLingliao = new PwBomNumberTwoLingliao(); + pbtLingliao.setProductionCode(pwBomNumber.getProductionCode()); + pbtLingliao.setNum(pwBomNumber.getNum()); + pbtLingliao.setFigureNumber(pwBomNumber.getFigureNumber()); + pbtLingliao.setName(pwBomNumber.getName()); + pbtLingliao.setOneNumber(pwBomNumber.getOneNumber()); + pbtLingliao.setType(pwBomNumber.getType()); + pbtLingliao.setPieceWeight(pwBomNumber.getPieceWeight()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelName(pwBomNumber.getParentLevelName()); + //把总装图的单台数量保存到本批数量中 + pbtLingliao.setSumNumber(pwBomNumber.getSumNumber()); + pbtLingliao.setSparedOne(pwBomNumber.getTypeName()); + pbtLingliao.setRemarks(pwBomNumber.getRemarks()); + pbtLingliao.setDelFlag(0); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + //递归查询所有子集 + recursionCountNum(pwBomNumber.getFigureNumber(),code,pwBomNumber.getOneNumber(),pwBomNumber.getSumNumber()); + } + } + + /** + * 递归查询所有子集 + * @param figureNumber 父级图号 + * @param code 执行单号 + * @param number 单台数量 + * @param sumNumber 本批产品数量 + */ + private void recursionCountNum(String figureNumber,String code,Long number,Long sumNumber){ + //根据总装图的图号查找其下所有子集 + List bomList = pwBomNumberService.selectPwBomNumberByParentFigureNumber(figureNumber,code); + //把数据保存到数量保存表中 + PwBomNumberTwo pbt = null; + PwBomNumberTwoLingliao pbtLingliao = null; + for (PwBomNumber pwBomNumber : bomList) { + //插入数据前根据令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + pbt = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(code, pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + if(null != pbt){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + pbt.setOneNumber(pbt.getOneNumber() + number * pwBomNumber.getOneNumber()); + pbt.setSumNumber(pbt.getSumNumber() + number * pwBomNumber.getOneNumber() * sumNumber); + pwBomNumberTwoService.updatePwBomNumberTwo(pbt); + }else{ + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbt.setProductionCode(code); + pbt.setNum(pwBomNumber.getNum()); + pbt.setFigureNumber(pwBomNumber.getFigureNumber()); + pbt.setName(pwBomNumber.getName()); + pbt.setOneNumber(number * pwBomNumber.getOneNumber()); + pbt.setType(pwBomNumber.getType()); + pbt.setPieceWeight(pwBomNumber.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber.getParentLevelName()); + //把单台数量保存到本批数量中,最后单台数量乘以总台数,就是本批数量 + pbt.setSumNumber(number * pwBomNumber.getOneNumber() * sumNumber); + pbt.setSparedOne(pwBomNumber.getTypeName()); + pbt.setInventoryStatus("未完成"); + pbt.setRemarks(pwBomNumber.getRemarks()); + pbt.setReceiveNumber(0l); + pbt.setDelFlag(0); + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + pbtLingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingLiaoByCodeAndNameAndFigureNumber(code, pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + if (null != pbtLingliao) { + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + pbtLingliao.setOneNumber(pbtLingliao.getOneNumber() + number * pwBomNumber.getOneNumber()); + pbtLingliao.setSumNumber(pbtLingliao.getSumNumber() + number * pwBomNumber.getOneNumber() * sumNumber); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(pbtLingliao); + } else { + pbtLingliao = new PwBomNumberTwoLingliao(); + pbtLingliao.setProductionCode(code); + pbtLingliao.setNum(pwBomNumber.getNum()); + pbtLingliao.setFigureNumber(pwBomNumber.getFigureNumber()); + pbtLingliao.setName(pwBomNumber.getName()); + pbtLingliao.setOneNumber(number * pwBomNumber.getOneNumber()); + pbtLingliao.setType(pwBomNumber.getType()); + pbtLingliao.setPieceWeight(pwBomNumber.getPieceWeight()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelName(pwBomNumber.getParentLevelName()); + //把单台数量保存到本批数量中,最后单台数量乘以总台数,就是本批数量 + pbtLingliao.setSumNumber(number * pwBomNumber.getOneNumber() * sumNumber); + pbtLingliao.setSparedOne(pwBomNumber.getTypeName()); + pbtLingliao.setRemarks(pwBomNumber.getRemarks()); + pbtLingliao.setDelFlag(0); + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + recursionCountNum(pwBomNumber.getFigureNumber(),code,pbt.getOneNumber(),sumNumber); + } + } + + /** + * 添加工序 + * @param code + */ + private void addProcesses(String code){ + //查询本批次下不是标准件的数据 + List bomnumber_list = pwBomNumberTwoService.selectPwBomNumberTwoByCode(code); + //查询金蝶临时库存 (序 )数据 + List jdBom_list = jdBomNumberService.queryJdBomNumberByCode(code); + //存储工序数据 + PwBomNumberTwo bomTwo = null; + List in_list = new ArrayList(); + for (PwBomNumberTwo pwBomNumberTwo : bomnumber_list) { + for (JdBomNumber jdBomNumber : jdBom_list) { + if("原材料".equals(jdBomNumber.getWorkshopSection())){ + continue; + } + String xuhao = jdBomNumber.getNum().substring(0,jdBomNumber.getNum().indexOf("-0")); + if(xuhao.equals(pwBomNumberTwo.getNum())){ + bomTwo = new PwBomNumberTwo(); + bomTwo.setCreateTime(new Date()); + bomTwo.setProductionCode(code); + bomTwo.setNum(pwBomNumberTwo.getNum()); + bomTwo.setFigureNumber(jdBomNumber.getFigureNumber()); + bomTwo.setName(jdBomNumber.getName()+"(M)"); + bomTwo.setOneNumber(pwBomNumberTwo.getOneNumber()); + bomTwo.setType(pwBomNumberTwo.getType()); + bomTwo.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + bomTwo.setParentLevelFigureNumber(pwBomNumberTwo.getFigureNumber()); + bomTwo.setParentLevelName(pwBomNumberTwo.getName()); + bomTwo.setSumNumber(pwBomNumberTwo.getSumNumber()); + bomTwo.setSparedOne(jdBomNumber.getTypeName()); + bomTwo.setSuperiorId(pwBomNumberTwo.getId()); + bomTwo.setDepartmentName(jdBomNumber.getWorkshopSection()); + in_list.add(bomTwo); + } + } + } + if(null != in_list && in_list.size() > 0){ + pwBomNumberTwoService.insertBatchPwBomNumberTwo(in_list); + } + //查询生产BOM + List gx_list = pwBomNumberTwoService.selectPwBomNumberTwoByCode(code); + //循环处理毛坯和第一序的关系 + for(int i=0;i list = jdBomMateriallsService.selectJdBomMateriallsList(jdBomMaterialls); + return getDataTable(list); + } + + /** + * 查询金蝶BOM物料信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:bomMaterialls:materialList')") + @GetMapping("/materialList") + public TableDataInfo materialList(JdBomMaterialls jdBomMaterialls) + { + startPage(); + List list = jdBomMateriallsService.selectJdBomMateriallsList(jdBomMaterialls); + return getDataTable(list); + } + + /** + * 导出金蝶BOM物料信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:bomMaterialls:export')") + @Log(title = "金蝶BOM物料信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(JdBomMaterialls jdBomMaterialls) + { + List list = jdBomMateriallsService.selectJdBomMateriallsList(jdBomMaterialls); + ExcelUtil util = new ExcelUtil(JdBomMaterialls.class); + return util.exportExcel(list, "materialls"); + } + + /** + * 新增金蝶BOM物料信息 + */ + @PreAuthorize("@ss.hasPermi('management:bomMaterialls:add')") + @Log(title = "金蝶BOM物料信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody JdBomMaterialls jdBomMaterialls) + { + return toAjax(jdBomMateriallsService.insertJdBomMaterialls(jdBomMaterialls)); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/JdBomRecordController.java b/evo/src/main/java/com/ruoyi/project/management/controller/JdBomRecordController.java new file mode 100644 index 0000000..95bc5f1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/JdBomRecordController.java @@ -0,0 +1,73 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import com.ruoyi.project.management.service.PlannedOrderService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.project.management.domain.JdBomRecord; +import com.ruoyi.project.management.service.IJdBomRecordService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 金蝶BOM记录Controller + * + * @author chenyongjiang + * @date 2024-04-24 + */ +@RestController +@RequestMapping("/management/jdBomRecord") +public class JdBomRecordController extends BaseController +{ + @Autowired + private IJdBomRecordService jdBomRecordService; + @Autowired + private PlannedOrderService plannedOrderService; + + /** + * 查询金蝶BOM记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:jdBomRecord:list')") + @GetMapping("/list") + public TableDataInfo list(JdBomRecord jdBomRecord) + { + startPage(); + List list = jdBomRecordService.selectJdBomRecordList(jdBomRecord); + return getDataTable(list); + } + + /** + * 推送金蝶记录 + */ + @PreAuthorize("@ss.hasPermi('management:jdBomRecord:upLoad')") + @GetMapping(value = "/{id}") + public AjaxResult upLoadRecord(@PathVariable("id") Long id) + { + return jdBomRecordService.pushJdProcesses(id); + } + + /** + * 打完成标识 + * @param id + * @return + */ + @PreAuthorize("@ss.hasPermi('management:jdBomRecord:delete')") + @GetMapping(value = "/update/{id}") + public AjaxResult updateRecord(@PathVariable("id") Long id) + { + return toAjax(jdBomRecordService.updateJdBomRecordById(id)); + } + + @PreAuthorize("@ss.hasPermi('management:jdBomRecord:placementOrder')") + @GetMapping("/placementOrder") + public void placementOrder(JdBomRecord jdBomRecord) + { + plannedOrderService.queryPlannedOrders(); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/JdCurrencyController.java b/evo/src/main/java/com/ruoyi/project/management/controller/JdCurrencyController.java new file mode 100644 index 0000000..6745c8f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/JdCurrencyController.java @@ -0,0 +1,96 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.JdCurrency; +import com.ruoyi.project.management.service.IJdCurrencyService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 币别Controller + * + * @author zhukangchao + * @date 2023-12-15 + */ +@RestController +@RequestMapping("/management/currency") +public class JdCurrencyController extends BaseController { + @Autowired + private IJdCurrencyService jdCurrencyService; + + /** + * 查询币别列表 + */ + @PreAuthorize("@ss.hasPermi('management:currency:list')") + @GetMapping("/list") + public TableDataInfo list(JdCurrency jdCurrency) { + startPage(); + List list = jdCurrencyService.selectJdCurrencyList(jdCurrency); + return getDataTable(list); + } + + /** + * 导出币别列表 + */ + @PreAuthorize("@ss.hasPermi('management:currency:export')") + @Log(title = "币别", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(JdCurrency jdCurrency) { + List list = jdCurrencyService.selectJdCurrencyList(jdCurrency); + ExcelUtil util = new ExcelUtil(JdCurrency.class); + return util.exportExcel(list, "currency"); + } + + /** + * 获取币别详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:currency:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(jdCurrencyService.selectJdCurrencyById(id)); + } + + /** + * 新增币别 + */ + @PreAuthorize("@ss.hasPermi('management:currency:add')") + @Log(title = "币别", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody JdCurrency jdCurrency) { + return toAjax(jdCurrencyService.insertJdCurrency(jdCurrency)); + } + + /** + * 修改币别 + */ + @PreAuthorize("@ss.hasPermi('management:currency:edit')") + @Log(title = "币别", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody JdCurrency jdCurrency) { + return toAjax(jdCurrencyService.updateJdCurrency(jdCurrency)); + } + + /** + * 删除币别 + */ + @PreAuthorize("@ss.hasPermi('management:currency:remove')") + @Log(title = "币别", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(jdCurrencyService.deleteJdCurrencyByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/JdExpenseItemsController.java b/evo/src/main/java/com/ruoyi/project/management/controller/JdExpenseItemsController.java new file mode 100644 index 0000000..4185dfe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/JdExpenseItemsController.java @@ -0,0 +1,98 @@ +package com.ruoyi.project.management.controller; + +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.JdExpenseItems; +import com.ruoyi.project.management.service.IJdExpenseItemsService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 费用项目Controller + * + * @author zhukangchao + * @date 2023-12-16 + */ +@RestController +@RequestMapping("/management/items") +public class JdExpenseItemsController extends BaseController { + @Autowired + private IJdExpenseItemsService jdExpenseItemsService; + + /** + * 查询费用项目列表 + */ + @PreAuthorize("@ss.hasPermi('management:items:list')") + @GetMapping("/list") + public TableDataInfo list(JdExpenseItems jdExpenseItems) { + startPage(); + List list = jdExpenseItemsService.selectJdExpenseItemsList(jdExpenseItems); + return getDataTable(list); + } + + /** + * 导出费用项目列表 + */ + @PreAuthorize("@ss.hasPermi('management:items:export')") + @Log(title = "费用项目", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(JdExpenseItems jdExpenseItems) { + List list = jdExpenseItemsService.selectJdExpenseItemsList(jdExpenseItems); + ExcelUtil util = new ExcelUtil(JdExpenseItems.class); + return util.exportExcel(list, "items"); + } + + /** + * 获取费用项目详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:items:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(jdExpenseItemsService.selectJdExpenseItemsById(id)); + } + + /** + * 新增费用项目 + */ + @PreAuthorize("@ss.hasPermi('management:items:add')") + @Log(title = "费用项目", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody JdExpenseItems jdExpenseItems) { + return toAjax(jdExpenseItemsService.insertJdExpenseItems(jdExpenseItems)); + } + + /** + * 修改费用项目 + */ + @PreAuthorize("@ss.hasPermi('management:items:edit')") + @Log(title = "费用项目", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody JdExpenseItems jdExpenseItems) { + jdExpenseItems.setUpdateTime(new Date()); + return toAjax(jdExpenseItemsService.updateJdExpenseItems(jdExpenseItems)); + } + + /** + * 删除费用项目 + */ + @PreAuthorize("@ss.hasPermi('management:items:remove')") + @Log(title = "费用项目", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(jdExpenseItemsService.deleteJdExpenseItemsByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/JdProcessBomController.java b/evo/src/main/java/com/ruoyi/project/management/controller/JdProcessBomController.java new file mode 100644 index 0000000..18068df --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/JdProcessBomController.java @@ -0,0 +1,81 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.JdProcessBom; +import com.ruoyi.project.management.service.IJdProcessBomService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 金蝶工序BOM记录Controller + * + * @author chenyongjiang + * @date 2024-05-07 + */ +@RestController +@RequestMapping("/management/jdProcessBom") +public class JdProcessBomController extends BaseController +{ + @Autowired + private IJdProcessBomService jdProcessBomService; + + /** + * 查询金蝶工序BOM记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:jdProcessBom:list')") + @GetMapping("/list") + public TableDataInfo list(JdProcessBom jdProcessBom) + { + List list = jdProcessBomService.selectJdProcessBomList(jdProcessBom); + return getDataTable(list); + } + + /** + * 获取金蝶工序BOM记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:jdProcessBom:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(jdProcessBomService.selectJdProcessBomById(id)); + } + + /** + * 审核金蝶工序BOM记录 + */ + @PreAuthorize("@ss.hasPermi('management:jdProcessBom:add')") + @Log(title = "审核金蝶工序BOM记录", businessType = BusinessType.INSERT) + @GetMapping(value = "/audit/{id}") + public AjaxResult audit(@PathVariable("id") Long id) + { + return toAjax(jdProcessBomService.auditJdProcessBom(id)); + } + + /** + * 修改金蝶工序BOM记录 + */ + @PreAuthorize("@ss.hasPermi('management:jdProcessBom:edit')") + @Log(title = "修改金蝶工序BOM记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody JdProcessBom jdProcessBom) + { + jdProcessBom.setFlag("1"); + return toAjax(jdProcessBomService.updateJdProcessBom(jdProcessBom)); + } + + @PreAuthorize("@ss.hasPermi('management:jdProcessBom:remove')") + @Log(title = "删除金蝶工序BOM记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(jdProcessBomService.deleteJdProcessBomById(id)); + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/JdReceiptsDataInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/JdReceiptsDataInfoController.java new file mode 100644 index 0000000..209277a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/JdReceiptsDataInfoController.java @@ -0,0 +1,140 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.JdReceiptsDataInfo; +import com.ruoyi.project.management.service.IJdReceiptsDataInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 财务系统数据信息Controller + * + * @author zhukangchao + * @date 2023-11-27 + */ +@RestController +@RequestMapping("/management/jdReceiptsDataInfo") +public class JdReceiptsDataInfoController extends BaseController +{ + @Autowired + private IJdReceiptsDataInfoService jdReceiptsDataInfoService; + + /** + * 查询财务系统数据信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:jdReceiptsDataInfo:list')") + @GetMapping("/list") + public TableDataInfo list(JdReceiptsDataInfo jdReceiptsDataInfo) + { + startPage(); + List list = jdReceiptsDataInfoService.selectJdReceiptsDataInfoList(jdReceiptsDataInfo); + return getDataTable(list); + } + + /** + * 导出财务系统数据信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:jdReceiptsDataInfo:export')") + @Log(title = "财务系统数据信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(JdReceiptsDataInfo jdReceiptsDataInfo) + { + List list = jdReceiptsDataInfoService.selectJdReceiptsDataInfoList(jdReceiptsDataInfo); + ExcelUtil util = new ExcelUtil(JdReceiptsDataInfo.class); + return util.exportExcel(list, "jdReceiptsDataInfo"); + } + + /** + * 获取财务系统数据信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:jdReceiptsDataInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(jdReceiptsDataInfoService.selectJdReceiptsDataInfoById(id)); + } + + /** + * 新增财务系统数据信息 + */ + @Log(title = "财务系统数据信息", businessType = BusinessType.INSERT) + @RequestMapping("/addInfo") + public AjaxResult add(@RequestBody String json){ + JdReceiptsDataInfo jdReceiptsDataInfo = JSONObject.parseObject(json, JdReceiptsDataInfo.class); + //校验 + if(null==jdReceiptsDataInfo.getCode()||"".equals(jdReceiptsDataInfo.getCode())){ + //编号为null + return AjaxResult.error(101, "编号不允许为空"); + } + if(null==jdReceiptsDataInfo.getContractCode()||"".equals(jdReceiptsDataInfo.getContractCode())){ + //关联单据编号为null + return AjaxResult.error(102, "关联单据编号不允许为空"); + } + if(null==jdReceiptsDataInfo.getType()||"".equals(jdReceiptsDataInfo.getType())){ + //单据类型为null + return AjaxResult.error(103, "单据类型不允许为空"); + } + if(null==jdReceiptsDataInfo.getSign()||"".equals(jdReceiptsDataInfo.getSign())){ + //操作类型为null + return AjaxResult.error(104, "操作类型不允许为空"); + } + if(!"1".equals(jdReceiptsDataInfo.getBusinessSign())&&!"2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //操作类型为null + return AjaxResult.error(105, "非法的操作类型"); + } + if(null==jdReceiptsDataInfo.getMoney()||"".equals(jdReceiptsDataInfo.getMoney())||jdReceiptsDataInfo.getMoney()<=0){ + //金额为null或者金额小于等于0 + return AjaxResult.error(106, "金额不允许为空且不允许为0"); + } + int i = jdReceiptsDataInfoService.insertJdReceiptsDataInfo(jdReceiptsDataInfo); + if(1 == i){ + return AjaxResult.success("保存成功"); + }else if(4004 == i){ + return AjaxResult.error(4004,"无法处理的业务类型"); + }else if(5004 == i){ + return AjaxResult.error(5004,"未查询到相关的关联单据"); + }else if(6004 == i){ + return AjaxResult.error(6004,"无法处理的操作类型"); + }else if(7004 == i){ + return AjaxResult.error(7004,"无法处理的业务类型"); + } + return toAjax(1); + } + + /** + * 修改财务系统数据信息 + */ + @PreAuthorize("@ss.hasPermi('management:jdReceiptsDataInfo:edit')") + @Log(title = "财务系统数据信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody JdReceiptsDataInfo jdReceiptsDataInfo) + { + return toAjax(jdReceiptsDataInfoService.updateJdReceiptsDataInfo(jdReceiptsDataInfo)); + } + + /** + * 删除财务系统数据信息 + */ + @PreAuthorize("@ss.hasPermi('management:jdReceiptsDataInfo:remove')") + @Log(title = "财务系统数据信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(jdReceiptsDataInfoService.deleteJdReceiptsDataInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/MaterialSecureController.java b/evo/src/main/java/com/ruoyi/project/management/controller/MaterialSecureController.java new file mode 100644 index 0000000..f064fb3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/MaterialSecureController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.MaterialSecure; +import com.ruoyi.project.management.service.IMaterialSecureService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 安全库存设置Controller + * + * @author chenyongjiang + * @date 2024-02-19 + */ +@RestController +@RequestMapping("/management/secure") +public class MaterialSecureController extends BaseController +{ + @Autowired + private IMaterialSecureService materialSecureService; + + /** + * 查询安全库存设置列表 + */ + @PreAuthorize("@ss.hasPermi('management:secure:list')") + @GetMapping("/list") + public TableDataInfo list(MaterialSecure materialSecure) + { + startPage(); + List list = materialSecureService.selectMaterialSecureList(materialSecure); + return getDataTable(list); + } + + /** + * 导出安全库存设置列表 + */ + @PreAuthorize("@ss.hasPermi('management:secure:export')") + @Log(title = "安全库存设置", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(MaterialSecure materialSecure) + { + List list = materialSecureService.selectMaterialSecureList(materialSecure); + ExcelUtil util = new ExcelUtil(MaterialSecure.class); + return util.exportExcel(list, "secure"); + } + + /** + * 获取安全库存设置详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:secure:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(materialSecureService.selectMaterialSecureById(id)); + } + + /** + * 新增安全库存设置 + */ + @PreAuthorize("@ss.hasPermi('management:secure:add')") + @Log(title = "安全库存设置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MaterialSecure materialSecure) + { + return toAjax(materialSecureService.insertMaterialSecure(materialSecure)); + } + + /** + * 修改安全库存设置 + */ + @PreAuthorize("@ss.hasPermi('management:secure:edit')") + @Log(title = "安全库存设置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MaterialSecure materialSecure) + { + return toAjax(materialSecureService.updateMaterialSecure(materialSecure)); + } + + /** + * 删除安全库存设置 + */ + @PreAuthorize("@ss.hasPermi('management:secure:remove')") + @Log(title = "安全库存设置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(materialSecureService.deleteMaterialSecureByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcCurtainMachineController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcCurtainMachineController.java new file mode 100644 index 0000000..69cfcef --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcCurtainMachineController.java @@ -0,0 +1,141 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcCurtainMachine; +import com.ruoyi.project.management.domain.PcWindlass; +import com.ruoyi.project.management.service.IPcCurtainMachineService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 大幕机型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/curtainMachine") +public class PcCurtainMachineController extends BaseController +{ + @Autowired + private IPcCurtainMachineService pcCurtainMachineService; + + /** + * 查询大幕机型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:curtainMachine:list')") + @GetMapping("/list") + public TableDataInfo list(PcCurtainMachine pcCurtainMachine) + { + startPage(); + List list = pcCurtainMachineService.selectPcCurtainMachineList(pcCurtainMachine); + return getDataTable(list); + } + + /** + * 导出大幕机型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:curtainMachine:export')") + @Log(title = "大幕机型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcCurtainMachine pcCurtainMachine) + { + List list = pcCurtainMachineService.selectPcCurtainMachineList(pcCurtainMachine); + ExcelUtil util = new ExcelUtil(PcCurtainMachine.class); + return util.exportExcel(list, "curtainMachine"); + } + + /** + * 获取大幕机型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:curtainMachine:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcCurtainMachineService.selectPcCurtainMachineById(id)); + } + + /** + * 新增大幕机型号 + */ + @PreAuthorize("@ss.hasPermi('management:curtainMachine:add')") + @Log(title = "大幕机型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcCurtainMachine pcCurtainMachine){ + //防止出现null指针异常 + if(null==pcCurtainMachine){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcCurtainMachine.getTypeName()||"".equals(pcCurtainMachine.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcCurtainMachine curtainMachine = pcCurtainMachineService.selectPcCurtainMachineByTypeName(pcCurtainMachine.getTypeName()); + if(null==curtainMachine){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcCurtainMachine.setProductName("大幕机"); + pcCurtainMachine.setDelFlag(0); + return toAjax(pcCurtainMachineService.insertPcCurtainMachine(pcCurtainMachine)); + } + + /** + * 修改大幕机型号 + */ + @PreAuthorize("@ss.hasPermi('management:curtainMachine:edit')") + @Log(title = "大幕机型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcCurtainMachine pcCurtainMachine){ + if(null==pcCurtainMachine.getTypeName()||"".equals(pcCurtainMachine.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcCurtainMachine curtainMachine = pcCurtainMachineService.selectPcCurtainMachineByTypeName(pcCurtainMachine.getTypeName()); + if(null==curtainMachine){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcCurtainMachineService.updatePcCurtainMachine(pcCurtainMachine)); + } + + /** + * 删除大幕机型号 + */ + @PreAuthorize("@ss.hasPermi('management:curtainMachine:remove')") + @Log(title = "大幕机型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcCurtainMachineService.deletePcCurtainMachineByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getCurtainMachine") + public AjaxResult selectCurtainMachine(String typeName){ + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error("请输入型号名称"); + } + PcCurtainMachine curtainMachine = pcCurtainMachineService.selectPcCurtainMachineByTypeName(typeName); + if(null==curtainMachine){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcDetentController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcDetentController.java new file mode 100644 index 0000000..96434ed --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcDetentController.java @@ -0,0 +1,142 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcDetent; +import com.ruoyi.project.management.domain.PcFTypeReducer; +import com.ruoyi.project.management.service.IPcDetentService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 制动器型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/detent") +public class PcDetentController extends BaseController +{ + @Autowired + private IPcDetentService pcDetentService; + + /** + * 查询制动器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:detent:list')") + @GetMapping("/list") + public TableDataInfo list(PcDetent pcDetent) + { + startPage(); + List list = pcDetentService.selectPcDetentList(pcDetent); + return getDataTable(list); + } + + /** + * 导出制动器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:detent:export')") + @Log(title = "制动器型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcDetent pcDetent) + { + List list = pcDetentService.selectPcDetentList(pcDetent); + ExcelUtil util = new ExcelUtil(PcDetent.class); + return util.exportExcel(list, "detent"); + } + + /** + * 获取制动器型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:detent:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcDetentService.selectPcDetentById(id)); + } + + /** + * 新增制动器型号 + */ + @PreAuthorize("@ss.hasPermi('management:detent:add')") + @Log(title = "制动器型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcDetent pcDetent){ + //防止出现null指针异常 + if(null==pcDetent){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcDetent.getTypeName()||"".equals(pcDetent.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcDetent detent = pcDetentService.selectPcDetentByTypeName(pcDetent.getTypeName()); + if(null!=detent){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcDetent.setProductName("制动器"); + pcDetent.setDelFlag(0); + return toAjax(pcDetentService.insertPcDetent(pcDetent)); + } + + /** + * 修改制动器型号 + */ + @PreAuthorize("@ss.hasPermi('management:detent:edit')") + @Log(title = "制动器型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcDetent pcDetent){ + if(null==pcDetent.getTypeName()||"".equals(pcDetent.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcDetent detent = pcDetentService.selectPcDetentByTypeName(pcDetent.getTypeName()); + if(null!=detent){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcDetentService.updatePcDetent(pcDetent)); + } + + /** + * 删除制动器型号 + */ + @PreAuthorize("@ss.hasPermi('management:detent:remove')") + @Log(title = "制动器型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcDetentService.deletePcDetentByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getDetent") + public AjaxResult selectDetent(String typeName){ + //型号名称为必填,校验非空 + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcDetent detent = pcDetentService.selectPcDetentByTypeName(typeName); + if(null!=detent){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcElectricalMachineryAcController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcElectricalMachineryAcController.java new file mode 100644 index 0000000..bf69da8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcElectricalMachineryAcController.java @@ -0,0 +1,127 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcElectricalMachineryAc; +import com.ruoyi.project.management.domain.PcTwoStageReductionGear; +import com.ruoyi.project.management.service.IPcElectricalMachineryAcService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 电机AC型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/electricalMachineryAc") +public class PcElectricalMachineryAcController extends BaseController +{ + @Autowired + private IPcElectricalMachineryAcService pcElectricalMachineryAcService; + + /** + * 查询电机AC型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:electricalMachineryAc:list')") + @GetMapping("/list") + public TableDataInfo list(PcElectricalMachineryAc pcElectricalMachineryAc) + { + startPage(); + List list = pcElectricalMachineryAcService.selectPcElectricalMachineryAcList(pcElectricalMachineryAc); + return getDataTable(list); + } + + /** + * 导出电机AC型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:electricalMachineryAc:export')") + @Log(title = "电机AC型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcElectricalMachineryAc pcElectricalMachineryAc) + { + List list = pcElectricalMachineryAcService.selectPcElectricalMachineryAcList(pcElectricalMachineryAc); + ExcelUtil util = new ExcelUtil(PcElectricalMachineryAc.class); + return util.exportExcel(list, "electricalMachineryAc"); + } + + /** + * 获取电机AC型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:electricalMachineryAc:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcElectricalMachineryAcService.selectPcElectricalMachineryAcById(id)); + } + + /** + * 新增电机AC型号 + */ + @PreAuthorize("@ss.hasPermi('management:electricalMachineryAc:add')") + @Log(title = "电机AC型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcElectricalMachineryAc pcElectricalMachineryAc){ + //防止出现null指针异常 + if(null==pcElectricalMachineryAc){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcElectricalMachineryAc.getTypeName()||"".equals(pcElectricalMachineryAc.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + pcElectricalMachineryAc.setProductName("电机AC"); + pcElectricalMachineryAc.setDelFlag(0); + return toAjax(pcElectricalMachineryAcService.insertPcElectricalMachineryAc(pcElectricalMachineryAc)); + } + + /** + * 修改电机AC型号 + */ + @PreAuthorize("@ss.hasPermi('management:electricalMachineryAc:edit')") + @Log(title = "电机AC型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcElectricalMachineryAc pcElectricalMachineryAc){ + if(null==pcElectricalMachineryAc.getTypeName()||"".equals(pcElectricalMachineryAc.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + return toAjax(pcElectricalMachineryAcService.updatePcElectricalMachineryAc(pcElectricalMachineryAc)); + } + + /** + * 删除电机AC型号 + */ + @PreAuthorize("@ss.hasPermi('management:electricalMachineryAc:remove')") + @Log(title = "电机AC型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + return toAjax(pcElectricalMachineryAcService.deletePcElectricalMachineryAcByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getElectricalMachineryAc") + public AjaxResult selectElectricalMachineryAc(PcElectricalMachineryAc pcElectricalMachineryAc){ + List list = pcElectricalMachineryAcService.selectPcElectricalMachineryAcList(pcElectricalMachineryAc); + if(list.size()>0){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcFTypeReducerController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcFTypeReducerController.java new file mode 100644 index 0000000..421a3e2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcFTypeReducerController.java @@ -0,0 +1,141 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcFTypeReducer; +import com.ruoyi.project.management.domain.PcTwoStageReductionGear; +import com.ruoyi.project.management.service.IPcFTypeReducerService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * F型减速机型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/fTypeReducer") +public class PcFTypeReducerController extends BaseController +{ + @Autowired + private IPcFTypeReducerService pcFTypeReducerService; + + /** + * 查询F型减速机型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:fTypeReducer:list')") + @GetMapping("/list") + public TableDataInfo list(PcFTypeReducer pcFTypeReducer) + { + startPage(); + List list = pcFTypeReducerService.selectPcFTypeReducerList(pcFTypeReducer); + return getDataTable(list); + } + + /** + * 导出F型减速机型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:fTypeReducer:export')") + @Log(title = "F型减速机型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcFTypeReducer pcFTypeReducer) + { + List list = pcFTypeReducerService.selectPcFTypeReducerList(pcFTypeReducer); + ExcelUtil util = new ExcelUtil(PcFTypeReducer.class); + return util.exportExcel(list, "fTypeReducer"); + } + + /** + * 获取F型减速机型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:fTypeReducer:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcFTypeReducerService.selectPcFTypeReducerById(id)); + } + + /** + * 新增F型减速机型号 + */ + @PreAuthorize("@ss.hasPermi('management:fTypeReducer:add')") + @Log(title = "F型减速机型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcFTypeReducer pcFTypeReducer){ + //防止出现null指针异常 + if(null==pcFTypeReducer){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcFTypeReducer.getTypeName()||"".equals(pcFTypeReducer.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcFTypeReducer fTypeReducer = pcFTypeReducerService.selectPcFTypeReducerByTypeName(pcFTypeReducer.getTypeName()); + if(null!=fTypeReducer){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcFTypeReducer.setProductName("F型减速机"); + pcFTypeReducer.setDelFlag(0); + return toAjax(pcFTypeReducerService.insertPcFTypeReducer(pcFTypeReducer)); + } + + /** + * 修改F型减速机型号 + */ + @PreAuthorize("@ss.hasPermi('management:fTypeReducer:edit')") + @Log(title = "F型减速机型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcFTypeReducer pcFTypeReducer){ + if(null==pcFTypeReducer.getTypeName()||"".equals(pcFTypeReducer.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcFTypeReducer fTypeReducer = pcFTypeReducerService.selectPcFTypeReducerByTypeName(pcFTypeReducer.getTypeName()); + if(null!=fTypeReducer){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcFTypeReducerService.updatePcFTypeReducer(pcFTypeReducer)); + } + + /** + * 删除F型减速机型号 + */ + @PreAuthorize("@ss.hasPermi('management:fTypeReducer:remove')") + @Log(title = "F型减速机型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + return toAjax(pcFTypeReducerService.deletePcFTypeReducerByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getFTypeReducer") + public AjaxResult selectFTypeReducer(String typeName){ + //型号名称为必填,校验非空 + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcFTypeReducer fTypeReducer = pcFTypeReducerService.selectPcFTypeReducerByTypeName(typeName); + if(null!=fTypeReducer){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcFireCurtainDampingDriveController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcFireCurtainDampingDriveController.java new file mode 100644 index 0000000..fbe2b58 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcFireCurtainDampingDriveController.java @@ -0,0 +1,170 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PcCurtainMachine; +import com.ruoyi.project.management.domain.PcFireCurtainDampingDrive; +import com.ruoyi.project.management.domain.PcStrokeMeasurement; +import com.ruoyi.project.management.service.IPcFireCurtainDampingDriveService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 防火隔离幕阻尼驱动型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/fireCurtainDampingDrive") +public class PcFireCurtainDampingDriveController extends BaseController +{ + @Autowired + private IPcFireCurtainDampingDriveService pcFireCurtainDampingDriveService; + //用户标识信息 + @Autowired + private TokenService tokenService; + + /** + * 查询防火隔离幕阻尼驱动型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:fireCurtainDampingDrive:list')") + @GetMapping("/list") + public TableDataInfo list(PcFireCurtainDampingDrive pcFireCurtainDampingDrive) + { + startPage(); + List list = pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveList(pcFireCurtainDampingDrive); + return getDataTable(list); + } + + /** + * 导出防火隔离幕阻尼驱动型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:fireCurtainDampingDrive:export')") + @Log(title = "防火隔离幕阻尼驱动型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcFireCurtainDampingDrive pcFireCurtainDampingDrive) + { + List list = pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveList(pcFireCurtainDampingDrive); + ExcelUtil util = new ExcelUtil(PcFireCurtainDampingDrive.class); + return util.exportExcel(list, "fireCurtainDampingDrive"); + } + + /** + * 获取防火隔离幕阻尼驱动型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:fireCurtainDampingDrive:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveById(id)); + } + + /** + * 新增防火隔离幕阻尼驱动型号 + */ + @PreAuthorize("@ss.hasPermi('management:fireCurtainDampingDrive:add')") + @Log(title = "防火隔离幕阻尼驱动型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcFireCurtainDampingDrive pcFireCurtainDampingDrive){ + //防止出现null指针异常 + if(null==pcFireCurtainDampingDrive){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcFireCurtainDampingDrive.getTypeName()||"".equals(pcFireCurtainDampingDrive.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcFireCurtainDampingDrive fireCurtainDampingDrive = pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveByTypeName(pcFireCurtainDampingDrive.getTypeName()); + if(null!=fireCurtainDampingDrive){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcFireCurtainDampingDrive.setProductName("防火隔离幕阻尼驱动"); + pcFireCurtainDampingDrive.setDelFlag(0); + return toAjax(pcFireCurtainDampingDriveService.insertPcFireCurtainDampingDrive(pcFireCurtainDampingDrive)); + } + + /** + * 修改防火隔离幕阻尼驱动型号 + */ + @PreAuthorize("@ss.hasPermi('management:fireCurtainDampingDrive:edit')") + @Log(title = "防火隔离幕阻尼驱动型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcFireCurtainDampingDrive pcFireCurtainDampingDrive){ + if(null==pcFireCurtainDampingDrive.getTypeName()||"".equals(pcFireCurtainDampingDrive.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcFireCurtainDampingDrive fireCurtainDampingDrive = pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveByTypeName(pcFireCurtainDampingDrive.getTypeName()); + if(null!=fireCurtainDampingDrive){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcFireCurtainDampingDriveService.updatePcFireCurtainDampingDrive(pcFireCurtainDampingDrive)); + } + + /** + * 删除防火隔离幕阻尼驱动型号 + */ + @PreAuthorize("@ss.hasPermi('management:fireCurtainDampingDrive:remove')") + @Log(title = "防火隔离幕阻尼驱动型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcFireCurtainDampingDriveService.deletePcFireCurtainDampingDriveByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getFireCurtainDampingDrive") + public AjaxResult selectFireCurtainDampingDrive(String typeName){ + //型号名称为必填,校验非空 + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcFireCurtainDampingDrive fireCurtainDampingDrive = pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveByTypeName(typeName); + if(null!=fireCurtainDampingDrive){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } + + /** + * 根据型号全称查询详细信息 + * 参数:typeName + */ + @RequestMapping("/getFireCurtainDampingDriveByType") + public AjaxResult getFireCurtainDampingDriveByType(String type){ + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //根据型号全称查询型号信息 + PcFireCurtainDampingDrive curtainDampingDrive = pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveByTypeName(type); + if(null==curtainDampingDrive){ + return AjaxResult.error("暂无此型号"); + } +// strokeMeasurement.setVipLevel(vipLevel); + return AjaxResult.success(curtainDampingDrive); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcHooksCouplingController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcHooksCouplingController.java new file mode 100644 index 0000000..96cd232 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcHooksCouplingController.java @@ -0,0 +1,142 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcDetent; +import com.ruoyi.project.management.domain.PcHooksCoupling; +import com.ruoyi.project.management.service.IPcHooksCouplingService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 万向连轴器型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/hooksCoupling") +public class PcHooksCouplingController extends BaseController +{ + @Autowired + private IPcHooksCouplingService pcHooksCouplingService; + + /** + * 查询万向连轴器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:hooksCoupling:list')") + @GetMapping("/list") + public TableDataInfo list(PcHooksCoupling pcHooksCoupling) + { + startPage(); + List list = pcHooksCouplingService.selectPcHooksCouplingList(pcHooksCoupling); + return getDataTable(list); + } + + /** + * 导出万向连轴器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:hooksCoupling:export')") + @Log(title = "万向连轴器型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcHooksCoupling pcHooksCoupling) + { + List list = pcHooksCouplingService.selectPcHooksCouplingList(pcHooksCoupling); + ExcelUtil util = new ExcelUtil(PcHooksCoupling.class); + return util.exportExcel(list, "hooksCoupling"); + } + + /** + * 获取万向连轴器型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:hooksCoupling:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcHooksCouplingService.selectPcHooksCouplingById(id)); + } + + /** + * 新增万向连轴器型号 + */ + @PreAuthorize("@ss.hasPermi('management:hooksCoupling:add')") + @Log(title = "万向连轴器型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcHooksCoupling pcHooksCoupling){ + //防止出现null指针异常 + if(null==pcHooksCoupling){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcHooksCoupling.getTypeName()||"".equals(pcHooksCoupling.getTypeName())){ + return AjaxResult.error(10, "请输入型号名称"); + } + //校验型号名称是否存在 + PcHooksCoupling hooksCoupling = pcHooksCouplingService.selectPcHooksCouplingByTypeName(pcHooksCoupling.getTypeName()); + if(null!=hooksCoupling){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcHooksCoupling.setProductName("万向联轴器"); + pcHooksCoupling.setDelFlag(0); + return toAjax(pcHooksCouplingService.insertPcHooksCoupling(pcHooksCoupling)); + } + + /** + * 修改万向连轴器型号 + */ + @PreAuthorize("@ss.hasPermi('management:hooksCoupling:edit')") + @Log(title = "万向连轴器型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcHooksCoupling pcHooksCoupling){ + if(null==pcHooksCoupling.getTypeName()||"".equals(pcHooksCoupling.getTypeName())){ + return AjaxResult.error(10, "请输入型号名称"); + } + //校验型号名称是否存在 + PcHooksCoupling hooksCoupling = pcHooksCouplingService.selectPcHooksCouplingByTypeName(pcHooksCoupling.getTypeName()); + if(null!=hooksCoupling){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcHooksCouplingService.updatePcHooksCoupling(pcHooksCoupling)); + } + + /** + * 删除万向连轴器型号 + */ + @PreAuthorize("@ss.hasPermi('management:hooksCoupling:remove')") + @Log(title = "万向连轴器型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcHooksCouplingService.deletePcHooksCouplingByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getHooksCoupling") + public AjaxResult selectHooksCoupling(String typeName){ + //型号名称为必填,校验非空 + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error(10, "请输入型号名称"); + } + PcHooksCoupling hooksCoupling = pcHooksCouplingService.selectPcHooksCouplingByTypeName(typeName); + if(null!=hooksCoupling){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcRigidChainController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcRigidChainController.java new file mode 100644 index 0000000..768ace8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcRigidChainController.java @@ -0,0 +1,264 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.IImMaterialGroupService; +import com.ruoyi.project.management.service.IImMaterialTypeService; +import com.ruoyi.project.management.service.IImMeteringUnitService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.service.IPcRigidChainService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 销齿链型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/rigidChain") +public class PcRigidChainController extends BaseController +{ + @Autowired + private IPcRigidChainService pcRigidChainService; + //用户标识信息 + @Autowired + private TokenService tokenService; + @Autowired + private IImMaterialTypeService imMaterialTypeService; + //计量单位 + @Autowired + private IImMeteringUnitService imMeteringUnitService; + //物料分组 + @Autowired + private IImMaterialGroupService imMaterialGroupService; + + /** + * 查询销齿链型号列表(报价时查询,型号去重) + */ +// @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") + @GetMapping("/getTypeList") + public TableDataInfo getTypeList() + { + List list = pcRigidChainService.selectPcRigidChainByTypeList(); + return getDataTable(list); + } + + /** + * 根据型号查询销齿链行程列表(报价时查询,行程去重) + */ +// @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") + @GetMapping("/getJourneyList") + public TableDataInfo getJourneyList(String type) + { + List list = pcRigidChainService.selectPcRigidChainByJourneyList(type); + return getDataTable(list); + } + + /** + * 查询销齿链型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") + @GetMapping("/list") + public TableDataInfo list(PcRigidChain pcRigidChain) + { + startPage(); + List list = pcRigidChainService.selectPcRigidChainList(pcRigidChain); + return getDataTable(list); + } + + /** + * 导出销齿链型号列表 + */ +// @PreAuthorize("@ss.hasPermi('management:rigidChain:export')") + @Log(title = "销齿链型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcRigidChain pcRigidChain) + { + List list = pcRigidChainService.selectPcRigidChainList(pcRigidChain); + ExcelUtil util = new ExcelUtil(PcRigidChain.class); + return util.exportExcel(list, "rigidChain"); + } + + /** + * 获取销齿链型号详细信息 + */ +// @PreAuthorize("@ss.hasPermi('management:rigidChain:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcRigidChainService.selectPcRigidChainById(id)); + } + + /** + * 新增销齿链型号 + */ + @PreAuthorize("@ss.hasPermi('management:rigidChain:add')") + @Log(title = "销齿链型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcRigidChain pcRigidChain){ + //防止出现null指针异常 + if(null==pcRigidChain){ + return AjaxResult.error(600,"参数不能为空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcRigidChain.getTypeName()||"".equals(pcRigidChain.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //拼接型号全称 +// String typeName = pcRigidChain.getType()+"/"+pcRigidChain.getAxialDirection()+"-"+pcRigidChain.getJourney()+"/"+pcRigidChain.getBox(); + //判断型号是否存在 + PcRigidChain rigidChain = pcRigidChainService.selectPcRigidChainByTypeName(pcRigidChain.getTypeName()); + if(null!=rigidChain){ + return AjaxResult.error(11, "型号名称已存在"); + } + //行程 + pcRigidChain.setJourney(pcRigidChain.getvOne()); + //产品名称 + //pcRigidChain.setProductName("销齿链"); + pcRigidChain.setDelFlag(0L); + return toAjax(pcRigidChainService.insertPcRigidChain(pcRigidChain)); + } + + /** + * 修改销齿链型号 + */ + @PreAuthorize("@ss.hasPermi('management:rigidChain:edit')") + @Log(title = "销齿链型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcRigidChain pcRigidChain){ + if(null==pcRigidChain.getTypeName()||"".equals(pcRigidChain.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //判断型号是否存在 + List list = pcRigidChainService.selectPcRigidChainList(pcRigidChain); + if(list.size()>0){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcRigidChainService.updatePcRigidChain(pcRigidChain)); + } + + /** + * 删除销齿链型号(逻辑删除,底层sql修改删除标记值) + */ + @PreAuthorize("@ss.hasPermi('management:rigidChain:remove')") + @Log(title = "销齿链型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcRigidChainService.deletePcRigidChainByIds(ids)); + } + + /** + * 根据型号全称查询 + * 添加时防止相同型号全称 + * 参数:typeName + */ +// @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") + @RequestMapping("/getRigidChain") + public AjaxResult selectRigidChain(PcRigidChain pcRigidChain){ + if(null==pcRigidChain){ + return AjaxResult.error("参数不能为空,请传参"); + } + if(null==pcRigidChain.getTypeName()||"".equals(pcRigidChain.getTypeName().trim())){ + return AjaxResult.error("参数不能为空,请传参"); + } + List list = pcRigidChainService.selectPcRigidChainList(pcRigidChain); + if(list.size()>0){ + return AjaxResult.error("型号名称已存在"); + } + return AjaxResult.success(); + } + + /** + * 根据型号全称查询详细信息 + * 参数:typeName + */ +// @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") + @RequestMapping("/getPcRigidChainByTypeName") + public AjaxResult getPcRigidChainByTypeName(String typeName){ + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //根据型号全称查询型号信息 + PcRigidChain rigidChain = pcRigidChainService.selectPcRigidChainByTypeName(typeName); + if(null==rigidChain){ + return AjaxResult.error("暂无此型号"); + } + rigidChain.setVipLevel(vipLevel); + return AjaxResult.success(rigidChain); + } + + /** + * 上传标记表 + */ + @RequestMapping("/uploadLableNumber") + @ResponseBody + public AjaxResult uploadLableNumber(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + for (int i = 1; i < result.size(); i++) { + for (int j = 1; j < result.get(i).size(); j++) { + PcRigidChain rigidChain = pcRigidChainService.selectPcRigidChainByTypeName("XCL"+result.get(i).get(1).toString()); + if(null!=rigidChain){ + rigidChain.setLableNumber(result.get(i).get(0).toString()); + pcRigidChainService.updatePcRigidChain(rigidChain); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcStrokeMeasurementController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcStrokeMeasurementController.java new file mode 100644 index 0000000..9e383c4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcStrokeMeasurementController.java @@ -0,0 +1,177 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.IImMaterialGroupService; +import com.ruoyi.project.management.service.IImMaterialTypeService; +import com.ruoyi.project.management.service.IImMeteringUnitService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.service.IPcStrokeMeasurementService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 行程检测型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/strokeMeasurement") +public class PcStrokeMeasurementController extends BaseController +{ + @Autowired + private IPcStrokeMeasurementService pcStrokeMeasurementService; + //用户标识信息 + @Autowired + private TokenService tokenService; + @Autowired + private IImMaterialTypeService imMaterialTypeService; + //计量单位 + @Autowired + private IImMeteringUnitService imMeteringUnitService; + //物料分组 + @Autowired + private IImMaterialGroupService imMaterialGroupService; + /** + * 查询行程检测型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:strokeMeasurement:list')") + @GetMapping("/list") + public TableDataInfo list(PcStrokeMeasurement pcStrokeMeasurement) + { + startPage(); + List list = pcStrokeMeasurementService.selectPcStrokeMeasurementList(pcStrokeMeasurement); + return getDataTable(list); + } + + /** + * 导出行程检测型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:strokeMeasurement:export')") + @Log(title = "行程检测型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcStrokeMeasurement pcStrokeMeasurement) + { + List list = pcStrokeMeasurementService.selectPcStrokeMeasurementList(pcStrokeMeasurement); + ExcelUtil util = new ExcelUtil(PcStrokeMeasurement.class); + return util.exportExcel(list, "strokeMeasurement"); + } + + /** + * 获取行程检测型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:strokeMeasurement:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcStrokeMeasurementService.selectPcStrokeMeasurementById(id)); + } + + /** + * 新增行程检测型号 + */ + @PreAuthorize("@ss.hasPermi('management:strokeMeasurement:add')") + @Log(title = "行程检测型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcStrokeMeasurement pcStrokeMeasurement){ + //防止出现null指针异常 + if(null==pcStrokeMeasurement){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcStrokeMeasurement.getTypeName()||"".equals(pcStrokeMeasurement.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcStrokeMeasurement strokeMeasurement = pcStrokeMeasurementService.selectPcStrokeMeasurementByTypeName(pcStrokeMeasurement.getTypeName()); + if(null!=strokeMeasurement){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcStrokeMeasurement.setProductName("行程检测"); + pcStrokeMeasurement.setDelFlag(0); + return toAjax(pcStrokeMeasurementService.insertPcStrokeMeasurement(pcStrokeMeasurement)); + } + + /** + * 修改行程检测型号 + */ + @PreAuthorize("@ss.hasPermi('management:strokeMeasurement:edit')") + @Log(title = "行程检测型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcStrokeMeasurement pcStrokeMeasurement){ + if(null==pcStrokeMeasurement.getTypeName()||"".equals(pcStrokeMeasurement.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcStrokeMeasurement strokeMeasurement = pcStrokeMeasurementService.selectPcStrokeMeasurementByTypeName(pcStrokeMeasurement.getTypeName()); + if(null!=strokeMeasurement){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcStrokeMeasurementService.updatePcStrokeMeasurement(pcStrokeMeasurement)); + } + + /** + * 删除行程检测型号 + */ + @PreAuthorize("@ss.hasPermi('management:strokeMeasurement:remove')") + @Log(title = "行程检测型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcStrokeMeasurementService.deletePcStrokeMeasurementByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getStrokeMeasurement") + public AjaxResult selectStrokeMeasurement(String typeName){ + //型号名称为必填,校验非空 + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcStrokeMeasurement strokeMeasurement = pcStrokeMeasurementService.selectPcStrokeMeasurementByTypeName(typeName); + if(null!=strokeMeasurement){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } + + /** + * 根据型号全称查询详细信息 + * 参数:typeName + */ + @RequestMapping("/getStrokeMeasurementByType") + public AjaxResult getStrokeMeasurementByType(String type){ + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //根据型号全称查询型号信息 + PcStrokeMeasurement strokeMeasurement = pcStrokeMeasurementService.selectPcStrokeMeasurementByTypeName(type); + if(null==strokeMeasurement){ + return AjaxResult.error("暂无此型号"); + } +// strokeMeasurement.setVipLevel(vipLevel); + return AjaxResult.success(strokeMeasurement); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcToothedCouplingController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcToothedCouplingController.java new file mode 100644 index 0000000..6d1b38a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcToothedCouplingController.java @@ -0,0 +1,128 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcToothedCoupling; +import com.ruoyi.project.management.domain.PcTravelSwitch; +import com.ruoyi.project.management.service.IPcToothedCouplingService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 齿形连轴器型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/toothedCoupling") +public class PcToothedCouplingController extends BaseController +{ + @Autowired + private IPcToothedCouplingService pcToothedCouplingService; + + /** + * 查询齿形连轴器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:toothedCoupling:list')") + @GetMapping("/list") + public TableDataInfo list(PcToothedCoupling pcToothedCoupling) + { + startPage(); + List list = pcToothedCouplingService.selectPcToothedCouplingList(pcToothedCoupling); + return getDataTable(list); + } + + /** + * 导出齿形连轴器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:toothedCoupling:export')") + @Log(title = "齿形连轴器型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcToothedCoupling pcToothedCoupling) + { + List list = pcToothedCouplingService.selectPcToothedCouplingList(pcToothedCoupling); + ExcelUtil util = new ExcelUtil(PcToothedCoupling.class); + return util.exportExcel(list, "toothedCoupling"); + } + + /** + * 获取齿形连轴器型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:toothedCoupling:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcToothedCouplingService.selectPcToothedCouplingById(id)); + } + + /** + * 新增齿形连轴器型号 + */ + @PreAuthorize("@ss.hasPermi('management:toothedCoupling:add')") + @Log(title = "齿形连轴器型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcToothedCoupling pcToothedCoupling){ + //防止出现null指针异常 + if(null==pcToothedCoupling){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcToothedCoupling.getTypeName()||"".equals(pcToothedCoupling.getTypeName())){ + return AjaxResult.error(10, "请输入型号名称"); + } + pcToothedCoupling.setProductName("齿形联轴器"); + pcToothedCoupling.setDelFlag(0); + return toAjax(pcToothedCouplingService.insertPcToothedCoupling(pcToothedCoupling)); + } + + /** + * 修改齿形连轴器型号 + */ + @PreAuthorize("@ss.hasPermi('management:toothedCoupling:edit')") + @Log(title = "齿形连轴器型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcToothedCoupling pcToothedCoupling){ + if(null==pcToothedCoupling.getTypeName()||"".equals(pcToothedCoupling.getTypeName())){ + return AjaxResult.error(10, "请输入型号名称"); + } + return toAjax(pcToothedCouplingService.updatePcToothedCoupling(pcToothedCoupling)); + } + + /** + * 删除齿形连轴器型号 + */ + @PreAuthorize("@ss.hasPermi('management:toothedCoupling:remove')") + @Log(title = "齿形连轴器型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcToothedCouplingService.deletePcToothedCouplingByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getToothedCoupling") + public AjaxResult selectToothedCoupling(PcToothedCoupling pcToothedCoupling){ + List list = pcToothedCouplingService.selectPcToothedCouplingList(pcToothedCoupling); + if(list.size()>0){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcTravelSwitchController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcTravelSwitchController.java new file mode 100644 index 0000000..33c4dc0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcTravelSwitchController.java @@ -0,0 +1,142 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcHooksCoupling; +import com.ruoyi.project.management.domain.PcTravelSwitch; +import com.ruoyi.project.management.service.IPcTravelSwitchService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 行程开关型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/travelSwitch") +public class PcTravelSwitchController extends BaseController +{ + @Autowired + private IPcTravelSwitchService pcTravelSwitchService; + + /** + * 查询行程开关型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:travelSwitch:list')") + @GetMapping("/list") + public TableDataInfo list(PcTravelSwitch pcTravelSwitch) + { + startPage(); + List list = pcTravelSwitchService.selectPcTravelSwitchList(pcTravelSwitch); + return getDataTable(list); + } + + /** + * 导出行程开关型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:travelSwitch:export')") + @Log(title = "行程开关型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcTravelSwitch pcTravelSwitch) + { + List list = pcTravelSwitchService.selectPcTravelSwitchList(pcTravelSwitch); + ExcelUtil util = new ExcelUtil(PcTravelSwitch.class); + return util.exportExcel(list, "travelSwitch"); + } + + /** + * 获取行程开关型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:travelSwitch:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcTravelSwitchService.selectPcTravelSwitchById(id)); + } + + /** + * 新增行程开关型号 + */ + @PreAuthorize("@ss.hasPermi('management:travelSwitch:add')") + @Log(title = "行程开关型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcTravelSwitch pcTravelSwitch){ + //防止出现null指针异常 + if(null==pcTravelSwitch){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcTravelSwitch.getTypeName()||"".equals(pcTravelSwitch.getTypeName())){ + return AjaxResult.error(10, "请输入型号名称"); + } + //校验型号名称是否存在 + PcTravelSwitch travelSwitch = pcTravelSwitchService.selectPcTravelSwitchByTypeName(pcTravelSwitch.getTypeName()); + if(null!=travelSwitch){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcTravelSwitch.setProductName("行程开关"); + pcTravelSwitch.setDelFlag(0); + return toAjax(pcTravelSwitchService.insertPcTravelSwitch(pcTravelSwitch)); + } + + /** + * 修改行程开关型号 + */ + @PreAuthorize("@ss.hasPermi('management:travelSwitch:edit')") + @Log(title = "行程开关型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcTravelSwitch pcTravelSwitch){ + if(null==pcTravelSwitch.getTypeName()||"".equals(pcTravelSwitch.getTypeName())){ + return AjaxResult.error(10, "请输入型号名称"); + } + //校验型号名称是否存在 + PcTravelSwitch travelSwitch = pcTravelSwitchService.selectPcTravelSwitchByTypeName(pcTravelSwitch.getTypeName()); + if(null!=travelSwitch){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcTravelSwitchService.updatePcTravelSwitch(pcTravelSwitch)); + } + + /** + * 删除行程开关型号 + */ + @PreAuthorize("@ss.hasPermi('management:travelSwitch:remove')") + @Log(title = "行程开关型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcTravelSwitchService.deletePcTravelSwitchByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getTravelSwitch") + public AjaxResult selectTravelSwitch(String typeName){ + //型号名称为必填,校验非空 + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error(10, "请输入型号名称"); + } + PcTravelSwitch travelSwitch = pcTravelSwitchService.selectPcTravelSwitchByTypeName(typeName); + if(null!=travelSwitch){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcTwoStageReductionGearController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcTwoStageReductionGearController.java new file mode 100644 index 0000000..814fa69 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcTwoStageReductionGearController.java @@ -0,0 +1,140 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcTwoStageReductionGear; +import com.ruoyi.project.management.service.IPcTwoStageReductionGearService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 二级减速器型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/twoStageReductionGear") +public class PcTwoStageReductionGearController extends BaseController +{ + @Autowired + private IPcTwoStageReductionGearService pcTwoStageReductionGearService; + + /** + * 查询二级减速器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:twoStageReductionGear:list')") + @GetMapping("/list") + public TableDataInfo list(PcTwoStageReductionGear pcTwoStageReductionGear) + { + startPage(); + List list = pcTwoStageReductionGearService.selectPcTwoStageReductionGearList(pcTwoStageReductionGear); + return getDataTable(list); + } + + /** + * 导出二级减速器型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:twoStageReductionGear:export')") + @Log(title = "二级减速器型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcTwoStageReductionGear pcTwoStageReductionGear) + { + List list = pcTwoStageReductionGearService.selectPcTwoStageReductionGearList(pcTwoStageReductionGear); + ExcelUtil util = new ExcelUtil(PcTwoStageReductionGear.class); + return util.exportExcel(list, "twoStageReductionGear"); + } + + /** + * 获取二级减速器型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:twoStageReductionGear:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcTwoStageReductionGearService.selectPcTwoStageReductionGearById(id)); + } + + /** + * 新增二级减速器型号 + */ + @PreAuthorize("@ss.hasPermi('management:twoStageReductionGear:add')") + @Log(title = "二级减速器型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcTwoStageReductionGear pcTwoStageReductionGear){ + //防止出现null指针异常 + if(null==pcTwoStageReductionGear){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcTwoStageReductionGear.getTypeName()||"".equals(pcTwoStageReductionGear.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcTwoStageReductionGear twoStageReductionGearByTypeName = pcTwoStageReductionGearService.selectPcTwoStageReductionGearByTypeName(pcTwoStageReductionGear.getTypeName()); + if(null!=twoStageReductionGearByTypeName){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcTwoStageReductionGear.setProductName("二级减速器"); + pcTwoStageReductionGear.setDelFlag(0); + return toAjax(pcTwoStageReductionGearService.insertPcTwoStageReductionGear(pcTwoStageReductionGear)); + } + + /** + * 修改二级减速器型号 + */ + @PreAuthorize("@ss.hasPermi('management:twoStageReductionGear:edit')") + @Log(title = "二级减速器型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcTwoStageReductionGear pcTwoStageReductionGear){ + if(null==pcTwoStageReductionGear.getTypeName()||"".equals(pcTwoStageReductionGear.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + //校验型号名称是否存在 + PcTwoStageReductionGear twoStageReductionGearByTypeName = pcTwoStageReductionGearService.selectPcTwoStageReductionGearByTypeName(pcTwoStageReductionGear.getTypeName()); + if(null!=twoStageReductionGearByTypeName){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcTwoStageReductionGearService.updatePcTwoStageReductionGear(pcTwoStageReductionGear)); + } + + /** + * 删除二级减速器型号 + */ + @PreAuthorize("@ss.hasPermi('management:twoStageReductionGear:remove')") + @Log(title = "二级减速器型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + return toAjax(pcTwoStageReductionGearService.deletePcTwoStageReductionGearByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getTwoStageReductionGear") + public AjaxResult selectTwoStageReductionGear(String typeName){ + //型号名称为必填,校验非空 + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcTwoStageReductionGear twoStageReductionGearByTypeName = pcTwoStageReductionGearService.selectPcTwoStageReductionGearByTypeName(typeName); + if(null!=twoStageReductionGearByTypeName){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PcWindlassController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PcWindlassController.java new file mode 100644 index 0000000..1270264 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PcWindlassController.java @@ -0,0 +1,167 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PcRigidChain; +import com.ruoyi.project.management.domain.PcWindlass; +import com.ruoyi.project.management.service.IPcWindlassService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 卷扬机型号Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/windlass") +public class PcWindlassController extends BaseController +{ + @Autowired + private IPcWindlassService pcWindlassService; + //用户标识信息 + @Autowired + private TokenService tokenService; + + /** + * 查询卷扬机型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:windlass:list')") + @GetMapping("/list") + public TableDataInfo list(PcWindlass pcWindlass) + { + startPage(); + List list = pcWindlassService.selectPcWindlassList(pcWindlass); + return getDataTable(list); + } + + /** + * 导出卷扬机型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:windlass:export')") + @Log(title = "卷扬机型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PcWindlass pcWindlass) + { + List list = pcWindlassService.selectPcWindlassList(pcWindlass); + ExcelUtil util = new ExcelUtil(PcWindlass.class); + return util.exportExcel(list, "windlass"); + } + + /** + * 获取卷扬机型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:windlass:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pcWindlassService.selectPcWindlassById(id)); + } + + /** + * 新增卷扬机型号 + */ + @PreAuthorize("@ss.hasPermi('management:windlass:add')") + @Log(title = "卷扬机型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PcWindlass pcWindlass){ + //防止出现null指针异常 + if(null==pcWindlass){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //型号名称为必填,校验非空 + if(null==pcWindlass.getTypeName()||"".equals(pcWindlass.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcWindlass windlass = pcWindlassService.selectPcWindlassByTypeName(pcWindlass.getTypeName()); + if(null!=windlass){ + return AjaxResult.error(11, "型号名称已存在"); + } + pcWindlass.setProductName("卷扬机"); + pcWindlass.setDelFlag(0); + return toAjax(pcWindlassService.insertPcWindlass(pcWindlass)); + } + + /** + * 修改卷扬机型号 + */ + @PreAuthorize("@ss.hasPermi('management:windlass:edit')") + @Log(title = "卷扬机型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PcWindlass pcWindlass){ + if(null==pcWindlass.getTypeName()||"".equals(pcWindlass.getTypeName())){ + return AjaxResult.error(10,"请输入型号名称"); + } + PcWindlass windlass = pcWindlassService.selectPcWindlassByTypeName(pcWindlass.getTypeName()); + if(null!=windlass){ + return AjaxResult.error(11, "型号名称已存在"); + } + return toAjax(pcWindlassService.updatePcWindlass(pcWindlass)); + } + + /** + * 删除卷扬机型号 + */ + @PreAuthorize("@ss.hasPermi('management:windlass:remove')") + @Log(title = "卷扬机型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pcWindlassService.deletePcWindlassByIds(ids)); + } + + /** + * 根据型号名称查询 + * 添加时防止相同型号名称 + */ + @RequestMapping("/getWindlass") + public AjaxResult selectWindlass(String typeName){ + if(null==typeName||"".equals(typeName.trim())){ + return AjaxResult.error("请输入型号名称"); + } + PcWindlass pcWindlass = pcWindlassService.selectPcWindlassByTypeName(typeName); + if(null!=pcWindlass){ + return AjaxResult.error(11, "型号名称已存在"); + } + return AjaxResult.success(); + } + + /** + * 根据型号全称查询详细信息 + * 参数:typeName + */ + @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") + @RequestMapping("/getPcWindlassByTypeName") + public AjaxResult getPcWindlassByTypeName(String typeName){ + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //根据型号全称查询型号信息 + PcWindlass pcWindlass = pcWindlassService.selectPcWindlassByTypeName(typeName); + if(null==pcWindlass){ + return AjaxResult.error("暂无此型号"); + } + pcWindlass.setVipLevel(vipLevel); + return AjaxResult.success(pcWindlass); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwAlterationController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwAlterationController.java new file mode 100644 index 0000000..6522b8d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwAlterationController.java @@ -0,0 +1,580 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.security.NoSuchAlgorithmException; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.PwAlteration; +import com.ruoyi.project.management.domain.PwAlterationDetail; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwBomNumber; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoLingliao; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.mapper.PwPurchaseContractMaterialMapper; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IPwAlterationDetailService; +import com.ruoyi.project.management.service.IPwAlterationService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwBomNumberService; +import com.ruoyi.project.management.service.IPwBomNumberTwoLingliaoService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 变更单Controller + * + * @author zhukangchao + * @date 2022-04-14 + */ +@RestController +@RequestMapping("/management/pwAlteration") +public class PwAlterationController extends BaseController +{ + @Autowired + private IPwAlterationService pwAlterationService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //变更单详情 + @Autowired + private IPwAlterationDetailService pwAlterationDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //原始bom信息 + @Autowired + private IPwBomNumberService pwBomNumberService; + //Bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //领料专用bom + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + //采购单详情列表信息 + @Autowired + private PwPurchaseContractMaterialMapper pwPurchaseContractMaterialMapper; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询变更单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlteration:list')") + @GetMapping("/list") + public TableDataInfo list(PwAlteration pwAlteration) + { + startPage(); + List list = pwAlterationService.selectPwAlterationList(pwAlteration); + return getDataTable(list); + } + + /** + * 导出变更单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlteration:export')") + @Log(title = "变更单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwAlteration pwAlteration) + { + List list = pwAlterationService.selectPwAlterationList(pwAlteration); + ExcelUtil util = new ExcelUtil(PwAlteration.class); + return util.exportExcel(list, "pwAlteration"); + } + + /** + * 获取变更单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlteration:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwAlterationService.selectPwAlterationById(id)); + } + + /** + * 新增变更单 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlteration:add')") + @Log(title = "变更单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwAlteration pwAlteration){ + if(null==pwAlteration.getCode()||"".equals(pwAlteration.getCode())){ + return AjaxResult.error("请选择要变更的项目"); + } + //根据项目令号查询项目名称 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(pwAlteration.getCode()); + if(null!=productionBill){ + pwAlteration.setName(productionBill.getProjectName()); + } + return toAjax(pwAlterationService.insertPwAlteration(pwAlteration)); + } + + /** + * 修改变更单 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlteration:edit')") + @Log(title = "变更单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwAlteration pwAlteration) + { + return toAjax(pwAlterationService.updatePwAlteration(pwAlteration)); + } + + /** + * 删除变更单 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlteration:remove')") + @Log(title = "变更单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwAlterationService.deletePwAlterationByIds(ids)); + } + + + /** + * 审核变更单,审核之后把详情中的数据改变到bom中 + */ + @RequestMapping("/audits/{ids}") + public AjaxResult audits(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + PwAlteration pwAlteration = pwAlterationService.selectPwAlterationById(id); + if("已审核".equals(pwAlteration.getAudit())){ + return AjaxResult.error("无需重复审核"); + } + //根据变更单id查询变更单详情 + List list = pwAlterationDetailService.selectPwAlterationDetailByAlterationId(id); + for (PwAlterationDetail pwAlterationDetail : list) { + //根据变更单详情的信息,修改bom表信息,物料信息,库存信息,质检信息,入库单信息,出库单信息,采购单信息,以及库存制作单信息 + //判断是企标单变更还是执行单变更 + if(pwAlteration.getCode().contains("QB")){ + //说明是企标单变更 + //判断变更单详情是增加还是修改,还是删除 + + }else{ + //说明是执行单变更 + //判断变更单详情是增加还是修改,还是删除 + if(null==pwAlterationDetail.getOldId()){ + + //1、说明是增加物料 + + //增加物料信息和库存信息(如果不存在则增加,如果存在则不增加) + addInfo(pwAlterationDetail); + + //增加bom原始表 增加bom表 增加bom领料表 + addBomInfo(pwAlterationDetail); + + //添加在途和预定信息 + addInventoryDetail(pwAlterationDetail); + + //判断是否是外购件或者标准件(如果没有安全库存设置,则直接出采购单详情,出采购单之前,判断库存数据,是否需要采购) + if((null!=pwAlterationDetail.getRemarks()&&pwAlterationDetail.getRemarks().contains("外购件"))||(null!=pwAlterationDetail.getNewFigureNumber()&&(" ".equals(pwAlterationDetail.getNewFigureNumber().substring(0,2)) || "009".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3))|| "017".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3))))){ + addPurchaseContractMaterial(pwAlterationDetail); + } + + //判断父级是否已经领料,如果已经领料,则把当前物料添加到领料单中 + + + }else if("删除".equals(pwAlterationDetail.getRemarks())){ + //2、说明是删除物料 TODO 删除时存在逻辑问题,如共用件,不知道如何删除 + + //删除bom表信息 +// deleteBomInfo(pwAlterationDetail); +// +// //减少库存信息的预定数量(判断是否是有安全库存设置,如果没有,则删除在途数量)减少在途数量时,判断此物料是否已经入库,减少预定数量时,判断此物料是否已经出库 +// deleteInventoryDetail(pwAlterationDetail); + + // + }else{ + //3、说明是修改物料 + //修改bom表信息,旧名称改为新名称,旧图号改为新图号,旧材质改为新材质,旧本批数量改为新本批数量 + + } + } + + } + //修改审核状态 + pwAlteration.setAudit("已审核"); + i = pwAlterationService.updatePwAlteration(pwAlteration); + } + return toAjax(i); + } + + + /** + * 删除bom信息 + * @param pwAlterationDetail + */ + private void deleteBomInfo(PwAlterationDetail pwAlterationDetail) { + // TODO Auto-generated method stub +// PwBomNumberTwo numberTwo = pwBomNumberService.selectPwBomNumberByCodeAndNameAndFigureNumber(pwAlterationDetail.getCode(), pwAlterationDetail.getOldName(), pwAlterationDetail.getOldFigureNumber()); +// pwBomNumberTwoService.deletePwBomNumberTwoById(numberTwo.getId()); +// PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwAlterationDetail.getCode(), pwAlterationDetail.getOldName(), pwAlterationDetail.getOldFigureNumber()); +// pwBomNumberTwoService.deletePwBomNumberTwoById(bomNumberTwo2.getId()); +// PwBomNumberTwoLingliao numberTwoLingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwAlterationDetail.getCode(), numberTwo.getSparedOne(),pwAlterationDetail.getNewName(),pwAlterationDetail.getNewFigureNumber()); +// pwBomNumberTwoLingliaoService.deletePwBomNumberTwoLingliaoById(numberTwoLingliao.getId()); + } + /** + * 增加物料信息和库存信息 + * @param pwAlterationDetail + */ + public void addInfo(PwAlterationDetail pwAlterationDetail){ + //新增物料表 + ImMaterial imMaterial2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwAlterationDetail.getNewName(), pwAlterationDetail.getNewFigureNumber()); + if(null==imMaterial2){ + //物料信息 + ImMaterial imMaterial = new ImMaterial(); + //名称 + imMaterial.setMaterialName(pwAlterationDetail.getNewName()); + //图号 + imMaterial.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //材料 + imMaterial.setMaterials(pwAlterationDetail.getNewType()); + //单重 + imMaterial.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); + //判断是否是标准件 + if("009".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3))|| "017".equals(pwAlterationDetail.getNewFigureNumber().substring(0,2)) || " ".equals(pwAlterationDetail.getNewFigureNumber().substring(0,2))){ + //默认仓库 + imMaterial.setWarehouseName("标准件库"); + }else{ + //默认仓库 +// imMaterial.setWarehouseName("零部件库"); + } + //最低库存 + imMaterial.setMinimum(0L); + //最高库存 + imMaterial.setHighest(0L); + //未税单价 + imMaterial.setUnitPrice(new BigDecimal(0)); + //含税单价 + imMaterial.setUnivalence(new BigDecimal(0)); + //删除标记 + imMaterial.setDelFlag(0); + imMaterialService.insertImMaterial(imMaterial); + } + + //新增库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwAlterationDetail.getNewName(), pwAlterationDetail.getNewFigureNumber()); + if(null==inventoryDetail){ + //库存信息 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //名称 + pwInventoryDetail.setName(pwAlterationDetail.getNewName()); + //图号 + pwInventoryDetail.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //材料 + pwInventoryDetail.setType(pwAlterationDetail.getNewType()); + //单重 + pwInventoryDetail.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); + //判断是否是标准件 + if("009".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3)) || "017".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3)) || " ".equals(pwAlterationDetail.getNewFigureNumber().substring(0,2))){ + //所属仓库 + pwInventoryDetail.setWarehouseName("标准件库"); + }else{ + //默认仓库 +// imMaterial.setWarehouseName("零部件库"); + } + //单价 + pwInventoryDetail.setUnivalence(new BigDecimal(0)); + //库存数量 + pwInventoryDetail.setQuantity(0L); + //在途数量 + pwInventoryDetail.setPreliminaryInventory(0L); + //锁定数量 + pwInventoryDetail.setLockNumber(0L); + //可用数量 + pwInventoryDetail.setAvailableNumber(0L); + //最低库存 + pwInventoryDetail.setMinimum(0L); + //最高库存 + pwInventoryDetail.setHighest(0L); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + + } + + /** + * 添加bom表信息 + */ + public int addBomInfo(PwAlterationDetail pwAlterationDetail){ + //根据父级图号和名称查询 + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumber(pwAlterationDetail.getCode(), pwAlterationDetail.getNewParentLevelName(), pwAlterationDetail.getNewParentLevelFigureNumber()); + //根据上级图号 + //增加bom原始表数据 + PwBomNumber bomNumber = new PwBomNumber(); + //令号 + bomNumber.setProductionCode(pwAlterationDetail.getCode()); + //型号 + bomNumber.setTypeName(numberTwo.getSparedOne()); + //序号 +// bomNumber.setNum("50"); + //图号 + bomNumber.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //名称 + bomNumber.setName(pwAlterationDetail.getNewName()); + //单台数量 + bomNumber.setOneNumber(pwAlterationDetail.getNewOneNumber()); + //材料 + bomNumber.setType(pwAlterationDetail.getNewType()); + //单重 + bomNumber.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); + //父级图号 + bomNumber.setParentLevelFigureNumber(pwAlterationDetail.getNewParentLevelFigureNumber()); + //父级名称 + bomNumber.setParentLevelName(pwAlterationDetail.getNewParentLevelName()); + if(null==pwAlterationDetail.getRemarks()){ + //备注 + bomNumber.setRemarks(""); + }else{ + //备注 + bomNumber.setRemarks(pwAlterationDetail.getRemarks()); + } + pwBomNumberService.insertPwBomNumber(bomNumber); + + //增加bom表数据,增加之前判断bom表中是否有此数据,如果有,则合并,反之则增加 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwAlterationDetail.getCode(), pwAlterationDetail.getNewName(), pwAlterationDetail.getNewFigureNumber()); + if(null != bomNumberTwo2){ + //说明存在,累加其数量 + + }else{ + //说明不存在,新增bom物料 + //直接新增物料 + PwBomNumberTwo bomNumberTwo = new PwBomNumberTwo(); + //令号 + bomNumberTwo.setProductionCode(pwAlterationDetail.getCode()); + //图号 + bomNumberTwo.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //名称 + bomNumberTwo.setName(pwAlterationDetail.getNewName()); + //单台数量 + bomNumberTwo.setOneNumber(pwAlterationDetail.getNewOneNumber()); + //材料 + bomNumberTwo.setType(pwAlterationDetail.getNewType()); + //单重 + bomNumberTwo.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); + //上级图号 + bomNumberTwo.setParentLevelFigureNumber(pwAlterationDetail.getNewParentLevelFigureNumber()); + //上级名称 + bomNumberTwo.setParentLevelName(pwAlterationDetail.getNewParentLevelName()); + //本批数量 + bomNumberTwo.setSumNumber(pwAlterationDetail.getNewSumNumber()); + //所属型号 + bomNumberTwo.setSparedOne(numberTwo.getSparedOne()); + if(null==pwAlterationDetail.getRemarks()){ + //备注 + bomNumberTwo.setRemarks(""); + }else{ + //备注 + bomNumberTwo.setRemarks(pwAlterationDetail.getRemarks()); + } + //删除标记 + bomNumberTwo.setDelFlag(0); + //是否有库存(根据名称和图号查询库存信息) + //库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwAlterationDetail.getNewName(),pwAlterationDetail.getNewFigureNumber()); + if(null!=inventoryDetail){ + //根据名称和图号查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwAlterationDetail.getNewName(),pwAlterationDetail.getNewFigureNumber()); + //查询实际库存(库存-预定>=本批数量)设置为有库存 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=pwAlterationDetail.getNewSumNumber()){ + bomNumberTwo.setSparedTwo("有库存"); + }else{ + if(null != material&&material.getMinimum() != 0&&material.getHighest() != 0){ + bomNumberTwo.setSparedTwo("安全库存"); + }else if((inventoryDetail.getQuantity()-bomNumberTwo.getSumNumber())-inventoryDetail.getLockNumber()>=0){ + bomNumberTwo.setSparedTwo("安全库存"); + } + } + + } + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo); + + } + + //增加bom领料信息 + PwBomNumberTwoLingliao numberTwoLingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwAlterationDetail.getCode(), numberTwo.getSparedOne(),pwAlterationDetail.getNewName(),pwAlterationDetail.getNewFigureNumber()); + if(null != numberTwoLingliao){ + //说明存在,累加其数量 + + }else{ + //说明不存在,新增bom物料 + //直接新增物料 + PwBomNumberTwoLingliao bomNumberTwoLingliao = new PwBomNumberTwoLingliao(); + //令号 + bomNumberTwoLingliao.setProductionCode(pwAlterationDetail.getCode()); + //图号 + bomNumberTwoLingliao.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //名称 + bomNumberTwoLingliao.setName(pwAlterationDetail.getNewName()); + //单台数量 + bomNumberTwoLingliao.setOneNumber(pwAlterationDetail.getNewOneNumber()); + //材料 + bomNumberTwoLingliao.setType(pwAlterationDetail.getNewType()); + //单重 + bomNumberTwoLingliao.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); + //上级图号 + bomNumberTwoLingliao.setParentLevelFigureNumber(pwAlterationDetail.getNewParentLevelFigureNumber()); + //上级名称 + bomNumberTwoLingliao.setParentLevelName(pwAlterationDetail.getNewParentLevelName()); + //本批数量 + bomNumberTwoLingliao.setSumNumber(pwAlterationDetail.getNewSumNumber()); + //所属型号 + bomNumberTwoLingliao.setSparedOne(numberTwo.getSparedOne()); + if(null==pwAlterationDetail.getRemarks()){ + //备注 + bomNumberTwoLingliao.setRemarks(""); + }else{ + //备注 + bomNumberTwoLingliao.setRemarks(pwAlterationDetail.getRemarks()); + } + //删除标记 + bomNumberTwoLingliao.setDelFlag(0); + + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao); + } + + return 1; + } + + /** + * 增加采购合同明细信息 + */ + public int addPurchaseContractMaterial(PwAlterationDetail pwAlterationDetail){ + //查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwAlterationDetail.getNewName(), pwAlterationDetail.getNewFigureNumber()); + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<=0){ + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code(此种单据没有code,暂时定为无) + pcm.setCode(pwAlterationDetail.getCode()); + //物料名称 + pcm.setMaterialName(pwAlterationDetail.getNewName()); + //图号 + pcm.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //材料 + pcm.setMaterials(pwAlterationDetail.getNewType()); + //含税单价 + pcm.setUnivalence(0.0); + //数量(本批数量-(库存数量+在途-预定)) + pcm.setAmount(pwAlterationDetail.getNewSumNumber()); + /*if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + pcm.setAmount(pwAlterationDetail.getNewSumNumber()); + }else{ + pcm.setAmount(pwAlterationDetail.getNewSumNumber()); + }*/ + //总价 + pcm.setTotalPrices(pcm.getUnivalence().doubleValue()*pcm.getAmount()); + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + + //下单日期+5天为采购计划完成时间 + Calendar now =Calendar.getInstance(); + now.setTime(new Date()); + now.set(Calendar.DATE,now.get(Calendar.DATE)+5); + //计划采购完成日期 + pcm.setCompleteDate(now.getTime()); + + //记录采购数量的由来 + pcm.setQuantity(inventoryDetail.getQuantity()); + pcm.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + pcm.setLockNumber(inventoryDetail.getLockNumber()); + pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pcm); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(pcm.getAmount()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("标准件待采购",pcm.getCode(),"安全库存","",pwAlterationDetail.getCode(),"采购","标准件采购","采购合同物料详情","/purchase/purchaseContractMaterial"); + } + return 1; + } + + /** + * 增加库存信息的在途和预定信息 + * @param pwAlterationDetail + */ + private void addInventoryDetail(PwAlterationDetail pwAlterationDetail) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwAlterationDetail.getNewName(),pwAlterationDetail.getNewFigureNumber()); + //增加预定数量和在途数量 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=pwAlterationDetail.getNewSumNumber()){ + //不用增加在途 + }else{ + inventoryDetail.setPreliminaryInventory(pwAlterationDetail.getNewSumNumber()); + } + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwAlterationDetail.getNewSumNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwAlterationDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwAlterationDetailController.java new file mode 100644 index 0000000..1365a07 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwAlterationDetailController.java @@ -0,0 +1,1377 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.PwAlteration; +import com.ruoyi.project.management.domain.PwAlterationDetail; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IPwAlterationDetailService; +import com.ruoyi.project.management.service.IPwAlterationService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 变更单详情Controller + * + * @author zhukangchao + * @date 2022-04-14 + */ +@RestController +@RequestMapping("/management/pwAlterationDetail") +public class PwAlterationDetailController extends BaseController +{ + @Autowired + private IPwAlterationDetailService pwAlterationDetailService; + //变更单信息 + @Autowired + private IPwAlterationService pwAlterationService; + //Bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //企标单信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + + /** + * 查询变更单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlterationDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwAlterationDetail pwAlterationDetail) + { + startPage(); + List list = pwAlterationDetailService.selectPwAlterationDetailList(pwAlterationDetail); + return getDataTable(list); + } + + /** + * 导出变更单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlterationDetail:export')") + @Log(title = "变更单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwAlterationDetail pwAlterationDetail) + { + List list = pwAlterationDetailService.selectPwAlterationDetailList(pwAlterationDetail); + ExcelUtil util = new ExcelUtil(PwAlterationDetail.class); + return util.exportExcel(list, "pwAlterationDetail"); + } + + /** + * 获取变更单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlterationDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwAlterationDetailService.selectPwAlterationDetailById(id)); + } + + /** + * 新增变更单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwAlterationDetail:add')") + @Log(title = "变更单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwAlterationDetail pwAlterationDetail){ + //根据变更单详情id查询变更单 + PwAlteration pwAlteration = pwAlterationService.selectPwAlterationById(pwAlterationDetail.getAlterationId()); + //判断是否是企标单 + if(pwAlteration.getCode().contains("QB")){ + //判断是新增物料还是修改物料 + if(null==pwAlterationDetail.getOldId()){ + //项目令号 + pwAlterationDetail.setCode(pwAlteration.getCode()); + //项目名称 + pwAlterationDetail.setProjectName(pwAlteration.getName()); + //说明是新增物料 + //判断新名称、新图号、新单台数量、新材料、新本批数量不能为null + if(null==pwAlterationDetail.getNewName()||"".equals(pwAlterationDetail.getNewName())){ + return AjaxResult.error("请填写物料名称"); + } + if(null==pwAlterationDetail.getNewFigureNumber()||"".equals(pwAlterationDetail.getNewFigureNumber())){ + return AjaxResult.error("请填写物料图号"); + } + if(null==pwAlterationDetail.getNewType()||"".equals(pwAlterationDetail.getNewType())){ + return AjaxResult.error("请填写材料"); + } + if(null==pwAlterationDetail.getNewSumNumber()||pwAlterationDetail.getNewSumNumber()==0){ + return AjaxResult.error("请填写本批数量"); + } + + }else{ + //说明是修改物料 + //根据id查询bom表信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwAlterationDetail.getOldId()); + //项目令号 + pwAlterationDetail.setCode(pwAlteration.getCode()); + //项目名称 + pwAlterationDetail.setProjectName(pwAlteration.getName()); + //原名称 + pwAlterationDetail.setOldName(makeDocumentsDetail.getName()); + //原图号 + pwAlterationDetail.setOldFigureNumber(makeDocumentsDetail.getFigureNumber()); + //原材料 + pwAlterationDetail.setOldType(makeDocumentsDetail.getMaterialType()); + //原本批数量 + pwAlterationDetail.setOldSumNumber(makeDocumentsDetail.getQuantity()); + + //判断新的是否为null,如果为null。则延用之前的数据 + //如果没有填新名称,那名称默认为旧名称 + if(null==pwAlterationDetail.getNewName()||"".equals(pwAlterationDetail.getNewName())){ + pwAlterationDetail.setNewName(makeDocumentsDetail.getName()); + } + //如果没有填图号,那图号默认为旧图号 + if(null==pwAlterationDetail.getNewFigureNumber()||"".equals(pwAlterationDetail.getNewFigureNumber())){ + pwAlterationDetail.setNewFigureNumber(makeDocumentsDetail.getFigureNumber()); + } + //新材料 + if(null==pwAlterationDetail.getNewType()||"".equals(pwAlterationDetail.getNewType())){ + pwAlterationDetail.setNewType(makeDocumentsDetail.getMaterialType()); + } + //新本批数量 + if(null==pwAlterationDetail.getNewSumNumber()||0 == pwAlterationDetail.getNewSumNumber()){ + pwAlterationDetail.setNewSumNumber(makeDocumentsDetail.getQuantity()); + } + } + }else{ + //判断是新增物料还是修改物料 + if(null==pwAlterationDetail.getOldId()){ + //说明是新增物料 + //项目令号 + pwAlterationDetail.setCode(pwAlteration.getCode()); + //项目名称 + pwAlterationDetail.setProjectName(pwAlteration.getName()); + //判断新名称、新图号、新单台数量、新材料、新本批数量不能为null + if(null==pwAlterationDetail.getNewName()||"".equals(pwAlterationDetail.getNewName())){ + return AjaxResult.error("请填写物料名称"); + } + if(null==pwAlterationDetail.getNewFigureNumber()||"".equals(pwAlterationDetail.getNewFigureNumber())){ + return AjaxResult.error("请填写物料图号"); + } + if(null==pwAlterationDetail.getNewType()||"".equals(pwAlterationDetail.getNewType())){ + return AjaxResult.error("请填写材料"); + } + if(null==pwAlterationDetail.getNewOneNumber()||pwAlterationDetail.getNewOneNumber()==0){ + return AjaxResult.error("请填写单台数量"); + } + if(null==pwAlterationDetail.getNewSumNumber()||pwAlterationDetail.getNewSumNumber()==0){ + return AjaxResult.error("请填写本批数量"); + } + if(null==pwAlterationDetail.getOldParentLevelId()||"".equals(pwAlterationDetail.getOldParentLevelId())){ + return AjaxResult.error("请选择父级"); + } + //如果单重是null。则单重为0 + if(null==pwAlterationDetail.getNewPieceWeight()||"".equals(pwAlterationDetail.getNewPieceWeight())){ + pwAlterationDetail.setNewPieceWeight(0.0); + } + //根据id查询bom表信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwAlterationDetail.getOldParentLevelId()); + //父级名称 + pwAlterationDetail.setNewParentLevelName(bomNumberTwo.getName()); + //父级图号 + pwAlterationDetail.setNewParentLevelFigureNumber(bomNumberTwo.getFigureNumber()); + + }else{ + //说明是修改物料 + //根据id查询bom表信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwAlterationDetail.getOldId()); + //项目令号 + pwAlterationDetail.setCode(pwAlteration.getCode()); + //项目名称 + pwAlterationDetail.setProjectName(pwAlteration.getName()); + //原名称 + pwAlterationDetail.setOldName(bomNumberTwo.getName()); + //原图号 + pwAlterationDetail.setOldFigureNumber(bomNumberTwo.getFigureNumber()); + //原单台数量 + pwAlterationDetail.setOldOneNumber(bomNumberTwo.getOneNumber()); + //原材料 + pwAlterationDetail.setOldType(bomNumberTwo.getType()); + //原单重 + pwAlterationDetail.setOldPieceWeight(bomNumberTwo.getPieceWeight()); + //原本批数量 + pwAlterationDetail.setOldSumNumber(bomNumberTwo.getSumNumber()); + + //判断新的是否为null,如果为null。则延用之前的数据 + //如果没有填新名称,那名称默认为旧名称 + if(null==pwAlterationDetail.getNewName()||"".equals(pwAlterationDetail.getNewName())){ + pwAlterationDetail.setNewName(bomNumberTwo.getName()); + } + //如果没有填图号,那图号默认为旧图号 + if(null==pwAlterationDetail.getNewFigureNumber()||"".equals(pwAlterationDetail.getNewFigureNumber())){ + pwAlterationDetail.setNewFigureNumber(bomNumberTwo.getFigureNumber()); + } + //新单台数量 + if(null==pwAlterationDetail.getNewOneNumber()||0==pwAlterationDetail.getNewOneNumber()){ + pwAlterationDetail.setNewOneNumber(bomNumberTwo.getOneNumber()); + } + //新材料 + if(null==pwAlterationDetail.getNewType()||"".equals(pwAlterationDetail.getNewType())){ + pwAlterationDetail.setNewType(bomNumberTwo.getType()); + } + //新单重 + if(null==pwAlterationDetail.getNewPieceWeight()||0 == pwAlterationDetail.getNewPieceWeight()){ + pwAlterationDetail.setNewPieceWeight(bomNumberTwo.getPieceWeight()); + } + //新本批数量 + if(null==pwAlterationDetail.getNewSumNumber()||0 == pwAlterationDetail.getNewSumNumber()){ + pwAlterationDetail.setNewSumNumber(bomNumberTwo.getSumNumber()); + } + if(null!=pwAlterationDetail.getOldParentLevelId()){ + //根据id查询bom表信息 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(pwAlterationDetail.getOldParentLevelId()); + //父级名称 + pwAlterationDetail.setNewParentLevelName(bomNumberTwo2.getName()); + //父级图号 + pwAlterationDetail.setNewParentLevelFigureNumber(bomNumberTwo2.getFigureNumber()); + }else{ + //父级名称 + pwAlterationDetail.setNewParentLevelName(bomNumberTwo.getParentLevelName()); + //父级图号 + pwAlterationDetail.setNewParentLevelFigureNumber(bomNumberTwo.getParentLevelFigureNumber()); + } + //新备注 + if(null==pwAlterationDetail.getRemarks()){ + pwAlterationDetail.setRemarks(bomNumberTwo.getRemarks()); + } + } + } + +// //根据变更单详情id查询变更单 +// PwAlteration pwAlteration = pwAlterationService.selectPwAlterationById(pwAlterationDetail.getAlterationId()); +// //判断是否是企标单 +// if(pwAlteration.getCode().contains("QB")){ +// //判断是新增物料还是修改物料 +// if(null==pwAlterationDetail.getOldId()){ +// //判断新名称、新图号、新单台数量、新材料、新本批数量不能为null +// if(null==pwAlterationDetail.getNewName()||"".equals(pwAlterationDetail.getNewName())){ +// return AjaxResult.error("请填写物料名称"); +// } +// if(null==pwAlterationDetail.getNewFigureNumber()||"".equals(pwAlterationDetail.getNewFigureNumber())){ +// return AjaxResult.error("请填写物料图号"); +// } +// if(null==pwAlterationDetail.getNewType()||"".equals(pwAlterationDetail.getNewType())){ +// return AjaxResult.error("请填写材料"); +// } +// if(null==pwAlterationDetail.getNewSumNumber()||pwAlterationDetail.getNewSumNumber()==0){ +// return AjaxResult.error("请填写本批数量"); +// } +// //创建新的企标单详情信息 +// PwMakeDocumentsDetail pwMakeDocumentsDetail = new PwMakeDocumentsDetail(); +// //令号 +// pwMakeDocumentsDetail.setMakeDocumentsCode(pwAlteration.getCode()); +// //图号 +// pwMakeDocumentsDetail.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); +// //名称 +// pwMakeDocumentsDetail.setName(pwAlterationDetail.getNewName()); +// //材料 +// pwMakeDocumentsDetail.setMaterialType(pwAlterationDetail.getNewType()); +// //本批数量 +// pwMakeDocumentsDetail.setQuantity(pwAlterationDetail.getNewSumNumber()); +// //删除标记 +// pwMakeDocumentsDetail.setDelFlag(0); +// //是否有库存(根据名称和图号查询库存信息) +// //库存信息 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwAlterationDetail.getNewName(),pwAlterationDetail.getNewFigureNumber()); +// if(null==inventoryDetail){ +// //新增库存信息和物料信息 +// addInfo(pwAlterationDetail); +// } +// //新增之前先判断有没有 +// PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); +// if(null == makeDocumentsDetail){ +// pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail); +// }else{ +// //合并本批数量 +// pwMakeDocumentsDetail.setQuantity(makeDocumentsDetail.getQuantity()+pwMakeDocumentsDetail.getQuantity()); +// pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); +// } +// +// }else{ +// //说明是修改物料 +// //查询原bom信息和其子集 +// //项目令号 +// pwAlterationDetail.setCode(pwAlteration.getCode()); +// //项目名称 +// pwAlterationDetail.setProjectName(pwAlteration.getName()); +// //根据id查询bom表信息 +// PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwAlterationDetail.getOldId()); +// //原名称 +// pwAlterationDetail.setOldName(makeDocumentsDetail.getName()); +// //原图号 +// pwAlterationDetail.setOldFigureNumber(makeDocumentsDetail.getFigureNumber()); +// //原材料 +// pwAlterationDetail.setOldType(makeDocumentsDetail.getMaterialType()); +// //原本批数量 +// pwAlterationDetail.setOldSumNumber(makeDocumentsDetail.getQuantity()); +// +// //旧名称 +// String name = makeDocumentsDetail.getName(); +// //旧图号 +// String figureNumber = makeDocumentsDetail.getFigureNumber(); +// //旧本批数量 +// Long sumNumber = makeDocumentsDetail.getQuantity(); +// //原物料信息 +// ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(name,figureNumber); +// //原库存信息 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name,figureNumber); +// //如果没有填新名称,那名称默认为旧名称 +// if(null==pwAlterationDetail.getNewName()||"".equals(pwAlterationDetail.getNewName())){ +// pwAlterationDetail.setNewName(makeDocumentsDetail.getName()); +// }else{ +// makeDocumentsDetail.setName(pwAlterationDetail.getNewName()); +// } +// //如果没有填图号,那图号默认为旧图号 +// if(null==pwAlterationDetail.getNewFigureNumber()||"".equals(pwAlterationDetail.getNewFigureNumber())){ +// pwAlterationDetail.setNewFigureNumber(makeDocumentsDetail.getFigureNumber()); +// }else{ +// makeDocumentsDetail.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); +// } +// //新材料 +// if(null==pwAlterationDetail.getNewType()||"".equals(pwAlterationDetail.getNewType())){ +// pwAlterationDetail.setNewType(makeDocumentsDetail.getMaterialType()); +// }else{ +// makeDocumentsDetail.setMaterialType(pwAlterationDetail.getNewType()); +// } +// //新本批数量 +// if(null==pwAlterationDetail.getNewSumNumber()||0 == pwAlterationDetail.getNewSumNumber()){ +// pwAlterationDetail.setNewSumNumber(makeDocumentsDetail.getQuantity()); +// }else{ +// makeDocumentsDetail.setQuantity(pwAlterationDetail.getNewSumNumber()); +// } +// //根据新名称和新图号查询库存信息,如果有库存则在bom中备注有库存 +// //修改物料的在途数量和锁定数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+(sumNumber-pwAlterationDetail.getNewSumNumber())); +// inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+(sumNumber-pwAlterationDetail.getNewSumNumber())); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// //根据当前物料的id查询其所有子集工序 +// List list5 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwAlterationDetail.getCode(), makeDocumentsDetail.getId()); +// for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list5) { +// //修改其所有子集工序的名称和图号 +// //根据图号和名称和令号查询质检列表(如果有则修改,只能是修改名称和图号和材料) +// List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); +// for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list2) { +// pwCompletionNoticeProduct.setProductName(pwCompletionNoticeProduct.getProductName().replaceAll(name, pwAlterationDetail.getNewName())); +// pwCompletionNoticeProduct.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber().replaceAll(figureNumber, pwAlterationDetail.getNewFigureNumber())); +// pwCompletionNoticeProduct.setMaterials(pwAlterationDetail.getNewType()); +// pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct); +// +// //修改此物料的物料信息和库存信息 +// //物料信息 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber()); +// //旧库存信息 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber()); +// //修改物料表 +// if(null != material2){ +// //名称 +// material2.setMaterialName(pwCompletionNoticeProduct.getProductName()); +// //图号 +// material2.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber()); +// //材料 +// material2.setMaterials(pwCompletionNoticeProduct.getMaterials()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(pwCompletionNoticeProduct.getProductName()); +// //图号 +// inventoryDetail3.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber()); +// //材料 +// inventoryDetail3.setMaterials(pwCompletionNoticeProduct.getMaterials()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// } +// //根据图号和名称和令号查询入库单列表(如果有则修改,只能是修改名称和图号和材料) +// List list3 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); +// for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { +// imProductReceiptMaterial.setMaterialName(imProductReceiptMaterial.getMaterialName().replaceAll(name, pwAlterationDetail.getNewName())); +// imProductReceiptMaterial.setSpecification(imProductReceiptMaterial.getSpecification().replaceAll(figureNumber, pwAlterationDetail.getNewFigureNumber())); +// imProductReceiptMaterial.setMaterialType(pwAlterationDetail.getNewType()); +// imProductReceiptMaterialService.updateImProductReceiptMaterial(imProductReceiptMaterial); +// //修改此物料的物料信息和库存信息 +// //物料信息 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(imProductReceiptMaterial.getMaterialName(),imProductReceiptMaterial.getSpecification()); +// //旧库存信息 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imProductReceiptMaterial.getMaterialName(),imProductReceiptMaterial.getSpecification()); +// //修改物料表 +// if(null != material2){ +// //名称 +// material2.setMaterialName(imProductReceiptMaterial.getMaterialName()); +// //图号 +// material2.setFigureNumber(imProductReceiptMaterial.getSpecification()); +// //材料 +// material2.setMaterials(imProductReceiptMaterial.getMaterialType()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(imProductReceiptMaterial.getMaterialName()); +// //图号 +// inventoryDetail3.setFigureNumber(imProductReceiptMaterial.getSpecification()); +// //材料 +// inventoryDetail3.setMaterials(imProductReceiptMaterial.getMaterialType()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// } +// //根据名称和图号和令号查询出库单列表(如果有则修改,只能是修改名称和图号和材料) +// List list4 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list4) { +// imStockRequisitionMaterial.setMaterialName(imStockRequisitionMaterial.getMaterialName().replaceAll(name, pwAlterationDetail.getNewName())); +// imStockRequisitionMaterial.setSpecification(imStockRequisitionMaterial.getSpecification().replaceAll(figureNumber, pwAlterationDetail.getNewFigureNumber())); +// imStockRequisitionMaterial.setMaterials(pwAlterationDetail.getNewType()); +// iImStockRequisitionMaterialService.updateImStockRequisitionMaterial(imStockRequisitionMaterial); +// //修改此物料的物料信息和库存信息 +// //物料信息 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber()); +// //旧库存信息 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber()); +// //修改物料表 +// if(null != material2){ +// //名称 +// material2.setMaterialName(imStockRequisitionMaterial.getMaterialName()); +// //图号 +// material2.setFigureNumber(imStockRequisitionMaterial.getSpecification()); +// //材料 +// material2.setMaterials(imStockRequisitionMaterial.getMaterials()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(imStockRequisitionMaterial.getMaterialName()); +// //图号 +// inventoryDetail3.setFigureNumber(imStockRequisitionMaterial.getSpecification()); +// //材料 +// inventoryDetail3.setMaterials(imStockRequisitionMaterial.getMaterials()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// } +// +// //物料信息子集 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail.getName(),pwMakeDocumentsDetail.getFigureNumber()); +// //旧库存信息子集 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getName(),pwMakeDocumentsDetail.getFigureNumber()); +// if(null != material2){ +// //名称 +// material2.setMaterialName(pwMakeDocumentsDetail.getName().replaceAll(name, pwAlterationDetail.getNewName())); +// //图号 +// material2.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber().replaceAll(figureNumber, pwAlterationDetail.getNewFigureNumber())); +// //材料 +// material2.setMaterials(pwAlterationDetail.getNewType()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(pwMakeDocumentsDetail.getName().replaceAll(name, pwAlterationDetail.getNewName())); +// //图号 +// inventoryDetail3.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber().replaceAll(figureNumber, pwAlterationDetail.getNewFigureNumber())); +// //材料 +// inventoryDetail3.setMaterials(pwAlterationDetail.getNewType()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// //名称 +// pwMakeDocumentsDetail.setName(pwMakeDocumentsDetail.getName().replaceAll(name, pwAlterationDetail.getNewName())); +// //图号 +// pwMakeDocumentsDetail.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber().replaceAll(figureNumber, pwAlterationDetail.getNewFigureNumber())); +// //材料 +// pwMakeDocumentsDetail.setMaterialType(pwAlterationDetail.getNewType()); +// //本批数量 +// pwMakeDocumentsDetail.setQuantity(pwAlterationDetail.getNewSumNumber()); +// if(pwAlterationDetail.getOldSumNumber()=pwAlterationDetail.getNewSumNumber()){ +// //说明可以使用库存 +// bomNumberTwo.setSparedTwo("有库存"); +// //锁定预定数量 +// inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+bomNumberTwo.getSumNumber()); +// } +// } +// if(null==pwAlterationDetail.getRemarks()){ +// //备注 +// bomNumberTwo.setRemarks(""); +// }else{ +// +// //备注 +// bomNumberTwo.setRemarks(pwAlterationDetail.getRemarks()); +// } +// //删除标记 +// bomNumberTwo.setDelFlag(0); +// //新增之前先判断有没有 +// PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); +// if(null == bomNumberTwo2){ +// pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo); +// }else{ +// //合并单台数量 +// bomNumberTwo2.setOneNumber(bomNumberTwo2.getOneNumber()+bomNumberTwo.getOneNumber()); +// //合并本批数量 +// bomNumberTwo2.setSumNumber(bomNumberTwo2.getSumNumber()+bomNumberTwo.getSumNumber()); +// pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); +// } +// //判断是否是外购件或者标准件(如果为外购件或者标准件则添加到待采购明细表中) +// if(pwAlterationDetail.getNewFigureNumber().contains(" ")||(null != pwAlterationDetail.getRemarks()&&!"".equals(pwAlterationDetail.getRemarks())&&pwAlterationDetail.getRemarks().contains("外购件"))){ +// //判断库存数量是否足够 +// if(!"有库存".equals(bomNumberTwo.getSparedTwo())){ +// //添加待采购明细表 +// //创建采购明细 +// PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); +// pcm.setCreateTime(DateUtils.getNowDate()); +// //执行单code +// pcm.setCode(pwAlteration.getCode()); +// //物料名称 +// pcm.setMaterialName(bomNumberTwo.getName()); +// //图号 +// pcm.setFigureNumber(bomNumberTwo.getFigureNumber()); +// //材料 +// pcm.setMaterials(bomNumberTwo.getType()); +// if(null!=inventoryDetail&&inventoryDetail.getHighest()!=0){ +// //数量 +// pcm.setAmount(inventoryDetail.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); +// }else{ +// pcm.setAmount(pwAlterationDetail.getNewSumNumber()); +// } +// //入库状态默认为未入库 +// pcm.setInventoryStatus("未入库"); +// //根据执行单code和名称和图号查询采购明细表采购合同id为null的数据(如果查询结果不为null,则说明有相同数据,直接累加其数量) +// PwPurchaseContractMaterial pwPurchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByNameAndFigureNumberAndPurchaseContractNotNull(pwAlteration.getCode(),bomNumberTwo.getMaterialsName(),bomNumberTwo.getFigureNumber()); +// if(null!=pwPurchaseContractMaterial){ +// //说明有此条数据,直接合并数量 +// pwPurchaseContractMaterial.setAmount(pwPurchaseContractMaterial.getAmount()+pcm.getAmount()); +// pwPurchaseContractMaterialMapper.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); +// }else{ +// pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pcm); +// } +// if(null==inventoryDetail){ +// inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwAlterationDetail.getNewName(),pwAlterationDetail.getNewFigureNumber()); +// } +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pcm.getAmount()); +// } +// } +// //修改在途数量 +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// //新增bom领料表 +// PwBomNumberTwoLingliao pwBomNumberTwoLingliao = new PwBomNumberTwoLingliao(); +// //令号 +// pwBomNumberTwoLingliao.setProductionCode(pwAlteration.getCode()); +// //图号 +// pwBomNumberTwoLingliao.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); +// //名称 +// pwBomNumberTwoLingliao.setName(pwAlterationDetail.getNewName()); +// //单台数量 +// pwBomNumberTwoLingliao.setOneNumber(pwAlterationDetail.getNewOneNumber()); +// //材料 +// pwBomNumberTwoLingliao.setType(pwAlterationDetail.getNewType()); +// //单重 +// pwBomNumberTwoLingliao.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); +// //上级图号 +// pwBomNumberTwoLingliao.setParentLevelFigureNumber(bomNumberTwos.getFigureNumber()); +// //上级名称 +// pwBomNumberTwoLingliao.setParentLevelName(bomNumberTwos.getName()); +// //本批数量 +// pwBomNumberTwoLingliao.setSumNumber(pwAlterationDetail.getNewSumNumber()); +// //所属型号 +// pwBomNumberTwoLingliao.setSparedOne(bomNumberTwos.getSparedOne()); +// if(null==pwAlterationDetail.getRemarks()){ +// //备注 +// pwBomNumberTwoLingliao.setRemarks(""); +// }else{ +// +// //备注 +// pwBomNumberTwoLingliao.setRemarks(pwAlterationDetail.getRemarks()); +// } +// //删除标记 +// pwBomNumberTwoLingliao.setDelFlag(0); +// pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pwBomNumberTwoLingliao); +// }else{ +// //说明是修改物料 +// +// //查询原bom信息和其子集 +// //项目令号 +// pwAlterationDetail.setCode(pwAlteration.getCode()); +// //项目名称 +// pwAlterationDetail.setProjectName(pwAlteration.getName()); +// //根据id查询bom表信息 +// PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwAlterationDetail.getOldId()); +// +// //原名称 +// pwAlterationDetail.setOldName(bomNumberTwo.getName()); +// //原图号 +// pwAlterationDetail.setOldFigureNumber(bomNumberTwo.getFigureNumber()); +// //原单台数量 +// pwAlterationDetail.setOldOneNumber(bomNumberTwo.getOneNumber()); +// //原材料 +// pwAlterationDetail.setOldType(bomNumberTwo.getType()); +// //原单重 +// pwAlterationDetail.setOldPieceWeight(bomNumberTwo.getPieceWeight()); +// //原本批数量 +// pwAlterationDetail.setOldSumNumber(bomNumberTwo.getSumNumber()); +// +// //根据名称和图号和令号查询bom领料表信息 +// PwBomNumberTwoLingliao lingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getSparedOne(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); +// //旧名称 +// String name = bomNumberTwo.getName(); +// //旧图号 +// String figureNumber = bomNumberTwo.getFigureNumber(); +// //旧本批数量 +// Long sumNumber = bomNumberTwo.getSumNumber(); +// //旧备注 +// String remarks = bomNumberTwo.getRemarks(); +// //原物料信息 +// ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(name,figureNumber); +// //原库存信息 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name,figureNumber); +// //如果没有填新名称,那名称默认为旧名称 +// if(null==pwAlterationDetail.getNewName()||"".equals(pwAlterationDetail.getNewName())){ +// pwAlterationDetail.setNewName(bomNumberTwo.getName()); +// }else{ +// bomNumberTwo.setName(pwAlterationDetail.getNewName()); +// lingliao.setName(pwAlterationDetail.getNewName()); +// } +// //如果没有填图号,那图号默认为旧图号 +// if(null==pwAlterationDetail.getNewFigureNumber()||"".equals(pwAlterationDetail.getNewFigureNumber())){ +// pwAlterationDetail.setNewFigureNumber(bomNumberTwo.getFigureNumber()); +// }else{ +// bomNumberTwo.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); +// lingliao.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); +// } +// //新单台数量 +// if(null==pwAlterationDetail.getNewOneNumber()||0==pwAlterationDetail.getNewOneNumber()){ +// pwAlterationDetail.setNewOneNumber(bomNumberTwo.getOneNumber()); +// }else{ +// bomNumberTwo.setOneNumber(pwAlterationDetail.getNewOneNumber()); +// lingliao.setOneNumber(pwAlterationDetail.getNewOneNumber()); +// } +// //新材料 +// if(null==pwAlterationDetail.getNewType()||"".equals(pwAlterationDetail.getNewType())){ +// pwAlterationDetail.setNewType(bomNumberTwo.getType()); +// }else{ +// bomNumberTwo.setType(pwAlterationDetail.getNewType()); +// lingliao.setType(pwAlterationDetail.getNewType()); +// } +// //新单重 +// if(null==pwAlterationDetail.getNewPieceWeight()||0 == pwAlterationDetail.getNewPieceWeight()){ +// pwAlterationDetail.setNewPieceWeight(bomNumberTwo.getPieceWeight()); +// }else{ +// bomNumberTwo.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); +// lingliao.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); +// } +// //新本批数量 +// if(null==pwAlterationDetail.getNewSumNumber()||0 == pwAlterationDetail.getNewSumNumber()){ +// pwAlterationDetail.setNewSumNumber(bomNumberTwo.getSumNumber()); +// }else{ +// bomNumberTwo.setSumNumber(pwAlterationDetail.getNewSumNumber()); +// lingliao.setSumNumber(pwAlterationDetail.getNewSumNumber()); +// } +// //新备注 +// if(null==pwAlterationDetail.getRemarks()){ +// pwAlterationDetail.setRemarks(bomNumberTwo.getRemarks()); +// }else{ +// bomNumberTwo.setRemarks(pwAlterationDetail.getRemarks()); +// lingliao.setRemarks(pwAlterationDetail.getRemarks()); +// } +// //根据新名称和新图号查询库存信息,如果有库存则在bom中备注有库存 +// //新物料的库存信息 +// PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwo.getName(),bomNumberTwo.getFigureNumber()); +// if(null != inventoryDetail2){ +// if(inventoryDetail2.getQuantity()+inventoryDetail2.getPreliminaryInventory()-inventoryDetail2.getLockNumber()>=bomNumberTwo.getSumNumber()){ +// bomNumberTwo.setSparedTwo("有库存"); +// lingliao.setSparedTwo("有库存"); +// } +// inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()+bomNumberTwo.getSumNumber()); +// inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+bomNumberTwo.getSumNumber()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); +// }else{ +// bomNumberTwo.setSparedTwo(null); +// lingliao.setSparedTwo(null); +// } +// //修改物料的在途数量和锁定数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+(sumNumber-pwAlterationDetail.getNewSumNumber())); +// inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+(sumNumber-pwAlterationDetail.getNewSumNumber())); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// //根据当前物料的id查询其所有子集工序 +// List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); +// for (PwBomNumberTwo pwBomNumberTwo : list) { +// //修改其所有子集工序的名称和图号 +// //根据图号和名称和令号查询质检列表(如果有则修改,只能是修改名称和图号和材料) +// List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); +// for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list2) { +// pwCompletionNoticeProduct.setProductName(pwCompletionNoticeProduct.getProductName().replaceAll(name, bomNumberTwo.getName())); +// pwCompletionNoticeProduct.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber().replaceAll(figureNumber, bomNumberTwo.getFigureNumber())); +// pwCompletionNoticeProduct.setMaterials(bomNumberTwo.getType()); +// pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo.getPieceWeight()); +// pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct); +// +// //修改此物料的物料信息和库存信息 +// //物料信息 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber()); +// //旧库存信息 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber()); +// //修改物料表 +// if(null != material2){ +// //名称 +// material2.setMaterialName(pwCompletionNoticeProduct.getProductName()); +// //图号 +// material2.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber()); +// //材料 +// material2.setMaterials(pwCompletionNoticeProduct.getMaterials()); +// //单重 +// material2.setPieceWeight(bomNumberTwo.getPieceWeight()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(pwCompletionNoticeProduct.getProductName()); +// //图号 +// inventoryDetail3.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber()); +// //材料 +// inventoryDetail3.setMaterials(pwCompletionNoticeProduct.getMaterials()); +// //单重 +// inventoryDetail3.setPieceWeight(bomNumberTwo.getPieceWeight()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// } +// //根据图号和名称和令号查询入库单列表(如果有则修改,只能是修改名称和图号和材料) +// List list3 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); +// for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { +// imProductReceiptMaterial.setMaterialName(imProductReceiptMaterial.getMaterialName().replaceAll(name, bomNumberTwo.getName())); +// imProductReceiptMaterial.setSpecification(imProductReceiptMaterial.getSpecification().replaceAll(figureNumber, bomNumberTwo.getFigureNumber())); +// imProductReceiptMaterial.setMaterialType(bomNumberTwo.getType()); +// imProductReceiptMaterialService.updateImProductReceiptMaterial(imProductReceiptMaterial); +// //修改此物料的物料信息和库存信息 +// //物料信息 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(imProductReceiptMaterial.getMaterialName(),imProductReceiptMaterial.getSpecification()); +// //旧库存信息 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imProductReceiptMaterial.getMaterialName(),imProductReceiptMaterial.getSpecification()); +// //修改物料表 +// if(null != material2){ +// //名称 +// material2.setMaterialName(imProductReceiptMaterial.getMaterialName()); +// //图号 +// material2.setFigureNumber(imProductReceiptMaterial.getSpecification()); +// //材料 +// material2.setMaterials(imProductReceiptMaterial.getMaterialType()); +// //单重 +// material2.setPieceWeight(bomNumberTwo.getPieceWeight()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(imProductReceiptMaterial.getMaterialName()); +// //图号 +// inventoryDetail3.setFigureNumber(imProductReceiptMaterial.getSpecification()); +// //材料 +// inventoryDetail3.setMaterials(imProductReceiptMaterial.getMaterialType()); +// //单重 +// inventoryDetail3.setPieceWeight(bomNumberTwo.getPieceWeight()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// } +// //根据名称和图号和令号查询出库单列表(如果有则修改,只能是修改名称和图号和材料) +// List list4 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list4) { +// imStockRequisitionMaterial.setMaterialName(imStockRequisitionMaterial.getMaterialName().replaceAll(name, bomNumberTwo.getName())); +// imStockRequisitionMaterial.setSpecification(imStockRequisitionMaterial.getSpecification().replaceAll(figureNumber, bomNumberTwo.getFigureNumber())); +// imStockRequisitionMaterial.setMaterials(bomNumberTwo.getType()); +// iImStockRequisitionMaterialService.updateImStockRequisitionMaterial(imStockRequisitionMaterial); +// //修改此物料的物料信息和库存信息 +// //物料信息 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber()); +// //旧库存信息 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber()); +// //修改物料表 +// if(null != material2){ +// //名称 +// material2.setMaterialName(imStockRequisitionMaterial.getMaterialName()); +// //图号 +// material2.setFigureNumber(imStockRequisitionMaterial.getSpecification()); +// //材料 +// material2.setMaterials(imStockRequisitionMaterial.getMaterials()); +// //单重 +// material2.setPieceWeight(bomNumberTwo.getPieceWeight()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(imStockRequisitionMaterial.getMaterialName()); +// //图号 +// inventoryDetail3.setFigureNumber(imStockRequisitionMaterial.getSpecification()); +// //材料 +// inventoryDetail3.setMaterials(imStockRequisitionMaterial.getMaterials()); +// //单重 +// inventoryDetail3.setPieceWeight(bomNumberTwo.getPieceWeight()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// } +// +// //物料信息子集 +// ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); +// //旧库存信息子集 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); +// if(null != material2){ +// //名称 +// material2.setMaterialName(pwBomNumberTwo.getName().replaceAll(name, bomNumberTwo.getName())); +// //图号 +// material2.setFigureNumber(pwBomNumberTwo.getFigureNumber().replaceAll(figureNumber, bomNumberTwo.getFigureNumber())); +// //材料 +// material2.setMaterials(bomNumberTwo.getType()); +// //单重 +// material2.setPieceWeight(bomNumberTwo.getPieceWeight()); +// imMaterialService.updateImMaterial(material2); +// } +// //修改库存表 +// if(null!=inventoryDetail3){ +// //名称 +// inventoryDetail3.setName(pwBomNumberTwo.getName().replaceAll(name, bomNumberTwo.getName())); +// //图号 +// inventoryDetail3.setFigureNumber(pwBomNumberTwo.getFigureNumber().replaceAll(figureNumber, bomNumberTwo.getFigureNumber())); +// //材料 +// inventoryDetail3.setMaterials(bomNumberTwo.getType()); +// //单重 +// inventoryDetail3.setPieceWeight(bomNumberTwo.getPieceWeight()); +// //判断本批数量是否有变动 +// if(pwAlterationDetail.getNewSumNumber() != sumNumber){ +// //在途数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// //锁定数量 +// inventoryDetail3.setLockNumber(inventoryDetail3.getLockNumber()-sumNumber+pwAlterationDetail.getNewSumNumber()); +// } +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail3); +// } +// //名称 +// pwBomNumberTwo.setName(pwBomNumberTwo.getName().replaceAll(name, bomNumberTwo.getName())); +// //图号 +// pwBomNumberTwo.setFigureNumber(pwBomNumberTwo.getFigureNumber().replaceAll(figureNumber, bomNumberTwo.getFigureNumber())); +// //材料 +// pwBomNumberTwo.setType(bomNumberTwo.getType()); +// //单重 +// pwBomNumberTwo.setPieceWeight(bomNumberTwo.getPieceWeight()); +// //单台数量 +// pwBomNumberTwo.setOneNumber(bomNumberTwo.getOneNumber()); +// //本批数量 +// pwBomNumberTwo.setSumNumber(bomNumberTwo.getSumNumber()); +// if(pwAlterationDetail.getOldSumNumber() list = new ArrayList(); + List list2 = new ArrayList(); + //根据id查询变更单信息 + PwAlteration pwAlteration = pwAlterationService.selectPwAlterationById(id); + //获取变更单令号 + if(null==pwAlteration){ + return getDataTable(list); + }else{ + if(null==pwAlteration.getCode()||"".equals(pwAlteration.getCode())){ + return getDataTable(list); + } + } + String code = pwAlteration.getCode(); + + //判断是否是企标单 + if(code.contains("QB")){ + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCode(code); + return getDataTable(list2); + }else{ + //根据项目令号查询此项目下所有的物料信息(本批数量大于0的且不带工序的物料) + list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeByG(code); + return getDataTable(list); + } + } + + public void addInfo(PwAlterationDetail pwAlterationDetail){ + //新增物料表 + //物料信息 + ImMaterial imMaterial = new ImMaterial(); + //名称 + imMaterial.setMaterialName(pwAlterationDetail.getNewName()); + //图号 + imMaterial.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //材料 + imMaterial.setMaterials(pwAlterationDetail.getNewType()); + //单重 + imMaterial.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); + //判断是否是标准件 + if("009".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3)) || "017".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3)) || " ".equals(pwAlterationDetail.getNewFigureNumber().substring(0,2))){ + //默认仓库 + imMaterial.setWarehouseName("标准件库"); + }else{ + //默认仓库 +// imMaterial.setWarehouseName("零部件库"); + } + //最低库存 + imMaterial.setMinimum(0L); + //最高库存 + imMaterial.setHighest(0L); + //未税单价 + imMaterial.setUnitPrice(new BigDecimal(0)); + //含税单价 + imMaterial.setUnivalence(new BigDecimal(0)); + //删除标记 + imMaterial.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial); + //新增库存信息 + //库存信息 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //名称 + pwInventoryDetail.setName(pwAlterationDetail.getNewName()); + //图号 + pwInventoryDetail.setFigureNumber(pwAlterationDetail.getNewFigureNumber()); + //材料 + pwInventoryDetail.setType(pwAlterationDetail.getNewType()); + //单重 + pwInventoryDetail.setPieceWeight(pwAlterationDetail.getNewPieceWeight()); + //判断是否是标准件 + if("009".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3)) || "017".equals(pwAlterationDetail.getNewFigureNumber().substring(0,3)) || " ".equals(pwAlterationDetail.getNewFigureNumber().substring(0,2))){ + //所属仓库 + pwInventoryDetail.setWarehouseName("标准件库"); + }else{ + //默认仓库 +// imMaterial.setWarehouseName("零部件库"); + } + //单价 + pwInventoryDetail.setUnivalence(new BigDecimal(0)); + //库存数量 + pwInventoryDetail.setQuantity(0L); + //在途数量 + pwInventoryDetail.setPreliminaryInventory(pwAlterationDetail.getNewSumNumber()); + //锁定数量 + pwInventoryDetail.setLockNumber(pwAlterationDetail.getNewSumNumber()); + //可用数量 + pwInventoryDetail.setAvailableNumber(0L); + //最低库存 + pwInventoryDetail.setMinimum(0L); + //最高库存 + pwInventoryDetail.setHighest(0L); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBacklogController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBacklogController.java new file mode 100644 index 0000000..195f01a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBacklogController.java @@ -0,0 +1,200 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.system.domain.SysRole; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 待办事项Controller + * + * @author zhukangchao + * @date 2023-02-05 + */ +@RestController +@RequestMapping("/management/pwBacklog") +public class PwBacklogController extends BaseController +{ + @Autowired + private IPwBacklogService pwBacklogService; + //用户信息 + @Autowired + private TokenService tokenService; + + /** + * 查询待办事项列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:list')") + @GetMapping("/list") + public TableDataInfo list(PwBacklog pwBacklog){ + if(null==pwBacklog.getStatus()||"".equals(pwBacklog.getStatus())){ + pwBacklog.setStatus("否"); + } + List list = new ArrayList(); + //判断登录人的角色,每个角色只能看到自己角色的数据 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if("admin".equals(user.getUserName())){ + startPage(); + list = pwBacklogService.selectPwBacklogList(pwBacklog); + }else{ + List roles = user.getRoles(); + for (SysRole sysRole : roles) { + pwBacklog.setRecipientName(sysRole.getRoleName()); + startPage(); + list = pwBacklogService.selectPwBacklogList(pwBacklog); + } + } + + return getDataTable(list); + } + + /** + * 查询数量 + * @param pwBacklog + * @return + */ + @GetMapping("/getlistNumber") + public AjaxResult getlistNumber(PwBacklog pwBacklog){ + if(null==pwBacklog.getStatus()||"".equals(pwBacklog.getStatus())){ + pwBacklog.setStatus("否"); + } + List list = new ArrayList(); + //判断登录人的角色,每个角色只能看到自己角色的数据 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if("admin".equals(user.getUserName())){ + startPage(); + list = pwBacklogService.selectPwBacklogList(pwBacklog); + }else{ + List roles = user.getRoles(); + for (SysRole sysRole : roles) { + pwBacklog.setRecipientName(sysRole.getRoleName()); + startPage(); + list = pwBacklogService.selectPwBacklogList(pwBacklog); + } + } + return AjaxResult.success(list.size()); + } + + /** + * 导出待办事项列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:export')") + @Log(title = "待办事项", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBacklog pwBacklog) + { + List list = pwBacklogService.selectPwBacklogList(pwBacklog); + ExcelUtil util = new ExcelUtil(PwBacklog.class); + return util.exportExcel(list, "pwBacklog"); + } + + /** + * 获取待办事项详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwBacklogService.selectPwBacklogById(id)); + } + + /** + * 新增待办事项 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:add')") + @Log(title = "待办事项", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBacklog pwBacklog){ + + return toAjax(pwBacklogService.insertPwBacklog(pwBacklog)); + } + + /** + * 修改待办事项 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:edit')") + @Log(title = "待办事项", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBacklog pwBacklog){ + return toAjax(pwBacklogService.updatePwBacklog(pwBacklog)); + } + + /** + * 修改待办事项为已阅状态 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:edit')") + @Log(title = "待办事项", businessType = BusinessType.UPDATE) + @RequestMapping("/editStatus/{ids}") + public AjaxResult editStatus(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + PwBacklog pwBacklog = pwBacklogService.selectPwBacklogById(id); + if("是".equals(pwBacklog.getStatus())){ + pwBacklog.setStatus("否"); + }else{ + pwBacklog.setStatus("是"); + //办事时间为当前时间 + pwBacklog.setRecipientTime(new Date()); + } + i = pwBacklogService.updatePwBacklog(pwBacklog); + } + return toAjax(i); + } + + /** + * 办理待办事项,修改是否已阅状态 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:remove')") + @Log(title = "待办事项", businessType = BusinessType.DELETE) + @DeleteMapping("/updatePwBacklogByStatus/{ids}") + public AjaxResult updatePwBacklogByStatus(@PathVariable Long[] ids){ + PwBacklog pwBacklog = pwBacklogService.selectPwBacklogById(ids[0]); + pwBacklog.setStatus("是"); + //办理时间为当前时间 + pwBacklog.setRecipientTime(new Date()); + return toAjax(pwBacklogService.updatePwBacklog(pwBacklog)); + } + + /** + * 删除待办事项 + */ + @PreAuthorize("@ss.hasPermi('management:pwBacklog:remove')") + @Log(title = "待办事项", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwBacklogService.deletePwBacklogByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBomController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomController.java new file mode 100644 index 0000000..4ad0cda --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwBom; +import com.ruoyi.project.management.service.IPwBomService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * bomController + * + * @author zhukangchao + * @date 2020-08-11 + */ +@RestController +@RequestMapping("/management/bom") +public class PwBomController extends BaseController +{ + @Autowired + private IPwBomService pwBomService; + + /** + * 查询bom列表 + */ + @PreAuthorize("@ss.hasPermi('management:bom:list')") + @GetMapping("/list") + public TableDataInfo list(PwBom pwBom) + { + startPage(); + List list = pwBomService.selectPwBomList(pwBom); + return getDataTable(list); + } + + /** + * 导出bom列表 + */ + @PreAuthorize("@ss.hasPermi('management:bom:export')") + @Log(title = "bom", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBom pwBom) + { + List list = pwBomService.selectPwBomList(pwBom); + ExcelUtil util = new ExcelUtil(PwBom.class); + return util.exportExcel(list, "bom"); + } + + /** + * 获取bom详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:bom:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwBomService.selectPwBomById(id)); + } + + /** + * 新增bom + */ + @PreAuthorize("@ss.hasPermi('management:bom:add')") + @Log(title = "bom", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBom pwBom) + { + return toAjax(pwBomService.insertPwBom(pwBom)); + } + + /** + * 修改bom + */ + @PreAuthorize("@ss.hasPermi('management:bom:edit')") + @Log(title = "bom", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBom pwBom) + { + return toAjax(pwBomService.updatePwBom(pwBom)); + } + + /** + * 删除bom + */ + @PreAuthorize("@ss.hasPermi('management:bom:remove')") + @Log(title = "bom", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwBomService.deletePwBomByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberController.java new file mode 100644 index 0000000..4e8a57b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberController.java @@ -0,0 +1,417 @@ +package com.ruoyi.project.management.controller; + +import java.util.*; +import com.alibaba.fastjson.JSONObject; +import com.google.gson.Gson; +import com.kingdee.bos.webapi.entity.RepoRet; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpJDUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.BaseDataTool; +import com.ruoyi.project.product.domain.ProdMaterial; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import javax.annotation.Resource; + +/** + * 数量计算Controller + * + * @author zhukangchao + * @date 2021-03-22 + */ +@RestController +@RequestMapping("/management/pwBomNumber") +public class PwBomNumberController extends BaseController +{ + @Value("${ruoyi.jdInterFaceUrl}") + private String jdInterFaceUrl; + @Value("${ruoyi.jdSessionUrl}") + private String jdSessionUrl; + @Value("${ruoyi.jd_acctId}") + private String acctId; + @Autowired + private IPwBomNumberService pwBomNumberService; + @Resource + private IJdBomRecordService jdBomRecordService; //金蝶使用 + @Autowired + private IPwMaterialParamsService pwMaterialParamsService; //金蝶物料维度 + @Autowired + private IPwProductionBillService pwProductionBillService; //执行单 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; //详情 + + /** + * 查询数量计算列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumber:list')") + @GetMapping("/list") + public TableDataInfo list(PwBomNumber pwBomNumber) + { + startPage(); + List list = pwBomNumberService.selectPwBomNumberList(pwBomNumber); + return getDataTable(list); + } + + /** + * BOM推送 + * @param param + * @return + */ + @RequestMapping("/pushJdBom/{param}") + public AjaxResult autoPushJdBom(@PathVariable("param") String param){ + //判断生产订单是否已经推送 + List jdRecord_list = jdBomRecordService.selectJdBomRecordByCode(param); + for(JdBomRecord jdBomRecord : jdRecord_list){ + if(null != jdBomRecord && StringUtils.isNotEmpty(jdBomRecord.getJdCode())){ + return AjaxResult.error("此执行单号的BOM已经推送金蝶!!"); + } + } + //获取要推送的bom + List pwlist = pwBomNumberService.queryPwBomNumberByCode(param); + //去重复物料 + for (int i=0;i material_list = null; + try{ + material_list = BaseDataTool.queryMaterials(""); + //物料信息 + ImMaterial imMaterial = null; + //循环把每一个物料推送到金蝶 + for (int i=0;i product_list = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(productionBill.getId()); + //循环自动生成生产订单,获取订单号 + String[] fig_arr = figureNumber.split(","); + String[] num_arr = number.split(","); + Map map = new HashMap(); + for(int i=0;i reslist =new ArrayList<>(); + for(PwBomNumber pwBom : pwlist){ + JdInterFace dto = null; + //查找主BOM数据 + if(StringUtils.isEmpty(pwBom.getParentLevelFigureNumber())){ + dto = new JdInterFace(); + dto.setFName(pwBom.getProductionCode()); + dto.setFMaterialNumber(pwBom.getFigureNumber()); + dto.setFMaterialName(pwBom.getName()); + if(StringUtils.isEmpty(pwBom.getMaterialGroup())){ + dto.setFMaterialGroup("非标"); + }else{ + dto.setFMaterialGroup(pwBom.getMaterialGroup()); + } + //物料属性 + if(pwBom.getRemarks().indexOf(Constants.MATERIAL_ATTRIBUTE_WG) != -1){ + dto.setFErpClsName(Constants.MATERIAL_ATTRIBUTE_WG); + }else if(pwBom.getRemarks().indexOf("伊特") != -1){ + dto.setFErpClsName(Constants.MATERIAL_ATTRIBUTE_ZZ); + }else if(("009".equals(pwBom.getFigureNumber().substring(0,3))&&!pwBom.getFigureNumber().substring(3,4).matches("[a-zA-Z]+")) || " ".equals(pwBom.getFigureNumber().substring(0,2)) || ("017".equals(pwBom.getFigureNumber().substring(0,3))&&!pwBom.getFigureNumber().substring(3,4).matches("[a-zA-Z]+"))){ + dto.setFErpClsName(Constants.MATERIAL_ATTRIBUTE_WG); + }else{ + dto.setFErpClsName(Constants.MATERIAL_ATTRIBUTE_ZZ); + } + dto.setFGroupNumber(Constants.BOM_GROUP_ID); + dto.setFBaseUnitName(Constants.UNIT_NAME); + dto.setFDepName(Constants.JD_DEPT_NAME_JJ); + dto.setF_SVRI_Assistant(pwBom.getType()); + + //在解析图纸时没有工时,所以都设置为 0 + dto.setF_UCHN_BZGS("0.0"); + if(null == pwBom.getPieceWeight() || pwBom.getPieceWeight() == 0){ + dto.setF_UCHN_DZ("0.0"); + }else{ + dto.setF_UCHN_DZ(pwBom.getPieceWeight().toString()); + } + String scdd = ""; + for (String key : map.keySet()) { + if(key.equals(pwBom.getFigureNumber())){ + scdd = map.get(key); + } + } + dto.setF_UCHN_SCDDH(scdd); + dto.setFTreeEntity(recursionSonList(dto.getFMaterialNumber(), pwlist)); + reslist.add(dto); + recursionSonOrNumber(reslist,pwBom.getFigureNumber(),pwlist,scdd); + } + } + //推送金蝶 + if(null != reslist && reslist.size() > 0){ + //获取金蝶的sessionId + String jd_param = "{\"acctID\": \""+acctId+"\",\"Username\": \"Administrator\",\"appId\": \"270187_01dPwbFu0NmW2YVp1fSLSc/uziwb4qks\",\"appSecret\": \"2cc5b5308fb044cfaa89bdd73964d59f\", \"lcid\": 2052}"; + String RES = HttpJDUtils.sendPost(jdSessionUrl,jd_param); + JSONObject object = JSONObject.parseObject(RES); + String sessionId = object.getString("KDSVCSessionId"); + //组装BOM + Gson gson = new Gson(); + String bomJson = "{\"JsonParam\": {\"BOMDatas\": "+ gson.toJson(reslist)+"}}"; + //调用金蝶接口 + String res_str = HttpJDUtils.sendJDPost(jdInterFaceUrl,bomJson,sessionId); + RepoRet repoRet = gson.fromJson(res_str, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + if(jdRecord_list == null || jdRecord_list.size() == 0){ + JdBomRecord jdBomRecord = null; + String[] name_arr = name.split(","); + for(int i=0;i paramList = pwMaterialParamsService.selectPwMaterialParamsList(null); + for (PwMaterialParams pwMaterialParams : paramList) { + if(name.equals(pwMaterialParams.getParamName())){ + return pwMaterialParams.getParamValue(); + } + } + return null; + } + + /** + * 递归查询子项集合 + * @param reslist + * @param number + * @param list + * @param orderNumber + */ + private void recursionSonOrNumber(List reslist,String number,List list,String orderNumber){ + JdInterFace dto = null; + for(int p=0;p 0){ + reslist.add(dto); + } + recursionSonOrNumber(reslist,list.get(p).getFigureNumber(),list,orderNumber); + } + } + } + + /** + * 金蝶BOM 的子项集合 + * @param number + * @param list + * @return + */ + private List recursionSonList(String number,List list){ + List rzlist = new ArrayList(); + JdInterFaceDto dto = null; + for(int p=0;p list = pwBomNumberService.queryBomList(prodictBillBom.getCode()); + ExcelUtil util = new ExcelUtil(ProdictBillBom.class); + return util.exportExcel(list, "BOM"); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberTwoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberTwoController.java new file mode 100644 index 0000000..ba2dda6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberTwoController.java @@ -0,0 +1,7355 @@ +package com.ruoyi.project.management.controller; + +import java.awt.image.BufferedImage; +import java.io.*; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import javax.annotation.Resource; +import javax.imageio.ImageIO; +import com.alibaba.fastjson.JSONArray; +import com.itextpdf.text.Rectangle; +import com.itextpdf.text.pdf.PdfReader; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.mapper.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.BaseDataTool; +import com.ruoyi.project.management.utils.FileToZip; +import com.ruoyi.project.management.utils.PDFDocHelper; +import org.springframework.security.access.prepost.PreAuthorize; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.rendering.PDFRenderer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import cn.hutool.core.io.FileUtil; +import cn.hutool.extra.qrcode.QrCodeUtil; +import cn.hutool.extra.qrcode.QrConfig; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 数量保存Controller + * + * @author zhukangchao + * @date 2021-03-30 + */ +@RestController +@RequestMapping("/management/pwBomNumberTwo") +public class PwBomNumberTwoController extends BaseController{ + @Value("${ruoyi.pdfUrl}") + private String pdfUrl; + @Value("${ruoyi.dwgAndPdf}") + private String dwgAndPdf; + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //部门信息 + @Autowired + private ISysDeptService deptService; + //用户信息 + @Autowired + private TokenService tokenService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //执行单详情信息 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //质检通知单信息 + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //企标单详情列表信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //采购单详情列表信息 + @Resource + private PwPurchaseContractMaterialMapper pwPurchaseContractMaterialMapper; + //bom信息 + @Autowired + private IPwBomNumberService pwBomNumberService; + //领料专用bom + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + @Resource + private PwProductionBillMapper pwProductionBillMapper; + @Resource + private PwContractMapper pwContractMapper; + @Resource + private PwInventoryDetailMapper pwInventoryDetailMapper; + @Resource + private ImMaterialMapper imMaterialMapper; + //预制单明细 + @Resource + private PwMakeDocumentsDetailMapper pwMakeDocumentsDetailMapper; + //物料工序信息 + @Autowired + private IPwMaterialProcessService pwMaterialProcessService; + //预制单信息 + @Resource + private PwMakeDocumentsMapper pwMakeDocumentsMapper; + //生产订单信息 + @Autowired + private IPwProductionOrderService pwProductionOrderService; + + //预采购单 + @Autowired + private IPwFuturesOrdersService pwFuturesOrdersService; + //预采购单明细 + @Autowired + private IPwFuturesOrdersDetailService pwFuturesOrdersDetailService; + //预采购单明细详情信息 + @Autowired + private IPwFuturesOrdersDetailTwoService pwFuturesOrdersDetailTwoService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + //外协合同详情信息 + @Autowired + private IPwOutsourceContractDetailService pwOutsourceContractDetailService; + //物品出入库 + @Autowired + private IEvoInOutStorageManagementService evoInOutStorageManagementService; + @Resource + private IJdProcessBomService jdProcessBomService; //金蝶使用 + @Resource + private IJdBomRecordService jdBomRecordService; //金蝶使用 + @Resource + private IJdProcessBomRecordService iJdProcessBomRecordService; //金蝶使用 + @Resource + private IPwProcessOrDeptService pwProcessOrDeptService; //根据工艺名称查询工艺信息 + @Resource + private IPwGxProcessService pwGxProcessService; + + /** + * 查询数量保存列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwo:list')") + @RequestMapping("/list") + public TableDataInfo list(PwBomNumberTwo pwBomNumberTwo){ + long time = new Date().getTime(); + //获取用户信息 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //用户昵称 + String nickName = user.getNickName(); + + List list = new ArrayList(); + //判断用户昵称如果为,机加车间,铆焊工段,铆装车间时,只查询当前派工的数据和当前物料的所有子集(不包括子集工序只包括物料子集,不包括工序子集) + List list2 = new ArrayList(); + if("机一工段".equals(user.getDept().getDeptName())||"机二工段".equals(user.getDept().getDeptName())||"机三工段".equals(user.getDept().getDeptName())||"外协部".equals(user.getDept().getDeptName())||"采购部".equals(user.getDept().getDeptName())){ + pwBomNumberTwo.setDepartmentName(user.getDept().getDeptName()); + //如果不带有令号,则查询所有未完成项目的所有给这个部门派工的数据,不包含已完成的 + if(null==pwBomNumberTwo.getProductionCode()||"".equals(pwBomNumberTwo.getProductionCode())){ + pwBomNumberTwo.setSparedOne(null); + //查询所有未完成的项目 + List list3 = pwProductionBillService.selectPwProductionBillByStatus("未完成"); + for (PwProductionBill pwProductionBill : list3) { + pwBomNumberTwo.setProductionCode(pwProductionBill.getCode()); + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } +// startPage(); + List list4 = pwBomNumberTwoService.selectPwBomNumberTwoByDeptNameAndWeiWanCheng(pwBomNumberTwo); + for (PwBomNumberTwo pwBomNumberTwo2 : list4) { + list2.add(pwBomNumberTwo2); + } + } + + if("是".equals(pwBomNumberTwo.getPerformable())){ + List list8 = new ArrayList(); + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + //查询上序是否入库 + String substring = pwBomNumberTwo2.getFigureNumber().substring(pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")+1); + String figureNumber = pwBomNumberTwo2.getFigureNumber().substring(0,pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndFigureNumber(pwBomNumberTwo2.getProductionCode(), figureNumber); + if(list4.size()>0||s == 0){ + list8.add(pwBomNumberTwo2); + } + } + return getDataTable(list8); + } + }else{ + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } + pwBomNumberTwo.setSparedOne(null); + startPage(); + list2 = pwBomNumberTwoService.selectPwBomNumberTwoList(pwBomNumberTwo); + if("是".equals(pwBomNumberTwo.getPerformable())){ + List list8 = new ArrayList(); + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + //查询上序是否入库 + String substring = pwBomNumberTwo2.getFigureNumber().substring(pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")+1); + String figureNumber = pwBomNumberTwo2.getFigureNumber().substring(0,pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + List list3 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndFigureNumber(pwBomNumberTwo2.getProductionCode(), figureNumber); + if(list3.size()>0||s == 0){ + list8.add(pwBomNumberTwo2); + } + } + return getDataTable(list8); + } + } + return getDataTable(list2); + }else{ + if(null!=pwBomNumberTwo.getDepartmentNames()&&pwBomNumberTwo.getDepartmentNames().length>0){ + + //判断令号是否为null,如果令号为null,则查询所有未完成项目的 + if(null==pwBomNumberTwo.getProductionCode()||"".equals(pwBomNumberTwo.getProductionCode())){ + pwBomNumberTwo.setSparedOne(""); + } + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())||null==pwBomNumberTwo.getInventoryStatus()){ + pwBomNumberTwo.setInventoryStatus(""); + } + String[] departmentNames = pwBomNumberTwo.getDepartmentNames(); + for (String string : departmentNames) { + pwBomNumberTwo.setDepartmentName(string); + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoList(pwBomNumberTwo); + for (PwBomNumberTwo pwBomNumberTwo2 : list3) { + list2.add(pwBomNumberTwo2); + } + } + + if("是".equals(pwBomNumberTwo.getPerformable())){ + List list8 = new ArrayList(); + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + //查询上序是否入库 + String substring = pwBomNumberTwo2.getFigureNumber().substring(pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")+1); + String figureNumber = pwBomNumberTwo2.getFigureNumber().substring(0,pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndFigureNumber(pwBomNumberTwo2.getProductionCode(), figureNumber); + if(list4.size()>0||s == 0){ + list8.add(pwBomNumberTwo2); + } + } + return getDataTable(list8); + } + + return getDataTable(list2); + } + //判断类型是否为null,如果不为null,则查询相应类型的数据 + if(null==pwBomNumberTwo.getMaterialType()||"".equals(pwBomNumberTwo.getMaterialType())){ + //截取第一个/出现之前的字符,模糊搜索 + if(null!=pwBomNumberTwo.getSparedOne()&&!"".equals(pwBomNumberTwo.getSparedOne())){ + //判断是销齿链时需要截取销齿链的型号 + if(pwBomNumberTwo.getProductionCode().contains("XCL")&&pwBomNumberTwo.getSparedOne().contains("/")){ + String sparedOne = pwBomNumberTwo.getSparedOne(); + pwBomNumberTwo.setSparedOne(sparedOne.substring(0,sparedOne.indexOf('/'))); + } + } + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } + // startPage(); + list2 = pwBomNumberTwoService.selectPwBomNumberTwoLists(pwBomNumberTwo); + }else if("自制件".equals(pwBomNumberTwo.getMaterialType())){ + //截取第一个/出现之前的字符,模糊搜索 + if(null!=pwBomNumberTwo.getSparedOne()&&!"".equals(pwBomNumberTwo.getSparedOne())){ + //判断是销齿链时需要截取销齿链的型号 + if(pwBomNumberTwo.getProductionCode().contains("XCL")&&pwBomNumberTwo.getSparedOne().contains("/")){ + String sparedOne = pwBomNumberTwo.getSparedOne(); + pwBomNumberTwo.setSparedOne(sparedOne.substring(0,sparedOne.indexOf('/'))); + } + } + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } + // startPage(); + list2 = pwBomNumberTwoService.selectPwBomNumberTwoListHomeMade(pwBomNumberTwo); + }else if("标准件".equals(pwBomNumberTwo.getMaterialType())){ + //截取第一个/出现之前的字符,模糊搜索 + if(null!=pwBomNumberTwo.getSparedOne()&&!"".equals(pwBomNumberTwo.getSparedOne())){ + //判断是销齿链时需要截取销齿链的型号 + if(pwBomNumberTwo.getProductionCode().contains("XCL")&&pwBomNumberTwo.getSparedOne().contains("/")){ + String sparedOne = pwBomNumberTwo.getSparedOne(); + pwBomNumberTwo.setSparedOne(sparedOne.substring(0,sparedOne.indexOf('/'))); + } + } + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } + // startPage(); + list2 = pwBomNumberTwoService.selectPwBomNumberTwoListStandard(pwBomNumberTwo); + }else if("外购件".equals(pwBomNumberTwo.getMaterialType())){ + //截取第一个/出现之前的字符,模糊搜索 + if(null!=pwBomNumberTwo.getSparedOne()&&!"".equals(pwBomNumberTwo.getSparedOne())){ + //判断是销齿链时需要截取销齿链的型号 + if(pwBomNumberTwo.getProductionCode().contains("XCL")&&pwBomNumberTwo.getSparedOne().contains("/")){ + String sparedOne = pwBomNumberTwo.getSparedOne(); + pwBomNumberTwo.setSparedOne(sparedOne.substring(0,sparedOne.indexOf('/'))); + } + } + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } + // startPage(); + list2 = pwBomNumberTwoService.selectPwBomNumberTwoListOutsourcing(pwBomNumberTwo); + }else if("甲供件".equals(pwBomNumberTwo.getMaterialType())){ + //截取第一个/出现之前的字符,模糊搜索 + if(null!=pwBomNumberTwo.getSparedOne()&&!"".equals(pwBomNumberTwo.getSparedOne())){ + //判断是销齿链时需要截取销齿链的型号 + if(pwBomNumberTwo.getProductionCode().contains("XCL")&&pwBomNumberTwo.getSparedOne().contains("/")){ + String sparedOne = pwBomNumberTwo.getSparedOne(); + pwBomNumberTwo.setSparedOne(sparedOne.substring(0,sparedOne.indexOf('/'))); + } + } + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } + // startPage(); + list2 = pwBomNumberTwoService.selectPwBomNumberTwoListFirstParty(pwBomNumberTwo); + } + } + for(int i=0;i list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(list2.get(i).getProductionCode(), list2.get(i).getId()); + int flag = 0; + //查询隐藏工艺 + if(StringUtils.isNotEmpty(pwBomNumberTwo.getJdFlag()) && "1".equals(pwBomNumberTwo.getJdFlag())){ + for (PwBomNumberTwo bomNumberTwo : list3) { + if("1".equals(bomNumberTwo.getFigureNumber().substring(bomNumberTwo.getFigureNumber().lastIndexOf("-")+1))){ + flag = 1; + } + } + if(flag == 0){ + list2.remove(i); + i--; + continue; + } + } + //查询工艺 + if(StringUtils.isNotEmpty(pwBomNumberTwo.getProcessFlag()) && "1".equals(pwBomNumberTwo.getProcessFlag())){ + for (PwBomNumberTwo bomNumberTwo : list3) { + if("1".equals(bomNumberTwo.getFigureNumber().substring(bomNumberTwo.getFigureNumber().lastIndexOf("-")+1))){ + list2.remove(i); + i--; + break; + } + } + continue; + } + list2.get(i).setChildren(list3); + } + + if(list2.size()>0){ + //查询此项目是否审核,返回审核标记 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(list2.get(0).getProductionCode()); + if(null!=productionBill&&productionBill.getStatusId()==1){ + //说明未审核 + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + pwBomNumberTwo2.setBiaoji("未审核"); + } + }else{ + //说明已审核 + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + pwBomNumberTwo2.setBiaoji("已审核"); + } + } + } + long time2 = new Date().getTime(); + System.out.println("用时:"+(time2-time)); + return getDataTable(list2); + } + + /** + * 查询物料状态信息 + * + */ + @GetMapping("/listPwBomNumberTwoAll") + public TableDataInfo listPwBomNumberTwoAll(PwBomNumberTwo pwBomNumberTwo){ + List list = new ArrayList(); + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + List list3 = new ArrayList(); + if(null != bomNumberTwo){ + list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); + } + //查询当前物料的质检,入库,出库等状态 + for (PwBomNumberTwo pwBomNumberTwo3 : list3) { + //查询领料数据 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo3.getFigureNumber().substring(pwBomNumberTwo3.getFigureNumber().lastIndexOf("-")+1); + List list5 = new ArrayList(); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1 == Integer.valueOf(substring)){ + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo3.getProductionCode(), pwBomNumberTwo3.getMaterialsName(), pwBomNumberTwo3.getMaterialsSpecification()); + }else{ + String figureNumber = pwBomNumberTwo3.getFigureNumber().substring(0,pwBomNumberTwo3.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo3.getProductionCode(), figureNumber); + } + //申请领料数量 + Long shenqingchuku = 0L; + //领料已发数量 + Long chuku = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list5) { + shenqingchuku += imStockRequisitionMaterial.getApplyForQuantity(); + chuku += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //申请领料数量 + pwBomNumberTwo3.setLen(shenqingchuku); + //已发领料数量 + pwBomNumberTwo3.setLingliaoNumber(chuku); + if(1 == Integer.valueOf(substring)&&(null==pwBomNumberTwo3.getMaterialsName()||"".equals(pwBomNumberTwo3.getMaterialsName()))){ + pwBomNumberTwo3.setInventoryStatus("无需领料"); + }else{ + if(chuku == 0){ + //未领料 + pwBomNumberTwo3.setInventoryStatus("未领料"); + }else{ + //已领料 + pwBomNumberTwo3.setInventoryStatus("已领料"); + } + } + + //查询质检数据 + List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo3.getProductionCode(), pwBomNumberTwo3.getName(), pwBomNumberTwo3.getFigureNumber()); + + //交检数量 + Long jiaojian = 0L; + //已检数量 + Long jianyan = 0L; + //累加其数量 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list2) { + jiaojian += pwCompletionNoticeProduct.getReceivableQuantity().longValue(); + jianyan += pwCompletionNoticeProduct.getQuantity().longValue(); + } + pwBomNumberTwo3.setWid(jiaojian); + pwBomNumberTwo3.setWorkblankTwo(jianyan); + + //查询入库数据 + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo3.getProductionCode(), pwBomNumberTwo3.getName(), pwBomNumberTwo3.getFigureNumber()); + + //申请入库数量 + Long shenqingruku = 0L; + //已入库数量 + Long ruku = 0L; + //累加其数量 + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + shenqingruku += imProductReceiptMaterial.getReceivableQuantity().longValue(); + ruku += imProductReceiptMaterial.getReceived().longValue(); + } + pwBomNumberTwo3.setLenTwo(shenqingruku); + pwBomNumberTwo3.setNumber(ruku); + //状态 + if(pwBomNumberTwo3.getSumNumber().equals(jianyan)){ + pwBomNumberTwo3.setInventoryStatus("已检验"); + } + if(pwBomNumberTwo3.getSumNumber().equals(ruku)){ + pwBomNumberTwo3.setInventoryStatus("已入库"); + } + + //查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo3.getName(), pwBomNumberTwo3.getFigureNumber()); + pwBomNumberTwo3.setWorkblank(inventoryDetail.getQuantity()); + } + if(null!=bomNumberTwo){ + bomNumberTwo.setChildren(list3); + } + list.add(bomNumberTwo); + return getDataTable(list); + } + + + /** + * 查询子集数据 + * + */ + @RequestMapping("/listZaiTuByInventoryDetailId/{id}") + public TableDataInfo listZaiTuByInventoryDetailId(@PathVariable Long id){ + //根据id查询当前物料信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + //根据物料名称和图号插叙企标单的数据 + List list = new ArrayList(); + //先查寻企标单的在途 + //根据物料名称和图号查询预制单详情中的物料信息(只查询未入库状态和入库中状态的,然后根据企标号去重) + List lists = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByNameAndFigureNumberList(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : lists) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + preliminaryInventoryInfo.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //名称 + preliminaryInventoryInfo.setName(pwMakeDocumentsDetail.getName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwMakeDocumentsDetail.getQuantity()); + //已入库数量 + //查询当前物料的最后一道序的入库情况 + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + //计录数量 + Long p = 0L; + if(list2.size()>0){ + List list3 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), list2.get(list2.size()-1).getName(), list2.get(list2.size()-1).getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { + p += imProductReceiptMaterial.getReceived().longValue(); + } + } + preliminaryInventoryInfo.setUsableQuantity(p); + //在途数量 + //preliminaryInventoryInfo.setPreliminaryInventory(pwMakeDocumentsDetail.getQuantity()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(pwMakeDocumentsDetail.getQuantity()-preliminaryInventoryInfo.getUsableQuantity()>0){ + list.add(preliminaryInventoryInfo); + } + } + return getDataTable(list); + } + + + /** + * 查询子集数据 + * + */ + @GetMapping("/selectSubsets/{ids}") + public TableDataInfo selectSubsets(@PathVariable Long[] ids){ + //根据id查询当前物料信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(ids[0]); + List list = new ArrayList(); + //根据名称和图号查询下级物料 + List list2 = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + list.add(pwBomNumberTwo2); + if("部件".equals(pwBomNumberTwo2.getType())){ + List list3 = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwo2.getProductionCode(), pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo3 : list3) { + list.add(pwBomNumberTwo3); + if("部件".equals(pwBomNumberTwo3.getType())){ + List list4 = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwo3.getProductionCode(), pwBomNumberTwo3.getName(), pwBomNumberTwo3.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo4 : list4) { + list.add(pwBomNumberTwo4); + if("部件".equals(pwBomNumberTwo4.getType())){ + List list5 = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwo4.getProductionCode(), pwBomNumberTwo4.getName(), pwBomNumberTwo4.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo5 : list5) { + list.add(pwBomNumberTwo5); + if("部件".equals(pwBomNumberTwo5.getType())){ + List list6 = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwo5.getProductionCode(), pwBomNumberTwo5.getName(), pwBomNumberTwo5.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo6 : list6) { + list.add(pwBomNumberTwo6); + } + } + } + } + } + } + } + } + } + return getDataTable(list); + } + + /** + * 导出数量保存列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwo:export')") + @Log(title = "数量保存", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBomNumberTwo pwBomNumberTwo){ + //如果入库状态为null,则默认查询是所有数据 + if("未完成".equals(pwBomNumberTwo.getInventoryStatus())){ + pwBomNumberTwo.setInventoryStatus(""); + } + List list = pwBomNumberTwoService.selectPwBomNumberTwoList(pwBomNumberTwo); + ExcelUtil util = new ExcelUtil(PwBomNumberTwo.class); + return util.exportExcel(list, "pwBomNumberTwo"); + } + + /** + * 生成外协合同功能 + */ + @RequestMapping("/addPwOutsourceContracts") + public AjaxResult addPwOutsourceContracts(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + if(pwBomNumberTwo.getLingliaoNumber()<=0){ + return AjaxResult.error("请输入数量"); + } + //查询当前令号和名称和图号下的生成的外协合同明细的数量,如果相加数量等于本批数量时,则把外协合同标记修改为 是 + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + Long a = 0L; + for (PwOutsourceContractDetail pwOutsourceContractDetail2 : list) { + a += pwOutsourceContractDetail2.getQuantity(); + } + if(pwBomNumberTwo.getSumNumber() list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + Long a = 0L; + for (PwOutsourceContractDetail pwOutsourceContractDetail2 : list) { + a += pwOutsourceContractDetail2.getQuantity(); + } + if(pwBomNumberTwo.getSumNumber() list = new ArrayList(); + //遍历ids + for (Long id : ids) { + Long i = 1L; + List list3 = new ArrayList(); + //根据id获取物料信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + + //增加项目名称(用此变量代替) + //根据令号查询项目 + PwProductionBill productionBill = pwProductionBillMapper.selectPwProductionBillByProductionCode(pwBomNumberTwo.getProductionCode()); + pwBomNumberTwo.setMaterialsNameTwo(productionBill.getProjectName()); + //查询其所有子集,显示到工件流转单中 + PwBomNumberTwo bomNumberTwo = new PwBomNumberTwo(); + bomNumberTwo.setMaterialsNameTwo(productionBill.getProjectName()); + if(!"有库存".equals(pwBomNumberTwo.getSparedTwo())&&null!=pwBomNumberTwo.getFigureNumber()&&(!" ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2)) || !"009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))|| !"017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)))&&!pwBomNumberTwo.getRemarks().contains("外购件")&&!pwBomNumberTwo.getRemarks().contains("甲供件")){ + List list2 = new ArrayList(); + //如果是序,则查询其父级 + if(null!=pwBomNumberTwo.getSuperiorId()){ + bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getSuperiorId()); + list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); + + //查询当前物料的已入库数量 + Long yiru = 0L; + if(list2.size()>0){ + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), list2.get(list2.size()-1).getName(), list2.get(list2.size()-1).getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + yiru += imProductReceiptMaterial.getReceived().longValue(); + } + } + bomNumberTwo.setLenTwo(yiru); + }else{ + //根据id查询其所有子集 + list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + + //查询当前物料的已入库数量 + Long yiru = 0L; + if(list2.size()>0){ + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list2.get(list2.size()-1).getName(), list2.get(list2.size()-1).getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + yiru += imProductReceiptMaterial.getReceived().longValue(); + } + } + pwBomNumberTwo.setLenTwo(yiru); + } + + //判断是否是部件,如果为部件,则查询其子集 + if("部件".equals(pwBomNumberTwo.getType())||"0".equals(pwBomNumberTwo.getNum())){ + if(null!=pwBomNumberTwo.getSuperiorId()){ + //查询其所有子集,显示到工件流转单中 +// bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getSuperiorId()); +// list3 = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); +// list3 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); +// list3 = pwBomNumberTwoLingliaoService.selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber(),bomNumberTwo.getSparedOne()); + list3 = pwBomNumberService.selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber(),bomNumberTwo.getSparedOne()); + }else{ + //查询其所有子集,显示到工件流转单中 +// list3 = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); +// list3 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + list3 = pwBomNumberService.selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber(),pwBomNumberTwo.getSparedOne()); + } + + } + QrConfig config = new QrConfig(); + // 设置边距,既二维码和背景之间的边距 + config.setWidth(300); + config.setHeight(300); + config.setErrorCorrection(ErrorCorrectionLevel.M); + //是否入库 + String ss = ""; + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + pwBomNumberTwo2.setNum(i+""); + + File file = new File("D:/java/qrcode/"+pwBomNumberTwo2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(file.exists()){ + file.delete(); + } + if(!"虚拟部件".equals(pwBomNumberTwo2.getRemarks())){ + // 生成申请质检的二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcode?id="+pwBomNumberTwo2.getId(), config, FileUtil.file("D:/java/qrcode/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrl("http://localhost:8088/qrcode/"+pwBomNumberTwo2.getId()+".jpg"); + } + + File fileTwo = new File("D:/java/qrcodeTwo/"+pwBomNumberTwo2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileTwo.exists()){ + fileTwo.delete(); + } + if(!"虚拟部件".equals(pwBomNumberTwo2.getRemarks())){ + //生成确认质检的二维码,指定url对应的二维码到文件,宽和高都是300像素 +// QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeTwo?code="+pwBomNumberTwo2.getProductionCode()+"&name="+pwBomNumberTwo2.getName()+"&figureNumber="+pwBomNumberTwo2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeTwo/"+pwBomNumberTwo2.getId()+".jpg")); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeTwo?code="+pwBomNumberTwo2.getProductionCode()+"&figureNumber="+pwBomNumberTwo2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeTwo/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlTwo("http://localhost:8088/qrcodeTwo/"+pwBomNumberTwo2.getId()+".jpg"); + } + + //判断是否入库,如果不入库,则不再生成入库的二维码 + if("是".equals(pwBomNumberTwo2.getGodownEntry())){ + File fileThree = new File("D:/java/qrcodeThree/"+pwBomNumberTwo2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileThree.exists()){ + fileThree.delete(); + } + //生成确认入库的二维码,指定url对应的二维码到文件,宽和高都是300像素 +// QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeThree?code="+pwBomNumberTwo2.getProductionCode()+"&name="+pwBomNumberTwo2.getName()+"&figureNumber="+pwBomNumberTwo2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeThree/"+pwBomNumberTwo2.getId()+".jpg")); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeThree?code="+pwBomNumberTwo2.getProductionCode()+"&figureNumber="+pwBomNumberTwo2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeThree/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlThree("http://localhost:8088/qrcodeThree/"+pwBomNumberTwo2.getId()+".jpg"); + } + + //判断是否填写了原材料,如果没有填写原材料,则不再生成领料的二维码和出库的二维码 + if(null!=pwBomNumberTwo.getSuperiorId()){ + if(i==1&&null==pwBomNumberTwo2.getMaterialId()&&!"部件".equals(pwBomNumberTwo.getType())&&null!=pwBomNumberTwo.getParentLevelFigureNumber()&&null!=bomNumberTwo.getParentLevelFigureNumber()){ + + }else{ + File fileFour = new File("D:/java/qrcodeFour/"+pwBomNumberTwo2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFour.exists()){ + fileFour.delete(); + } + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFour?id="+pwBomNumberTwo2.getId(), config, FileUtil.file("D:/java/qrcodeFour/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFour("http://localhost:8088/qrcodeFour/"+pwBomNumberTwo2.getId()+".jpg"); + } + + if(i==1&&null==pwBomNumberTwo2.getMaterialId()&&!"部件".equals(pwBomNumberTwo.getType())&&null!=pwBomNumberTwo.getParentLevelFigureNumber()&&null!=bomNumberTwo.getParentLevelFigureNumber()){ + + }else{ + //判断上一序是否入库,如果上一序不入库,则当前序不生成二维码 + if("是".equals(ss)||"".equals(ss)){ + File fileFive = new File("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFive.exists()){ + fileFive.delete(); + } + if(i==1&&!"部件".equals(pwBomNumberTwo.getType())&&null!=pwBomNumberTwo.getParentLevelFigureNumber()){ + //原材料出库 + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode()+"&name="+pwBomNumberTwo2.getMaterialsName()+"&figureNumber="+pwBomNumberTwo2.getMaterialsSpecification(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + }else if("部件".equals(pwBomNumberTwo.getType())||null==pwBomNumberTwo.getParentLevelFigureNumber()){ + //生成部件领料码 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + }else{ + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo2.getFigureNumber().substring(pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + String figureNumber = pwBomNumberTwo2.getFigureNumber().substring(0,pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //根据令号和图号查询上一道序的物料信息 + bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo2.getProductionCode(), figureNumber); +// QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode()+"&name="+bomNumberTwo.getName()+"&figureNumber="+bomNumberTwo.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode()+"&figureNumber="+bomNumberTwo.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + } + } + } + }else{ + if(i==1&&null==pwBomNumberTwo2.getMaterialId()&&!"部件".equals(pwBomNumberTwo.getType())&&null!=pwBomNumberTwo.getParentLevelFigureNumber()){ + + }else{ + File fileFour = new File("D:/java/qrcodeFour/"+pwBomNumberTwo2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFour.exists()){ + fileFour.delete(); + } + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFour?id="+pwBomNumberTwo2.getId(), config, FileUtil.file("D:/java/qrcodeFour/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFour("http://localhost:8088/qrcodeFour/"+pwBomNumberTwo2.getId()+".jpg"); + } + + if(i==1&&null==pwBomNumberTwo2.getMaterialId()&&!"部件".equals(pwBomNumberTwo.getType())&&null!=pwBomNumberTwo.getParentLevelFigureNumber()){ + + }else{ + //判断上一序是否入库,如果上一序不入库,则当前序不生成二维码 + if("是".equals(ss)||"".equals(ss)){ + File fileFive = new File("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFive.exists()){ + fileFive.delete(); + } + if(i==1&&!"部件".equals(pwBomNumberTwo.getType())&&null!=pwBomNumberTwo.getParentLevelFigureNumber()){ + //原材料出库 + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode()+"&name="+pwBomNumberTwo2.getMaterialsName()+"&figureNumber="+pwBomNumberTwo2.getMaterialsSpecification(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + }else if("部件".equals(pwBomNumberTwo.getType())||null==pwBomNumberTwo.getParentLevelFigureNumber()){ + //生成部件领料码 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + }else{ + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo2.getFigureNumber().substring(pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + String figureNumber = pwBomNumberTwo2.getFigureNumber().substring(0,pwBomNumberTwo2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //根据令号和图号查询上一道序的物料信息 + bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo2.getProductionCode(), figureNumber); +// QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode()+"&name="+bomNumberTwo.getName()+"&figureNumber="+bomNumberTwo.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwo2.getProductionCode()+"&figureNumber="+bomNumberTwo.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg")); + pwBomNumberTwo2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwo2.getId()+".jpg"); + } + } + } + } + + ss = pwBomNumberTwo2.getGodownEntry(); + i++; + } + //返回pdf图片地址 + File file = new File("D:/evoEngine/static/product/"+pwBomNumberTwo.getProductionCode()+"/bomTwo/"+pwBomNumberTwo.getFigureNumber().replaceAll("/","--")+".pdf"); + if(null!=file){ + try { + PDDocument doc = PDDocument.load(file); + PDFRenderer renderer = new PDFRenderer(doc); + int pageCount = doc.getNumberOfPages(); + for(int r=0;r godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list); + return AjaxResult.success("success",godownMessage); + } + + /** + * 上传bom清单(针对于那些有执行单,但无dwg图的项目,需手动上传bom清单) + */ + @RequestMapping("/uploadBom") + @ResponseBody + public AjaxResult uploadBom(@RequestParam("productionBillProduceId") String productionBillProduceId,@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/ruoyi/qingdanExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + //根据productionBillProduceId查询 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductById(Long.valueOf(productionBillProduceId)); + PwProductionBill pwProductionBill = null; + if(null!=productionBillProduct){ + //根据执行单id查询执行单信息 + pwProductionBill = pwProductionBillService.selectPwProductionBillById(productionBillProduct.getProductionBillId()); + } + String typeName = productionBillProduct.getProductType(); + List list = new ArrayList<>(); + for (int i = 1; i < result.size(); i++) { + //创建原始bom对象 + PwBomNumber bom = new PwBomNumber(); + if(null!=pwProductionBill){ + //令号 + bom.setProductionCode(pwProductionBill.getCode()); + //产品型号 + bom.setTypeName(typeName); + }else{ + return AjaxResult.error("未查询到相关令号"); + } + //图号 + if(null!=result.get(i).get(0).toString()&&!"".equals(result.get(i).get(0).toString())){ + String substring2 = result.get(i).get(0).toString().substring(0, 3); + String substring10 = result.get(i).get(0).toString().substring(0, 2); + if("009".equals(substring2) || "017".equals(substring2) || " ".equals(substring10)){ + String replaceAll = result.get(i).get(0).toString().replaceAll(" ", ""); + replaceAll = " "+replaceAll; + + String replaceAll2 = ""; + //把标准件图号中的x转换为X + if(replaceAll.contains("x")){ + replaceAll2 = replaceAll.replaceAll("x","X"); + }else if(replaceAll.contains("×")){ + replaceAll2 = replaceAll.replaceAll("×","X"); + }else{ + replaceAll2 = replaceAll; + } + //图号 + bom.setFigureNumber(replaceAll2); + }else{ + if(result.get(i).get(0).toString().contains("/2-1")){ + bom.setFigureNumber(result.get(i).get(0).toString().replaceAll(" ","").replaceAll("/2-1", "")); + }else if(result.get(i).get(0).toString().contains("/2-2")){ + bom.setFigureNumber(result.get(i).get(0).toString().replaceAll(" ","").replaceAll("/2-2", "")); + }else if(result.get(i).get(0).toString().contains("/3-1")){ + bom.setFigureNumber(result.get(i).get(0).toString().replaceAll(" ","").replaceAll("/3-1", "")); + }else if(result.get(i).get(0).toString().contains("/3-2")){ + bom.setFigureNumber(result.get(i).get(0).toString().replaceAll(" ","").replaceAll("/3-2", "")); + }else if(result.get(i).get(0).toString().contains("/3-3")){ + bom.setFigureNumber(result.get(i).get(0).toString().replaceAll(" ","").replaceAll("/3-3", "")); + }else{ + bom.setFigureNumber(result.get(i).get(0).toString().replaceAll(" ","")); + } + } + }else{ + bom.setFigureNumber(result.get(i).get(0).toString()); + } + + Boolean b = type(result.get(i).get(1).toString().trim().replaceAll(" ","")); + //如果b返回的是true说明是整数,否是是小数,除整数需要处理成整数外,其他的都不做处理 + if(b){ + bom.setName(Double.valueOf(result.get(i).get(1).toString().trim().replaceAll(" ","")).longValue()+""); + }else{ + //名称 + bom.setName(result.get(i).get(1).toString().trim().replaceAll(" ","")); + } + +// //名称 +// if(null!=result.get(i).get(1).toString()){ +// //名称 +// bom.setName(result.get(i).get(1).toString().trim().replaceAll(" ","")); +// }else{ +// bom.setName(result.get(i).get(1).toString()); +// } + //单台数量 + if (null != result.get(i).get(2).toString() && !"".equals(result.get(i).get(2).toString())) { + bom.setOneNumber(Double.valueOf(result.get(i).get(2).toString()).longValue()); + } + Boolean b1 = type(result.get(i).get(3).toString().trim().replaceAll(" ","")); + if(b1){ + bom.setType(Double.valueOf(result.get(i).get(3).toString().trim().replaceAll(" ","")).longValue()+""); + }else{ + //材料 + bom.setType(result.get(i).get(3).toString()); + } + //材料 +// bom.setType(result.get(i).get(3).toString()); + //单重 + if (null != result.get(i).get(4).toString() && !"".equals(result.get(i).get(4).toString())) { + bom.setPieceWeight(Double.valueOf(result.get(i).get(4).toString())); + } + if("-9".equals(result.get(i).get(8).toString())||"-9.0".equals(result.get(i).get(8).toString())){ + bom.setSumNumber(productionBillProduct.getQuantity()); + //序号,总装图序号为0 + bom.setNum("0"); + } + //父级图号 + if("-9".equals(result.get(i).get(8).toString())||"-9.0".equals(result.get(i).get(8).toString())){ +// bom.setParentLevelFigureNumber(null); + }else{ + if(result.get(i).get(8).toString().contains("/2-1")){ + bom.setParentLevelFigureNumber(result.get(i).get(8).toString().replaceAll(" ","").replaceAll("/2-1", "")); + }else if(result.get(i).get(8).toString().contains("/2-2")){ + bom.setParentLevelFigureNumber(result.get(i).get(8).toString().replaceAll(" ","").replaceAll("/2-2", "")); + }else if(result.get(i).get(8).toString().contains("/3-1")){ + bom.setParentLevelFigureNumber(result.get(i).get(8).toString().replaceAll(" ","").replaceAll("/3-1", "")); + }else if(result.get(i).get(8).toString().contains("/3-2")){ + bom.setParentLevelFigureNumber(result.get(i).get(8).toString().replaceAll(" ","").replaceAll("/3-2", "")); + }else if(result.get(i).get(8).toString().contains("/3-3")){ + bom.setParentLevelFigureNumber(result.get(i).get(8).toString().replaceAll(" ","").replaceAll("/3-3", "")); + }else{ + bom.setParentLevelFigureNumber(result.get(i).get(8).toString().replaceAll(" ","")); + } + } + //父级名称 + bom.setParentLevelName(result.get(i).get(7).toString()); + //备注 + bom.setRemarks(result.get(i).get(6).toString()); + // 保存到list,然后批量添加 + list.add(bom); + } + pwBomNumberService.insertPwBoms(list); + + //处理序号问题 + //根据令号和型号查询出所有的物料信息 + List list3 = pwBomNumberService.selectPwBomNumberByCodeAndTypeName(pwProductionBill.getCode(),typeName); + for (PwBomNumber pwBomNumber : list3) { + if(null!=pwBomNumber.getNum()){ + //查询其下一级 + List list2 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber.getFigureNumber(), typeName, pwProductionBill.getCode()); + int o = 0; + for (PwBomNumber pwBomNumber2 : list2) { + if(pwBomNumber2.getNum()==null){ + pwBomNumber2.setNum(o+1+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber2); + } + o++; + //查询其下一级 + List list4 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber2.getFigureNumber(), typeName, pwProductionBill.getCode()); + int a = 0; + for (PwBomNumber pwBomNumber3 : list4) { + if(pwBomNumber3.getNum()==null){ + pwBomNumber3.setNum(pwBomNumber2.getNum()+"."+(a+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber3); + } + a++; + //查询其下一级 + List list5 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber3.getFigureNumber(), typeName, pwProductionBill.getCode()); + int f = 0; + for (PwBomNumber pwBomNumber4 : list5) { + if(pwBomNumber4.getNum()==null){ + pwBomNumber4.setNum(pwBomNumber3.getNum()+"."+(f+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber4); + } + f++; + //查询其下一级 + List list6 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber4.getFigureNumber(), typeName, pwProductionBill.getCode()); + int w = 0; + for (PwBomNumber pwBomNumber5 : list6) { + if(pwBomNumber5.getNum()==null){ + pwBomNumber5.setNum(pwBomNumber4.getNum()+"."+(w+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber5); + } + f++; + //查询其下一级 + List list7 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber5.getFigureNumber(), typeName, pwProductionBill.getCode()); + int r = 0; + for (PwBomNumber pwBomNumber6 : list7) { + if(pwBomNumber6.getNum()==null){ + pwBomNumber6.setNum(pwBomNumber5.getNum()+"."+(r+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber6); + } + r++; + List list8 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber6.getFigureNumber(), typeName, pwProductionBill.getCode()); + int q = 0; + for (PwBomNumber pwBomNumber7 : list8) { + if(pwBomNumber7.getNum()==null){ + pwBomNumber7.setNum(pwBomNumber6.getNum()+"."+(q+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber7); + } + q++; + List list9 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber7.getFigureNumber(), typeName, pwProductionBill.getCode()); + int b = 0; + for (PwBomNumber pwBomNumber8 : list9) { + if(pwBomNumber8.getNum()==null){ + pwBomNumber8.setNum(pwBomNumber7.getNum()+"."+(q+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber8); + } + b++; + } + } + } + } + } + } + } + } + } + //根据令号查询当前令号下所有的零部件,加入到物料信息表和库存信息表中 + AjaxResult ajaxResult = counterNum(pwProductionBill.getCode(),typeName); + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByProductionCode(pwProductionBill.getCode()); + for (PwBomNumberTwo pwBomNumberTwo : list2) { + //判断是否已经添加了此物料 + ImMaterial imMaterial2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=imMaterial2){ + + if(null==imMaterial2.getMaterials()||"".equals(imMaterial2.getMaterials())){ + imMaterial2.setMaterials(pwBomNumberTwo.getType()); + imMaterial2.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + imMaterialMapper.updateImMaterial(imMaterial2); + } + + //如果存在,则判断材料和单重是否一致,如果不一致则修改原来的 + if(!imMaterial2.getMaterials().equals(pwBomNumberTwo.getType())){ + imMaterial2.setMaterials(pwBomNumberTwo.getType()); + imMaterial2.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + imMaterialMapper.updateImMaterial(imMaterial2); + } + //根据名称和图号获取库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(imMaterial2.getMaterialName(), imMaterial2.getFigureNumber()); + + if(null==inventoryDetail.getMaterials()||"".equals(inventoryDetail.getMaterials())){ + inventoryDetail.setMaterials(pwBomNumberTwo.getType()); + inventoryDetail.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + } + + //修改库存信息的材料 + if(null!=inventoryDetail&&!inventoryDetail.getMaterials().equals(pwBomNumberTwo.getType())){ + inventoryDetail.setMaterials(pwBomNumberTwo.getType()); + inventoryDetail.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + } + + //更新锁定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwBomNumberTwo.getSumNumber()); + //判断当前物料是否有安全库存设置 + if(imMaterial2.getMinimum()!=0&&imMaterial2.getHighest()!=0){ + //有安全库存设置,先判断需不需要添加在途数量(如果库存数量+在途数量-本批数量<最低库存数量),则代表需要制作 + if(inventoryDetail.getQuantity()-pwBomNumberTwo.getSumNumber()=inventoryDetail.getLockNumber()){ + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + //更新库存信息 + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + }else{ + //直接更新可用数量后更新库存信息 + //更新可用数量 + if(inventoryDetail.getQuantity()>=inventoryDetail.getLockNumber()){ + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + //更新库存信息 + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + } + }else{ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=0){ + pwBomNumberTwo.setSparedTwo("有库存"); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + }else{ + if(null != inventoryDetail&&inventoryDetail.getMinimum() != 0&&inventoryDetail.getHighest() != 0){ + pwBomNumberTwo.setSparedTwo("安全库存"); + }else if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=0){ + pwBomNumberTwo.setSparedTwo("安全库存"); + }else{ + //没有库存,直接更新在途数量 + inventoryDetail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + } + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + + //更新可用数量 + if(inventoryDetail.getQuantity()>=inventoryDetail.getLockNumber()){ + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + //更新库存信息 + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + } + }else{ + //创建物料对象 + ImMaterial imMaterial = new ImMaterial(); + //名称 + imMaterial.setMaterialName(pwBomNumberTwo.getName()); + //图号 + imMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + imMaterial.setMaterials(pwBomNumberTwo.getType()); + //单重 + imMaterial.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //pdf图纸路径 + imMaterial.setPicture("http://localhost:8909/Allpdf/"+imMaterial.getFigureNumber().replaceAll("/","--")); + //删除标记 + imMaterial.setDelFlag(0); + //添加物料信息 + imMaterialMapper.insertImMaterial(imMaterial); + //创建库存对象 + PwInventoryDetail pid = new PwInventoryDetail(); + //名称 + pid.setName(pwBomNumberTwo.getName()); + //图号 + pid.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + pid.setMaterials(pwBomNumberTwo.getType()); + //单重 + pid.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //库存数量初始值为0 + pid.setQuantity(0L); + //在途数量为本批数量 + pid.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + //预定数量 + pid.setLockNumber(pwBomNumberTwo.getSumNumber()); + //可用数量等于0 + pid.setAvailableNumber(0L); + //删除标记 + pid.setDelFlag(0); + //添加库存信息 + pwInventoryDetailMapper.insertPwInventoryDetail(pid); + } + } + //根据令号查询所有的以空格开头的零部件(空格开头的默认为标准件或外购件) + List list5 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndIsSpacing(pwProductionBill.getCode()); + for (PwBomNumberTwo pwBomNumberTwo : list5) { + ImMaterial imMaterial2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=imMaterial2){ + //遍历此集合,根据图号和名称去库存表里查询,判断其是否有安全库存(如果有,则判断) + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(!"有库存".equals(pwBomNumberTwo.getSparedTwo())&&!"安全库存".equals(pwBomNumberTwo.getSparedTwo())){ + //添加采购单 + //创建采购明细 + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code + pcm.setCode(pwProductionBill.getCode()); + //物料名称 + pcm.setMaterialName(pwBomNumberTwo.getName()); + //图号 + pcm.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + pcm.setMaterials(pwBomNumberTwo.getType()); + //含税单价 + pcm.setUnivalence(imMaterial2.getUnitPrice().doubleValue()); + + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + + /*if(pwBomNumberTwo.getSumNumber()-inventoryDetail.getQuantity()<=0){ + //采购数量 + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + }else{ + //采购数量 = 本批数量-(库存+在途-预定) + pcm.setAmount(pwBomNumberTwo.getSumNumber()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); + }*/ + //总价 + pcm.setTotalPrices(imMaterial2.getUnitPrice().doubleValue()*pcm.getAmount()); + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + + //根据执行单令号查询执行单信息,然后根据执行单中的合同code查询合同信息 + PwProductionBill productionBill = pwProductionBillMapper.selectPwProductionBillByProductionCode(pwProductionBill.getCode()); + + //根据生产订单编号查询生产订单信息 + PwProductionOrder productionOrder = pwProductionOrderService.selectPwProductionOrderByCode(productionBill.getContractCode()); + //查询合同信息 + PwContract pwContract = pwContractMapper.selectByContractCode(productionOrder.getSparedOne()); + + //根据合同完成时间推算采购完成时间 + Date deliveryTime = pwContract.getDeliveryTime(); + + //获取当前时间,获取发货时间,对比这两个日期相差的天数,除以2(发货时间的百分之50)为采购时间 + int days = differentDays(new Date(),deliveryTime); + if(days%2 == 0){ + //采购完成时间 + int s = days/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + }else{ + //如果为单数时,减少一天再计算 + int s = (days-1)/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + } + pwBomNumberTwo.setCompletionDate(pcm.getCompleteDate()); + + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + + //重新更新在途数量 + inventoryDetail.setPreliminaryInventory(pcm.getAmount()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + + //根据名称和图号查询采购明细表采购合同id为null的数据(如果查询结果不为null,则说明有相同数据,直接累加其数量) + PwPurchaseContractMaterial pwPurchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByNameAndFigureNumberAndPurchaseContractNotNull(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=pwPurchaseContractMaterial){ + //说明有此条数据,直接合并数量 + pwPurchaseContractMaterial.setAmount(pwPurchaseContractMaterial.getAmount()+pcm.getAmount()); + pwPurchaseContractMaterialMapper.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + }else{ + pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pcm); + } + } + } + } + return ajaxResult; + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + /** + * date2比date1多的天数 + * @param date1 + * @param date2 + * @return + */ + private static int differentDays(Date date1,Date date2) { + Calendar cal1 = Calendar.getInstance(); + cal1.setTime(date1); + + Calendar cal2 = Calendar.getInstance(); + cal2.setTime(date2); + int day1= cal1.get(Calendar.DAY_OF_YEAR); + int day2 = cal2.get(Calendar.DAY_OF_YEAR); + + int year1 = cal1.get(Calendar.YEAR); + int year2 = cal2.get(Calendar.YEAR); + if(year1 != year2) {//同一年 + int timeDistance = 0 ; + for(int i = year1 ; i < year2 ; i ++) + { + if(i%4==0 && i%100!=0 || i%400==0) //闰年 + { + timeDistance += 366; + } + else //不是闰年 + { + timeDistance += 365; + } + } + + return timeDistance + (day2-day1) ; + } else { + // 不同年 + return day2-day1; + } + } + + + /** + * 上传PDF图纸(针对于那些有执行单,但无dwg图的项目,需手动上传PDF) + */ + @RequestMapping("/uploadPDF") + @ResponseBody + public AjaxResult uploadPDF(@RequestParam("productionBillProduceId") String productionBillProduceId,@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + + //判断是否是.zip文件 + if("zip".equals(postfix)){ + + }else{ + return AjaxResult.error("非.ZIP文件不允许上传"); + } + return AjaxResult.error("非.ZIP文件不允许上传"); + } + + + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id){ + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + //判断是组焊件 + /*if("组焊件".equals(bomNumberTwo.getType())){ + List children_list = pwBomNumberTwoService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(bomNumberTwo.getProductionCode(),bomNumberTwo.getName(),bomNumberTwo.getFigureNumber()); + bomNumberTwo.setChildren(children_list); + }*/ + return AjaxResult.success(bomNumberTwo); + } + + /** + * 申请领料按钮(返回剩余申领数量) + * + */ + @RequestMapping("/bujianstoresRequisition/{id}") + public AjaxResult bujianstoresRequisition(@PathVariable("id") Long id){ + //获取要申请领料的型号的id + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + //根据令号和名称和图号查询领料单详情 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + Long s = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getAlreadyQuantity()+imStockRequisitionMaterial.getApplyForQuantity(); + } + pwBomNumberTwo.setShuliang(s); + //查询当前物料的单价和供应商 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=imMaterial){ + //供应商名称 + pwBomNumberTwo.setPreferentialOriginName(imMaterial.getPreferentialOriginName()); + //未税单价 + pwBomNumberTwo.setUnitPrice(imMaterial.getUnivalence().doubleValue()); + } + return AjaxResult.success(pwBomNumberTwo); + } + + /** + * 新增木箱 + * + */ + @RequestMapping("/addPwBomNumberTwoMuXiang") + public AjaxResult addPwBomNumberTwoMuXiang(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + if(null==pwBomNumberTwo.getName()||"".equals(pwBomNumberTwo.getName().trim())){ + return AjaxResult.error("请选择木箱类型"); + } + if(null==pwBomNumberTwo.getFigureNumber()||"".equals(pwBomNumberTwo.getFigureNumber().trim())){ + return AjaxResult.error("请输入木箱规格"); + } + if(pwBomNumberTwo.getSumNumber()<1){ + return AjaxResult.error("请输入数量"); + } + + //清洗规格格式 + if(pwBomNumberTwo.getFigureNumber().contains("X")){ + pwBomNumberTwo.setFigureNumber(pwBomNumberTwo.getFigureNumber().replaceAll("X", "*")); + }else if(pwBomNumberTwo.getFigureNumber().contains("x")){ + pwBomNumberTwo.setFigureNumber(pwBomNumberTwo.getFigureNumber().replaceAll("x", "*")); + } + + //根据物料id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null==imMaterial){ + //添加到物料信息中 + ImMaterial material = new ImMaterial(); + //名称 + material.setMaterialName(pwBomNumberTwo.getName()); + //图号 + material.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //物料类型 + material.setMaterialTypeName("生产用品"); + //删除标记 + material.setDelFlag(0); + imMaterialService.insertImMaterial(material); + } + //查询库存信息表 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null == inventoryDetail){ + //添加库存信息 + PwInventoryDetail detail = new PwInventoryDetail(); + detail.setName(pwBomNumberTwo.getName()); + //图号 + detail.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //类型 + detail.setType("生产用品"); + //在途数量和预定数量 + detail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + //预定数量 + detail.setLockNumber(pwBomNumberTwo.getSumNumber()); + //删除标记 + detail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(detail); + } + + //把木箱增加到装配领料表中用于领料出库 + PwBomNumberTwoLingliao lingliao = new PwBomNumberTwoLingliao(); + + //物料名称 +// pwBomNumberTwo.setName(imMaterial.getMaterialName()); +// //物料图号 +// pwBomNumberTwo.setFigureNumber(imMaterial.getFigureNumber()); + //单台数量设置为0 + pwBomNumberTwo.setOneNumber(0L); + //材料 + pwBomNumberTwo.setType("成品"); + //父级名称和图号设定为本名称和图号 + pwBomNumberTwo.setParentLevelName("木箱"); + pwBomNumberTwo.setParentLevelFigureNumber("木箱"); + //单重 +// pwBomNumberTwo.setPieceWeight(imMaterial.getPieceWeight()); + //备注 + pwBomNumberTwo.setRemarks(""); + + //令号 + lingliao.setProductionCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + lingliao.setName(pwBomNumberTwo.getName()); + //物料图号 + lingliao.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //单台数量设置为0 + lingliao.setOneNumber(0L); + //材料 + lingliao.setType("成品"); + //单重 +// lingliao.setPieceWeight(imMaterial.getPieceWeight()); + //本批数量 + lingliao.setSumNumber(pwBomNumberTwo.getSumNumber()); + //父级名称 + lingliao.setParentLevelName(pwBomNumberTwo.getName()); + //父级图号 + lingliao.setParentLevelFigureNumber(pwBomNumberTwo.getFigureNumber()); + //所属项目 + lingliao.setSparedOne(pwBomNumberTwo.getSparedOne()); + //删除标记 + lingliao.setDelFlag(0); + + int i = pwBomNumberTwoService.insertPwBomNumberTwo(pwBomNumberTwo); + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(lingliao); + return AjaxResult.success(i); + } + + /** + * 新增数量保存 + */ + @RepeatSubmit + @PostMapping + public AjaxResult add(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + //判断是否选择了原材料 + if(null!=pwBomNumberTwo.getMaterialId()){ + //说明选择了毛坯 + //查询选择的原材料 + ImMaterial immaterial = imMaterialService.selectImMaterialById(pwBomNumberTwo.getMaterialId()); + if(null != immaterial){ + //判断如果选择的是毛坯,则长度不能大于1,且必须为1 + if("毛坯".equals(immaterial.getMaterialTypeName())){ + if(1!=Long.valueOf(pwBomNumberTwo.getLen())){ + return AjaxResult.error("所选材料为毛坯时,长度必须为1"); + } + if(null!=pwBomNumberTwo.getWid()){ + return AjaxResult.error("所选材料为毛坯时,宽度无需填写"); + } + } + //原材料名称 + pwBomNumberTwo.setMaterialsName(immaterial.getMaterialName()); + //原材料图号 + pwBomNumberTwo.setMaterialsSpecification(immaterial.getFigureNumber()); + //判断是否是长和宽都不为null + if(null!=pwBomNumberTwo.getWid()&&pwBomNumberTwo.getWid()!=0){ + if(null==pwBomNumberTwo.getLen()){ + return AjaxResult.error("请输入长度"); + } + //规格合并成 长*宽 + pwBomNumberTwo.setSpecification(pwBomNumberTwo.getLen()+"*"+pwBomNumberTwo.getWid()+""); + //说明是板材,下料尺寸改为长*宽 + pwBomNumberTwo.setMeasure(Long.valueOf(pwBomNumberTwo.getLen())*pwBomNumberTwo.getWid()+""); + }else{ + pwBomNumberTwo.setMeasure(pwBomNumberTwo.getLen()+""); + pwBomNumberTwo.setSpecification(pwBomNumberTwo.getMeasure()); + } + //判断是否填写了毛坯数量 + if(null==pwBomNumberTwo.getWorkblank()||0==pwBomNumberTwo.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + //成品数量默认为本批数量 + pwBomNumberTwo.setFinished(pwBomNumberTwo.getSumNumber()); + if(null!=immaterial.getMaterialTypeName()&&!"毛坯".equals(immaterial.getMaterialTypeName())&&immaterial.getMinimum()==0&&immaterial.getHighest()==0){ + //计算领料数量 + pwBomNumberTwo.setReceiveNumber(pwBomNumberTwo.getWorkblank()*Long.valueOf(pwBomNumberTwo.getMeasure())+(3*pwBomNumberTwo.getWorkblank())); + }else{ + //计算领料数量 + pwBomNumberTwo.setReceiveNumber(pwBomNumberTwo.getWorkblank()*Long.valueOf(pwBomNumberTwo.getMeasure())); + } + } + } + + //获取父级图号 + String parentLevelFigureNumber = pwBomNumberTwo.getFigureNumber(); + //获取父级名称 + String parentLevelName = pwBomNumberTwo.getName(); + //获取执行单令号 + String productionCode = pwBomNumberTwo.getProductionCode(); + //根据执行单令号和上级图号和上级名称查找上级信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumber(productionCode,parentLevelName,parentLevelFigureNumber); + //根据上级id和令号查询 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(productionCode,bomNumberTwo.getId()); + //获取工序名称集合 + String[] processNames = pwBomNumberTwo.getProcessNames(); + if(null==processNames||processNames.length==0){ + return AjaxResult.error("请选择工序"); + } + int ii = 0; + String gyfigureNumber = pwBomNumberTwo.getFigureNumber(); + String gyName = pwBomNumberTwo.getName(); + for (int i = 0; i < processNames.length; i++) { + if(list.size()==0){ + pwBomNumberTwo.setFigureNumber(gyfigureNumber +"-"+(i+1)); + }else{ + int sia = list.size()+i+1; + pwBomNumberTwo.setFigureNumber(gyfigureNumber +"-"+sia); + } + //只保留工序为1时的材料名称 + if(i>0){ + pwBomNumberTwo.setMaterialsName(null); + pwBomNumberTwo.setMaterialsSpecification(null); + pwBomNumberTwo.setMeasure(null); + pwBomNumberTwo.setWorkblank(null); + pwBomNumberTwo.setFinished(null); + } + pwBomNumberTwo.setName(gyName + "-" + processNames[i] +"(M)"); + //工序名称 + pwBomNumberTwo.setProcessName(processNames[i]); + //完成时间置为null + pwBomNumberTwo.setCompletionDate(null); + //把上级id赋值给当前需要添加的工序 + pwBomNumberTwo.setSuperiorId(bomNumberTwo.getId()); + + //如果上一级为总装图,则添加标记,在申请入库时判断 + if(null==bomNumberTwo.getFigureNumber()&&"".equals(bomNumberTwo.getName())){ + //说明是成品的序(用此字段代替标识) + pwBomNumberTwo.setSparedFive(100L); + } + //添加之前先去物料表和库存表查询有没有此物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=material){ + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(null!=inventoryDetail){ + //判断库存数量够不够,如果够用,则标记有库存 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=pwBomNumberTwo.getSumNumber()){ + pwBomNumberTwo.setSparedTwo("有库存"); + } + //判断是否设置了安全库存 + if(material.getMinimum()>0&&material.getHighest()>0){ + //如果有安全库存设置,则代表一定有库存,只不过是企标单再派工,执行单不再派工 + pwBomNumberTwo.setSparedTwo("有库存"); + //说明设置了安全库存,则需要计算数量是否低于了安全库存数量 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<=material.getMinimum()){ + //生成企标单 + //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + //名称 + pdd.setName(material.getMaterialName()); + //图号 + pdd.setFigureNumber(material.getFigureNumber()); + //材料 + pdd.setMaterialType(material.getMaterials()); + //数量(最高库存数量-(库存数量+在途数量-本批数量)) + pdd.setQuantity(material.getHighest()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd); + //更新在途数量 + inventoryDetail.setPreliminaryInventory(pdd.getQuantity()); +// pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + //更新可用数量 + if(inventoryDetail.getQuantity()>=inventoryDetail.getLockNumber()){ + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + } + //锁定本序数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwBomNumberTwo.getSumNumber()); + pwBomNumberTwo.setSparedFour(inventoryDetail.getQuantity()); + //预存数量(添加工序时不预添加在途数量,而是在领料时才添加在途数量) +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getSumNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //如果填写了原材料,则更新原材料的锁定数量 + if(null!=pwBomNumberTwo.getReceiveNumber()&&pwBomNumberTwo.getReceiveNumber()>0){ + //查询原材料库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwBomNumberTwo.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + }else{ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwBomNumberTwo.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //预存数量(添加工序时不预添加在途数量,而是在领料时才添加在途数量) +// pwInventoryDetail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + //锁定数量 + pwInventoryDetail.setLockNumber(pwBomNumberTwo.getSumNumber()); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + }else{ + //添加物料信息 + ImMaterial imMaterial = new ImMaterial(); + //物料名称 + imMaterial.setMaterialName(pwBomNumberTwo.getName()); + //物料图号 + imMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //删除标记 + imMaterial.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial); + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwBomNumberTwo.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //预存数量(添加工序时不预添加在途数量,而是在领料时才添加在途数量) +// pwInventoryDetail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + //锁定数量 + pwInventoryDetail.setLockNumber(pwBomNumberTwo.getSumNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + //如果填写了原材料,则更新原材料的锁定数量 + if(null!=pwBomNumberTwo.getReceiveNumber()&&pwBomNumberTwo.getReceiveNumber()>0){ + //查询原材料库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwBomNumberTwo.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + ii = pwBomNumberTwoService.insertPwBomNumberTwo(pwBomNumberTwo); + if(ii < 1){ + return AjaxResult.error("填写工艺失败!!"); + } + } + return AjaxResult.success(); + } + + /** + * 修改数量保存 + */ + @RepeatSubmit + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwo:edit')") + @Log(title = "数量保存", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + //根据id查询原数据 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + //判断原数据的名称及图号及材料和数量是否一致,如果不一致,则需要修改物料表,库存表 + if(!pwBomNumberTwo.getName().equals(bomNumberTwo.getName())||!pwBomNumberTwo.getFigureNumber().equals(bomNumberTwo.getFigureNumber())||!pwBomNumberTwo.getType().equals(bomNumberTwo.getType())||!pwBomNumberTwo.getSumNumber().equals(bomNumberTwo.getSumNumber())){ + //修改物料表(根据名称和图号查询物料信息) + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + //名称 + imMaterial.setMaterialName(pwBomNumberTwo.getName()); + //图号 + imMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + imMaterial.setMaterials(pwBomNumberTwo.getType()); + + imMaterialService.updateImMaterial(imMaterial); + //修改库存表(根据名称和图号查询库存信息) + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + //名称 + inventoryDetail.setName(pwBomNumberTwo.getName()); + //图号 + inventoryDetail.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + inventoryDetail.setMaterials(pwBomNumberTwo.getType()); + //判断数量是否一致 + if(pwBomNumberTwo.getSumNumber()!=bomNumberTwo.getSumNumber()){ + //修改锁定数量(锁定数量-原数量+现在的数量) + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-bomNumberTwo.getSumNumber()+pwBomNumberTwo.getSumNumber()); + //修改在途数量 + //先判断此物料有没有安全库存,如果有则需要重新计算在途数量,如果没有,则直接修改在途数量 + /*if(imMaterial.getMinimum()==0&&imMaterial.getHighest()==0){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-bomNumberTwo.getSumNumber()+pwBomNumberTwo.getSumNumber()); + }*/ + //判断是否为标准件 + if(null!=bomNumberTwo.getFigureNumber()&&(" ".equals(bomNumberTwo.getFigureNumber().substring(0,2)) || "009".equals(bomNumberTwo.getFigureNumber().substring(0,3)) || "017".equals(bomNumberTwo.getFigureNumber().substring(0,3)))){ + //修改采购列表(根据名称和图号查询采购单id为null的数据,修改其数量,如果没有查询到数据,则自动认为已经生成采购合同,需要手动释放采购合同后再修改数量) + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByNameAndFigureNumberAndPurchaseContractNotNull(bomNumberTwo.getProductionCode(),bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + if(null==purchaseContractMaterial){ + return AjaxResult.error("当前物料已生成采购合同,数量无法修改"); + }else{ + //名称 + purchaseContractMaterial.setMaterialName(pwBomNumberTwo.getName()); + //图号 + purchaseContractMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //数量 + purchaseContractMaterial.setAmount(purchaseContractMaterial.getAmount()-bomNumberTwo.getSumNumber()+pwBomNumberTwo.getSumNumber()); + pwPurchaseContractMaterialMapper.updatePwPurchaseContractMaterial(purchaseContractMaterial); + } + } + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + //判断是否修改了原材料信息,如果修改了原材料信息,则判断是否已经领料,如果已经领料则不允许修改,需要退库或者撤销申请领料 + if((null!=pwBomNumberTwo.getMaterialId()&&null!=bomNumberTwo.getMaterialId()&&!pwBomNumberTwo.getMaterialId().equals(bomNumberTwo.getMaterialId())) + ||(null!=pwBomNumberTwo.getLen()&&null!=bomNumberTwo.getLen()&&!pwBomNumberTwo.getLen().equals(bomNumberTwo.getLen())) + ||(null!=pwBomNumberTwo.getWid()&&null!=bomNumberTwo.getWid()&&!pwBomNumberTwo.getWid().equals(bomNumberTwo.getWid())) + ||(null!=pwBomNumberTwo.getWorkblank()&&null!=bomNumberTwo.getWorkblank()&&!pwBomNumberTwo.getWorkblank().equals(bomNumberTwo.getWorkblank()))){ + //说明修改了原材料 + //查询领料单中是否已经申请领料 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialBySparedThree(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getId()); + if(list.size()>0){ + return AjaxResult.error("已申请领料,不可修改"); + } + } + if(null==pwBomNumberTwo.getMaterialId()){ + //说明是去掉材料了 + + //查询领料单中是否已经申请领料 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialBySparedThree(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getId()); + if(list.size()>0){ + return AjaxResult.error("已申请领料,不可修改"); + } + + //查询是否生成了原材料采购单,如果生成了,则不允许修改为null + PwFuturesOrdersDetail pwFuturesOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getMaterialsName(), bomNumberTwo.getMaterialsSpecification()); + if(null!=pwFuturesOrdersDetail&&"已生成".equals(pwFuturesOrdersDetail.getStatus())){ + //说明生成了原材料采购单,则需要撤销撤销原材料采购单 + return AjaxResult.error("已生成原材料采购单,请先撤销原材料采购单"); + }else{ + //删除预采购单,删除预采购单明细 + if(null!=pwFuturesOrdersDetail){ + pwFuturesOrdersDetailTwoService.deletePwFuturesOrdersDetailTwoByOrdersDetailId(pwFuturesOrdersDetail.getId()); + pwFuturesOrdersDetailService.deletePwFuturesOrdersDetailById(pwFuturesOrdersDetail.getId()); + } + //物料id置为null + pwBomNumberTwo.setMaterialId(null); + pwBomNumberTwo.setMaterialsName(null); + pwBomNumberTwo.setMaterialsSpecification(null); + pwBomNumberTwo.setLen(null); + pwBomNumberTwo.setWid(null); + pwBomNumberTwo.setWorkblank(null); + pwBomNumberTwo.setFinished(null); + pwBomNumberTwo.setMeasure(null); + pwBomNumberTwo.setSpecification(null); + pwBomNumberTwo.setReceiveNumber(null); + } + + } + + //获取当前物料的图号和名称,查询其下是否有子集工序,如果有子集工序,则不能直接派工,需要派工子集工序的物料 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + if(list.size()>0){ + return AjaxResult.error("带有工序的物料不可直接派工"); + } + } + + if(null!=pwBomNumberTwo.getMaterialId()){ + //查询选择的原材料 + ImMaterial material = imMaterialService.selectImMaterialById(pwBomNumberTwo.getMaterialId()); + if(null != material){ + + //判断如果选择的是毛坯,则长度不能大于1,且必须为1 + if("毛坯".equals(material.getMaterialTypeName())){ + if(1!=Long.valueOf(pwBomNumberTwo.getLen())){ + return AjaxResult.error("所选材料为毛坯时,长度必须为1"); + } + if(null!=pwBomNumberTwo.getWid()){ + return AjaxResult.error("所选材料为毛坯时,宽度无需填写"); + } + } + + //判断是否是第一道序 TODO + String substring = pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + if(1==Integer.valueOf(substring)){ + //原材料名称 + pwBomNumberTwo.setMaterialsName(material.getMaterialName()); + //原材料图号 + pwBomNumberTwo.setMaterialsSpecification(material.getFigureNumber()); + //判断是否是长和宽都不为null + if(null!=pwBomNumberTwo.getWid()&&pwBomNumberTwo.getWid()!=0){ + if(null==pwBomNumberTwo.getLen()){ + return AjaxResult.error("请输入长度"); + } + //规格合并成 长*宽 + pwBomNumberTwo.setSpecification(pwBomNumberTwo.getLen()+"*"+pwBomNumberTwo.getWid()+""); + //说明是板材,下料尺寸改为长*宽 + pwBomNumberTwo.setMeasure(Long.valueOf(pwBomNumberTwo.getLen())*pwBomNumberTwo.getWid()+""); + }else{ + pwBomNumberTwo.setMeasure(pwBomNumberTwo.getLen()+""); + pwBomNumberTwo.setSpecification(pwBomNumberTwo.getMeasure()); + } + //判断是否填写了毛坯数量 + if(null==pwBomNumberTwo.getWorkblank()||0==pwBomNumberTwo.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //计算领料数量 + pwBomNumberTwo.setReceiveNumber(pwBomNumberTwo.getWorkblank()*Long.valueOf(pwBomNumberTwo.getMeasure())+(3*pwBomNumberTwo.getWorkblank())); + }else{ + //计算领料数量 + pwBomNumberTwo.setReceiveNumber(pwBomNumberTwo.getWorkblank()*Long.valueOf(pwBomNumberTwo.getMeasure())); + } + + //修改预定数量 + //查询之前的原材料信息 + if(null!=bomNumberTwo.getMaterialId()){ + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwo.getMaterialsName(), bomNumberTwo.getMaterialsSpecification()); + if(null!=inventoryDetail){ + //减掉修改之前的预定数量 + if(null==bomNumberTwo.getReceiveNumber()){ + bomNumberTwo.setReceiveNumber(0L); + } + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-bomNumberTwo.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + //查询修改之后的原材料信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getMaterialsName(),pwBomNumberTwo.getMaterialsSpecification()); + if(null!=inventoryDetail){ + if(null==pwBomNumberTwo.getReceiveNumber()){ + pwBomNumberTwo.setReceiveNumber(0L); + } + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwBomNumberTwo.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + + //如果材料不为毛坯且没有设置安全库存,则修改 + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //查询预采购表,如果预采购表不为空,则把预采购表也修改了 + PwFuturesOrders futuresOrders = pwFuturesOrdersService.selectPwFuturesOrdersByCode(pwBomNumberTwo.getProductionCode()); + if(null != futuresOrders){ + //把合并之前的信息增加到详情中 + PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo = new PwFuturesOrdersDetailTwo(); + //说明已经生成预采购单 + //根据名称和图号查询预购单明细中是否有了此物料,如果有则不再新增,则在原有的基础上添加总数量 + PwFuturesOrdersDetail futuresOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(futuresOrders.getCode(),material.getMaterialName(),material.getFigureNumber()); + if(null != futuresOrdersDetail){ + //原尺寸 + Double number = futuresOrdersDetail.getNumber(); + + if(null==bomNumberTwo.getMeasure()){ + bomNumberTwo.setMeasure("0"); + } + if(null==bomNumberTwo.getWorkblank()){ + bomNumberTwo.setWorkblank(0L); + } + if(null==pwBomNumberTwo.getMeasure()){ + pwBomNumberTwo.setMeasure("0"); + } + if(null==pwBomNumberTwo.getWorkblank()){ + pwBomNumberTwo.setWorkblank(0L); + } + //总尺寸 + futuresOrdersDetail.setNumber(futuresOrdersDetail.getNumber()-(Double.valueOf(bomNumberTwo.getMeasure())*bomNumberTwo.getWorkblank()+(3*pwBomNumberTwo.getWorkblank()))+(Double.valueOf(pwBomNumberTwo.getMeasure())*pwBomNumberTwo.getWorkblank())+(3*pwBomNumberTwo.getWorkblank())); + if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000); + }else if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("平方毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000000); + }else{ + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()); + } + //总重量重新计算 + futuresOrdersDetail.setReferenceNumber(futuresOrdersDetail.getQuantity() * material.getPieceWeight()); + pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(futuresOrdersDetail); + + //修改预采购单明细的明细信息(根据物料id) + PwFuturesOrdersDetailTwo futuresOrdersDetailTwo = pwFuturesOrdersDetailTwoService.selectPwFuturesOrdersDetailTwoByMatenaisIdAndNameAndFigureNumber(pwBomNumberTwo.getId(),pwBomNumberTwo.getMaterialsName(),pwBomNumberTwo.getMaterialsSpecification()); + if(null != futuresOrdersDetailTwo){ + //物料id + futuresOrdersDetailTwo.setMatenaisId(pwBomNumberTwo.getId()); + //名称 + futuresOrdersDetailTwo.setName(pwBomNumberTwo.getMaterialsName()); + //图号 + futuresOrdersDetailTwo.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + futuresOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + futuresOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + futuresOrdersDetailTwo.setSparedOne(pwBomNumberTwo.getSpecification()); + //毛坯数量 + futuresOrdersDetailTwo.setWorkblank(pwBomNumberTwo.getWorkblank().doubleValue()); + //总数量(计算)下料尺寸*毛坯数量 + futuresOrdersDetailTwo.setNumber(Double.valueOf(pwBomNumberTwo.getMeasure())*pwBomNumberTwo.getWorkblank().doubleValue()+(3*pwBomNumberTwo.getWorkblank().doubleValue())); + //计量单位(物料属性) + futuresOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + futuresOrdersDetailTwo.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + futuresOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()); + //采用原单位 + futuresOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + futuresOrdersDetailTwo.setReferenceNumber(futuresOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + pwFuturesOrdersDetailTwoService.updatePwFuturesOrdersDetailTwo(futuresOrdersDetailTwo); + } + }else{ + //新增预采购单明细 + PwFuturesOrdersDetail pwFuturesOrdersDetail = new PwFuturesOrdersDetail(); + //令号 + pwFuturesOrdersDetail.setCode(pwBomNumberTwo.getProductionCode()); + //预购单id + pwFuturesOrdersDetail.setOrdersId(futuresOrders.getId()); + //名称 + pwFuturesOrdersDetail.setName(pwBomNumberTwo.getMaterialsName()); + //图号 + pwFuturesOrdersDetail.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetail.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetail.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetail.setMeasure(Long.valueOf(pwBomNumberTwo.getMeasure())); + //毛坯数量 + pwFuturesOrdersDetail.setWorkblank(pwBomNumberTwo.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetail.setNumber(Double.valueOf(pwBomNumberTwo.getMeasure())*pwBomNumberTwo.getWorkblank().doubleValue()+(3*pwBomNumberTwo.getWorkblank())); + //计量单位(物料属性) + pwFuturesOrdersDetail.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(Double.valueOf(pwBomNumberTwo.getMeasure())*pwBomNumberTwo.getWorkblank().doubleValue()); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetail.setReferenceNumber(pwFuturesOrdersDetail.getQuantity() * material.getPieceWeight()); + + //库存数量 + PwInventoryDetail inventoryDetaila = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + + //库存数量 + pwFuturesOrdersDetail.setInventoryQuantity(inventoryDetaila.getQuantity()); + //在途数量 + pwFuturesOrdersDetail.setPreliminaryInventory(inventoryDetaila.getPreliminaryInventory()); + //锁定数量 + pwFuturesOrdersDetail.setLockNumber(inventoryDetaila.getLockNumber()-pwFuturesOrdersDetail.getNumber().longValue()); + pwFuturesOrdersDetailService.insertPwFuturesOrdersDetail(pwFuturesOrdersDetail); + + //令号 + pwFuturesOrdersDetailTwo.setCode(pwBomNumberTwo.getProductionCode()); + //物料id + pwFuturesOrdersDetailTwo.setMatenaisId(pwBomNumberTwo.getId()); + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(pwFuturesOrdersDetail.getId()); + //名称 + pwFuturesOrdersDetailTwo.setName(pwBomNumberTwo.getMaterialsName()); + //图号 + pwFuturesOrdersDetailTwo.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetailTwo.setSparedOne(pwBomNumberTwo.getSpecification()); + //毛坯数量 + pwFuturesOrdersDetailTwo.setWorkblank(pwBomNumberTwo.getWorkblank().doubleValue()); + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetailTwo.setNumber(Double.valueOf(pwBomNumberTwo.getMeasure())*pwBomNumberTwo.getWorkblank().doubleValue()+(3*pwBomNumberTwo.getWorkblank().doubleValue())); + //计量单位(物料属性) + pwFuturesOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + pwFuturesOrdersDetailTwo.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetailTwo.setReferenceNumber(pwFuturesOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + + pwFuturesOrdersDetailTwoService.insertPwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo); + + } + } + } + } + } + } + + if("无库存".equals(pwBomNumberTwo.getSparedTwo())){ + pwBomNumberTwo.setSparedTwo(null); + + //判断是否已经添加了此物料 + ImMaterial imMaterial2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + //根据物料名称和图号查询库存信息,增加上在途 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + //判断是否有安全库存设置,如果有安全库存设置,则修改为安全库存。则不再产生采购单,采购单根据系统自动巡查产生 + if(!"0".equals(imMaterial2.getMinimum())&&!"0".equals(imMaterial2.getHighest())){ + //判断是否是标准件和外购件,如果是,则添加到采购合同明细中,同时加上在途 + if((null!=pwBomNumberTwo.getFigureNumber()&&(" ".equals(bomNumberTwo.getFigureNumber().substring(0,2)) || "009".equals(bomNumberTwo.getFigureNumber().substring(0,3)) || "017".equals(bomNumberTwo.getFigureNumber().substring(0,3))))||pwBomNumberTwo.getRemarks().contains("外购件")){ + //创建采购明细 + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code + pcm.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + pcm.setMaterialName(pwBomNumberTwo.getName()); + //图号 + pcm.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + pcm.setMaterials(pwBomNumberTwo.getType()); + //含税单价 + pcm.setUnivalence(imMaterial2.getUnitPrice().doubleValue()); + + if(pwBomNumberTwo.getSumNumber()-inventoryDetail.getQuantity()<=0){ + //采购数量 + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + }else{ + //采购数量 + pcm.setAmount(pwBomNumberTwo.getSumNumber()-inventoryDetail.getQuantity()); + } + //总价 + pcm.setTotalPrices(imMaterial2.getUnitPrice().doubleValue()*pcm.getAmount()); + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + + //根据执行单令号查询执行单信息,然后根据执行单中的合同code查询合同信息 + PwProductionBill productionBill = pwProductionBillMapper.selectPwProductionBillByProductionCode(pwBomNumberTwo.getProductionCode()); + PwContract pwContract = pwContractMapper.selectByContractCode(productionBill.getContractCode()); + //根据合同完成时间推算采购完成时间 + Date deliveryTime = pwContract.getDeliveryTime(); + + //获取当前时间,获取发货时间,对比这两个日期相差的天数,除以2(发货时间的百分之50)为采购时间 + int days = differentDays(new Date(),deliveryTime); + if(days%2 == 0){ + //采购完成时间 + int s = days/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + }else{ + //如果为单数时,减少一天再计算 + int s = (days-1)/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + } + pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pcm); + } + inventoryDetail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + pwBomNumberTwo.setSparedTwo("安全库存"); + } + } + return toAjax(pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo)); + } + + /** + * 修改数量保存 + */ + @RequestMapping("/updatePwBomNumberTwoPaiGong") + public AjaxResult updatePwBomNumberTwoPaiGong(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + + //获取当前物料的图号和名称,查询其下是否有子集工序,如果有子集工序,则不能直接派工,需要派工子集工序的物料 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + if(list.size()>0){ + return AjaxResult.error("带有工序的物料不可直接派工"); + } + + if(null!=pwBomNumberTwo.getDepartmentName()&&!"".equals(pwBomNumberTwo.getDepartmentName())){ + //如果派工部门不为null时,判断完成时间是否为null + if(null==pwBomNumberTwo.getCompletionDate()||"".equals(pwBomNumberTwo.getCompletionDate())){ + return AjaxResult.error("请选择完成时间"); + } + } + if(null!=pwBomNumberTwo.getDepartmentNames()&&pwBomNumberTwo.getDepartmentNames().length>0){ + //如果派工部门不为null时,判断完成时间是否为null + if(null==pwBomNumberTwo.getCompletionDates()||"".equals(pwBomNumberTwo.getCompletionDates())){ + return AjaxResult.error("请选择完成时间"); + }else{ + //修改派工部门 + pwBomNumberTwo.setDepartmentName(pwBomNumberTwo.getDepartmentNames()[0]); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //修改完成时间 + try { + pwBomNumberTwo.setCompletionDate(sdf.parse(pwBomNumberTwo.getCompletionDates()[0])); + } catch (ParseException e) { + e.printStackTrace(); + } + } + } + + //判断当物料为成品物料的序时,是否入库只能是是(必须入库) + if(null!=pwBomNumberTwo.getSparedFive()&&100==pwBomNumberTwo.getSparedFive()){ + if("否".equals(pwBomNumberTwo.getGodownEntry())){ + return AjaxResult.error("成品物料的工序必须入库"); + } + } + + if("无库存".equals(pwBomNumberTwo.getSparedTwo())){ + pwBomNumberTwo.setSparedTwo(null); + + //判断是否已经添加了此物料 + ImMaterial imMaterial2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + //根据物料名称和图号查询库存信息,增加上在途 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + //判断是否有安全库存设置,如果有安全库存设置,则修改为安全库存。则不再产生采购单,采购单根据系统自动巡查产生 + if(!"0".equals(imMaterial2.getMinimum())&&!"0".equals(imMaterial2.getHighest())){ + //判断是否是标准件和外购件,如果是,则添加到采购合同明细中,同时加上在途 + if((null!=pwBomNumberTwo.getFigureNumber()&&(" ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2)) || "009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || "017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))))||pwBomNumberTwo.getRemarks().contains("外购件")){ + //创建采购明细 + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code + pcm.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + pcm.setMaterialName(pwBomNumberTwo.getName()); + //图号 + pcm.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + pcm.setMaterials(pwBomNumberTwo.getType()); + //含税单价 + pcm.setUnivalence(imMaterial2.getUnitPrice().doubleValue()); + + if(pwBomNumberTwo.getSumNumber()-inventoryDetail.getQuantity()<=0){ + //采购数量 + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + }else{ + //采购数量 + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + } + //总价 + pcm.setTotalPrices(imMaterial2.getUnitPrice().doubleValue()*pcm.getAmount()); + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + + //根据执行单令号查询执行单信息,然后根据执行单中的合同code查询合同信息 + PwProductionBill productionBill = pwProductionBillMapper.selectPwProductionBillByProductionCode(pwBomNumberTwo.getProductionCode()); + PwContract pwContract = pwContractMapper.selectByContractCode(productionBill.getContractCode()); + //根据合同完成时间推算采购完成时间 + Date deliveryTime = pwContract.getDeliveryTime(); + + //获取当前时间,获取发货时间,对比这两个日期相差的天数,除以2(发货时间的百分之50)为采购时间 + int days = differentDays(new Date(),deliveryTime); + if(days%2 == 0){ + //采购完成时间 + int s = days/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + }else{ + //如果为单数时,减少一天再计算 + int s = (days-1)/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + } + pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pcm); + } + inventoryDetail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + pwBomNumberTwo.setSparedTwo("安全库存"); + } + } + return toAjax(pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo)); + } + + + /** + * 修改(车间排产) + */ + @RequestMapping("/updatePwBomNumberTwoShopScheduling") + public AjaxResult updatePwBomNumberTwoShopScheduling(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + + if(null==pwBomNumberTwo.getXuTime()||"".equals(pwBomNumberTwo.getXuTime())){ + return AjaxResult.error("请输入序工时"); + } + return toAjax(pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo)); + } + + /** + * 删除数量保存 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwo:remove')") + @Log(title = "数量保存", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //释放在途数量和锁定数量 + /*for (Long id : ids) { + + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + + //判断当前物料是否已经领料 + String substring = pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + String figureNumber = pwBomNumberTwo.getFigureNumber().substring(0,pwBomNumberTwo.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + if(s==0){ + //说明是第一道序,则查询原材料信息 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(list.size()>0){ + return AjaxResult.error("已经领料的工序不能直接删除"); + } + }else{ + //删除之前,跟据code和名称和图号查询是否已经领料 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), figureNumber); + if(list.size()>0){ + return AjaxResult.error("已经领料的工序不能直接删除"); + } + } + + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + *//*if(inventoryDetail.getPreliminaryInventory()>=pwBomNumberTwo.getSumNumber()){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-pwBomNumberTwo.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(0L); + }*//* + if(inventoryDetail.getLockNumber()>=pwBomNumberTwo.getSumNumber()){ + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwBomNumberTwo.getSumNumber()); + }else{ + inventoryDetail.setLockNumber(0L); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + }*/ + int i = 0; + for (Long long1 : ids) { + i = pwBomNumberTwoService.deletePwBomNumberTwoById(long1); + //根据id查询 + /*PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(long1); + if(pwBomNumberTwo.getName().contains("(M)")){ + i = pwBomNumberTwoService.deletePwBomNumberTwoById(long1); + }else{ + pwBomNumberTwo.setDelFlag(1); + i = pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + }*/ + } + return toAjax(i); + } + + /** + * 虚拟化部件 + */ + @RequestMapping("/xuNiBuJians/{ids}") + public AjaxResult xuNiBuJians(@PathVariable Long[] ids){ + for (Long id : ids) { + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + + //查询原始表 + List list = pwBomNumberService.selectPwBomNumberByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(),bomNumberTwo.getName(),bomNumberTwo.getFigureNumber()); + + //查询领料表 + PwBomNumberTwoLingliao pwBomNumberTwoLingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingLiaoByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(),bomNumberTwo.getName(),bomNumberTwo.getFigureNumber()); + if(null == pwBomNumberTwoLingliao){ + continue; + } + if("虚拟部件".equals(bomNumberTwo.getRemarks())){ + bomNumberTwo.setRemarks(""); + }else{ + bomNumberTwo.setRemarks("虚拟部件"); + } + for (PwBomNumber pwBomNumber : list) { + if("虚拟部件".equals(pwBomNumber.getRemarks())){ + pwBomNumber.setRemarks(""); + }else{ + pwBomNumber.setRemarks("虚拟部件"); + } + pwBomNumberService.updatePwBomNumber(pwBomNumber); + } + + if("虚拟部件".equals(pwBomNumberTwoLingliao.getRemarks())){ + pwBomNumberTwoLingliao.setRemarks(""); + }else{ + pwBomNumberTwoLingliao.setRemarks("虚拟部件"); + } + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(pwBomNumberTwoLingliao); + + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + } + return AjaxResult.success(); + } + + /** + * 设置虚拟物料 + */ + @DeleteMapping("/xunis/{ids}") + public AjaxResult xunis(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id查询物料信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + + //查询领料表中的数据 + PwBomNumberTwoLingliao numberTwoLingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getSparedOne(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + + + if("是".equals(bomNumberTwo.getTheoretical())){ + bomNumberTwo.setTheoretical("否"); + numberTwoLingliao.setTheoretical("否"); + }else{ + bomNumberTwo.setTheoretical("是"); + numberTwoLingliao.setTheoretical("是"); + } + + i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(numberTwoLingliao); + } + return toAjax(i); + } + + /** + * 撤销申请质检按钮 + */ + @DeleteMapping("/revocationBoms/{ids}") + public AjaxResult revocationBoms(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + //根据物料名称和图号和令号查找此物料最近一次申请的质检信息 + int a = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + if(a==0){ + return AjaxResult.error("当前物料未申请质检,无需撤销"); + } + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById((long)a); + //判断是否已经质检,如果已经质检则需要查询入库信息,并退库,如果没有质检,则直接删除质检详情信息,然后把状态改为null + if(completionNoticeProduct.getCheckoutStatus().equals("已检验")||completionNoticeProduct.getCheckoutStatus().equals("正在检验")){ + return AjaxResult.error("已检验的物料不允许撤销"); + }else{ + //根据物料名称和图号和令号查询入库单详情信息,距离当前时间最近的一条数据 + //先查询是否有数据 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + if(list.size()>0){ + int b = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + ImProductReceiptMaterial receiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById((long)b); + //判断当前数据是否已经确认入库,如果确认入库则需要退库 + if(receiptMaterial.getInventoryStatus().equals("已入库")){ + //已经确认入库的则不允许撤销 + return AjaxResult.error("已经确认入库的物料不允许撤销"); + } + //删除当前数据 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(receiptMaterial.getId()); + } + } + pwCompletionNoticeProductService.deletePwCompletionNoticeProductById(completionNoticeProduct.getId()); + + //修改点件表的物料入库状态 + bomNumberTwo.setInventoryStatus(null); + i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + } + return toAjax(i); + } + + /** + * 撤销申请领料按钮 + */ + @DeleteMapping("/revocationLingliaos/{ids}") + public AjaxResult revocationLingliaos(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + //图号 + String figureNumber = bomNumberTwo.getFigureNumber(); + //判断当前物料是否是第一道序的物料 + String substring = bomNumberTwo.getFigureNumber().substring(bomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + List list = new ArrayList(); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1==Integer.valueOf(substring)){ + if("部件".equals(bomNumberTwo.getType())||"0".equals(bomNumberTwo.getNum())){ + //说明是部件或者是成品则查询零件的领用信息 + //查询父级的信息 + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo.getSuperiorId()); + //查询当前部件下的零件 + List list2 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(numberTwo.getFigureNumber(), numberTwo.getSparedOne(), bomNumberTwo.getProductionCode()); + //是否可以删除标记 + int e = 0; + for (PwBomNumber pwBomNumber : list2) { + if(!"虚拟部件".equals(pwBomNumber.getRemarks())){ + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber(), bomNumberTwo.getId()); +// if(list3.size()<1){ +// return AjaxResult.error("已全部撤销领料条目"); +// } + if(list3.size()>0&&!"未出库".equals(list3.get(list3.size()-1).getGetStatus())){ + //说明已经出库,则不允许删除 + e = 1; + } + } + } + if(e == 1){ + return AjaxResult.error("已出库的物料不允许撤销申请领料!"); + }else{ + //删除 + for (PwBomNumber pwBomNumber : list2) { + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber(), bomNumberTwo.getId()); + if(list3.size()>0){ + i = iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(list3.get(list3.size()-1).getId()); + } + } + return AjaxResult.success(i); + } + + }else{ + //如果是零件,则查询原材料领用信息 + list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getMaterialsName(), bomNumberTwo.getMaterialsSpecification()); + } + }else{ + Integer s = Integer.valueOf(substring)-1; + String figureNumbers = bomNumberTwo.getFigureNumber().substring(0,bomNumberTwo.getFigureNumber().lastIndexOf("-")); + figureNumber = figureNumbers+"-"+s; + list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(bomNumberTwo.getProductionCode(), figureNumber); + } + if(list.size()>0){ + ImStockRequisitionMaterial imStockRequisitionMaterial = list.get(list.size()-1); + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + if(null!=bomNumberTwo.getSparedThree()){ + if(bomNumberTwo.getSparedThree()-imStockRequisitionMaterial.getSalaryQuantity()<0){ + //修改已领数量 + bomNumberTwo.setSparedThree(0L); + }else{ + //修改已领数量 + bomNumberTwo.setSparedThree(bomNumberTwo.getSparedThree()-imStockRequisitionMaterial.getSalaryQuantity()); + } + } + //修改领料状态 + bomNumberTwo.setSparedFour(0L); + i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + }else{ + return AjaxResult.error("已入库的不允许撤销"); + } + } + } + if(i==0){ + return AjaxResult.error("已全部撤销领料条目"); + } + return toAjax(i); + } + + /** + * 毛坯物料申请领料 + */ + @RepeatSubmit + @RequestMapping("/getWorkblanks") + public AjaxResult getWorkblanks(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + + long time = new Date().getTime(); + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //申请领料时判断当前序派工给谁了,如果不是管理员账号和本派工部门的权限,则不允许申请 + if(!"admin".equals(user.getUserName())&&!"chenshitian".equals(user.getUserName())&&!pwBomNumberTwo.getDepartmentName().equals(user.getDept().getDeptName())){ + return AjaxResult.error("当前账号无权限"); + } + if(null==pwBomNumberTwo.getLingliaoNumber()||0==pwBomNumberTwo.getLingliaoNumber()){ + return AjaxResult.error("请填写领料数量"); + } + + //名称 + String name = pwBomNumberTwo.getName(); + //图号 + String figureNumber2 = pwBomNumberTwo.getFigureNumber(); + + //判断上序是否需要入库,如果上序不需要入库,则当前序不需要领料 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1 list = imProductReceiptMaterialService.selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + Long ruku = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + ruku += imProductReceiptMaterial.getReceived().longValue(); + } + + //查询发料的数量 + List list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + Long chuku = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + chuku += imStockRequisitionMaterial.getAlreadyQuantity(); + } + if(list.size()<1){ + //说明没有入库 + return AjaxResult.error("上序未入库,不允许领料"); + }else{ + if(rukuinventoryDetail.getQuantity()){ + return AjaxResult.error("领料数量不可以大于库存数量,当前库存数量为:"+inventoryDetail.getQuantity()+" 件"); + } + if(pwBomNumberTwo.getLingliaoNumber()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + } + + //查询是否有未出库的数据(同一部件的) + List list8 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber(),pwBomNumberTwo.getId()); + int wei = 0; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list8) { + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + wei = 1; + } + } + if(1==wei){ + return AjaxResult.error("上次领料未办理出库,不允许再次申请"); + } + } + + //根据id查看bom表 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + //获取执行单号 + String code = bomNumberTwo.getProductionCode(); + //根据code获取执行单信息 + PwProductionBill pwProductionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + List list2 = new ArrayList(); + //第一序 + if(1==Integer.valueOf(substring)){ + if("部件".equals(bomNumberTwo.getType())||"0".equals(bomNumberTwo.getNum())){ + //判断是否有勾选的物料,如果没有勾选的,则默认为全部领出,如果有勾选物料,则领用勾选物料 + if(null!=pwBomNumberTwo.getIds()&&pwBomNumberTwo.getIds().length>0){ + String[] ids = pwBomNumberTwo.getIds(); + for (String string : ids) { + PwBomNumber bomNumber = pwBomNumberService.selectPwBomNumberById(Long.valueOf(string)); + list2.add(bomNumber); + } + }else{ + //根据superior_id查询上级物料信息 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo.getSuperiorId()); + //如果需领物料为部件,则查询当前部件下所有的零件,领料数量*单台数量 + list2 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(bomNumberTwo2.getFigureNumber(), bomNumberTwo2.getSparedOne(), code); + } + }else{ + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(bomNumberTwo.getMaterialsName(), bomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + bomNumberTwo.setName(bomNumberTwo.getMaterialsName()); + bomNumberTwo.setFigureNumber(bomNumberTwo.getMaterialsSpecification()); + //修改为领料数量*下料尺寸 + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //计算领料数量 + pwBomNumberTwo.setLingliaoNumber(pwBomNumberTwo.getLingliaoNumber()*Long.valueOf(bomNumberTwo.getMeasure())+(3*pwBomNumberTwo.getLingliaoNumber())); + }else{ + //计算领料数量 + pwBomNumberTwo.setLingliaoNumber(pwBomNumberTwo.getLingliaoNumber()*Long.valueOf(bomNumberTwo.getMeasure())); + } + //判断领用的原材料信息是否充足 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwo.getMaterialsName(), bomNumberTwo.getMaterialsSpecification()); + //领料数量大于库存修改为领料数量大于可用 + if(pwBomNumberTwo.getLingliaoNumber()>inventoryDetail.getAvailableNumber()){ + return AjaxResult.error("领料数量不可以大于库存可用数量,当前库存数量为:"+inventoryDetail.getAvailableNumber()); + } + } + } + }else{ + String figureNumber = pwBomNumberTwo.getFigureNumber().substring(0,pwBomNumberTwo.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + bomNumberTwo.setFigureNumber(figureNumber); + } + //判断库存是否足够当前领料数量,如果不足,则不允许申请 + int i = 0; + if(list2.size()>0){ + //判断领料数量是否已超本批数量 + for (PwBomNumber pwBomNumber : list2) { + //计算本次领料的数量 + Long number = pwBomNumber.getOneNumber()*pwBomNumberTwo.getLingliaoNumber(); + //先查询库存数量是否够本次领料的数量,如果不够,则不允许申请领 + //根据物料名称和图号和令号查询bomTwo + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + + //查询当前物料是否出现在原材料中,如果出现在原材料中,则需要把原材料的数量累加到本批数量中比较 + List list3 = pwBomNumberTwoService.selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(bomNumberTwo2.getProductionCode(), bomNumberTwo2.getName(), bomNumberTwo2.getFigureNumber()); + //原材料数量 + Long cailiaoNumber = 0L; + for (PwBomNumberTwo pwBomNumberTwo2 : list3) { + cailiaoNumber += pwBomNumberTwo2.getWorkblank(); + } + + //查询已申请领料数量 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + Long yiling = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + yiling += imStockRequisitionMaterial.getSalaryQuantity(); + } + //判断 已申请+本次申领 > 本批 + if(yiling + number > bomNumberTwo2.getSumNumber()+cailiaoNumber){ + return AjaxResult.error("领料数量不可超出本批数量"); + } + } + + //判断数量是否充足 + int a = 0; + //库存是否满足本次领料标记 TODO 返回库存数量不够的数据 + List list7 = new ArrayList(); + for (PwBomNumber pwBomNumber : list2) { + //计算本次领料的数量 + Long number = pwBomNumber.getOneNumber()*pwBomNumberTwo.getLingliaoNumber(); + + //先查询库存数量是否够本次领料的数量,如果不够,则不允许申请领 + //根据物料名称和图号和令号查询bomTwo + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + //非铆焊工段领料 + if(!"虚拟部件".equals(bomNumberTwo2.getRemarks())){ + //根据物料名称和图号查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwo2.getName(), bomNumberTwo2.getFigureNumber()); + if(inventoryDetail.getQuantity() list8 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber(),pwBomNumberTwo.getId()); + int wei = 0; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list8) { + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + wei = 1; + } + } + if(1==wei){ + return AjaxResult.error("上次领料未办理出库,不允许再次申请"); + } + } + if(a == 1){ + //返回库存数量不足的物料信息 TODO 标记够几套的数量 + String buzu = ""; + for (PwBomNumberTwo bomNumberTwo3 : list7) { + buzu += bomNumberTwo3.getName()+","; + } + return AjaxResult.error(buzu+"库存数量不足,不允许申请领料"); + } + + //说明是部件领料 + for (PwBomNumber pwBomNumber : list2) { + //根据物料名称和图号和令号查询bomTwo + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + if(!"虚拟部件".equals(bomNumberTwo2.getRemarks())){ + //计算本次领料的数量 + Long number = pwBomNumber.getOneNumber()*pwBomNumberTwo.getLingliaoNumber(); + + //根据名称图号和令号查询本批数量(本批数量为领料表中的数量,未合并的数量) + List list3 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + Long sumNumber = 0L; + for (PwBomNumberTwoLingliao pwBomNumberTwoLingliao : list3) { + sumNumber += pwBomNumberTwoLingliao.getSumNumber(); + } + + //查询领料单信息 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCodeAndTypeName(pwBomNumber.getProductionCode(),pwBomNumber.getTypeName()); + if(null!=stockRequisition){ + //说明此单据之前领过料 + if(null==stockRequisition.getSparedThree()){ + stockRequisition.setSparedThree(0L); + } + //修改申领数量 + stockRequisition.setSparedThree(stockRequisition.getSparedThree()+pwBomNumberTwo.getLingliaoNumber()); + + Long s = 0L; + //根据图号和code查询 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumber.getName(),pwBomNumber.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + + //查询当前物料是否出现在原材料中,如果出现在原材料中,则需要把原材料的数量累加到本批数量中比较 + List list6 = pwBomNumberTwoService.selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(pwBomNumberTwo.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + //原材料数量 + Long cailiaoNumber = 0L; + for (PwBomNumberTwo pwBomNumberTwo2 : list6) { + cailiaoNumber += pwBomNumberTwo2.getWorkblank(); + } + + //判断数量是否已经超了本批数量 + if(s+number>sumNumber+cailiaoNumber){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumber.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumber.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumber.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumber.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(number); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(number); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(number); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + + }else{ + if(number>sumNumber){ + return AjaxResult.error("申领数量不可大于本批数量"); + } + //说明此单据之前没有领过料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwBomNumberTwo.getProductionCode()); + //项目名称 + imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(pwBomNumberTwo.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //修改申领数量 + imStockRequisition.setSparedThree(pwBomNumberTwo.getLingliaoNumber()); + //申领数量 + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumber.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumber.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumber.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumber.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(number); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(number); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(number); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + } + }else{ + //查询是否有未出库的数据 + //查询已申请领料数量 +// List list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + int wei = 0; + if(1==Integer.valueOf(substring)){ + List list8 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification(),pwBomNumberTwo.getId()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list8) { + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + wei = 1; + } + } + }else{ + List list8 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber(),pwBomNumberTwo.getId()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list8) { + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + wei = 1; + } + } + } + if(1==wei){ + return AjaxResult.error("上次领料未办理出库,不允许再次申请"); + } + //说明是零件领料 + //根据code查询领料单的申领数量,只查询当前材料的 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCodeAndTypeName(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getSparedOne()); + if(null!=stockRequisition){ + Long s = 0L; + //如果为第一序,则查询时需要带上名称 + if(1==Integer.valueOf(substring)){ + //根据图号和code查询 +// List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getMaterialsName(),pwBomNumberTwo.getMaterialsSpecification()); + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getMaterialsName(),pwBomNumberTwo.getMaterialsSpecification(),pwBomNumberTwo.getId()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + }else{ + //根据图号和code查询 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(),bomNumberTwo.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + } + //分序判断 + if(1==Integer.valueOf(substring)){ + //判断数量是否已经超了本批数量 + //判断领料状态是否是1 + if(null!=pwBomNumberTwo.getSparedFour()&&pwBomNumberTwo.getSparedFour()==1){ + return AjaxResult.error("已申请,无需重复申请"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + + if(null==pwBomNumberTwo.getSparedThree()){ + pwBomNumberTwo.setSparedThree(0L); + } + if((s/Long.valueOf(pwBomNumberTwo.getMeasure()))+pwBomNumberTwo.getLingliaoNumber()>pwBomNumberTwo.getReceiveNumber()){ + return AjaxResult.error("申请数量不可大于本批数量,已申请数量为:"+pwBomNumberTwo.getSparedThree()+",剩余可申领数量为:"+(pwBomNumberTwo.getReceiveNumber()-pwBomNumberTwo.getSparedThree())); + } + + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwo bomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), bomNumberTwo.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwos.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwos.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwos.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwos.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + } + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + /*if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getLingliaoNumber()); + }*/ + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + if(null==pwBomNumberTwo.getSparedThree()){ + pwBomNumberTwo.setSparedThree(0L); + } + //判断领料数量是否已等于本批数量 + if((pwBomNumberTwo.getLingliaoNumber()/Long.valueOf(pwBomNumberTwo.getMeasure()))+pwBomNumberTwo.getSparedThree()>=pwBomNumberTwo.getSumNumber()){ + //修改领料状态为1 + pwBomNumberTwo.setSparedFour(1L); + }else{ + pwBomNumberTwo.setSparedThree(pwBomNumberTwo.getSparedThree()+pwBomNumberTwo.getLingliaoNumber()); + } + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + }else{ + //判断数量是否已经超了本批数量 + if(s+pwBomNumberTwo.getLingliaoNumber()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwo bomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), bomNumberTwo.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwos.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwos.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwos.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwos.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + } + //查找当前物料的上一道序的物料 + PwBomNumberTwo bomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), bomNumberTwo.getFigureNumber()); + if(bomNumberTwos.getGodownEntry().equals("否")){ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(pwBomNumberTwo.getLingliaoNumber()); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(0L); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("已出库"); + //出库时间 + imStockRequisitionMaterial.setOutboundDate(new Date()); + //出库人 + imStockRequisitionMaterial.setSendingPeopleName("虚拟出库"); + //减少库存 + //根据图号和名称查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imStockRequisitionMaterial.getMaterialName(), imStockRequisitionMaterial.getFigureNumber()); + //减少库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-pwBomNumberTwo.getLingliaoNumber()); + if(inventoryDetail.getLockNumber()-pwBomNumberTwo.getLingliaoNumber()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + //减少预定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwBomNumberTwo.getLingliaoNumber()); + } + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(0L); + + }else{ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + } + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + /*if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getLingliaoNumber()); + }*/ + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + if(!bomNumberTwos.getGodownEntry().equals("否")){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + } + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwBomNumberTwo.getProductionCode()); + //项目名称 + imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(pwBomNumberTwo.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //申领数量 +// imStockRequisition.setSparedThree(pwBomNumberTwo.getShuliang()); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + + if(null==pwBomNumberTwo.getSparedThree()){ + pwBomNumberTwo.setSparedThree(0L); + } + if(1==Integer.valueOf(substring)){ + if(pwBomNumberTwo.getLingliaoNumber()+pwBomNumberTwo.getSparedThree()>pwBomNumberTwo.getReceiveNumber()){ + return AjaxResult.error("申请数量不可大于本批数量,已申请数量为:"+pwBomNumberTwo.getSparedThree()+",剩余可申领数量为:"+(pwBomNumberTwo.getReceiveNumber()-pwBomNumberTwo.getSparedThree())); + } + }else{ + if(pwBomNumberTwo.getLingliaoNumber()+pwBomNumberTwo.getSparedThree()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申请数量不可大于本批数量,已申请数量为:"+pwBomNumberTwo.getSparedThree()+",剩余可申领数量为:"+(pwBomNumberTwo.getSumNumber()-pwBomNumberTwo.getSparedThree())); + } + } + + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + + //查找当前物料的上一道序的物料 + PwBomNumberTwo bomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), bomNumberTwo.getFigureNumber()); + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + } + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwos.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwos.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwos.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwos.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + + if("否".equals(bomNumberTwos.getGodownEntry())){ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(pwBomNumberTwo.getLingliaoNumber()); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("已出库"); + //出库时间 + imStockRequisitionMaterial.setOutboundDate(new Date()); + //出库人 + imStockRequisitionMaterial.setSendingPeopleName("虚拟出库"); + //减少库存 + //根据图号和名称查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imStockRequisitionMaterial.getMaterialName(), imStockRequisitionMaterial.getFigureNumber()); + //减少库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-pwBomNumberTwo.getLingliaoNumber()); + if(inventoryDetail.getLockNumber()-pwBomNumberTwo.getLingliaoNumber()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + //减少预定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwBomNumberTwo.getLingliaoNumber()); + } + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(0L); + + }else{ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + } + } + + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + if(null==pwBomNumberTwo.getSparedThree()){ + pwBomNumberTwo.setSparedThree(0L); + } + //判断领料数量是否已等于本批数量 + if(1==Integer.valueOf(substring)){ + if((pwBomNumberTwo.getLingliaoNumber()/Long.valueOf(pwBomNumberTwo.getMeasure()))+pwBomNumberTwo.getSparedThree()>=pwBomNumberTwo.getSumNumber()){ + //修改领料状态为1 + pwBomNumberTwo.setSparedFour(1L); + }else{ + pwBomNumberTwo.setSparedThree(pwBomNumberTwo.getSparedThree()+pwBomNumberTwo.getLingliaoNumber()); + } + }else{ + if(pwBomNumberTwo.getLingliaoNumber()+pwBomNumberTwo.getSparedThree()>=pwBomNumberTwo.getSumNumber()){ + //修改领料状态为1 + pwBomNumberTwo.setSparedFour(1L); + }else{ + pwBomNumberTwo.setSparedThree(pwBomNumberTwo.getSparedThree()+pwBomNumberTwo.getLingliaoNumber()); + } + } + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + + + if(1==Integer.valueOf(substring)){ + if(!"否".equals(pwBomNumberTwo.getGodownEntry())){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + }else{ + if(!"否".equals(bomNumberTwos.getGodownEntry())){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + } + } + + long time2 = new Date().getTime(); + System.out.println(time2-time); + return toAjax(i); + } + + /** + * 成品物料申请领料 + */ + @RequestMapping("/getWorkblanksTwo") + public AjaxResult getWorkblanksTwo(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + if(null==pwBomNumberTwo.getLingliaoNumber()||0==pwBomNumberTwo.getLingliaoNumber()){ + return AjaxResult.error("请输入申请数量"); + } + //查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(inventoryDetail.getQuantity() list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + //判断数量是否已经超了本批数量 + if(s+pwBomNumberTwo.getLingliaoNumber()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumberTwo.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + }else{ + //判断数量是否已经超了本批数量 + if(pwBomNumberTwo.getLingliaoNumber()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwBomNumberTwo.getProductionCode()); + //项目名称 + imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(pwBomNumberTwo.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumberTwo.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwo.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwo.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwo.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + return AjaxResult.success(i); + } + + /** + * 申请入库 + */ + @RepeatSubmit + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //申请领料时判断当前序派工给谁了,如果不是管理员账号和本派工部门的权限,则不允许申请 + if(!"admin".equals(user.getUserName())&&!"yinguofeng".equals(user.getUserName())&&!pwBomNumberTwo.getDepartmentName().equals(user.getDept().getDeptName())){ + return AjaxResult.error("当前账号无权限"); + } + + if(null==pwBomNumberTwo.getNumber()||"".equals(pwBomNumberTwo.getNumber())||pwBomNumberTwo.getNumber()==0){ + return AjaxResult.error("请输入申请入库数量"); + } + if(pwBomNumberTwo.getSumNumber() list = pwBomNumberService.selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(numberTwo.getProductionCode(), numberTwo.getName(), numberTwo.getFigureNumber(), numberTwo.getSparedOne()); + //查询子集的出库数量是否大于等于已入库和正要入库的数量 + //查询已入库数量 + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + int yiru = 0; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + yiru += imProductReceiptMaterial.getActualQuantity(); + } + //查询领料数量 + for (PwBomNumber pwBomNumber : list) { + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + int yichu =0; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list3) { + yichu += imStockRequisitionMaterial.getAlreadyQuantity(); + } + if(!"虚拟部件".equals(pwBomNumber.getRemarks())){ + if(yichu < ((yiru + pwBomNumberTwo.getNumber())*pwBomNumber.getOneNumber())){ + return AjaxResult.error("未领料或领料数量不足,不允许申请入库"); + } + } + } + } + } + + //判断需要入库的物料是否是成品件 + if(null!=pwBomNumberTwo.getParentLevelFigureNumber()&&!"".equals(pwBomNumberTwo.getParentLevelFigureNumber())&&null!=pwBomNumberTwo.getParentLevelName()&&!"".equals(pwBomNumberTwo.getParentLevelName())){ + //判断其物料是否已经领料(未领料或者领料数量小于入库数量的不允许入库)判断是否是第一道序,如果为第一道序,则需要根据原材料去查询领料信息,否则需要根据上一道序的物料去查询领料信息 + //判断领料的是第几道工序 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + if(1==Integer.valueOf(substring)){ + + //此处需要确定项目之后打开注释(因为现在第一道序还没原材料,所以不能限制第一道序也必须领料) + + //说明是第一道工序 + //判断当前序是否添加了原材料。如果添加了原材料则判断是否已经领料,如果未领料,则不允许申请质检 + if(null!=pwBomNumberTwo.getMaterialsName()&&!"".equals(pwBomNumberTwo.getMaterialsName())){ + //说明填写了原材料信息 + //根据物料的单据code和名称和图号查询领料信息 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(list.size()==0){ + //原材料无需判断领料数量 + return AjaxResult.error("未申请领料的不允许入库"); + } + + //判断领料数量是否大于等于申请入库的数量 TODO + + } + + }else{ + String figureNumber = pwBomNumberTwo.getFigureNumber().substring(0,pwBomNumberTwo.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //查询上序是否需要入库,如果上序不需要入库,则当前序不再控制必须领料后才可入库 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), figureNumber); +// if(bomNumberTwo.getGodownEntry().equals("是")){ + //说明不是第一道工序 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), figureNumber); + if(list.size()>0){ + Long i = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + i += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断数量是否大于等于入库数量 + //查询当前需入库物料的已入库数量(包函已申请的数量) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + //已申请入库的数量 + Long p = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + p += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(i list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + Long a = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + if(imProductReceiptMaterial.getInventoryStatus().equals("已入库")||imProductReceiptMaterial.getInventoryStatus().equals("正在入库")){ + a = a + imProductReceiptMaterial.getReceived().longValue(); + }else{ + a = a + imProductReceiptMaterial.getActualQuantity().longValue(); + } + } + //合并数量 + a = a + pwBomNumberTwo.getNumber().intValue(); + + //根据令号和入库的型号,查询成品入库单是否状态已全部为已出库(除部件以外)成品入库后把所有的部件状态都改为已入库(实际数量并不参与库存) + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCodeAndTypeName(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getSparedOne()); + if(null==stockRequisition){ + + return AjaxResult.error("未查询到领料信息,不允许入库"); + }else{ + if(a.equals(stockRequisition.getSparedThree())){ + //根据出库单id查询当前出库当下所有的物料 + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialList(imStockRequisitionMaterial); + //出库标识 + int r = 0; + for (ImStockRequisitionMaterial imStockRequisitionMaterial2 : list) { + int t = 0; + //判断当前零件的物料是不是最后一道序是装配车间或企标工段或销齿链组或非标设备组或综合工段 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(imStockRequisitionMaterial2.getCode(), imStockRequisitionMaterial2.getMaterialName(), imStockRequisitionMaterial2.getFigureNumber()); + if(null!=bomNumberTwo){ + //根据当前物料id查询子集工序 + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); + /*if(list3.size()>0&&!"装配车间".equals(list3.get(list3.size()-1).getDepartmentName())&&!"企标工段".equals(list3.get(list3.size()-1).getDepartmentName())&&!"销齿链组".equals(list3.get(list3.size()-1).getDepartmentName())&&!"非标设备组".equals(list3.get(list3.size()-1).getDepartmentName())&&!"综合工段".equals(list3.get(list3.size()-1).getDepartmentName())){ + t = 1; + }*/ + if(t==1&&(!bomNumberTwo.getRemarks().contains("甲供件(不入厂)")||!bomNumberTwo.getRemarks().contains("甲供件(不入厂)"))&&!("是").equals(bomNumberTwo.getTheoretical())&&!("已出库").equals(imStockRequisitionMaterial2.getGetStatus())&&!("部件").equals(imStockRequisitionMaterial2.getMaterials())){ + r = 1; + } + } + if(r == 1){ + return AjaxResult.error("出库未完成,不允许入库"); + } + } + }else if(null!=stockRequisition.getSparedThree()&&a > stockRequisition.getSparedThree()){ + + return AjaxResult.error("入库数量大于领料数量,不允许入库"); + }else{ + //根据执行单令号和产品型号查询bom表信息 + List listTwo = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndProductType(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getSparedOne()); + //应该申请领料的数量 + Long y = 0L; + for (PwBomNumberTwoLingliao pwBomNumberTwoLingliao : listTwo) { + y = pwBomNumberTwoLingliao.getOneNumber()*a; + if(!"是".equals(pwBomNumberTwoLingliao.getTheoretical())&&!"部件".equals(pwBomNumberTwoLingliao.getType())&&null!=pwBomNumberTwoLingliao.getParentLevelFigureNumber()&&!"".equals(pwBomNumberTwoLingliao.getParentLevelFigureNumber())&&null!=pwBomNumberTwoLingliao.getParentLevelName()&&!"".equals(pwBomNumberTwoLingliao.getParentLevelName())){ + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwoLingliao.getProductionCode(), pwBomNumberTwoLingliao.getFigureNumber()); + if(list.size() == 0){ + return AjaxResult.error("未查询到领料信息,不允许入库"); + } + //已经出库的数量 + Long t = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + if(imStockRequisitionMaterial.getGetStatus().equals("已出库")||imStockRequisitionMaterial.getGetStatus().equals("出库中")){ + t = t + imStockRequisitionMaterial.getAlreadyQuantity(); + } + } + if(y > t){ + //说明出库数量不足 + return AjaxResult.error("出库未完成,不允许入库"); + } + } + } + } + } + } + + //根据id查看bom表 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + //根据物料名称和图号查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + //获取执行单号 + String code = bomNumberTwo.getProductionCode(); + //根据code获取执行单信息 + PwProductionBill pwProductionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + //根据企标号查询此企标号时候已经添加到入库申请表了,如果添加到了则不再添加,反之则直接添加 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(code); + if(null!=productReceipt){ + //如果不等于null 则直接把物料添加到待入库详情表中 + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + //此处查询质检单 + PwCompletionNotice pwCompletionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + PwCompletionNoticeProduct cnp = new PwCompletionNoticeProduct(); + //质检单id + cnp.setCompletionNoticeId(pwCompletionNotice.getId()); + //名称 + cnp.setProductName(bomNumberTwo2.getName()); + //图号 + cnp.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + cnp.setMaterials(bomNumberTwo2.getType()); + //供应商 + cnp.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(cnp); + +// //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(bomNumberTwo2.getProductionCode()); + int s = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + s += pwCompletionNoticeProduct2.getActualQuantity(); + } + if((null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus()))&&!"未入库".equals(bomNumberTwo2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwBomNumberTwo.getNumber()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申请数量不可大于本批数量"); + }else{ + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //判断是否需要入库,如果需要则添加入库单,不需要则直接添加质检单 + if("是".equals(bomNumberTwo2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBomNumberTwo.getUnitPrice()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBomNumberTwo.getUnitPrice()*pwBomNumberTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwBomNumberTwo.getNumber() == bomNumberTwo2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + }else{ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBomNumberTwo.getUnitPrice()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBomNumberTwo.getUnitPrice()*pwBomNumberTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwBomNumberTwo.getNumber() == bomNumberTwo2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + //把添加入库单的id添加到质检单中 + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwo2.getFigureNumber()&&!"009".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwo2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwo2.getSuperiorId()){ + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwo.getProductionCode()+"/bom/"+numberTwo.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwo2.getProductionCode()+"/bom/"+bomNumberTwo2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单和质检通知单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(code); + //关联令号 + imProductReceipt.setCode(code); + //项目名称 + imProductReceipt.setProjectName(pwProductionBill.getIllustrate()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + if(null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(code); + //根据生产令号查询项目名称 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + //保存项目名称 + pwCompletionNotice.setProjectName(productionBill.getProjectName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + if("是".equals(bomNumberTwo2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBomNumberTwo.getUnitPrice()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBomNumberTwo.getUnitPrice()*pwBomNumberTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwBomNumberTwo.getNumber()==pwBomNumberTwo.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + }else{ + //虚拟入库 + + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBomNumberTwo.getUnitPrice()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBomNumberTwo.getUnitPrice()*pwBomNumberTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwBomNumberTwo.getNumber()==pwBomNumberTwo.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + //供应商名称 + pwCompletionNoticeProduct.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwo2.getFigureNumber()&&!"009".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwo2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwo2.getSuperiorId()){ + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwo.getProductionCode()+"/bom/"+numberTwo.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwo2.getProductionCode()+"/bom/"+bomNumberTwo2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + } + return toAjax(200); + } + + /** + * 生成原材料明细单 + */ + @RequestMapping("generateProcurements/{ids}") + public AjaxResult generateProcurements(@PathVariable Long[] ids){ + //查找执行单 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(ids[0]); + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据令号查询是否之前生成果预采购单,如果生成果,则不允许再生成 + PwFuturesOrders futuresOrders = pwFuturesOrdersService.selectPwFuturesOrdersByCode(bomNumberTwo.getProductionCode()); + //如果填写了原材料,则计算原材料的数量 + if(null!=futuresOrders){ + return AjaxResult.error("不允许重复生成预采购单"); + } + + //判断材料是否是毛坯或者设置了安全库存的物料 + //查询所有填写了材料的数据 + int s = 0; + List list4 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndMaterialIdIsNotNull(bomNumberTwo.getProductionCode()); + for (PwBomNumberTwo pwBomNumberTwo : list4) { + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + s = 1; + } + } + int i = 0; + if(s == 1){ + //生成新的预采购单 + PwFuturesOrders pwFuturesOrders = new PwFuturesOrders(); + //令号 + pwFuturesOrders.setCode(bomNumberTwo.getProductionCode()); + //申请人 + pwFuturesOrders.setUser(user.getNickName()); + //申请时间 + pwFuturesOrders.setTime(new Date()); + //状态(初始状态为未审核) + pwFuturesOrders.setStatus("未审核"); + i = pwFuturesOrdersService.insertPwFuturesOrders(pwFuturesOrders); + + //根据令号查询此令号下所有的工序不为null的数据 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByProductionCode(bomNumberTwo.getProductionCode()); + for (PwBomNumberTwo pwBomNumberTwo : list) { + //获取每颗料的第一序的物料 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + PwBomNumberTwo pwBomNumberTwo2 = new PwBomNumberTwo(); + if(list2.size()>0){ + //默认为下标为0的为第一序 + pwBomNumberTwo2 = list2.get(0); + }else{ + continue; + } + + //获取下料尺寸和毛坯数量(下料尺寸*毛坯数量为需要出库的) + if(null!=pwBomNumberTwo2.getMaterialsName()&&null!=pwBomNumberTwo2.getMaterialsSpecification()){ + //根据名称和图号查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo2.getMaterialsName(), pwBomNumberTwo2.getMaterialsSpecification()); + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //把合并之前的信息增加到详情中 + PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo = new PwFuturesOrdersDetailTwo(); + + //根据名称和图号查询预购单明细中是否有了此物料,如果有则不再新增,则在原有的基础上添加总数量 + PwFuturesOrdersDetail futuresOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(pwBomNumberTwo2.getProductionCode(),pwBomNumberTwo2.getMaterialsName(),pwBomNumberTwo2.getMaterialsSpecification()); + if(null != futuresOrdersDetail){ + //总尺寸相加 + futuresOrdersDetail.setNumber(futuresOrdersDetail.getNumber()+(Double.valueOf(pwBomNumberTwo2.getMeasure())*pwBomNumberTwo2.getWorkblank())+(3*pwBomNumberTwo2.getWorkblank())); + if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000); + }else if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("平方毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000000); + }else{ + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()); + } + //总重量重新计算 + futuresOrdersDetail.setReferenceNumber(futuresOrdersDetail.getQuantity() * material.getPieceWeight()); + pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(futuresOrdersDetail); + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(futuresOrdersDetail.getId()); + + }else{ + //新增预采购单明细 + PwFuturesOrdersDetail pwFuturesOrdersDetail = new PwFuturesOrdersDetail(); + //令号 + pwFuturesOrdersDetail.setCode(pwBomNumberTwo2.getProductionCode()); + //预购单id + pwFuturesOrdersDetail.setOrdersId(pwFuturesOrders.getId()); + //名称 + pwFuturesOrdersDetail.setName(pwBomNumberTwo2.getMaterialsName()); + //图号 + pwFuturesOrdersDetail.setFigureNumber(pwBomNumberTwo2.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetail.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetail.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetail.setMeasure(Double.valueOf(pwBomNumberTwo2.getMeasure()).longValue()); + //毛坯数量 + pwFuturesOrdersDetail.setWorkblank(pwBomNumberTwo2.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetail.setNumber(Double.valueOf(pwBomNumberTwo2.getMeasure())*pwBomNumberTwo2.getWorkblank().doubleValue()+(3*pwBomNumberTwo2.getWorkblank().doubleValue())); + //计量单位(物料属性) + pwFuturesOrdersDetail.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000); + //采用换算后的单位 + pwFuturesOrdersDetail.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetail.setReferenceNumber(pwFuturesOrdersDetail.getQuantity() * material.getPieceWeight()); + + //库存数量 + //根据原材料物料名称和图号查询库存 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo2.getMaterialsName(), pwBomNumberTwo2.getMaterialsSpecification()); + //库存数量 + pwFuturesOrdersDetail.setInventoryQuantity(inventoryDetail.getQuantity()); + //在途数量 + pwFuturesOrdersDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + //锁定数量 + pwFuturesOrdersDetail.setLockNumber(inventoryDetail.getLockNumber()-pwFuturesOrdersDetail.getNumber().longValue()); + + pwFuturesOrdersDetailService.insertPwFuturesOrdersDetail(pwFuturesOrdersDetail); + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(pwFuturesOrdersDetail.getId()); + //锁定库存数量 +// inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwFuturesOrdersDetail.getNumber().longValue()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + + //令号 + pwFuturesOrdersDetailTwo.setCode(pwBomNumberTwo2.getProductionCode()); + //物料id + pwFuturesOrdersDetailTwo.setMatenaisId(pwBomNumberTwo2.getId()); +// //预购单id +// pwFuturesOrdersDetailTwo.setOrdersDetailId(pwFuturesOrders.getId()); + //名称 + pwFuturesOrdersDetailTwo.setName(pwBomNumberTwo2.getMaterialsName()); + //图号 + pwFuturesOrdersDetailTwo.setFigureNumber(pwBomNumberTwo2.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetailTwo.setSparedOne(pwBomNumberTwo2.getSpecification()); + //毛坯数量 + pwFuturesOrdersDetailTwo.setWorkblank(pwBomNumberTwo2.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetailTwo.setNumber(Double.valueOf(pwBomNumberTwo2.getMeasure())*pwBomNumberTwo2.getWorkblank().doubleValue()+(3*pwBomNumberTwo2.getWorkblank().doubleValue())); + //计量单位(物料属性) + pwFuturesOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + pwFuturesOrdersDetailTwo.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetailTwo.setReferenceNumber(pwFuturesOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + + pwFuturesOrdersDetailTwoService.insertPwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo); + } + } + } + } + return toAjax(i); + } + + /** + * 计算bom表的单台数量和本批数量 + * @return + */ + public AjaxResult counterNum(String code,String typeName){ + //根据报价单id查询当前报价单下所有的型号 + PwBomNumber pwBomNumber = new PwBomNumber(); + pwBomNumber.setProductionCode(code); + pwBomNumber.setTypeName(typeName); + //获取所有零部件数据集 + List list = pwBomNumberService.selectPwBomNumberList(pwBomNumber); + //把数据保存到数量保存表中 + PwBomNumberTwo pbt = null; + for (PwBomNumber pwBomNumber2 : list) { + //获取总装图 + if(null==pwBomNumber2.getParentLevelFigureNumber()||"".equals(pwBomNumber2.getParentLevelFigureNumber())){ + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbt.setProductionCode(pwBomNumber2.getProductionCode()); + pbt.setNum("0"); + pbt.setFigureNumber(pwBomNumber2.getFigureNumber()); + pbt.setName(pwBomNumber2.getName()); + pbt.setOneNumber(pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber2.getType()); + pbt.setPieceWeight(pwBomNumber2.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber2.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber2.getParentLevelName()); + //把总装图的单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber2.getTypeName()); + pbt.setRemarks(pwBomNumber2.getRemarks()); + pbt.setDelFlag(0); + //计算后的bom表添加数据bom + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + + PwBomNumberTwoLingliao pbtLingliao = new PwBomNumberTwoLingliao(); + pbtLingliao.setProductionCode(pwBomNumber2.getProductionCode()); + pbtLingliao.setNum("0"); + pbtLingliao.setFigureNumber(pwBomNumber2.getFigureNumber()); + pbtLingliao.setName(pwBomNumber2.getName()); + pbtLingliao.setOneNumber(pwBomNumber2.getOneNumber()); + pbtLingliao.setType(pwBomNumber2.getType()); + pbtLingliao.setPieceWeight(pwBomNumber2.getPieceWeight()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber2.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelName(pwBomNumber2.getParentLevelName()); + //把总装图的单台数量保存到本批数量中 + pbtLingliao.setSumNumber(pwBomNumber2.getSumNumber()); + pbtLingliao.setSparedOne(pwBomNumber2.getTypeName()); + pbtLingliao.setRemarks(pwBomNumber2.getRemarks()); + pbtLingliao.setDelFlag(0); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + }else{ + System.out.println("未找到总装图"); + return AjaxResult.error(); + } + //根据总装图的图号查找其下所有子集 + List listTwo = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber2.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + //遍历子集 + int a = 0; + String s = ""; + for (PwBomNumber pwBomNumber3 : listTwo) { + PwBomNumberTwoLingliao pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber3.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber3.getProductionCode()); +// pbt.setNum(a + 1 + ""); +// pbtLingliao.setNum(a + 1 + ""); + pbt.setNum(pwBomNumber3.getNum()); + pbtLingliao.setNum(pwBomNumber3.getNum()); + s = pbt.getNum(); + a++; + pbt.setFigureNumber(pwBomNumber3.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber3.getFigureNumber()); + pbt.setName(pwBomNumber3.getName()); + pbtLingliao.setName(pwBomNumber3.getName()); + pbt.setOneNumber(pwBomNumber2.getOneNumber()*pwBomNumber3.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber2.getOneNumber()*pwBomNumber3.getOneNumber()); + pbt.setType(pwBomNumber3.getType()); + pbtLingliao.setType(pwBomNumber3.getType()); + pbt.setPieceWeight(pwBomNumber3.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber3.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber3.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber3.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber3.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber3.getParentLevelName()); + //把单台数量保存到本批数量中,最后单台数量乘以总台数,就是本批数量 + pbt.setSumNumber(pwBomNumber2.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber2.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber3.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber3.getTypeName()); + pbt.setRemarks(pwBomNumber3.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber3.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根据令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + //判断零部件的备注是否是借用件,如果为借用件则在累加了数量之后再添加一条新的数据,然后查找其是否有子集,如果有则把其所有子集再添加一次(数量全部为0) + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber3.getProductionCode(),pwBomNumber3.getName(),pwBomNumber3.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber3.getProductionCode(),typeName,pwBomNumber3.getName(),pwBomNumber3.getFigureNumber()); + if(null!=bomNumberTwo){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo.setOneNumber(bomNumberTwo.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo.setSumNumber(bomNumberTwo.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo); + + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao.setOneNumber(bomNumberTwoLingliao.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao.setSumNumber(bomNumberTwoLingliao.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + //继续查找下一级 + List listThree = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber3.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listThree.size()>0){ + int b = 0; + String y = ""; + for (PwBomNumber pwBomNumber4 : listThree) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber4.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber4.getProductionCode()); +// pbt.setNum(s + "." + (b+1)); +// pbtLingliao.setNum(s + "." + (b+1)); + pbt.setNum(pwBomNumber4.getNum()); + pbtLingliao.setNum(pwBomNumber4.getNum()); + y = pbt.getNum(); + b++; + pbt.setFigureNumber(pwBomNumber4.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber4.getFigureNumber()); + pbt.setName(pwBomNumber4.getName()); + pbtLingliao.setName(pwBomNumber4.getName()); + pbt.setOneNumber(pwBomNumber3.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber3.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber4.getType()); + pbtLingliao.setType(pwBomNumber4.getType()); + pbt.setPieceWeight(pwBomNumber4.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber4.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber4.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber4.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber4.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber4.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber3.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber3.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber4.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber4.getTypeName()); + pbt.setRemarks(pwBomNumber4.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber4.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号和名称(标准件图号相同,规格型号不同)查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber4.getProductionCode(),pwBomNumber4.getName(),pwBomNumber4.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao2 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber4.getProductionCode(),typeName,pwBomNumber4.getName(),pwBomNumber4.getFigureNumber()); + if(null!=bomNumberTwo2){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo2.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo2.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo2.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo2.setOneNumber(bomNumberTwo2.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo2.setSumNumber(bomNumberTwo2.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo2.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo2); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao2){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao2.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao2.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao2.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao2.setOneNumber(bomNumberTwoLingliao2.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao2.setSumNumber(bomNumberTwoLingliao2.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao2); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao2.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao2); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List listFour = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber4.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listFour.size()>0){ + int c = 0; + String t = ""; + for (PwBomNumber pwBomNumber5 : listFour) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber5.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber5.getProductionCode()); +// pbt.setNum(y+"."+(c+1)); +// pbtLingliao.setNum(y+"."+(c+1)); + pbt.setNum(pwBomNumber5.getNum()); + pbtLingliao.setNum(pwBomNumber5.getNum()); + t = pbt.getNum(); + c++; + pbt.setFigureNumber(pwBomNumber5.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber5.getFigureNumber()); + pbt.setName(pwBomNumber5.getName()); + pbtLingliao.setName(pwBomNumber5.getName()); + pbt.setOneNumber(pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber5.getType()); + pbtLingliao.setType(pwBomNumber5.getType()); + pbt.setPieceWeight(pwBomNumber5.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber5.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber5.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber5.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber5.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber5.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber5.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber5.getTypeName()); + pbt.setRemarks(pwBomNumber5.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber5.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber5.getProductionCode(),pwBomNumber5.getName(),pwBomNumber5.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao3 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber5.getProductionCode(),typeName,pwBomNumber5.getName(),pwBomNumber5.getFigureNumber()); + if(null!=bomNumberTwo3){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo3.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo3.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo3.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo3.setOneNumber(bomNumberTwo3.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo3.setSumNumber(bomNumberTwo3.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo3); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo3.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo3); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao3){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao3.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao3.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao3.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao3.setOneNumber(bomNumberTwoLingliao3.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao3.setSumNumber(bomNumberTwoLingliao3.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao3); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao3.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao3); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List listFive = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber5.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listFive.size()>0){ + int d = 0; + String g = ""; + for (PwBomNumber pwBomNumber6 : listFive) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber6.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber6.getProductionCode()); +// pbt.setNum(t + "." + (d+1)); +// pbtLingliao.setNum(t + "." + (d+1)); + pbt.setNum(pwBomNumber6.getNum()); + pbtLingliao.setNum(pwBomNumber6.getNum()); + g = pbt.getNum(); + d++; + pbt.setFigureNumber(pwBomNumber6.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber6.getFigureNumber()); + pbt.setName(pwBomNumber6.getName()); + pbtLingliao.setName(pwBomNumber6.getName()); + pbt.setOneNumber(pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber6.getType()); + pbtLingliao.setType(pwBomNumber6.getType()); + pbt.setPieceWeight(pwBomNumber6.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber6.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber6.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber6.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber6.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber6.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber6.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber6.getTypeName()); + pbt.setRemarks(pwBomNumber6.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber6.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo4 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber6.getProductionCode(),pwBomNumber6.getName(),pwBomNumber6.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao4 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber6.getProductionCode(),typeName,pwBomNumber6.getName(),pwBomNumber6.getFigureNumber()); + if(null!=bomNumberTwo4){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo4.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo4.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo4.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo4.setOneNumber(bomNumberTwo4.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo4.setSumNumber(bomNumberTwo4.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo4); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo4.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo4); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao4){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao4.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao4.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao4.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao4.setOneNumber(bomNumberTwoLingliao4.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao4.setSumNumber(bomNumberTwoLingliao4.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao4); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao4.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao4); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List listSix = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber6.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listSix.size()>0){ + int e = 0; + String u = ""; + for (PwBomNumber pwBomNumber7 : listSix) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber7.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber7.getProductionCode()); +// pbt.setNum(g +"."+(e+1)); +// pbtLingliao.setNum(g +"."+(e+1)); + pbt.setNum(pwBomNumber7.getNum()); + pbtLingliao.setNum(pwBomNumber7.getNum()); + u = pbt.getNum(); + e++; + pbt.setFigureNumber(pwBomNumber7.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber7.getFigureNumber()); + pbt.setName(pwBomNumber7.getName()); + pbtLingliao.setName(pwBomNumber7.getName()); + pbt.setOneNumber(pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber7.getType()); + pbtLingliao.setType(pwBomNumber7.getType()); + pbt.setPieceWeight(pwBomNumber7.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber7.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber7.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber7.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber7.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber7.getParentLevelName()); + pbt.setRemarks(pwBomNumber7.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber7.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber7.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber7.getTypeName()); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo5 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber7.getProductionCode(),pwBomNumber7.getName(),pwBomNumber7.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao5 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber7.getProductionCode(),typeName,pwBomNumber7.getName(),pwBomNumber7.getFigureNumber()); + if(null!=bomNumberTwo5){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo5.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo5.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo5.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo5.setOneNumber(bomNumberTwo5.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo5.setSumNumber(bomNumberTwo5.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo5); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo5.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo5); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao5){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao5.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao5.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao5.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao5.setOneNumber(bomNumberTwoLingliao5.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao5.setSumNumber(bomNumberTwoLingliao5.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao5); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao5.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao5); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List listSeven = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber7.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listSeven.size()>0){ + int f = 0; + for (PwBomNumber pwBomNumber8 : listSeven) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber8.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber8.getProductionCode()); +// pbt.setNum(u+"."+(f+1)); +// pbtLingliao.setNum(u+"."+(f+1)); + pbt.setNum(pwBomNumber8.getNum()); + pbtLingliao.setNum(pwBomNumber8.getNum()); + f++; + pbt.setFigureNumber(pwBomNumber8.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber8.getFigureNumber()); + pbt.setName(pwBomNumber8.getName()); + pbtLingliao.setName(pwBomNumber8.getName()); + pbt.setOneNumber(pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber8.getType()); + pbtLingliao.setType(pwBomNumber8.getType()); + pbt.setPieceWeight(pwBomNumber8.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber8.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber8.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber8.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber8.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber8.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber8.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber8.getTypeName()); + pbt.setRemarks(pwBomNumber8.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber8.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo6 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber8.getProductionCode(),pwBomNumber8.getName(),pwBomNumber8.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao6 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber8.getProductionCode(),typeName,pwBomNumber8.getName(),pwBomNumber8.getFigureNumber()); + if(null!=bomNumberTwo6){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo6.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo6.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo6.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo6.setOneNumber(bomNumberTwo6.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo6.setSumNumber(bomNumberTwo6.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo6); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo6.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo6); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao6){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao6.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao6.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao6.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao6.setOneNumber(bomNumberTwoLingliao6.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao6.setSumNumber(bomNumberTwoLingliao6.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao6); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao6.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao6); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List listEgint = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber8.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listEgint.size()>0){ + for (PwBomNumber pwBomNumber9 : listEgint) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber9.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber9.getProductionCode()); + pbt.setNum(pwBomNumber9.getNum()); + pbtLingliao.setNum(pwBomNumber9.getNum()); + pbt.setFigureNumber(pwBomNumber9.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber9.getFigureNumber()); + pbt.setName(pwBomNumber9.getName()); + pbtLingliao.setName(pwBomNumber9.getName()); + pbt.setOneNumber(pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber9.getType()); + pbtLingliao.setType(pwBomNumber9.getType()); + pbt.setPieceWeight(pwBomNumber9.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber9.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber9.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber9.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber9.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber9.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber9.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber9.getTypeName()); + pbt.setRemarks(pwBomNumber9.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber9.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo7 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber9.getProductionCode(),pwBomNumber9.getName(),pwBomNumber9.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao7 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber9.getProductionCode(),typeName,pwBomNumber9.getName(),pwBomNumber9.getFigureNumber()); + if(null!=bomNumberTwo7){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo7.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo7.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo7.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo7.setOneNumber(bomNumberTwo7.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo7.setSumNumber(bomNumberTwo7.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo7); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo7.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo7); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao7){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao7.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao7.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao7.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao7.setOneNumber(bomNumberTwoLingliao7.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao7.setSumNumber(bomNumberTwoLingliao7.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao7); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao7.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao7); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List listNigt = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber9.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listNigt.size()>0){ + for (PwBomNumber pwBomNumber10 : listNigt) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber10.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber10.getProductionCode()); + pbt.setNum(pwBomNumber10.getNum()); + pbtLingliao.setNum(pwBomNumber10.getNum()); + pbt.setFigureNumber(pwBomNumber10.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber10.getFigureNumber()); + pbt.setName(pwBomNumber10.getName()); + pbtLingliao.setName(pwBomNumber10.getName()); + pbt.setOneNumber(pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber10.getType()); + pbtLingliao.setType(pwBomNumber10.getType()); + pbt.setPieceWeight(pwBomNumber10.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber10.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber10.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber10.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber10.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber10.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber10.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber10.getTypeName()); + pbt.setRemarks(pwBomNumber10.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber10.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo8 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber10.getProductionCode(),pwBomNumber10.getName(),pwBomNumber10.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao8 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber10.getProductionCode(),typeName,pwBomNumber10.getName(),pwBomNumber10.getFigureNumber()); + if(null!=bomNumberTwo8){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo8.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo8.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo8.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo8.setOneNumber(bomNumberTwo8.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo8.setSumNumber(bomNumberTwo8.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo8); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo8.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo8); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao8){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao8.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao8.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao8.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao8.setOneNumber(bomNumberTwoLingliao8.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao8.setSumNumber(bomNumberTwoLingliao8.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao8); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao8.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao8); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List listTen = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber10.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(listTen.size()>0){ + for (PwBomNumber pwBomNumber11 : listTen) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber11.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber11.getProductionCode()); + pbt.setNum(pwBomNumber11.getNum()); + pbtLingliao.setNum(pwBomNumber11.getNum()); + pbt.setFigureNumber(pwBomNumber11.getFigureNumber()); + pbt.setFigureNumber(pwBomNumber11.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber11.getFigureNumber()); + pbt.setName(pwBomNumber11.getName()); + pbtLingliao.setName(pwBomNumber11.getName()); + pbt.setOneNumber(pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber11.getType()); + pbtLingliao.setType(pwBomNumber11.getType()); + pbt.setPieceWeight(pwBomNumber11.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber11.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber11.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber11.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber11.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber11.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber11.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber11.getTypeName()); + pbt.setRemarks(pwBomNumber11.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber11.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo9 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber11.getProductionCode(),pwBomNumber11.getName(),pwBomNumber11.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao9 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber11.getProductionCode(),typeName,pwBomNumber11.getName(),pwBomNumber11.getFigureNumber()); + if(null!=bomNumberTwo9){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo9.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo9.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo9.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo9.setOneNumber(bomNumberTwo9.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo9.setSumNumber(bomNumberTwo9.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo9); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo9.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo9); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao9){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao9.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao9.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao9.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao9.setOneNumber(bomNumberTwoLingliao9.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao9.setSumNumber(bomNumberTwoLingliao9.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao9); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao9.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao9); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List list11 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber11.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(list11.size()>0){ + for (PwBomNumber pwBomNumber12 : list11) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber12.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber12.getProductionCode()); + pbt.setNum(pwBomNumber12.getNum()); + pbtLingliao.setNum(pwBomNumber12.getNum()); + pbt.setFigureNumber(pwBomNumber12.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber12.getFigureNumber()); + pbt.setName(pwBomNumber12.getName()); + pbtLingliao.setName(pwBomNumber12.getName()); + pbt.setOneNumber(pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber12.getType()); + pbtLingliao.setType(pwBomNumber12.getType()); + pbt.setPieceWeight(pwBomNumber12.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber12.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber12.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber12.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber12.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber12.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber12.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber12.getTypeName()); + pbt.setRemarks(pwBomNumber12.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber12.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo10 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber12.getProductionCode(),pwBomNumber12.getName(),pwBomNumber12.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao10 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber12.getProductionCode(),typeName,pwBomNumber12.getName(),pwBomNumber12.getFigureNumber()); + if(null!=bomNumberTwo10){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo10.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo10.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo10.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo10.setOneNumber(bomNumberTwo10.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo10.setSumNumber(bomNumberTwo10.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo10); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo10.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo10); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao10){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao10.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao10.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao10.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao10.setOneNumber(bomNumberTwoLingliao10.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao10.setSumNumber(bomNumberTwoLingliao10.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao10); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao10.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao10); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List list12 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber12.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(list12.size()>0){ + for (PwBomNumber pwBomNumber13 : list12) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber13.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber13.getProductionCode()); + pbt.setNum(pwBomNumber13.getNum()); + pbtLingliao.setNum(pwBomNumber13.getNum()); + pbt.setFigureNumber(pwBomNumber13.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber13.getFigureNumber()); + pbt.setName(pwBomNumber13.getName()); + pbtLingliao.setName(pwBomNumber13.getName()); + pbt.setOneNumber(pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber13.getType()); + pbtLingliao.setType(pwBomNumber13.getType()); + pbt.setPieceWeight(pwBomNumber13.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber13.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber13.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber13.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber13.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber13.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber13.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber13.getTypeName()); + pbt.setRemarks(pwBomNumber13.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber13.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo11 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber13.getProductionCode(),pwBomNumber13.getName(),pwBomNumber13.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao11 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber13.getProductionCode(),typeName,pwBomNumber13.getName(),pwBomNumber13.getFigureNumber()); + if(null!=bomNumberTwo11){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo11.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo11.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo11.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo11.setOneNumber(bomNumberTwo11.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo11.setSumNumber(bomNumberTwo11.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo11); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo11.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo11); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao11){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao11.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao11.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao11.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao11.setOneNumber(bomNumberTwoLingliao11.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao11.setSumNumber(bomNumberTwoLingliao11.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao11); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao11.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao11); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List list13 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber13.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(list13.size()>0){ + for (PwBomNumber pwBomNumber14 : list13) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber14.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber14.getProductionCode()); + pbt.setNum(pwBomNumber14.getNum()); + pbtLingliao.setNum(pwBomNumber14.getNum()); + pbt.setFigureNumber(pwBomNumber14.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber14.getFigureNumber()); + pbt.setName(pwBomNumber14.getName()); + pbtLingliao.setName(pwBomNumber14.getName()); + pbt.setOneNumber(pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber14.getType()); + pbtLingliao.setType(pwBomNumber14.getType()); + pbt.setPieceWeight(pwBomNumber14.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber14.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber14.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber14.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber14.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber14.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber14.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber14.getTypeName()); + pbt.setRemarks(pwBomNumber14.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber14.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo12 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber14.getProductionCode(),pwBomNumber14.getName(),pwBomNumber14.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao12 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber14.getProductionCode(),typeName,pwBomNumber14.getName(),pwBomNumber14.getFigureNumber()); + if(null!=bomNumberTwo12){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo12.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo12.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo12.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo12.setOneNumber(bomNumberTwo12.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo12.setSumNumber(bomNumberTwo12.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo12); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo12.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo12); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao12){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao12.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao12.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao12.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao12.setOneNumber(bomNumberTwoLingliao12.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao12.setSumNumber(bomNumberTwoLingliao12.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao12); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao12.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao12); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List list14 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber14.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(list14.size()>0){ + for (PwBomNumber pwBomNumber15 : list14) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber15.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber15.getProductionCode()); + pbt.setNum(pwBomNumber15.getNum()); + pbtLingliao.setNum(pwBomNumber15.getNum()); + pbt.setFigureNumber(pwBomNumber15.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber15.getFigureNumber()); + pbt.setName(pwBomNumber15.getName()); + pbtLingliao.setName(pwBomNumber15.getName()); + pbt.setOneNumber(pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber15.getType()); + pbtLingliao.setType(pwBomNumber15.getType()); + pbt.setPieceWeight(pwBomNumber15.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber15.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber15.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber15.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber15.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber15.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber15.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber15.getTypeName()); + pbt.setRemarks(pwBomNumber15.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber15.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo13 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber15.getProductionCode(),pwBomNumber15.getName(),pwBomNumber15.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao13 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber15.getProductionCode(),typeName,pwBomNumber15.getName(),pwBomNumber15.getFigureNumber()); + if(null!=bomNumberTwo13){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo13.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo13.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo13.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo13.setOneNumber(bomNumberTwo13.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo13.setSumNumber(bomNumberTwo13.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo13); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo13.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo13); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao13){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao13.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao13.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao13.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao13.setOneNumber(bomNumberTwoLingliao13.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao13.setSumNumber(bomNumberTwoLingliao13.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao13); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao13.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao13); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + List list15 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber15.getFigureNumber(),typeName,pwBomNumber.getProductionCode()); + if(list15.size()>0){ + for (PwBomNumber pwBomNumber16 : list15) { + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber16.getProductionCode()); + pbtLingliao.setProductionCode(pwBomNumber16.getProductionCode()); + pbt.setNum(pwBomNumber16.getNum()); + pbtLingliao.setNum(pwBomNumber16.getNum()); + pbt.setFigureNumber(pwBomNumber16.getFigureNumber()); + pbtLingliao.setFigureNumber(pwBomNumber16.getFigureNumber()); + pbt.setName(pwBomNumber16.getName()); + pbtLingliao.setName(pwBomNumber16.getName()); + pbt.setOneNumber(pwBomNumber16.getOneNumber()*pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbtLingliao.setOneNumber(pwBomNumber16.getOneNumber()*pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()); + pbt.setType(pwBomNumber16.getType()); + pbtLingliao.setType(pwBomNumber16.getType()); + pbt.setPieceWeight(pwBomNumber16.getPieceWeight()); + pbtLingliao.setPieceWeight(pwBomNumber16.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber16.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber16.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber16.getParentLevelName()); + pbtLingliao.setParentLevelName(pwBomNumber16.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(pwBomNumber16.getOneNumber()*pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbtLingliao.setSumNumber(pwBomNumber16.getOneNumber()*pwBomNumber15.getOneNumber()*pwBomNumber14.getOneNumber()*pwBomNumber13.getOneNumber()*pwBomNumber12.getOneNumber()*pwBomNumber11.getOneNumber()*pwBomNumber10.getOneNumber()*pwBomNumber9.getOneNumber()*pwBomNumber8.getOneNumber()*pwBomNumber7.getOneNumber()*pwBomNumber6.getOneNumber()*pwBomNumber5.getOneNumber()*pwBomNumber4.getOneNumber()*pwBomNumber3.getOneNumber()*pwBomNumber2.getOneNumber()*pwBomNumber2.getSumNumber()); + pbt.setSparedOne(pwBomNumber16.getTypeName()); + pbtLingliao.setSparedOne(pwBomNumber16.getTypeName()); + pbt.setRemarks(pwBomNumber16.getRemarks()); + pbtLingliao.setRemarks(pwBomNumber16.getRemarks()); + pbt.setDelFlag(0); + pbtLingliao.setDelFlag(0); + + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + PwBomNumberTwo bomNumberTwo14 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(pwBomNumber16.getProductionCode(),pwBomNumber16.getName(),pwBomNumber16.getFigureNumber()); + PwBomNumberTwoLingliao bomNumberTwoLingliao14 = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(pwBomNumber16.getProductionCode(),typeName,pwBomNumber16.getName(),pwBomNumber16.getFigureNumber()); + if(null!=bomNumberTwo14){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo14.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo14.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo14.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo14.setOneNumber(bomNumberTwo14.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo14.setSumNumber(bomNumberTwo14.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo14); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo14.setSumNumber(0L); + pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo14); + }else{ + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + if(null!=bomNumberTwoLingliao14){ + //相同令号、型号和名称和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwoLingliao14.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwoLingliao14.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwoLingliao14.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwoLingliao14.setOneNumber(bomNumberTwoLingliao14.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwoLingliao14.setSumNumber(bomNumberTwoLingliao14.getSumNumber()+pbt.getSumNumber()); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(bomNumberTwoLingliao14); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwoLingliao14.setSumNumber(0L); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(bomNumberTwoLingliao14); + }else{ + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + + return AjaxResult.success(); + } + + /** + * 自动出企标单 + * + */ + private void addMakeDocuments() { + //查询预制单详情表没有预制单号的数据 + List list3 = pwMakeDocumentsDetailMapper.selectByMakeDocumentsCodeIsNull(); + //创建存储图纸类型的集合 + List li = new ArrayList(); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list3) { + //判断集合是否存在当前图号的标识 + int p = 0; + //遍历其图号 + String figureNumber = pwMakeDocumentsDetail.getFigureNumber(); + //判断图号中是否包函点 + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + String str1=figureNumber.substring(0, figureNumber.indexOf(".")); + for (String string : li) { + if(string.contains(str1)){ + p = 1; + } + } + if(p==0){ + //p = 0时说明集合中没有此型号 + li.add(str1); + } + } + } + //查看map的长度,长度为几,则创建几个预制单 + for (int j = 0; j < li.size(); j++) { + //创建预制单,然后把单据的code添加到相关的物料上 + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsMapper.selectList(); + //获取最后一条记录的code的,分解其code + String code = documents.getCode(); + String substring = code.substring(code.length()-6,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + String str = String.format("%03d", valueOf); + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + String substring2 = ss.substring(2); + //code + pwMakeDocuments.setCode("QB-XCL-"+str+"-"+substring2); + //单据名称 + pwMakeDocuments.setName(li.get(j)+"预制清单"); + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(li.get(j))){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) + pwMakeDocuments.setSparedOne("XCL"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(li.get(j)); + } + pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + //把code添加到预制单明细表包函当前图纸型号的物料上 + //查询预制单明细表(物料图号包函当前图号且code为null的数据) + List list4 = pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByFigureNumberAndCode(li.get(j)); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list4) { + pwMakeDocumentsDetail.setMakeDocumentsCode(pwMakeDocuments.getCode()); + pwMakeDocumentsDetailMapper.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + //自动添加工序 + //查询当前令号下所有的物料(不包含标准件和数量为0的数据,遍历此集合查询物料工序表,如果查询到则添加到bomtwo中) + List list5 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pwMakeDocumentsDetail.getName(),pwMakeDocumentsDetail.getFigureNumber()); + if(list5.size()>0){ + for (int js = 0; js < list5.size(); js++) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()+"-"+(js+1)); + //物料名称 + pwMakeDocumentsDetail2.setName(pwMakeDocumentsDetail.getName()+"-"+list5.get(js).getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pwMakeDocumentsDetail.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pwMakeDocumentsDetail.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pwMakeDocumentsDetail.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //派工部门 + if(null!=list5.get(js).getDispatchingDept()&&!"".equals(list5.get(js).getDispatchingDept())){ + pwMakeDocumentsDetail2.setDepartmentName(list5.get(js).getDispatchingDept()); + } + //把物料信息保存到物料表中 + ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null!=material){ + //先根据名称和图号查询库存信息表中有没有此数据 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null!=inventoryDetail){ + //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 + if(material.getMinimum()!=0&&material.getHighest()!=0){ + //判断库存数量+在途数量-锁定数量,是否小于等于最低安全库存数量 + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=material.getMinimum()){ + pwMakeDocumentsDetail2.setQuantity(material.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); + }else{ + pwMakeDocumentsDetail2.setQuantity(0L); + } + } + //预存数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail2.getQuantity()); + pwMakeDocumentsDetail2.setUsableQuantity(inventoryDetail.getQuantity()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + }else{ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //预存数量 + pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + }else{ + //添加物料信息 + ImMaterial imMaterial = new ImMaterial(); + //物料名称 + imMaterial.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + + imMaterialMapper.insertImMaterial(imMaterial); + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //预存数量 + pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); + //锁定数量 +// pwInventoryDetail.setLockNumber(pwMakeDocumentsDetail2.getQuantity()); + pwInventoryDetail.setLockNumber(0L); + //删除标记 + pwInventoryDetail.setDelFlag(0); + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + } + } + } + } + } + + /** + * 删除数量保存 + */ + @RequestMapping("/getWorkblankMuXiangs/{ids}") + public AjaxResult getWorkblankMuXiangs(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int k = 0; + for (Long id : ids) { + //根据id查询bom信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(id); + //根据code和产品型号查询领料单的申领数量 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCodeAndTypeName(bomNumberTwo.getProductionCode(), bomNumberTwo.getSparedOne()); + //如果领料单不为null,说明之前此单据领过料 + if(null!=stockRequisition){ + //修改申领数量 + stockRequisition.setGetStatus("未出库"); + int j = imStockRequisitionService.updateImStockRequisition(stockRequisition); + if(j<1){ + return AjaxResult.error("申领失败"); + } + //领料之前,判断此木箱是否以跟随装配领料申请领用了,如果没有,则新增,如果有,则不再新增 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + if(list.size()>0){ + //说明已经领用 + return AjaxResult.error("此物料已申请领用,无需重复申请"); + }else{ + //创建物料出库明细 + ImStockRequisitionMaterial stockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + stockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + stockRequisitionMaterial.setCode(stockRequisition.getCode()); + //物料名称 + stockRequisitionMaterial.setMaterialName(bomNumberTwo.getName()); + //物料图号 + stockRequisitionMaterial.setFigureNumber(bomNumberTwo.getFigureNumber()); + //材料 + stockRequisitionMaterial.setMaterials(bomNumberTwo.getType()); + //单重 + stockRequisitionMaterial.setPieceWeight(bomNumberTwo.getPieceWeight()); + //申请人 + stockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //应发数量 + stockRequisitionMaterial.setSalaryQuantity(bomNumberTwo.getSumNumber()); + //申请数量 + stockRequisitionMaterial.setApplyForQuantity(bomNumberTwo.getSumNumber()); + //已发数量 + stockRequisitionMaterial.setAlreadyQuantity(0L); + //实发数量 + stockRequisitionMaterial.setActualQuantityIssued(bomNumberTwo.getSumNumber()); + //出库状态 + stockRequisitionMaterial.setGetStatus("未出库"); + k = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(stockRequisitionMaterial); + if(k<0){ + return AjaxResult.error("申请出库失败"); + } + } + }else{ + return AjaxResult.error("装配未领料,不允许单独领用木箱"); + } + } + return AjaxResult.success(k); + } + + /** + * 甲供件申请质检入库 + */ + + @RepeatSubmit + @RequestMapping("/submitFormJiaGongJians") + public AjaxResult submitFormJiaGongJians(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + if(null==pwBomNumberTwo.getNumber()||"".equals(pwBomNumberTwo.getNumber())||pwBomNumberTwo.getNumber()==0){ + return AjaxResult.error("请输入申请入库数量"); + } + if(pwBomNumberTwo.getSumNumber() list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(cnp); + +// //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(bomNumberTwo2.getProductionCode()); + int s = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + s += pwCompletionNoticeProduct2.getActualQuantity(); + } + if(null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwBomNumberTwo.getNumber()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申请数量不可大于本批数量"); + }else{ + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //单价 +// imProductReceiptMaterial.setUnivalence(pwBomNumberTwo.getUnitPrice()); + //总价 +// imProductReceiptMaterial.setTotalPrices(pwBomNumberTwo.getUnitPrice()*pwBomNumberTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwBomNumberTwo.getNumber() == bomNumberTwo2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + //把添加入库单的id添加到质检单中 + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + } + }else{ + //如果等于null 则先添加待入库单和质检通知单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(code); + //关联令号 + imProductReceipt.setCode(code); + //项目名称 + imProductReceipt.setProjectName(pwProductionBill.getIllustrate()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + if(null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(code); + //根据生产令号查询项目名称 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + //保存项目名称 + pwCompletionNotice.setProjectName(productionBill.getProjectName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwo.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //单价 +// imProductReceiptMaterial.setUnivalence(pwBomNumberTwo.getUnitPrice()); + //总价 +// imProductReceiptMaterial.setTotalPrices(pwBomNumberTwo.getUnitPrice()*pwBomNumberTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwBomNumberTwo.getNumber()==pwBomNumberTwo.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBomNumberTwo.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + } + } + return toAjax(200); + } + + /** + * 查询合同详情的入库信息 + */ + @DeleteMapping("/listInfo/{ids}") + public TableDataInfo listInfo(@PathVariable Long[] ids){ + List list = new ArrayList(); + if(ids.length<1){ + return getDataTable(list); + } + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(ids[0]); + if(null!=pwBomNumberTwo.getSuperiorId()){ + pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getSuperiorId()); + } + + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + List list3 = new ArrayList(); + if(null != bomNumberTwo){ + list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); + } + //查询当前物料的质检,入库,出库等状态 + for (PwBomNumberTwo pwBomNumberTwo3 : list3) { + //查询领料数据 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo3.getFigureNumber().substring(pwBomNumberTwo3.getFigureNumber().lastIndexOf("-")+1); + List list5 = new ArrayList(); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1 == Integer.valueOf(substring)){ + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo3.getProductionCode(), pwBomNumberTwo3.getMaterialsName(), pwBomNumberTwo3.getMaterialsSpecification()); + }else{ + String figureNumber = pwBomNumberTwo3.getFigureNumber().substring(0,pwBomNumberTwo3.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo3.getProductionCode(), figureNumber); + } + //申请领料数量 + Long shenqingchuku = 0L; + //领料已发数量 + Long chuku = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list5) { + shenqingchuku += imStockRequisitionMaterial.getApplyForQuantity(); + chuku += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //申请领料数量 + pwBomNumberTwo3.setLen(shenqingchuku); + //已发领料数量 + pwBomNumberTwo3.setLingliaoNumber(chuku); + if(1 == Integer.valueOf(substring)&&(null==pwBomNumberTwo3.getMaterialsName()||"".equals(pwBomNumberTwo3.getMaterialsName()))){ + pwBomNumberTwo3.setInventoryStatus("无需领料"); + }else{ + if(chuku == 0){ + //未领料 + pwBomNumberTwo3.setInventoryStatus("未领料"); + }else{ + //已领料 + pwBomNumberTwo3.setInventoryStatus("已领料"); + } + } + + //查询质检数据 + List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo3.getProductionCode(), pwBomNumberTwo3.getName(), pwBomNumberTwo3.getFigureNumber()); + + //交检数量 + Long jiaojian = 0L; + //已检数量 + Long jianyan = 0L; + //累加其数量 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list2) { + jiaojian += pwCompletionNoticeProduct.getReceivableQuantity().longValue(); + jianyan += pwCompletionNoticeProduct.getQuantity().longValue(); + } + pwBomNumberTwo3.setWid(jiaojian); + pwBomNumberTwo3.setWorkblankTwo(jianyan); + + //查询入库数据 + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo3.getProductionCode(), pwBomNumberTwo3.getName(), pwBomNumberTwo3.getFigureNumber()); + + //申请入库数量 + Long shenqingruku = 0L; + //已入库数量 + Long ruku = 0L; + //累加其数量 + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + shenqingruku += imProductReceiptMaterial.getReceivableQuantity().longValue(); + ruku += imProductReceiptMaterial.getReceived().longValue(); + } + pwBomNumberTwo3.setLenTwo(shenqingruku); + pwBomNumberTwo3.setNumber(ruku); + //状态 + if(pwBomNumberTwo3.getSumNumber().equals(jianyan)){ + pwBomNumberTwo3.setInventoryStatus("已检验"); + } + if(pwBomNumberTwo3.getSumNumber().equals(ruku)){ + pwBomNumberTwo3.setInventoryStatus("已入库"); + } + + //查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo3.getName(), pwBomNumberTwo3.getFigureNumber()); + pwBomNumberTwo3.setWorkblank(inventoryDetail.getQuantity()); + } + if(null!=bomNumberTwo){ + bomNumberTwo.setChildren(list3); + } + list.add(bomNumberTwo); + return getDataTable(list); + } + + /** + * 上传bom信息 + * 王炎程序用 + */ + @RequestMapping("/uploadBomInfo") + public AjaxResult uploadBomInfo(@RequestBody String json){ + //解析收到的数据 +// JSONObject jsonObject = JSONObject.parseObject(json); + JSONArray jsonArray = JSONArray.parseArray(json); + for (Object object : jsonArray) { + JSONObject jsonObject = JSONObject.parseObject(object.toString()); + //令号 + String code = jsonObject.get("code").toString(); + //型号 + String typeName = jsonObject.get("typeName").toString(); + //序号 + String num = jsonObject.get("num").toString(); + //图号 + String figureNumber = jsonObject.get("figureNumber").toString(); + //名称 + String name = jsonObject.get("name").toString(); + //单台数量 + String oneNumber = jsonObject.get("oneNumber").toString(); + //材料 + String materials = jsonObject.get("materials").toString(); + //单重 + String pieceWeight = jsonObject.get("pieceWeight").toString(); + //父级图号 + String parentLevelFigureNumber = jsonObject.get("parentLevelFigureNumber").toString(); + //父级名称 + String parentLevelName = jsonObject.get("parentLevelName").toString(); + //本批数量 + String sumNumber = jsonObject.get("sumNumber").toString(); + //备注 + String remarks = jsonObject.get("remarks").toString(); + //有无库存标记 + String sparedTwo = jsonObject.get("sparedTwo").toString(); + //是否为工序标记 + String xuSign = jsonObject.get("xuSign").toString(); + //工序名称 + String processName = jsonObject.get("processName").toString(); + //派工部门 + String departmentName = jsonObject.get("departmentName").toString(); + //是否入库 + String godownEntry = jsonObject.get("godownEntry").toString(); + //完成日期 + String completionDate = jsonObject.get("completionDate").toString(); + //材料id + String materialId = jsonObject.get("materialId").toString(); + //下料长度 + String len = jsonObject.get("len").toString(); + //下料宽度 + String wid = jsonObject.get("wid").toString(); + //毛坯数量 + String workblank = jsonObject.get("workblank").toString(); + //序描述 + String xuDescribe = jsonObject.get("xuDescribe").toString(); + //工期描述 + String dateDescribe = jsonObject.get("dateDescribe").toString(); + //序工时 + String xuTime = jsonObject.get("xuTime").toString(); + //成品标记 + String finishedSign = jsonObject.get("finishedSign").toString(); + + System.out.println("code:"+code); + System.out.println("typeName:"+typeName); + System.out.println("num:"+num); + System.out.println("figureNumber:"+figureNumber); + System.out.println("name:"+name); + System.out.println("oneNumber:"+oneNumber); + System.out.println("materials:"+materials); + System.out.println("pieceWeight:"+pieceWeight); + System.out.println("parentLevelFigureNumber:"+parentLevelFigureNumber); + System.out.println("parentLevelName:"+parentLevelName); + System.out.println("sumNumber:"+sumNumber); + System.out.println("remarks:"+remarks); + System.out.println("sparedTwo:"+sparedTwo); + System.out.println("xuSign:"+xuSign); + System.out.println("processName"+processName); + System.out.println("departmentName"+departmentName); + System.out.println("godownEntry"+godownEntry); + System.out.println("completionDate"+completionDate); + System.out.println("materialId"+materialId); + System.out.println("len"+len); + System.out.println("wid"+wid); + System.out.println("workblank"+workblank); + } + + return AjaxResult.success(); + } + + /** + * 判断一个字符串是整数还是小数 + */ + public Boolean type(String str){ + if(null==str||"".equals(str)){ + return false; + } + boolean b = str.matches("-?\\d+(\\.\\d+)?"); + if(!b){ + return false; + } + Double valueOf = Double.valueOf(str); + if(valueOf%1==0.0){ + return true; + } + return false; + } + + /** + * 退料 + * @param pwBomNumberTwo + * @return + */ + @RequestMapping("/materialReturn") + public AjaxResult materialReturn(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + //修改bom单的领料数量 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + if(null == bomNumberTwo){ + return AjaxResult.error("出库单错误,检查数据是否正确!!"); + } + //根据物料名称,图号和生产单号查询本批领料状态及数量 + List materials = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(),bomNumberTwo.getName(),bomNumberTwo.getFigureNumber()); + if(null == materials || materials.size() == 0){ + return AjaxResult.error("没有找到已经领取的物料!!"); + } + //查询物料状态是在出库中还是已出库 + ImStockRequisition imStockRequisition = imStockRequisitionService.selectImStockRequisitionById(materials.get(0).getStockRequisitionId()); + if(null == imStockRequisition){ + return AjaxResult.error("出库单错误,检查数据是否正确!!"); + } + //判断是退库还是退库领料: 1退库 + if("1".equals(pwBomNumberTwo.getBiaoji())){ + bomNumberTwo.setLingliaoNumber(bomNumberTwo.getLingliaoNumber() - pwBomNumberTwo.getReturnNumber()); + int i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + if(i < 1){ + return AjaxResult.error("修改领料数量错误!!"); + } + //判断出库状态是已出库则修改为出库中 + if("已出库".equals(imStockRequisition.getGetStatus())){ + imStockRequisition.setGetStatus("出库中"); + i = imStockRequisitionService.updateImStockRequisition(imStockRequisition); + if(i < 1){ + return AjaxResult.error("修改出库状态错误!!"); + } + } + //修改出库单中的出库数量 + materials.get(0).setAlreadyQuantity(materials.get(0).getAlreadyQuantity() - pwBomNumberTwo.getReturnNumber()); //已领数量 + materials.get(0).setActualQuantityIssued(materials.get(0).getActualQuantityIssued() - pwBomNumberTwo.getReturnNumber()); // 本批实际领取数量 + materials.get(0).setInventoryQuantity(pwBomNumberTwo.getReturnNumber()); //存储退货数量 + if("已出库".equals(materials.get(0).getGetStatus())){ + materials.get(0).setGetStatus("出库中"); + } + i = iImStockRequisitionMaterialService.updateImStockRequisitionMaterial(materials.get(0)); + if(i < 1){ + return AjaxResult.error("修改出库单数量错误!!"); + } + //新增入库操作 + EvoInOutStorageManagement evoInOutStorageManagement = new EvoInOutStorageManagement(); + evoInOutStorageManagement.setMaterialName(bomNumberTwo.getName()); + evoInOutStorageManagement.setFigureNumber(bomNumberTwo.getFigureNumber()); + evoInOutStorageManagement.setMaterials(materials.get(0).getMaterials()); + evoInOutStorageManagement.setApproveTime(new Date()); + evoInOutStorageManagement.setFlag("0"); + evoInOutStorageManagement.setStatus("2"); + evoInOutStorageManagement.setApplicant(SecurityUtils.getLoginUser().getUser().getNickName()); + evoInOutStorageManagement.setUseTo(bomNumberTwo.getProductionCode() + "的退料(TL)" ); + evoInOutStorageManagement.setQuantity(pwBomNumberTwo.getReturnNumber()); + evoInOutStorageManagement.setUnit(materials.get(0).getUnit()); + evoInOutStorageManagement.setInOutFlag("1"); + return evoInOutStorageManagementService.insertEvoInOutStorageManagement(evoInOutStorageManagement); + }else{ //退料领料 + //判断是否为空,存储已领的个数 + if(materials.get(0).getSparedFour() == null){ + materials.get(0).setSparedFour(0l); + } + if(materials.get(0).getInventoryQuantity() < pwBomNumberTwo.getReturnNumber() + materials.get(0).getSparedFour()){ + return AjaxResult.error("领料数量大于退料数量!!"); + } + //修改领料数量 + bomNumberTwo.setLingliaoNumber(bomNumberTwo.getLingliaoNumber() + pwBomNumberTwo.getReturnNumber()); + int i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + if(i < 1){ + return AjaxResult.error("修改领料数量错误!!"); + } + //修改出库单中的出库数量 + materials.get(0).setAlreadyQuantity(materials.get(0).getAlreadyQuantity() + pwBomNumberTwo.getReturnNumber()); //已领数量 + materials.get(0).setActualQuantityIssued(materials.get(0).getActualQuantityIssued() + pwBomNumberTwo.getReturnNumber()); // 本批实际领取数量 + materials.get(0).setSparedFour(pwBomNumberTwo.getReturnNumber() + materials.get(0).getSparedFour()); //退料领料数量 + //判断是否出料完成 + if(materials.get(0).getSalaryQuantity() == materials.get(0).getAlreadyQuantity()){ + materials.get(0).setGetStatus("已出库"); + } + i = iImStockRequisitionMaterialService.updateImStockRequisitionMaterial(materials.get(0)); + if(i < 1){ + return AjaxResult.error("修改出库单数量错误!!"); + } + //查询执行单下的物料是否领完 + ImStockRequisitionMaterial istm = new ImStockRequisitionMaterial(); + istm.setCode(materials.get(0).getCode()); + istm.setStockRequisitionId(materials.get(0).getStockRequisitionId()); + List outMaterials = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialList(istm); + int p = 0; //是否全部出库标识 + for(ImStockRequisitionMaterial m : outMaterials){ + if(!"已出库".equals(m.getGetStatus())){ + p = 1; + break; + } + } + if(p == 0){ + imStockRequisition.setGetStatus("已出库"); + i = imStockRequisitionService.updateImStockRequisition(imStockRequisition); + if(i < 1){ + return AjaxResult.error("修改出库状态错误!!"); + } + } + //新增入库操作 + EvoInOutStorageManagement evoInOutStorageManagement = new EvoInOutStorageManagement(); + evoInOutStorageManagement.setMaterialName(bomNumberTwo.getName()); + evoInOutStorageManagement.setFigureNumber(bomNumberTwo.getFigureNumber()); + evoInOutStorageManagement.setMaterials(materials.get(0).getMaterials()); + evoInOutStorageManagement.setApproveTime(new Date()); + evoInOutStorageManagement.setFlag("0"); + evoInOutStorageManagement.setStatus("2"); + evoInOutStorageManagement.setApplicant(SecurityUtils.getLoginUser().getUser().getNickName()); + evoInOutStorageManagement.setUseTo(bomNumberTwo.getProductionCode() + "的退料领料(TLLL)"); + evoInOutStorageManagement.setQuantity(pwBomNumberTwo.getReturnNumber()); + evoInOutStorageManagement.setUnit(materials.get(0).getUnit()); + evoInOutStorageManagement.setInOutFlag("0"); + return evoInOutStorageManagementService.insertEvoInOutStorageManagement(evoInOutStorageManagement); + } + } + + /** + * 导入工艺 + * @param file + * @param updateSupport + * @return + * @throws Exception + */ + @PostMapping("/importBom") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { + ExcelUtil util = new ExcelUtil(PwBomNumberTwo.class); + List bomList = util.importExcel(file.getInputStream()); + return pwBomNumberTwoService.importData(bomList); + } + + /** + * 新增工艺添加 + */ + @RepeatSubmit + @PostMapping("/addProcessNew") + @Transactional + public AjaxResult addProcessNew(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + //获取工艺 + String process_str = pwBomNumberTwo.getTableData(); + if(StringUtils.isEmpty(process_str)){ + return AjaxResult.error("请添加工序!!"); + } + //判断物料是否添加过工艺 + List gx_list_flag = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getId()); + if(null != gx_list_flag && gx_list_flag.size() > 0){ + return AjaxResult.error("已添加工序,不能重复添加!!"); + } + PwBomNumberTwo bomTwo = null; + //JdProcessBom jdProcessBom = null; + //获取原材料 + String process_ycl = pwBomNumberTwo.getTableSon(); + int y = 0; + if(StringUtils.isNotEmpty(process_ycl) && !Constants.JD_RESULT.equals(process_ycl)){ + JSONArray ycl_arrays = JSONArray.parseArray(process_ycl); + y = ycl_arrays.size(); + //循环把原材料添加到ERP + for(int i=0;i copy_list = pwBomNumberTwoService.queryProcessByCodeAndFigureNumber(pwBomNumberTwo.getId()); + PwGxProcess pwProcess = pwGxProcessService.queryPwGxProcesssByFigureNumber(figureNumber); + //判断备份序是否与其中一套相同 + if(StringUtils.isNull(pwProcess)){ + PwGxProcess process = null; + Long proc_str = null; + for(PwBomNumberTwo pBomNumberTwo : copy_list){ + process = new PwGxProcess(); + process.setFigureNumber(pBomNumberTwo.getFigureNumber()); + process.setName(pBomNumberTwo.getName()); + if(StringUtils.isNotNull(proc_str)){ + process.setParentId(proc_str); //父级ID标识 + } + process.setDispatchingDept(pBomNumberTwo.getDepartmentName()); + if(StringUtils.isNotNull(pBomNumberTwo.getSuperiorId()) && StringUtils.isEmpty(pBomNumberTwo.getDepartmentName())){ + process.setWorkblank(pBomNumberTwo.getPieceWeight()+""); + }else{ + process.setWorkblank(pBomNumberTwo.getOneNumber().toString()); + } + process.setRemarks(pBomNumberTwo.getXuDescribe()); + process.setSerialTime(pBomNumberTwo.getXuTime().longValue()); + process.setMaterials(pBomNumberTwo.getType()); + process.setDelFlag("0"); + pwGxProcessService.insertPwGxProcess(process); + if(pBomNumberTwo.getSuperiorId() == null){ + proc_str = process.getId(); + } + } + } + + //根据生产令号查询是否推送过金蝶 + List jdBom_list = jdBomRecordService.selectJdBomRecordByCode(pwBomNumberTwo.getProductionCode()); + if(jdBom_list == null || jdBom_list.size() == 0){ + jdBom_list = new ArrayList(); + //根据生产执行单,查询总BOM + List pwBom_list = pwBomNumberService.queryPwBomNumberZTByCode(pwBomNumberTwo.getProductionCode()); + //根据序号查询是哪个产品的序 + JdBomRecord jdBomRecord = null; + if(null != pwBom_list || pwBom_list.size() > 0){ + for(PwBomNumber pwBomNumber: pwBom_list){ + jdBomRecord = new JdBomRecord(); + jdBomRecord.setProductName(pwBomNumber.getName()); + jdBomRecord.setFigureNumber(pwBomNumber.getFigureNumber()); + jdBomRecord.setCreateTime(new Date()); + jdBomRecord.setProductCode(pwBomNumberTwo.getProductionCode()); + jdBomRecord.setStatus(Constants.AUDIT_STATUS_DSH); + jdBomRecord.setDelFlag("0"); + int r = jdBomRecordService.insertJdBomRecord(jdBomRecord); + if(r < 1){ + return AjaxResult.error("填写审核表信息错误!!"); + } + jdBom_list.add(jdBomRecord); + } + } + } + + //查询物料是否已做工艺 + jdProcessBom = jdProcessBomService.selectJdProcessBomByFigurenumber(pwBomNumberTwo.getFigureNumber()); + if(jdProcessBom == null){ + jdProcessBom = new JdProcessBom(); + jdProcessBom.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + jdProcessBom.setProductCode(pwBomNumberTwo.getProductionCode()); + jdProcessBom.setMaterials(pwBomNumberTwo.getType()); + jdProcessBom.setRemarks(pwBomNumberTwo.getRemarks()); + jdProcessBom.setProductName(pwBomNumberTwo.getName()); + jdProcessBom.setParentFigureNumber(pwBomNumberTwo.getParentLevelFigureNumber()); + jdProcessBom.setParentProductName(pwBomNumberTwo.getParentLevelName()); + jdProcessBom.setWeight(pwBomNumberTwo.getPieceWeight()+""); + jdProcessBom.setCreateTime(new Date()); + jdProcessBom.setStatus(Constants.AUDIT_STATUS_DSH); + jdProcessBom.setPushStatus(Constants.PUSH_STATUS_WTS); + jdProcessBom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_ZZ); + int r = jdProcessBomService.insertJdProcessBom(jdProcessBom); + if(r < 1){ + return AjaxResult.error("添加工艺详情错误!!"); + } + //获取需要推送金蝶的工艺 + List bom_list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(jdProcessBom.getProductCode(),pwBomNumberTwo.getId()); + //解析工艺为金蝶工艺 + int biaoji = 0; //标识上一序,0为自制,1为委外 + JdProcessBom jdProcessBom1 = null; + JdProcessBom pbom = null; + Long id = 0l; //上一序的ID + int xTime = 0; //序工时 + String gx_apre = ""; + for(int p=bom_list.size()-1;p>y-1;p--){ + jdProcessBom1 = new JdProcessBom(); + //根据名称查询工艺 + PwProcessOrDept processDept = pwProcessOrDeptService.selectPwProcessOrDeptByProcessName(bom_list.get(p).getProcessName()); + if(StringUtils.isNotEmpty(processDept.getAbbreviation())){ + //假如最后一序为外协,则此物料属性为委外 + if(p == bom_list.size()-1){ + if(Constants.PROCESS_TYPE.equals(processDept.getAbbreviation())){ + jdProcessBom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WG); + jdProcessBom1.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WG); + }else{ + //修改上一序的属性和图号 + jdProcessBom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WW); + jdProcessBom1.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WW); + } + jdProcessBomService.updateJdProcessBom(jdProcessBom); + //设置父级图号 + jdProcessBom1.setParentFigureNumber(pwBomNumberTwo.getFigureNumber()); + }else{ + //修改上一序的属性和图号 + pbom = new JdProcessBom(); + pbom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WW); + if(biaoji == 0){ + pbom.setFigureNumber(figureNumber +"-"+ processDept.getAbbreviation() + "-ZZ"); + } + pbom.setId(id); + jdProcessBomService.updateJdProcessBom(pbom); + //设置父级图号 + jdProcessBom1.setParentFigureNumber(pbom.getFigureNumber()); + } + jdProcessBom1.setFigureNumber(figureNumber + "-" + processDept.getAbbreviation()); + jdProcessBom1.setProductName(gxName); + jdProcessBom1.setParentProductName(pwBomNumberTwo.getName()); + jdProcessBom1.setMaterials(pwBomNumberTwo.getType()); + jdProcessBom1.setWeight(jdProcessBom.getWeight()); + jdProcessBom1.setXuTime(bom_list.get(p).getXuTime().intValue()); + jdProcessBom1.setParentId(jdProcessBom.getId()); + jdProcessBomService.insertJdProcessBom(jdProcessBom1); + biaoji = 1; + id = jdProcessBom1.getId(); //保存上一序id + gx_apre = processDept.getAbbreviation(); + }else{ + if(biaoji == 0 && p != bom_list.size()-1){ + //修改上序工时 + pbom = new JdProcessBom(); + pbom.setXuTime(xTime + bom_list.get(p).getXuTime().intValue()); + pbom.setId(id); + jdProcessBomService.updateJdProcessBom(pbom); + xTime = pbom.getXuTime(); + continue; + } + if(p != bom_list.size()-1){ + jdProcessBom1.setParentFigureNumber(figureNumber +"-"+ gx_apre); + //修改上序属性 + pbom = new JdProcessBom(); + pbom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_ZZ); + pbom.setId(id); + jdProcessBomService.updateJdProcessBom(pbom); + }else{ + jdProcessBom1.setParentFigureNumber(pwBomNumberTwo.getFigureNumber()); + } + jdProcessBom1.setFigureNumber(figureNumber + "-" + "ZZ"); + jdProcessBom1.setProductName(gxName); + jdProcessBom1.setParentProductName(pwBomNumberTwo.getName()); + jdProcessBom1.setMaterials(pwBomNumberTwo.getType()); + jdProcessBom1.setWeight(jdProcessBom.getWeight()); + jdProcessBom1.setXuTime(bom_list.get(p).getXuTime().intValue()); + jdProcessBom1.setParentId(jdProcessBom.getId()); + jdProcessBomService.insertJdProcessBom(jdProcessBom1); + biaoji = 0; + id = jdProcessBom1.getId(); //保存上一序id + xTime = jdProcessBom1.getXuTime(); + } + } + + //查询金蝶工艺,最后一序的特殊处理 + List JdBom_list = jdProcessBomService.queryJdProcessByPatentId(jdProcessBom.getId()); + int flag = 0; //标识最后一序是订购 0不是订购 + Long pre_id = 0l; + for(int j=JdBom_list.size()-1;j>=0;j--){ + if(j == JdBom_list.size()-1){ + if("-DZ".equals(JdBom_list.get(j).getFigureNumber().substring(JdBom_list.get(j).getFigureNumber().length()-3))){ + flag = 1; + pre_id = JdBom_list.get(j).getId(); + JdBom_list.get(j).setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WG); + jdProcessBomService.updateJdProcessBom(JdBom_list.get(j)); + if(JdBom_list.size() == 1){ + //修改BOM 物料属性 + pwBomNumberService.updatePwBomNumberByCodeAndFigureNumber(Constants.MATERIAL_ATTRIBUTE_WG,jdProcessBom.getProductCode(),jdProcessBom.getFigureNumber()); + //金蝶工艺工序 + jdProcessBomService.deleteJdProcessBomById(jdProcessBom.getId()); + jdProcessBomService.deleteJdProcessBomById(pre_id); + break; + } + }else if("-ZZ".equals(JdBom_list.get(j).getFigureNumber().substring(JdBom_list.get(j).getFigureNumber().length()-3))){ + jdProcessBomService.deleteJdProcessBomById(JdBom_list.get(j).getId()); + continue; + }else{ + JdBom_list.get(j).setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WW); + jdProcessBomService.updateJdProcessBom(JdBom_list.get(j)); + continue; + } + } + if(j == JdBom_list.size()-2 && flag == 1){ + if("-ZZ".equals(JdBom_list.get(j).getFigureNumber().substring(JdBom_list.get(j).getFigureNumber().length()-3))){ + pbom = new JdProcessBom(); + pbom.setId(pre_id); + pbom.setParentFigureNumber(JdBom_list.get(j).getParentFigureNumber()); + jdProcessBomService.updateJdProcessBom(pbom); + jdProcessBomService.deleteJdProcessBomById(JdBom_list.get(j).getId()); + }else{ + JdBom_list.get(j).setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WG); + jdProcessBomService.updateJdProcessBom(JdBom_list.get(j)); + //删除外购序 + jdProcessBomService.deleteJdProcessBomById(pre_id); + } + } + } + if(null != jdProcessBom){ + //查询金蝶最后一序 + List last_list = jdProcessBomService.queryJdProcessByPatentId(jdProcessBom.getId()); + //添加原材料 + if(StringUtils.isNotEmpty(process_ycl) && !Constants.JD_RESULT.equals(process_ycl)){ + JSONArray ycl_arrays = JSONArray.parseArray(process_ycl); + JdProcessBom jpBom = null; + //循环把原材料添加到ERP和金蝶 + for(int i=0;i record_List = jdProcessBomService.queryJdProcessByProductCode(pwBomNumberTwo.getProductionCode()); + //记录审核的数据量,0为没有审核的数据 + int a = 0; + for(JdProcessBom jdBom : record_List){ + if(Constants.AUDIT_STATUS_YSH.equals(jdBom.getStatus())){ + a += 1; + } + } + if(a == 0){ + record.setStatus(Constants.AUDIT_STATUS_DSH); + }else if(a == record_List.size()){ + record.setStatus(Constants.AUDIT_STATUS_YSH); + }else { + record.setStatus(Constants.AUDIT_STATUS_SHZ); + } + jdBomRecordService.updateJdBomRecord(record); + return AjaxResult.success(); + } + }*/ + return AjaxResult.success(); + } + + + @GetMapping("/callProcess") + public List listZaiTuByInventoryDetailId(PwBomNumberTwo pwBomNumberTwo){ + List res_list = new ArrayList(); + //判断物料是否添加过工艺 + List gx_list_flag = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getId()); + if(null != gx_list_flag && gx_list_flag.size() > 0){ + return res_list; + } + //查询所有此物料的工序 + PwGxProcess pwProcess = pwGxProcessService.queryPwGxProcesssByFigureNumber(pwBomNumberTwo.getFigureNumber()); + if(pwProcess == null){ + return res_list; + } + List list = pwGxProcessService.selectPwGxProcessByParengId(pwProcess.getId()); + list.add(0,pwProcess); + res_list.addAll(list); + return res_list; + } + + @GetMapping("/queryCallProcessListByProcess") + public AjaxResult queryCallProcessListByProcess(PwBomNumberTwo pwBomNumberTwo){ + PwGxProcess pwGxProcess = pwGxProcessService.selectPwMaterialProcessById(pwBomNumberTwo.getId()); + //插入工序 + PwBomNumberTwo bomTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwGxProcess.getFigureNumber()); + PwBomNumberTwo pwbomTwo = null; + List process_list = pwGxProcessService.selectPwGxProcessByParengId(pwBomNumberTwo.getId()); + for(PwGxProcess process : process_list){ + pwbomTwo = new PwBomNumberTwo(); + pwbomTwo.setNum(bomTwo.getNum()); + pwbomTwo.setProductionCode(pwBomNumberTwo.getProductionCode()); + pwbomTwo.setSparedOne(bomTwo.getSparedOne()); + pwbomTwo.setFigureNumber(process.getFigureNumber()); + pwbomTwo.setName(process.getName()); + pwbomTwo.setType(bomTwo.getType()); + pwbomTwo.setOneNumber(bomTwo.getOneNumber()); + pwbomTwo.setSumNumber(bomTwo.getSumNumber()); + if("015".equals(process.getFigureNumber().substring(0,3))){ + pwbomTwo.setPieceWeight(Double.valueOf(process.getWorkblank())); + } + //把上级id赋值给当前需要添加的工序 + pwbomTwo.setSuperiorId(bomTwo.getId()); + pwbomTwo.setDepartmentName(process.getDispatchingDept()); + pwbomTwo.setXuTime(process.getSerialTime().doubleValue()); + pwbomTwo.setXuDescribe(process.getRemarks()); + pwbomTwo.setParentLevelName(bomTwo.getName()); + pwbomTwo.setParentLevelFigureNumber(bomTwo.getFigureNumber()); + pwbomTwo.setDelFlag(0); + int ii = pwBomNumberTwoService.insertPwBomNumberTwo(pwbomTwo); + if(ii < 1){ + return AjaxResult.error("添加工序失败!!"); + } + } + return AjaxResult.success(); + } + + /** + * 提交工艺,生成ZIP包 + * @param bomNumberTwo + * @return + */ + @GetMapping("/commitProcess") + public AjaxResult commitProcess(PwBomNumberTwo bomNumberTwo){ + + SimpleDateFormat sdf= new SimpleDateFormat("MM月dd日"); + String code = bomNumberTwo.getProductionCode(); + + //创建bom表查看图纸的文件夹(去掉页码的pdf,可供于bom表直接点击查看图纸) + File filesBom = new File(dwgAndPdf+code+"/bom"); + if (!filesBom.exists()) { + filesBom.mkdir(); + } + + //创建zip压缩文件夹,把没有库存的图复制到此文件夹下等待压缩 + File files = new File(dwgAndPdf+code+"/zip"); + if (!files.exists()) { + files.mkdir(); + } + + FileInputStream fileInputStream = null; + FileOutputStream fileOutputStream = null; + //根据令号查询当前令号下没有库存且不是标准件的图号 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCode(code); + for (PwBomNumberTwo pwBomNumberTwo : list) { + //获取图号,根据图号去服务器pdf文件夹下找对应的图纸 + String figureNumber = pwBomNumberTwo.getFigureNumber(); + // 根据当前物料的id查询其所有工序子集 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + //把所有工序拼接成字符串 + String clName = ""; + String clth = ""; + String clyl = ""; + int gs = 0; //定义原材料个数 + for(int r=0;r> reviews = new ArrayList<>(); + Map review = new HashMap<>(); + Map rev = null; + Map xu = null; + Map zzck = new HashMap<>(); + float[] pawX = null; + float[] pawY = null; + //坐标个数为工序个数加序描述行数 ,10个字换行 + int x = gongxu.length + 2; + if(x > 2){ + for(int p=0;p(); + rev.put("result", gongxu[zz]); + rev.put("type", "1"); + reviews.add(rev); + cs -= 18; + if(StringUtils.isEmpty(xumiaoshu[zz])){ + zz += 1; + continue; + }else{ + if(xumiaoshu[zz].length()%10 == 0){ + z = xumiaoshu[zz].length()/10; + }else{ + z = xumiaoshu[zz].length()/10 + 1; + } + } + for(int a=0;a(); + if(a == z-1){ + xu.put("result", xumiaoshu[zz].substring(a*10)); + }else{ + xu.put("result", xumiaoshu[zz].substring(a*10,a*10+10)); + } + xu.put("type", "1"); + reviews.add(xu); + cs -= 18; + } + p += z; + zz += 1; + } + }else{ + pawX = new float[2]; + pawY = new float[2]; + } + // 获取文件名(图号),根据图号查询表中数量 + review.put("result", cailiao); + review.put("type", "1"); + reviews.add(review); + pawX[x - 2] = 30; + pawY[x - 2] = height-20; + zzck.put("result", width+" * "+height); + zzck.put("type", "1"); + reviews.add(zzck); + pawX[x - 1] = width-100; + pawY[x - 1] = height-20; + //把当前zip路径下的所有图片添加上图纸章水印 + String zhang = "tuzhizhang.png"; + try { + pd.imageWatermark(dwgAndPdf+code+"/"+replaceAll+"-pdf/" + name, dwgAndPdf+code+"/new/" + name, "D:/java/"+zhang, reviews, pawX, pawY); + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.error(); + } + } catch (Exception e) { + // TODO: handle exception + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + }else if( + na.contains("--2-1")||na.contains("--2-2") + ||na.contains("--3-1")||na.contains("--3-2")||na.contains("--3-3") + ||na.contains("--4-1")||na.contains("--4-2")||na.contains("--4-3")||na.contains("--4-4") + ||na.contains("--5-1")||na.contains("--5-2")||na.contains("--5-3")||na.contains("--5-4")||na.contains("--5-5") + ||na.contains("--6-1")||na.contains("--6-2")||na.contains("--6-3")||na.contains("--6-4")||na.contains("--6-5")||na.contains("--6-6") + ||na.contains("XCL.1-1")||na.contains("XCL.1-2")||na.contains("XCL.1-3")||na.contains("XCL.1-4")||na.contains("XCL.1-5") + ||na.contains("XCL.2-1")||na.contains("XCL.2-2")||na.contains("XCL.2-3")||na.contains("XCL.2-4")||na.contains("XCL.2-5") + ){ + try { + //获取要复制的文件 + File oldfile = new File(dwgAndPdf+code+"/"+replaceAll+"-pdf/" + name); + //文件输入流,用于读取要复制的文件 + fileInputStream = new FileInputStream(oldfile); + //要生成的新文件(指定路径如果没有则创建) + File newfile = new File(dwgAndPdf+code+"/new/" + name); + //获取父目录 + File fileParent = newfile.getParentFile(); + if(fileParent.exists()){ + fileParent.delete(); + } + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfile.exists()){ + newfile.delete(); + } + //判断文件是否存在 + if (!newfile.exists()) { + //创建文件 + newfile.createNewFile(); + }else{ + continue; + } + //把当前zip路径下所有的图片添加上文字水印 + List> reviews = new ArrayList<>(); + Map review = new HashMap<>(); + Map rev = null; + Map xu = null; + Map zzck = new HashMap<>(); + float[] pawX = null; + float[] pawY = null; + //坐标个数为工序个数加序描述行数 ,11个字换行 + int x = gongxu.length + 2; + if(x > 2){ + for(int p=0;p(); + rev.put("result", gongxu[zz]); + rev.put("type", "1"); + reviews.add(rev); + cs -= 18; + if(StringUtils.isEmpty(xumiaoshu[zz])){ + zz += 1; + continue; + }else{ + if(xumiaoshu[zz].length()%10 == 0){ + z = xumiaoshu[zz].length()/10; + }else{ + z = xumiaoshu[zz].length()/10 + 1; + } + } + for(int a=0;a(); + if(a == z-1){ + xu.put("result", xumiaoshu[zz].substring(a*10)); + }else{ + xu.put("result", xumiaoshu[zz].substring(a*10,a*10+10)); + } + xu.put("type", "1"); + reviews.add(xu); + cs -= 18; + } + p += z; + zz += 1; + } + }else{ + pawX = new float[2]; + pawY = new float[2]; + } + // 获取文件名(图号),根据图号查询表中数量 + review.put("result", cailiao); + review.put("type", "1"); + reviews.add(review); + pawX[x - 2] = 30; + pawY[x - 2] = height-20; + zzck.put("result", width+" * "+height); + zzck.put("type", "1"); + reviews.add(zzck); + pawX[x - 1] = width-100; + pawY[x - 1] = height-20; + //把当前zip路径下的所有图片添加上图纸章水印 + String zhang = "tuzhizhang.png"; + try { + pd.imageWatermark(dwgAndPdf+code+"/"+replaceAll+"-pdf/" + name, dwgAndPdf+code+"/new/" + name, "D:/java/"+zhang, reviews, pawX, pawY); + } catch (Exception e) { + e.printStackTrace(); + } + } catch (Exception e) { + // TODO: handle exception + return AjaxResult.error(); + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + } + File file = new File(dwgAndPdf + code + "/zip/"+ code + ".zip"); + if (file.exists()) { + file.delete(); + } + + // 把当前文件夹下所有的文件打包,把路径保存到数据库 + boolean flag = FileToZip.fileToZip(dwgAndPdf + code + "/zip", dwgAndPdf + code + "/zip", code); + if (flag) { + //生产令号打标记 + pwProductionBillMapper.updatePwProductionBillByCode(code,"1"); + return AjaxResult.success(code); + } else { + return AjaxResult.error(); + } + } + + /** + * 新增单条数据 + * @param pwBomNumberTwo + * @return + */ + @RepeatSubmit + @PostMapping("/addProcessByOnlyOne") + @Transactional + public AjaxResult addProcessByOnlyOne(@RequestBody PwBomNumberTwo pwBomNumberTwo){ + int p = 0; //序标识 + String figureNumber = ""; //图号 + String name = ""; //名称 + //获取第几序添加和图号,名称 + if(pwBomNumberTwo.getName().indexOf("(M)") == -1){ + figureNumber = pwBomNumberTwo.getFigureNumber(); + p = 0; + name = pwBomNumberTwo.getName(); + }else{ + figureNumber = pwBomNumberTwo.getFigureNumber().substring(0,pwBomNumberTwo.getFigureNumber().lastIndexOf("-")); + p = Integer.parseInt(pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1)); + name = pwBomNumberTwo.getName().substring(0,pwBomNumberTwo.getName().lastIndexOf("-")); + } + //查询物料的所有工序,不包含原材料 + List list = null; + if(p == 0){ + list = pwBomNumberTwoService.queryProcessByParentId(pwBomNumberTwo.getId()); + }else{ + list = pwBomNumberTwoService.queryProcessByParentId(pwBomNumberTwo.getSuperiorId()); + } + //查询工序信息 + PwProcessOrDept processOrDept = pwProcessOrDeptService.selectPwProcessOrDeptByProcessName(pwBomNumberTwo.getProcessName()); + PwBomNumberTwo bomNumberTwo = new PwBomNumberTwo(); + if(list == null || list.size() == 0 || p == 0){ + bomNumberTwo.setSuperiorId(pwBomNumberTwo.getId()); + }else{ + bomNumberTwo.setSuperiorId(pwBomNumberTwo.getSuperiorId()); + } + bomNumberTwo.setProductionCode(pwBomNumberTwo.getProductionCode()); + bomNumberTwo.setFigureNumber(figureNumber + "-" + (p + 1)); + bomNumberTwo.setName(name + "-" + pwBomNumberTwo.getProcessName() + "(M)"); + bomNumberTwo.setType(pwBomNumberTwo.getType()); + bomNumberTwo.setOneNumber(pwBomNumberTwo.getOneNumber()); + bomNumberTwo.setSumNumber(pwBomNumberTwo.getSumNumber()); + bomNumberTwo.setNum(pwBomNumberTwo.getNum()); + if("天".equals(processOrDept.getTimeUnit())){ + bomNumberTwo.setXuTime(Double.valueOf(processOrDept.getXuTime() * 24 * 60+"")); + } + bomNumberTwo.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + bomNumberTwo.setParentLevelFigureNumber(figureNumber); + bomNumberTwo.setParentLevelName(name); + bomNumberTwo.setSparedOne(pwBomNumberTwo.getSparedOne()); + bomNumberTwo.setDepartmentName(processOrDept.getDeptName()); + bomNumberTwo.setDelFlag(0); + bomNumberTwo.setProcessName(pwBomNumberTwo.getProcessName()); + int a = pwBomNumberTwoService.insertPwBomNumberTwo(bomNumberTwo); + if(a < 1){ + return AjaxResult.error(); + } + //添加序 + for(int i=p;i list = pwBomNumberTwoFuService.selectPwBomNumberTwoFuList(pwBomNumberTwoFu); + return getDataTable(list); + } + + /** + * 导出副Bom列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoFu:export')") + @Log(title = "副Bom", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBomNumberTwoFu pwBomNumberTwoFu) + { + List list = pwBomNumberTwoFuService.selectPwBomNumberTwoFuList(pwBomNumberTwoFu); + ExcelUtil util = new ExcelUtil(PwBomNumberTwoFu.class); + return util.exportExcel(list, "pwBomNumberTwoFu"); + } + + /** + * 获取副Bom详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoFu:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id){ + PwBomNumberTwoFu bomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(id); + //根据令号和图号和名称查询质检单详情 + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(bomNumberTwoFu.getProductionCode(),bomNumberTwoFu.getName(),bomNumberTwoFu.getFigureNumber()); + int i = 0; +// //计算修改入库的剩余数量 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list) { + if(0==pwCompletionNoticeProduct.getActualQuantity()){ + i += pwCompletionNoticeProduct.getQuantity(); + }else{ + i += pwCompletionNoticeProduct.getActualQuantity(); + } + } + if(bomNumberTwoFu.getSumNumber()-i<0){ + bomNumberTwoFu.setNumber(0L); + }else{ + bomNumberTwoFu.setNumber(bomNumberTwoFu.getSumNumber()-i); + } + //查询当前物料的单价和供应商 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(bomNumberTwoFu.getName(), bomNumberTwoFu.getFigureNumber()); + if(null!=imMaterial){ + //供应商名称 + bomNumberTwoFu.setPreferentialOriginName(imMaterial.getPreferentialOriginName()); + //未税单价 + bomNumberTwoFu.setUnitPrice(imMaterial.getUnitPrice().doubleValue()); + } + return AjaxResult.success(bomNumberTwoFu); + } + + /** + * 打印流转单功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据 + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + if(ids.length==0){ + return AjaxResult.error("请选择物料"); + } + List list = new ArrayList(); + //遍历ids + for (Long id : ids) { + Long i = 1L; + List list3 = new ArrayList(); + //根据id获取物料信息 + PwBomNumberTwoFu pwBomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(id); + //查询其所有子集,显示到工件流转单中 + PwBomNumberTwoFu bomNumberTwo = new PwBomNumberTwoFu(); + if(!"有库存".equals(pwBomNumberTwoFu.getSparedTwo())&&null!=pwBomNumberTwoFu.getFigureNumber()&&!" ".equals(pwBomNumberTwoFu.getFigureNumber().substring(0,3))&&!"009".equals(pwBomNumberTwoFu.getFigureNumber().substring(0,3))&&!"017".equals(pwBomNumberTwoFu.getFigureNumber().substring(0,3))&&!pwBomNumberTwoFu.getRemarks().contains("外购件")&&!pwBomNumberTwoFu.getRemarks().contains("甲供件")){ + //根据id查询其所有子集 + List list2 = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndSuperiorId(pwBomNumberTwoFu.getProductionCode(), pwBomNumberTwoFu.getId()); + + //如果是序,则查询其父级 + if(null!=pwBomNumberTwoFu.getSuperiorId()){ + bomNumberTwo = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(pwBomNumberTwoFu.getSuperiorId()); + list2 = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndSuperiorId(bomNumberTwo.getProductionCode(), bomNumberTwo.getId()); + }else{ + //根据id查询其所有子集 + list2 = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndSuperiorId(pwBomNumberTwoFu.getProductionCode(), pwBomNumberTwoFu.getId()); + } + + //判断是否是部件,如果为部件,则查询其子集 + if("部件".equals(pwBomNumberTwoFu.getType())||null==pwBomNumberTwoFu.getParentLevelFigureNumber()){ + if(null!=pwBomNumberTwoFu.getSuperiorId()){ + //查询其所有子集,显示到工件流转单中 + bomNumberTwo = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(pwBomNumberTwoFu.getSuperiorId()); + list3 = pwBomNumberTwoFuService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + }else{ + //查询其所有子集,显示到工件流转单中 + list3 = pwBomNumberTwoFuService.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwoFu.getProductionCode(), pwBomNumberTwoFu.getName(), pwBomNumberTwoFu.getFigureNumber()); + } + + } + + QrConfig config = new QrConfig(); + // 设置边距,既二维码和背景之间的边距 + config.setWidth(300); + config.setHeight(300); + config.setErrorCorrection(ErrorCorrectionLevel.M); + + //是否入库 + String ss = ""; + for (PwBomNumberTwoFu pwBomNumberTwoFu2 : list2) { + if(null!=pwBomNumberTwoFu2.getDepartmentName()){ + pwBomNumberTwoFu2.setNum(i+""); + + File file = new File("D:/java/qrcode/"+pwBomNumberTwoFu2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(file.exists()){ + file.delete(); + } + // 生成申请质检的二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcode?id="+pwBomNumberTwoFu2.getId(), config, FileUtil.file("D:/java/qrcode/"+pwBomNumberTwoFu2.getId()+".jpg")); + pwBomNumberTwoFu2.setQrCodeUrl("http://localhost:8088/qrcode/"+pwBomNumberTwoFu2.getId()+".jpg"); + + File fileTwo = new File("D:/java/qrcodeTwo/"+pwBomNumberTwoFu2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileTwo.exists()){ + fileTwo.delete(); + } + //生成确认质检的二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeTwo?code="+pwBomNumberTwoFu2.getProductionCode()+"&name="+pwBomNumberTwoFu2.getName()+"&figureNumber="+pwBomNumberTwoFu2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeTwo/"+pwBomNumberTwoFu2.getId()+".jpg")); + pwBomNumberTwoFu2.setQrCodeUrlTwo("http://localhost:8088/qrcodeTwo/"+pwBomNumberTwoFu2.getId()+".jpg"); + + //判断是否入库,如果不入库,则不再生成入库的二维码 + if("是".equals(pwBomNumberTwoFu2.getGodownEntry())){ + File fileThree = new File("D:/java/qrcodeThree/"+pwBomNumberTwoFu2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileThree.exists()){ + fileThree.delete(); + } + //生成确认入库的二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeThree?code="+pwBomNumberTwoFu2.getProductionCode()+"&name="+pwBomNumberTwoFu2.getName()+"&figureNumber="+pwBomNumberTwoFu2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeThree/"+pwBomNumberTwoFu2.getId()+".jpg")); + pwBomNumberTwoFu2.setQrCodeUrlThree("http://localhost:8088/qrcodeThree/"+pwBomNumberTwoFu2.getId()+".jpg"); + } + + //判断是否填写了原材料,如果没有填写原材料,则不再生成领料的二维码和出库的二维码 + if(i==1&&null==pwBomNumberTwoFu2.getMaterialId()&&!"部件".equals(pwBomNumberTwoFu.getType())&&null!=pwBomNumberTwoFu.getParentLevelFigureNumber()){ + + }else{ + File fileFour = new File("D:/java/qrcodeFour/"+pwBomNumberTwoFu2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFour.exists()){ + fileFour.delete(); + } + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFour?id="+pwBomNumberTwoFu2.getId(), config, FileUtil.file("D:/java/qrcodeFour/"+pwBomNumberTwoFu2.getId()+".jpg")); + pwBomNumberTwoFu2.setQrCodeUrlFour("http://localhost:8088/qrcodeFour/"+pwBomNumberTwoFu2.getId()+".jpg"); + } + + if(i==1&&null==pwBomNumberTwoFu2.getMaterialId()&&!"部件".equals(pwBomNumberTwoFu.getType())&&null!=pwBomNumberTwoFu.getParentLevelFigureNumber()){ + + }else{ + //判断上一序是否入库,如果上一序不入库,则当前序不生成二维码 + if("是".equals(ss)||"".equals(ss)){ + File fileFive = new File("D:/java/qrcodeFive/"+pwBomNumberTwoFu2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFive.exists()){ + fileFive.delete(); + } + if(i==1&&!"部件".equals(pwBomNumberTwoFu.getType())&&null!=pwBomNumberTwoFu.getParentLevelFigureNumber()){ + //原材料出库 + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwoFu2.getProductionCode()+"&name="+pwBomNumberTwoFu2.getMaterialsName()+"&figureNumber="+pwBomNumberTwoFu2.getMaterialsSpecification(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwoFu2.getId()+".jpg")); + pwBomNumberTwoFu2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwoFu2.getId()+".jpg"); + }else if("部件".equals(pwBomNumberTwoFu.getType())||null==pwBomNumberTwoFu.getParentLevelFigureNumber()){ + //生成部件领料码 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwoFu2.getProductionCode(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwoFu2.getId()+".jpg")); + pwBomNumberTwoFu2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwoFu2.getId()+".jpg"); + }else{ + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwoFu2.getFigureNumber().substring(pwBomNumberTwoFu2.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + String figureNumber = pwBomNumberTwoFu2.getFigureNumber().substring(0,pwBomNumberTwoFu2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //根据令号和图号查询上一道序的物料信息 + bomNumberTwo = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndFigureNumber(pwBomNumberTwoFu2.getProductionCode(), figureNumber); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+pwBomNumberTwoFu2.getProductionCode()+"&name="+bomNumberTwo.getName()+"&figureNumber="+bomNumberTwo.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeFive/"+pwBomNumberTwoFu2.getId()+".jpg")); + pwBomNumberTwoFu2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/"+pwBomNumberTwoFu2.getId()+".jpg"); + } + } + } + ss = pwBomNumberTwoFu2.getGodownEntry(); + i++; + } + } + + //返回pdf图片地址 + File file = new File("D:/evoEngine/static/product/"+pwBomNumberTwoFu.getProductionCode()+"/bomTwo/"+pwBomNumberTwoFu.getFigureNumber().replaceAll("/","--")+".pdf"); + if(null!=file){ + try { + PDDocument doc = PDDocument.load(file); + PDFRenderer renderer = new PDFRenderer(doc); + int pageCount = doc.getNumberOfPages(); + for(int r=0;r godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list); + return AjaxResult.success("success",godownMessage); + } + + /** + * 新增副Bom(添加工序) + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoFu:add')") + @Log(title = "副Bom", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBomNumberTwoFu pwBomNumberTwoFu){ + //判断是否选择了原材料 + if(null!=pwBomNumberTwoFu.getMaterialId()){ + //说明选择了毛坯 + //查询选择的原材料 + ImMaterial immaterial = imMaterialService.selectImMaterialById(pwBomNumberTwoFu.getMaterialId()); + if(null != immaterial){ + //原材料名称 + pwBomNumberTwoFu.setMaterialsName(immaterial.getMaterialName()); + //原材料图号 + pwBomNumberTwoFu.setMaterialsSpecification(immaterial.getFigureNumber()); + //判断是否是长和宽都不为null + if(null!=pwBomNumberTwoFu.getWid()&&pwBomNumberTwoFu.getWid()!=0){ + if(null==pwBomNumberTwoFu.getLen()){ + return AjaxResult.error("请输入长度"); + } + //规格合并成 长*宽 + pwBomNumberTwoFu.setSpecification(pwBomNumberTwoFu.getLen()+"*"+pwBomNumberTwoFu.getWid()+""); + //说明是板材,下料尺寸改为长*宽 + pwBomNumberTwoFu.setMeasure(Long.valueOf(pwBomNumberTwoFu.getLen())*pwBomNumberTwoFu.getWid()+""); + }else{ + pwBomNumberTwoFu.setMeasure(pwBomNumberTwoFu.getLen()+""); + pwBomNumberTwoFu.setSpecification(pwBomNumberTwoFu.getMeasure()); + } + //判断是否填写了毛坯数量 + if(null==pwBomNumberTwoFu.getWorkblank()||0==pwBomNumberTwoFu.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + //成品数量默认为本批数量 + pwBomNumberTwoFu.setFinished(pwBomNumberTwoFu.getSumNumber()); + //计算领料数量 + pwBomNumberTwoFu.setReceiveNumber(pwBomNumberTwoFu.getWorkblank()*Long.valueOf(pwBomNumberTwoFu.getMeasure())); + } + } + + //获取执行单令号 + String productionCode = pwBomNumberTwoFu.getProductionCode(); + //根据上级id和令号查询 + List list = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndSuperiorId(productionCode,pwBomNumberTwoFu.getId()); + //获取工序名称集合 + String[] processNames = pwBomNumberTwoFu.getProcessNames(); + if(null==processNames||processNames.length==0){ + return AjaxResult.error("请选择工序"); + } + int ii = 0; + //保留原始的名称和图号和id + Long id = pwBomNumberTwoFu.getId(); + String name = pwBomNumberTwoFu.getName(); + String figureNumber = pwBomNumberTwoFu.getFigureNumber(); + for (int i = 0; i < processNames.length; i++) { + + if(list.size()==0){ + pwBomNumberTwoFu.setFigureNumber(figureNumber+"-"+(i+1)); + }else{ + int sia = list.size()+i+1; + pwBomNumberTwoFu.setFigureNumber(figureNumber+"-"+sia); + } + //只保留工序为1时的材料名称 + if(i>0){ + pwBomNumberTwoFu.setMaterialsName(null); + pwBomNumberTwoFu.setMaterialsSpecification(null); + pwBomNumberTwoFu.setMeasure(null); + pwBomNumberTwoFu.setWorkblank(null); + pwBomNumberTwoFu.setFinished(null); + } + pwBomNumberTwoFu.setName(name+"-"+processNames[i]+"(M)"); + //工序名称 + pwBomNumberTwoFu.setProcessName(processNames[i]); + //完成时间置为null + pwBomNumberTwoFu.setCompletionDate(null); + //根据工序名称查询工序信息 +// PwProcess pwProcess = pwProcessService.selectPwProcessByName(processNames[i]); +// pwBomNumberTwo.setGodownEntry(pwProcess.getGodownEntry()); + //把上级id赋值给当前需要添加的工序 + pwBomNumberTwoFu.setSuperiorId(id); + //添加之前先去物料表和库存表查询有没有此物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwoFu.getName(), pwBomNumberTwoFu.getFigureNumber()); + if(null!=material){ + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(null!=inventoryDetail){ + //判断库存数量够不够,如果够用,则标记有库存 + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()>=pwBomNumberTwoFu.getSumNumber()){ + pwBomNumberTwoFu.setSparedTwo("有库存"); + } + //判断是否设置了安全库存 + if(material.getMinimum()>0&&material.getHighest()>0){ + //如果有安全库存设置,则代表一定有库存,只不过是企标单再派工,执行单不再派工 + pwBomNumberTwoFu.setSparedTwo("有库存"); + //说明设置了安全库存,则需要计算数量是否低于了安全库存数量 + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=material.getMinimum()){ + //生成企标单 + //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + //名称 + pdd.setName(material.getMaterialName()); + //图号 + pdd.setFigureNumber(material.getFigureNumber()); + //材料 + pdd.setMaterialType(material.getMaterials()); + //数量(最高库存数量-(库存数量+在途数量-本批数量)) + pdd.setQuantity(material.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-pwBomNumberTwoFu.getSumNumber())); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd); + //更新在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pdd.getQuantity()); +// pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + //更新可用数量 + if(inventoryDetail.getQuantity()>=inventoryDetail.getLockNumber()){ + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + } + //锁定本序数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwBomNumberTwoFu.getSumNumber()); + pwBomNumberTwoFu.setSparedFour(inventoryDetail.getQuantity()); + //预存数量(添加工序时不预添加在途数量,而是在领料时才添加在途数量) +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getSumNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //如果填写了原材料,则更新原材料的锁定数量 + if(null!=pwBomNumberTwoFu.getReceiveNumber()&&pwBomNumberTwoFu.getReceiveNumber()>0){ + //查询原材料库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwBomNumberTwoFu.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + }else{ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwBomNumberTwoFu.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwBomNumberTwoFu.getFigureNumber()); + //预存数量(添加工序时不预添加在途数量,而是在领料时才添加在途数量) +// pwInventoryDetail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + //锁定数量 + pwInventoryDetail.setLockNumber(pwBomNumberTwoFu.getSumNumber()); + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + }else{ + //添加物料信息 + ImMaterial imMaterial = new ImMaterial(); + //物料名称 + imMaterial.setMaterialName(pwBomNumberTwoFu.getName()); + //物料图号 + imMaterial.setFigureNumber(pwBomNumberTwoFu.getFigureNumber()); + //删除标记 + imMaterial.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial); + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwBomNumberTwoFu.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwBomNumberTwoFu.getFigureNumber()); + //预存数量(添加工序时不预添加在途数量,而是在领料时才添加在途数量) +// pwInventoryDetail.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()); + //锁定数量 + pwInventoryDetail.setLockNumber(pwBomNumberTwoFu.getSumNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + //如果填写了原材料,则更新原材料的锁定数量 + if(null!=pwBomNumberTwoFu.getReceiveNumber()&&pwBomNumberTwoFu.getReceiveNumber()>0){ + //查询原材料库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwBomNumberTwoFu.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + ii = pwBomNumberTwoFuService.insertPwBomNumberTwoFu(pwBomNumberTwoFu); + } + return toAjax(ii); + } + + /** + * 修改副Bom + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoFu:edit')") + @Log(title = "副Bom", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBomNumberTwoFu pwBomNumberTwoFu){ + //根据id查询原数据 + PwBomNumberTwoFu bomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(pwBomNumberTwoFu.getId()); + //查询领料单中是否已经申请领料 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialBySparedThree(pwBomNumberTwoFu.getProductionCode(),pwBomNumberTwoFu.getId()); + if(list.size()>0){ + return AjaxResult.error("已申请领料,不可修改"); + } + + if(null!=pwBomNumberTwoFu.getMaterialId()){ + //查询选择的原材料 + ImMaterial material = imMaterialService.selectImMaterialById(pwBomNumberTwoFu.getMaterialId()); + if(null != material){ + //判断是否是第一道序 TODO + String substring = pwBomNumberTwoFu.getFigureNumber().substring(pwBomNumberTwoFu.getFigureNumber().lastIndexOf("-")+1); + if(1==Integer.valueOf(substring)){ + //原材料名称 + pwBomNumberTwoFu.setMaterialsName(material.getMaterialName()); + //原材料图号 + pwBomNumberTwoFu.setMaterialsSpecification(material.getFigureNumber()); + //判断是否是长和宽都不为null + if(null!=pwBomNumberTwoFu.getWid()&&pwBomNumberTwoFu.getWid()!=0){ + if(null==pwBomNumberTwoFu.getLen()){ + return AjaxResult.error("请输入长度"); + } + //规格合并成 长*宽 + pwBomNumberTwoFu.setSpecification(pwBomNumberTwoFu.getLen()+"*"+pwBomNumberTwoFu.getWid()+""); + //说明是板材,下料尺寸改为长*宽 + pwBomNumberTwoFu.setMeasure(Long.valueOf(pwBomNumberTwoFu.getLen())*pwBomNumberTwoFu.getWid()+""); + }else{ + pwBomNumberTwoFu.setMeasure(pwBomNumberTwoFu.getLen()+""); + pwBomNumberTwoFu.setSpecification(pwBomNumberTwoFu.getMeasure()); + } + //判断是否填写了毛坯数量 + if(null==pwBomNumberTwoFu.getWorkblank()||0==pwBomNumberTwoFu.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + //计算领料数量 + pwBomNumberTwoFu.setReceiveNumber(pwBomNumberTwoFu.getWorkblank()*Long.valueOf(pwBomNumberTwoFu.getMeasure())); + + //修改预定数量 + //查询之前的原材料信息 + if(null!=bomNumberTwoFu.getMaterialId()){ + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwoFu.getMaterialsName(), bomNumberTwoFu.getMaterialsSpecification()); + if(null!=inventoryDetail){ + //减掉修改之前的预定数量 + if(null==bomNumberTwoFu.getReceiveNumber()){ + bomNumberTwoFu.setReceiveNumber(0L); + } + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-bomNumberTwoFu.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + //查询修改之后的原材料信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwoFu.getMaterialsName(),pwBomNumberTwoFu.getMaterialsSpecification()); + if(null!=inventoryDetail){ + if(null==pwBomNumberTwoFu.getReceiveNumber()){ + pwBomNumberTwoFu.setReceiveNumber(0L); + } + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwBomNumberTwoFu.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + //查询预采购表,如果预采购表不为空,则把预采购表也修改了 + PwFuturesOrders futuresOrders = pwFuturesOrdersService.selectPwFuturesOrdersByCode(pwBomNumberTwoFu.getProductionCode()); + if(null != futuresOrders){ + //把合并之前的信息增加到详情中 + PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo = new PwFuturesOrdersDetailTwo(); + //说明已经生成预采购单 + //根据名称和图号查询预购单明细中是否有了此物料,如果有则不再新增,则在原有的基础上添加总数量 + PwFuturesOrdersDetail futuresOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(futuresOrders.getCode(),material.getMaterialName(),material.getFigureNumber()); + if(null != futuresOrdersDetail){ + //原尺寸 + Double number = futuresOrdersDetail.getNumber(); + + if(null==bomNumberTwoFu.getMeasure()){ + bomNumberTwoFu.setMeasure("0"); + } + if(null==bomNumberTwoFu.getWorkblank()){ + bomNumberTwoFu.setWorkblank(0L); + } + if(null==bomNumberTwoFu.getMeasure()){ + bomNumberTwoFu.setMeasure("0"); + } + if(null==bomNumberTwoFu.getWorkblank()){ + bomNumberTwoFu.setWorkblank(0L); + } + //总尺寸 + futuresOrdersDetail.setNumber(futuresOrdersDetail.getNumber()-(Double.valueOf(bomNumberTwoFu.getMeasure())*bomNumberTwoFu.getWorkblank())+(Double.valueOf(pwBomNumberTwoFu.getMeasure())*pwBomNumberTwoFu.getWorkblank())); + if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000); + }else if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("平方毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000000); + }else{ + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()); + } + //总重量重新计算 + futuresOrdersDetail.setReferenceNumber(futuresOrdersDetail.getQuantity() * material.getPieceWeight()); + pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(futuresOrdersDetail); + + //修改预采购单明细的明细信息(根据物料id) + PwFuturesOrdersDetailTwo futuresOrdersDetailTwo = pwFuturesOrdersDetailTwoService.selectPwFuturesOrdersDetailTwoByMatenaisIdAndNameAndFigureNumber(pwBomNumberTwoFu.getId(),pwBomNumberTwoFu.getMaterialsName(),pwBomNumberTwoFu.getMaterialsSpecification()); + if(null != futuresOrdersDetailTwo){ + //物料id + futuresOrdersDetailTwo.setMatenaisId(pwBomNumberTwoFu.getId()); + //名称 + futuresOrdersDetailTwo.setName(pwBomNumberTwoFu.getMaterialsName()); + //图号 + futuresOrdersDetailTwo.setFigureNumber(pwBomNumberTwoFu.getMaterialsSpecification()); + //材料 + futuresOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + futuresOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + futuresOrdersDetailTwo.setSparedOne(pwBomNumberTwoFu.getSpecification()); + //毛坯数量 + futuresOrdersDetailTwo.setWorkblank(pwBomNumberTwoFu.getWorkblank().doubleValue()); + //总数量(计算)下料尺寸*毛坯数量 + futuresOrdersDetailTwo.setNumber(Double.valueOf(pwBomNumberTwoFu.getMeasure())*pwBomNumberTwoFu.getWorkblank().doubleValue()); + //计量单位(物料属性) + futuresOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + futuresOrdersDetailTwo.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + futuresOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()); + //采用原单位 + futuresOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + futuresOrdersDetailTwo.setReferenceNumber(futuresOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + pwFuturesOrdersDetailTwoService.updatePwFuturesOrdersDetailTwo(futuresOrdersDetailTwo); + } + }else{ + //新增预采购单明细 + PwFuturesOrdersDetail pwFuturesOrdersDetail = new PwFuturesOrdersDetail(); + //令号 + pwFuturesOrdersDetail.setCode(pwBomNumberTwoFu.getProductionCode()); + //预购单id + pwFuturesOrdersDetail.setOrdersId(futuresOrders.getId()); + //名称 + pwFuturesOrdersDetail.setName(pwBomNumberTwoFu.getMaterialsName()); + //图号 + pwFuturesOrdersDetail.setFigureNumber(pwBomNumberTwoFu.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetail.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetail.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetail.setMeasure(Long.valueOf(pwBomNumberTwoFu.getMeasure())); + //毛坯数量 + pwFuturesOrdersDetail.setWorkblank(pwBomNumberTwoFu.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetail.setNumber(Double.valueOf(pwBomNumberTwoFu.getMeasure())*pwBomNumberTwoFu.getWorkblank().doubleValue()); + //计量单位(物料属性) + pwFuturesOrdersDetail.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(Double.valueOf(pwBomNumberTwoFu.getMeasure())*pwBomNumberTwoFu.getWorkblank().doubleValue()); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetail.setReferenceNumber(pwFuturesOrdersDetail.getQuantity() * material.getPieceWeight()); + + //库存数量 + PwInventoryDetail inventoryDetaila = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + + //库存数量 + pwFuturesOrdersDetail.setInventoryQuantity(inventoryDetaila.getQuantity()); + //在途数量 + pwFuturesOrdersDetail.setPreliminaryInventory(inventoryDetaila.getPreliminaryInventory()); + //锁定数量 + pwFuturesOrdersDetail.setLockNumber(inventoryDetaila.getLockNumber()-pwFuturesOrdersDetail.getNumber().longValue()); + pwFuturesOrdersDetailService.insertPwFuturesOrdersDetail(pwFuturesOrdersDetail); + + //令号 + pwFuturesOrdersDetailTwo.setCode(pwBomNumberTwoFu.getProductionCode()); + //物料id + pwFuturesOrdersDetailTwo.setMatenaisId(pwBomNumberTwoFu.getId()); + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(pwFuturesOrdersDetail.getId()); + //名称 + pwFuturesOrdersDetailTwo.setName(pwBomNumberTwoFu.getMaterialsName()); + //图号 + pwFuturesOrdersDetailTwo.setFigureNumber(pwBomNumberTwoFu.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetailTwo.setSparedOne(pwBomNumberTwoFu.getSpecification()); + //毛坯数量 + pwFuturesOrdersDetailTwo.setWorkblank(pwBomNumberTwoFu.getWorkblank().doubleValue()); + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetailTwo.setNumber(Double.valueOf(pwBomNumberTwoFu.getMeasure())*pwBomNumberTwoFu.getWorkblank().doubleValue()); + //计量单位(物料属性) + pwFuturesOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + pwFuturesOrdersDetailTwo.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetailTwo.setReferenceNumber(pwFuturesOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + + pwFuturesOrdersDetailTwoService.insertPwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo); + } + } + } + } + } + return toAjax(pwBomNumberTwoFuService.updatePwBomNumberTwoFu(pwBomNumberTwoFu)); + } + + /** + * 删除副Bom + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoFu:remove')") + @Log(title = "副Bom", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //释放在途数量和锁定数量 + for (Long id : ids) { + + PwBomNumberTwoFu pwBomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(id); + + //判断当前物料是否已经领料 + String substring = pwBomNumberTwoFu.getFigureNumber().substring(pwBomNumberTwoFu.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + String figureNumber = pwBomNumberTwoFu.getFigureNumber().substring(0,pwBomNumberTwoFu.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + if(s==0){ + //说明是第一道序,则查询原材料信息 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + if(list.size()>0){ + return AjaxResult.error("已经领料的工序不能直接删除"); + } + }else{ + //删除之前,跟据code和名称和图号查询是否已经领料 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), figureNumber); + if(list.size()>0){ + return AjaxResult.error("已经领料的工序不能直接删除"); + } + } + + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwoFu.getName(), pwBomNumberTwoFu.getFigureNumber()); + if(null!=inventoryDetail){ + if(inventoryDetail.getPreliminaryInventory()>=pwBomNumberTwoFu.getSumNumber()){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-pwBomNumberTwoFu.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(0L); + } + if(inventoryDetail.getLockNumber()>=pwBomNumberTwoFu.getSumNumber()){ + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwBomNumberTwoFu.getSumNumber()); + }else{ + inventoryDetail.setLockNumber(0L); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + int i = 0; + for (Long long1 : ids) { + //根据id查询 + PwBomNumberTwoFu pwBomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(long1); + if(pwBomNumberTwoFu.getName().contains("(M)")){ + i = pwBomNumberTwoFuService.deletePwBomNumberTwoFuById(long1); + }else{ + pwBomNumberTwoFu.setDelFlag(1); + i = pwBomNumberTwoFuService.updatePwBomNumberTwoFu(pwBomNumberTwoFu); + } + } + return toAjax(i); + } + + /** + * 派工功能 + */ + @RequestMapping("/updatePwBomNumberTwoFuPaiGong") + public AjaxResult updatePwBomNumberTwoFuPaiGong(@RequestBody PwBomNumberTwoFu pwBomNumberTwoFu){ + + //获取当前物料的图号和名称,查询其下是否有子集工序,如果有子集工序,则不能直接派工,需要派工子集工序的物料 + List list = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndSuperiorId(pwBomNumberTwoFu.getProductionCode(), pwBomNumberTwoFu.getId()); + if(list.size()>0){ + return AjaxResult.error("带有工序的物料不可直接派工"); + } + + if(null!=pwBomNumberTwoFu.getDepartmentName()&&!"".equals(pwBomNumberTwoFu.getDepartmentName())){ + //如果派工部门不为null时,判断完成时间是否为null + if(null==pwBomNumberTwoFu.getCompletionDate()||"".equals(pwBomNumberTwoFu.getCompletionDate())){ + return AjaxResult.error("请选择完成时间"); + } + } + if(null!=pwBomNumberTwoFu.getDepartmentNames()&&pwBomNumberTwoFu.getDepartmentNames().length>0){ + //如果派工部门不为null时,判断完成时间是否为null + if(null==pwBomNumberTwoFu.getCompletionDates()||"".equals(pwBomNumberTwoFu.getCompletionDates())){ + return AjaxResult.error("请选择完成时间"); + }else{ + //修改派工部门 + pwBomNumberTwoFu.setDepartmentName(pwBomNumberTwoFu.getDepartmentNames()[0]); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //修改完成时间 + try { + pwBomNumberTwoFu.setCompletionDate(sdf.parse(pwBomNumberTwoFu.getCompletionDates()[0])); + } catch (ParseException e) { + e.printStackTrace(); + } + } + } + if(null==pwBomNumberTwoFu.getGodownEntry()||"".equals(pwBomNumberTwoFu.getGodownEntry())){ + return AjaxResult.error("请选择是否入库"); + } + return toAjax(pwBomNumberTwoFuService.updatePwBomNumberTwoFu(pwBomNumberTwoFu)); + } + + /** + * 申请入库 + */ + @RepeatSubmit + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwBomNumberTwoFu pwBomNumberTwoFu){ + if(null==pwBomNumberTwoFu.getNumber()||"".equals(pwBomNumberTwoFu.getNumber())||pwBomNumberTwoFu.getNumber()==0){ + return AjaxResult.error("请输入申请入库数量"); + } + if(pwBomNumberTwoFu.getSumNumber() list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + if(list.size()==0){ + //原材料无需判断领料数量 + return AjaxResult.error("未申请领料的不允许入库"); + } + } + }else{ + String figureNumber = pwBomNumberTwoFu.getFigureNumber().substring(0,pwBomNumberTwoFu.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //查询上序是否需要入库,如果上序不需要入库,则当前序不再控制必须领料后才可入库 + PwBomNumberTwoFu bomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), figureNumber); + if(bomNumberTwoFu.getGodownEntry().equals("是")){ + //说明不是第一道工序 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), figureNumber); + if(list.size()>0){ + Long i = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + i += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断数量是否大于等于入库数量 + //查询当前需入库物料的已入库数量(包函已申请的数量) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwoFu.getProductionCode(),pwBomNumberTwoFu.getName(), pwBomNumberTwoFu.getFigureNumber()); + //已申请入库的数量 + Long p = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + p += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(i list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(cnp); + +// //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(bomNumberTwoFu2.getProductionCode()); + int s = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + s += pwCompletionNoticeProduct2.getActualQuantity(); + } + if(null!=bomNumberTwoFu2.getInventoryStatus()&&!"".equals(bomNumberTwoFu2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwBomNumberTwoFu.getNumber()>pwBomNumberTwoFu.getSumNumber()){ + return AjaxResult.error("申请数量不可大于本批数量"); + }else{ + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //判断是否需要入库,如果需要则添加入库单,不需要则直接添加质检单 + if("是".equals(bomNumberTwoFu2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwoFu.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwoFu2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwoFu2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwoFu2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwoFu.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBomNumberTwoFu.getUnitPrice()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBomNumberTwoFu.getUnitPrice()*pwBomNumberTwoFu.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwBomNumberTwoFu.getNumber() == bomNumberTwoFu2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwoFu2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoFuService.updatePwBomNumberTwoFu(bomNumberTwoFu2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + //把添加入库单的id添加到质检单中 + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwoFu2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwoFu2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwoFu2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwoFu2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwoFu2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwoFu2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwoFu2.getFigureNumber()&&!"009".equals(bomNumberTwoFu2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwoFu2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwoFu2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwoFu2.getSuperiorId()){ + PwBomNumberTwoFu numberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(bomNumberTwoFu2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwoFu.getProductionCode()+"/bom/"+numberTwoFu.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwoFu2.getProductionCode()+"/bom/"+bomNumberTwoFu2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwoFu.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单和质检通知单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(code); + //关联令号 + imProductReceipt.setCode(code); + //项目名称 + imProductReceipt.setProjectName(pwProductionBill.getIllustrate()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwBomNumberTwoFu bomNumberTwoFu2 = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(pwBomNumberTwoFu.getId()); + if(null!=bomNumberTwoFu2.getInventoryStatus()&&!"".equals(bomNumberTwoFu2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(code); + //根据生产令号查询项目名称 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + //保存项目名称 + pwCompletionNotice.setProjectName(productionBill.getProjectName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + if("是".equals(bomNumberTwoFu2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwoFu.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwoFu2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwoFu2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwoFu2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(pwBomNumberTwoFu.getPreferentialOriginName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBomNumberTwoFu.getUnitPrice()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBomNumberTwoFu.getUnitPrice()*pwBomNumberTwoFu.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwBomNumberTwoFu.getNumber()==pwBomNumberTwoFu.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwoFu2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoFuService.updatePwBomNumberTwoFu(bomNumberTwoFu2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwoFu2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwoFu2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwoFu2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwoFu2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwoFu2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwoFu2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwoFu2.getFigureNumber()&&!"009".equals(bomNumberTwoFu2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwoFu2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwoFu2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwoFu2.getSuperiorId()){ + PwBomNumberTwoFu numberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(bomNumberTwoFu2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwoFu.getProductionCode()+"/bom/"+numberTwoFu.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwoFu2.getProductionCode()+"/bom/"+bomNumberTwoFu2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBomNumberTwoFu.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwoFu.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + } + return toAjax(200); + } + + /** + * 毛坯物料申请领料 + */ + @RequestMapping("/getWorkblanks") + public AjaxResult getWorkblanks(@RequestBody PwBomNumberTwoFu pwBomNumberTwoFu){ + + //名称 + String name = pwBomNumberTwoFu.getName(); + //图号 + String figureNumber2 = pwBomNumberTwoFu.getFigureNumber(); + + //判断上序是否需要入库,如果上序不需要入库,则当前序不需要领料 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwoFu.getFigureNumber().substring(pwBomNumberTwoFu.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1pwBomNumberTwoFu.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + } + } + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据id查看bom表 + PwBomNumberTwoFu bomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(pwBomNumberTwoFu.getId()); + //获取执行单号 + String code = bomNumberTwoFu.getProductionCode(); + //根据code获取执行单信息 + PwProductionBill pwProductionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + List list2 = new ArrayList(); + if(1==Integer.valueOf(substring)){ + if("部件".equals(bomNumberTwoFu.getType())||"0".equals(bomNumberTwoFu.getNum())){ + //根据superior_id查询上级物料信息 + PwBomNumberTwoFu bomNumberTwoFu2 = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(bomNumberTwoFu.getSuperiorId()); + //如果需领物料为部件,则查询当前部件下所有的零件,领料数量*单台数量 + list2 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(bomNumberTwoFu2.getFigureNumber(), bomNumberTwoFu2.getSparedOne(), code); + }else{ + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(bomNumberTwoFu.getMaterialsName(), bomNumberTwoFu.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + bomNumberTwoFu.setName(bomNumberTwoFu.getMaterialsName()); + bomNumberTwoFu.setFigureNumber(bomNumberTwoFu.getMaterialsSpecification()); + + //获取当前物料的信息(如果物料的级别尺寸和残料尺寸大于0,则计算需要多少数量) + if(null!=material.getRankMeasure()&&material.getRankMeasure()>0&&null!=material.getDefectiveMaterialMeasure()&&material.getDefectiveMaterialMeasure()>0){ + //说明设置了级别尺寸和残料尺寸 + //总长度除以下料尺寸长度= 一支能出几件毛坯的数量(向下取整) + //毛坯数量除以一支出的毛坯数量 = 需要出料的数量(小数向上取整)如果为整数则该领料数量为当前数量,如果为小数,则向上取整 + }else{ + pwBomNumberTwoFu.setLingliaoNumber(bomNumberTwoFu.getWorkblank()*Long.valueOf(bomNumberTwoFu.getMeasure())); + } + } + } + }else{ + String figureNumber = pwBomNumberTwoFu.getFigureNumber().substring(0,pwBomNumberTwoFu.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + bomNumberTwoFu.setFigureNumber(figureNumber); + } + + int i = 0; + if(list2.size()>0){ + + for (PwBomNumber pwBomNumber : list2) { + //计算本次领料的数量 + Long number = pwBomNumber.getOneNumber()*pwBomNumberTwoFu.getLingliaoNumber(); + + //库存是否满足本次领料标记 TODO 返回库存数量不够的数据 + List list7 = new ArrayList(); + //判断数量是否充足 + int a = 0; + //先查询库存数量是否够本次领料的数量,如果不够,则不允许申请领 + //根据code和名称和图号查询 + int t = 0; + //根据物料名称和图号和令号查询bomTwo + PwBomNumberTwoFu bomNumberTwoFu2 = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndNameAndFigureNumber(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + //根据当前物料id查询子集工序 + List list3 = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndSuperiorId(pwBomNumber.getProductionCode(), bomNumberTwoFu2.getId()); + /*if(list3.size()>0&&("装配车间".equals(list3.get(list3.size()-1).getDepartmentName())||"企标工段".equals(list3.get(list3.size()-1).getDepartmentName())||"销齿链组".equals(list3.get(list3.size()-1).getDepartmentName())||"非标设备组".equals(list3.get(list3.size()-1).getDepartmentName())||"综合工段".equals(list3.get(list3.size()-1).getDepartmentName()))){ + t = 1; + }*/ + if(t!=1&&(!"部件".equals(bomNumberTwoFu2.getType())&&!"是".equals(bomNumberTwoFu2.getTheoretical()))&& null != bomNumberTwoFu2.getName() && !bomNumberTwoFu2.getName().contains("木箱")){ + //根据物料名称和图号查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwoFu2.getName(), bomNumberTwoFu2.getFigureNumber()); + if(inventoryDetail.getQuantity() list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwoFu.getProductionCode(),pwBomNumber.getName(),pwBomNumber.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + //判断数量是否已经超了本批数量 + if(s+number>numberTwoLingliao.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwoFu.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumber.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumber.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumber.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumber.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(number); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(number); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(number); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwoFu.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwoFu.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + + }else{ + if(number>numberTwoLingliao.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + } + //说明此单据之前没有领过料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwBomNumberTwoFu.getProductionCode()); + //项目名称 + imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(pwBomNumberTwoFu.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //申领数量 + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwoFu.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumber.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumber.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumber.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumber.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(number); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(number); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(number); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwoFu.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwoFu.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + }else{ + //说明是零件领料 + //根据code查询领料单的申领数量 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCodeAndTypeName(pwBomNumberTwoFu.getProductionCode(),pwBomNumberTwoFu.getSparedOne()); + if(null!=stockRequisition){ + Long s = 0L; + //如果为第一序,则查询时需要带上名称 + if(1==Integer.valueOf(substring)){ + //根据图号和code查询 +// List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { +// s += imStockRequisitionMaterial.getApplyForQuantity(); +// } + }else{ + //根据图号和code查询 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwoFu.getProductionCode(),bomNumberTwoFu.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + } + //分序判断 + if(1==Integer.valueOf(substring)){ + //判断数量是否已经超了本批数量 + //判断领料状态是否是1 + if(null!=pwBomNumberTwoFu.getSparedFour()&&pwBomNumberTwoFu.getSparedFour()==1){ + return AjaxResult.error("已申请,无需重复申请"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwoFu.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwoFu.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwoFu.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwoFu.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwoFu bomNumberTwoFus = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwoFus.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwoFus.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwoFus.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwoFus.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwoFu.getLingliaoNumber()); + } + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwoFu.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwoFu.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwoFu.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwoFu.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //修改领料状态为1 + pwBomNumberTwoFu.setSparedFour(1L); + pwBomNumberTwoFuService.updatePwBomNumberTwoFu(pwBomNumberTwoFu); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + }else{ + //判断数量是否已经超了本批数量 + if(s+pwBomNumberTwoFu.getLingliaoNumber()>pwBomNumberTwoFu.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwoFu.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwoFu.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwoFu.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwoFu.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwoFu bomNumberTwoFus = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwoFus.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwoFus.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwoFus.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwoFus.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwoFu.getLingliaoNumber()); + } + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwoFu.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwoFu.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwoFu.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwoFu.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + } + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwBomNumberTwoFu.getProductionCode()); + //项目名称 + imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(pwBomNumberTwoFu.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //申领数量 +// imStockRequisition.setSparedThree(pwBomNumberTwo.getShuliang()); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwoFu.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwoFu.getMaterialsName(), pwBomNumberTwoFu.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwoFu.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwoFu.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + } + //修改领料状态为1 + pwBomNumberTwoFu.setSparedFour(1L); + pwBomNumberTwoFuService.updatePwBomNumberTwoFu(pwBomNumberTwoFu); + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwoFu bomNumberTwoFus = pwBomNumberTwoFuService.selectPwBomNumberTwoFuByCodeAndFigureNumber(pwBomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwoFus.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwoFus.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwoFus.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwoFus.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoFu.getLingliaoNumber()); + } + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwoFu.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwoFu.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwoFu.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwoFu.getSumNumber()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwoFu.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + return toAjax(i); + } + + /** + * 撤销申请质检按钮 + */ + @DeleteMapping("/revocationBoms/{ids}") + public AjaxResult revocationBoms(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwBomNumberTwoFu bomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(id); + //根据物料名称和图号和令号查找此物料最近一次申请的质检信息 + int a = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(bomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getName(), bomNumberTwoFu.getFigureNumber()); + if(a==0){ + return AjaxResult.error("当前物料未申请质检,无需撤销"); + } + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById((long)a); + //判断是否已经质检,如果已经质检则需要查询入库信息,并退库,如果没有质检,则直接删除质检详情信息,然后把状态改为null + if(completionNoticeProduct.getCheckoutStatus().equals("已检验")||completionNoticeProduct.getCheckoutStatus().equals("正在检验")){ + return AjaxResult.error("已检验的物料不允许撤销"); + }else{ + //根据物料名称和图号和令号查询入库单详情信息,距离当前时间最近的一条数据 + //先查询是否有数据 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(bomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getName(), bomNumberTwoFu.getFigureNumber()); + if(list.size()>0){ + int b = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(bomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getName(), bomNumberTwoFu.getFigureNumber()); + ImProductReceiptMaterial receiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById((long)b); + //判断当前数据是否已经确认入库,如果确认入库则需要退库 + if(receiptMaterial.getInventoryStatus().equals("已入库")){ + //已经确认入库的则不允许撤销 + return AjaxResult.error("已经确认入库的物料不允许撤销"); + } + //删除当前数据 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(receiptMaterial.getId()); + } + } + pwCompletionNoticeProductService.deletePwCompletionNoticeProductById(completionNoticeProduct.getId()); + + //修改点件表的物料入库状态 + bomNumberTwoFu.setInventoryStatus(null); + i = pwBomNumberTwoFuService.updatePwBomNumberTwoFu(bomNumberTwoFu); + } + return toAjax(i); + } + + /** + * 撤销申请领料按钮 + */ + @DeleteMapping("/revocationLingliaos/{ids}") + public AjaxResult revocationLingliaos(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwBomNumberTwoFu bomNumberTwoFu = pwBomNumberTwoFuService.selectPwBomNumberTwoFuById(id); + //图号 + String figureNumber = bomNumberTwoFu.getFigureNumber(); + //判断当前物料是否已经出库 + //判断是第几道序,如果是第一道序,则根据原材料名称和图号和令号查询,如果不是第一道序,则根据令号和图号查询 + //判断当前物料是否是第一道序的物料 + String substring = bomNumberTwoFu.getFigureNumber().substring(bomNumberTwoFu.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1==Integer.valueOf(substring)){ + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getMaterialsName(), bomNumberTwoFu.getMaterialsSpecification()); + int f = 0; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + if(imStockRequisitionMaterial.getGetStatus().equals("已出库")){ + f = 1; + } + } + if(f == 1){ + return AjaxResult.error("已出库的物料不允许撤销"); + }else{ + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + } + if(null!=bomNumberTwoFu.getMaterialIdTwo()){ + List list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwoFu.getProductionCode(), bomNumberTwoFu.getMaterialsNameTwo(), bomNumberTwoFu.getMaterialsSpecificationTwo()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + } + } + } + //修改领料状态 + bomNumberTwoFu.setSparedFour(0L); + i = pwBomNumberTwoFuService.updatePwBomNumberTwoFu(bomNumberTwoFu); + }else{ + Integer s = Integer.valueOf(substring)-1; + String figureNumbers = bomNumberTwoFu.getFigureNumber().substring(0,bomNumberTwoFu.getFigureNumber().lastIndexOf("-")); + figureNumber = figureNumbers+"-"+s; + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(bomNumberTwoFu.getProductionCode(), figureNumber); + if(list.size()>0){ + ImStockRequisitionMaterial imStockRequisitionMaterial = list.get(list.size()-1); + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + //修改领料状态 + bomNumberTwoFu.setSparedFour(0L); + i = pwBomNumberTwoFuService.updatePwBomNumberTwoFu(bomNumberTwoFu); + }else{ + return AjaxResult.error("已出库的不允许撤销"); + } + } + } + } + return toAjax(i); + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberTwoGongxuController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberTwoGongxuController.java new file mode 100644 index 0000000..927d8db --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBomNumberTwoGongxuController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwBomNumberTwoGongxu; +import com.ruoyi.project.management.service.IPwBomNumberTwoGongxuService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * BOM工序引用Controller + * + * @author zhukangchao + * @date 2023-09-24 + */ +@RestController +@RequestMapping("/management/pwBomNumberTwoGongxu") +public class PwBomNumberTwoGongxuController extends BaseController +{ + @Autowired + private IPwBomNumberTwoGongxuService pwBomNumberTwoGongxuService; + + /** + * 查询BOM工序引用列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoGongxu:list')") + @GetMapping("/list") + public TableDataInfo list(PwBomNumberTwoGongxu pwBomNumberTwoGongxu) + { + startPage(); + List list = pwBomNumberTwoGongxuService.selectPwBomNumberTwoGongxuList(pwBomNumberTwoGongxu); + return getDataTable(list); + } + + /** + * 导出BOM工序引用列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoGongxu:export')") + @Log(title = "BOM工序引用", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBomNumberTwoGongxu pwBomNumberTwoGongxu) + { + List list = pwBomNumberTwoGongxuService.selectPwBomNumberTwoGongxuList(pwBomNumberTwoGongxu); + ExcelUtil util = new ExcelUtil(PwBomNumberTwoGongxu.class); + return util.exportExcel(list, "pwBomNumberTwoGongxu"); + } + + /** + * 获取BOM工序引用详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoGongxu:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwBomNumberTwoGongxuService.selectPwBomNumberTwoGongxuById(id)); + } + + /** + * 新增BOM工序引用 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoGongxu:add')") + @Log(title = "BOM工序引用", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBomNumberTwoGongxu pwBomNumberTwoGongxu) + { + return toAjax(pwBomNumberTwoGongxuService.insertPwBomNumberTwoGongxu(pwBomNumberTwoGongxu)); + } + + /** + * 修改BOM工序引用 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoGongxu:edit')") + @Log(title = "BOM工序引用", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBomNumberTwoGongxu pwBomNumberTwoGongxu) + { + return toAjax(pwBomNumberTwoGongxuService.updatePwBomNumberTwoGongxu(pwBomNumberTwoGongxu)); + } + + /** + * 删除BOM工序引用 + */ + @PreAuthorize("@ss.hasPermi('management:pwBomNumberTwoGongxu:remove')") + @Log(title = "BOM工序引用", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwBomNumberTwoGongxuService.deletePwBomNumberTwoGongxuByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionController.java new file mode 100644 index 0000000..b9f385b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionController.java @@ -0,0 +1,673 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.MoneyUtil; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 采购申请单Controller + * + * @author zhukangchao + * @date 2020-08-31 + */ +@RestController +@RequestMapping("/management/buyingRequisition") +public class PwBuyingRequisitionController extends BaseController +{ + @Autowired + private IPwBuyingRequisitionService pwBuyingRequisitionService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + @Autowired + private IPwBuyingRequisitionMaterialService pwBuyingRequisitionMaterialService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //供应商 + @Autowired + private IImSupplierService imSupplierService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //物流费用信息 + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + + /** + * 查询采购申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:buyingRequisition:list')") + @GetMapping("/list") + public TableDataInfo list(PwBuyingRequisition pwBuyingRequisition){ + startPage(); + List list = new ArrayList(); + if(null!=pwBuyingRequisition.getMaterialsName()&&!"".equals(pwBuyingRequisition.getMaterialsName())){ + List list2 = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByName(pwBuyingRequisition.getMaterialsName()); + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial : list2) { + //根据单据id查询请购单 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(pwBuyingRequisitionMaterial.getBuyingRequisitionId()); + if(null!=buyingRequisition){ + list.add(buyingRequisition); + } + } + }else{ + list = pwBuyingRequisitionService.selectPwBuyingRequisitionList(pwBuyingRequisition); + } + return getDataTable(list); + } + + /** + * 导出采购申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:buyingRequisition:export')") + @Log(title = "采购申请单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBuyingRequisition pwBuyingRequisition) + { + List list = pwBuyingRequisitionService.selectPwBuyingRequisitionList(pwBuyingRequisition); + ExcelUtil util = new ExcelUtil(PwBuyingRequisition.class); + return util.exportExcel(list, "buyingRequisition"); + } + + /** + * 获取采购申请单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:buyingRequisition:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwBuyingRequisitionService.selectPwBuyingRequisitionById(id)); + } + + /** + * 新增采购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:buyingRequisition:add')") + @Log(title = "采购申请单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBuyingRequisition pwBuyingRequisition){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + // 获取当前登录用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //令号 + pwBuyingRequisition.setCode("QG"+sdf.format(new Date())); + if(null==pwBuyingRequisition.getName()){ + //名称(统一为原材料) + pwBuyingRequisition.setName("原材料"); + } + if(null==pwBuyingRequisition.getPurpose()){ + //用途(手动添加的为 安全库存) + pwBuyingRequisition.setPurpose("安全库存"); + } + pwBuyingRequisition.setProposer(user.getNickName()); + pwBuyingRequisition.setTotalPrices(0.0); + //请购单状态初始值为1,(待审核状态) + pwBuyingRequisition.setStatus(1); + int i = pwBuyingRequisitionService.insertPwBuyingRequisition(pwBuyingRequisition); + + //查询原材料类型中设置了安全库存的物料 + List list = imMaterialService.selectImMaterialListByTypeAndMinimum(); + for (ImMaterial imMaterial : list) { + //根据物料名称和图号查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + //判断如果库存数量+在途数量-预定数量如果小于最低安全库存数量,则添加一条原材料采购记录 + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=imMaterial.getMinimum()){ + //产生采购记录 + PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial = new PwBuyingRequisitionMaterial(); + //令号 为请购单号 + pwBuyingRequisitionMaterial.setCode(pwBuyingRequisition.getCode()); + //请购单id + pwBuyingRequisitionMaterial.setBuyingRequisitionId(pwBuyingRequisition.getId()); + //物料名称 + pwBuyingRequisitionMaterial.setMaterialName(imMaterial.getMaterialName()); + //物料图号 + pwBuyingRequisitionMaterial.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterial.setMaterials(imMaterial.getMaterials()); + //单重 + pwBuyingRequisitionMaterial.setPieceWeight(imMaterial.getPieceWeight()); + //单位(如果材料单位为毫米,需要转换为米,如果材料单位为平方毫米,需要转换为平方米,其它的直接使用材料的单位) + if(imMaterial.getUnitOfMeasurementName().equals("毫米")){ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName("米"); + }else if(imMaterial.getUnitOfMeasurementName().equals("平方毫米")){ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName("平方米"); + }else{ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + } + //数量(如果材料单位为毫米,转换成米数,如果材料单位为平方毫米,转换为平方米)其他的不做转换 + if(imMaterial.getUnitOfMeasurementName().equals("毫米")){ + //最高安全库存-库存-在途+预定 + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-inventoryDetail.getQuantity()-inventoryDetail.getPreliminaryInventory())/1000); + }else if(imMaterial.getUnitOfMeasurementName().equals("平方毫米")){ + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-inventoryDetail.getQuantity()-inventoryDetail.getPreliminaryInventory())/1000000); + }else{ + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-inventoryDetail.getQuantity()-inventoryDetail.getPreliminaryInventory())); + } + //单价(获取原材料的单价) + pwBuyingRequisitionMaterial.setUnivalence(imMaterial.getUnitPrice().doubleValue()); + //总价(单价*数量) + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getNumber()*imMaterial.getUnitPrice().doubleValue()); + //理论重量(数量*材料的单重) + pwBuyingRequisitionMaterial.setReferenceNumber(pwBuyingRequisitionMaterial.getNumber()*imMaterial.getPieceWeight()); + //实际重量 + pwBuyingRequisitionMaterial.setPracticalNumber(0.0); + //入库状态 + pwBuyingRequisitionMaterial.setInventoryStatus("未入库"); + pwBuyingRequisitionMaterialService.insertPwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + + //修改库存的在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+(imMaterial.getHighest()-inventoryDetail.getQuantity()-inventoryDetail.getPreliminaryInventory())); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + return toAjax(i); + } + + /** + * 修改采购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:buyingRequisition:edit')") + @Log(title = "采购申请单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBuyingRequisition pwBuyingRequisition) + { + return toAjax(pwBuyingRequisitionService.updatePwBuyingRequisition(pwBuyingRequisition)); + } + + /** + * 删除采购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:buyingRequisition:remove')") + @Log(title = "采购申请单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long long1 : ids) { + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(long1); + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial : list) { + pwBuyingRequisitionMaterialService.deletePwBuyingRequisitionMaterialById(pwBuyingRequisitionMaterial.getId()); + } + } + return toAjax(pwBuyingRequisitionService.deletePwBuyingRequisitionByIds(ids)); + } + + /** + * 查询采购申请单已审核状态的数据 + * @return + */ + @GetMapping("/getPwBuyingRequisitionByStatus") + public AjaxResult getPwBuyingRequisitionByStatus(){ + PwBuyingRequisition pwBuyingRequisition = new PwBuyingRequisition(); + pwBuyingRequisition.setStatus(2); + List list = pwBuyingRequisitionService.selectPwBuyingRequisitionList(pwBuyingRequisition); + return AjaxResult.success(list); + } + + /** + * 审核请购单 + */ + @RequestMapping("/auditPwBuyingRequisition") + public AjaxResult auditPwBuyingRequisition(Long id){ + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(id); + if(StringUtils.isEmpty(buyingRequisition.getSellerName()) || null == buyingRequisition.getDemandDate()){ + return AjaxResult.error("请补全信息,再审核!"); + } + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + buyingRequisition.setStatus(2); + buyingRequisition.setAuditor(user.getNickName()); + int i = pwBuyingRequisitionService.updatePwBuyingRequisition(buyingRequisition); + if(i<1){ + return AjaxResult.error("审核失败"); + } + return AjaxResult.success("审核成功"); + } + + /** + * 打印合同 + * @param ids + * @return + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids) { + HashMap printMessageMap = new HashMap<>(); + //根据id获取合同信息 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(ids[0]); + if(StringUtils.isEmpty(buyingRequisition.getRemark())){ + buyingRequisition.setRemark(""); + } + if(buyingRequisition.getAppointTime() == null){ + buyingRequisition.setAppointTime(new Date()); + pwBuyingRequisitionService.updatePwBuyingRequisition(buyingRequisition); + } + //获得产品列表 + PwBuyingRequisitionMaterial materal = new PwBuyingRequisitionMaterial(); + materal.setBuyingRequisitionId(buyingRequisition.getId()); + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialList(materal); + long i = 1; + for (PwBuyingRequisitionMaterial pwbuy : list) { + pwbuy.setSerialNumber(i); + if(pwbuy.getNumber() != null && pwbuy.getUnivalence() != null){ + String zj = String.format("%.2f",pwbuy.getNumber() * pwbuy.getUnivalence()); + pwbuy.setTotalprice(Double.parseDouble(zj)); + } + i++; + } + //根据供应商名称查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierByName(buyingRequisition.getSellerName()); + //产品列表 + printMessageMap.put("product", list); + printMessageMap.put("contract", buyingRequisition); + printMessageMap.put("supplier", supplier); + return AjaxResult.success("success", printMessageMap); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody PwBuyingRequisition buyingRequisition){ + //校验付款金额 + if(null==buyingRequisition.getPaymentAmount()||"".equals(buyingRequisition.getPaymentAmount())||0==buyingRequisition.getPaymentAmount()){ + return AjaxResult.error("请填写付款金额"); + } + //获取合同id + Long[] ids = buyingRequisition.getIds(); + //供应商名称 + String name = ""; + //合同总金额 + Double d = 0.0; + for (Long id : ids) { + PwBuyingRequisition pwBuyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(id); + //校验当前选中的合同是否为同一个供应商 + if(!"".equals(name)){ + //校验name是否和供应商名称相同 + if(!name.equals(pwBuyingRequisition.getSellerName())){ + return AjaxResult.error("不同供应商不可合并付款"); + } + }else{ + name = pwBuyingRequisition.getSellerName(); + } + + //计算合同总金额 + d += pwBuyingRequisition.getTotalPrices(); + } + + //校验付款金额是否大于合同总金额 + if(d0){ + //生成付款申请单及付款申请单明细 + for (Long id : ids) { + PwBuyingRequisition pwBuyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(id); + + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + //付款单id + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + //付款单编号 + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + //关联合同编号 + cwOtherPaymentInfo.setCode(pwBuyingRequisition.getCode()); + //合同金额 + cwOtherPaymentInfo.setContractMoney(pwBuyingRequisition.getTotalPrices()); + //付款金额(计算) 合同金额*(付款金额/总金额) + cwOtherPaymentInfo.setPaymentAmount(pwBuyingRequisition.getTotalPrices()*(buyingRequisition.getPaymentAmount()/d)); + //付款比例(计算) 付款金额/合同金额 + cwOtherPaymentInfo.setProportion(cwOtherPaymentInfo.getPaymentAmount()/pwBuyingRequisition.getTotalPrices()*100); + //合同类型 + cwOtherPaymentInfo.setSparedOne("原材料采购合同"); + cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + } + return toAjax(i); + } + + /** + * 生成物流费用单 + */ + @RequestMapping("/addLogistics") + public AjaxResult addLogistics(@RequestBody PwBuyingRequisition pwBuyingRequisition) { + //校验付款金额 + if (null == pwBuyingRequisition.getMoney() || "".equals(pwBuyingRequisition.getMoney()) || 0 == pwBuyingRequisition.getMoney()) { + return AjaxResult.error("请填写付款金额"); + } + //校验支付方式 + if(null==pwBuyingRequisition.getPayWay()||"".equals(pwBuyingRequisition.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==pwBuyingRequisition.getUnitName()||"".equals(pwBuyingRequisition.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //物料费用单 + CwLogisticsFeesInfo cwLogisticsFeesInfo = new CwLogisticsFeesInfo(); + + //编号 + cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); + //关联单据编号 所勾选的合同编号 + //获取合同id + Long[] ids = pwBuyingRequisition.getIds(); + //拼接合同编号 + String code = ""; + for (Long id : ids) { + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(id); + code += buyingRequisition.getCode()+","; + } + cwLogisticsFeesInfo.setRelevanceCode(code); + //单据类型 + cwLogisticsFeesInfo.setRelevanceType("原材料采购合同"); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //小写金额 + cwLogisticsFeesInfo.setMoney(pwBuyingRequisition.getMoney()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(pwBuyingRequisition.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //事由 + cwLogisticsFeesInfo.setCause("采购运费"); + //支付方式 + cwLogisticsFeesInfo.setPayWay(pwBuyingRequisition.getPayWay()); + //单位名称 + cwLogisticsFeesInfo.setUnitName(pwBuyingRequisition.getUnitName()); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(pwBuyingRequisition.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(pwBuyingRequisition.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(pwBuyingRequisition.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); + return toAjax(i); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(id); + /*if(StringUtils.isEmpty(buyingRequisition.getSellerName()) || null == buyingRequisition.getDemandDate()){ + return AjaxResult.error("请补全信息,再审核!"); + }*/ + if (buyingRequisition.getSellerName() == null || buyingRequisition.getSellerName().isEmpty()) { + AjaxResult.error("供应商信息不全,请补充完整"); + } + if (buyingRequisition.getTaxRate() == null || buyingRequisition.getTaxRate() == 0) { + AjaxResult.error("税率信息不全,请补充完整"); + } + if (buyingRequisition.getTotalPrices() == null || buyingRequisition.getTotalPrices() == 0.0) { + AjaxResult.error("总价不全,请补充完整"); + } + if (buyingRequisition.getDeliveryType() == null || buyingRequisition.getDeliveryType().isEmpty()) { + AjaxResult.error("交货方式不全,请补充完整"); + } + if (buyingRequisition.getPayer() == null || buyingRequisition.getPayer().isEmpty()) { + AjaxResult.error("运费支付方不全,请补充完整"); + } + if (buyingRequisition.getModeOfPayment() == null || buyingRequisition.getModeOfPayment().isEmpty()) { + AjaxResult.error("货款支付方式不全,请补充完整"); + } + + if(null!=buyingRequisition.getLeadership()){ + buyingRequisition.setLeadership(""); + }else{ + buyingRequisition.setLeadership(user.getNickName()); + //审批时间 + buyingRequisition.setLeadershipTime(new Date()); + } + i = pwBuyingRequisitionService.updatePwBuyingRequisition(buyingRequisition); + } + return toAjax(i); + } + + /** + * 返回不符合条件的字段 + * + * @param buyingRequisition + * @return message + */ + private static StringBuilder getCondition(PwBuyingRequisition buyingRequisition) { + StringBuilder message = new StringBuilder("以下条件不符:"); + if (buyingRequisition.getSellerName() == null || buyingRequisition.getSellerName().isEmpty()) { + message.append("供应商, "); + } + if (buyingRequisition.getTaxRate() == null || buyingRequisition.getTaxRate() == 0) { + message.append("税率, "); + } + if (buyingRequisition.getTotalPrices() == null || buyingRequisition.getTotalPrices() == 0.0) { + message.append("总价, "); + } + if (buyingRequisition.getDeliveryType() == null || buyingRequisition.getDeliveryType().isEmpty()) { + message.append("交货方式, "); + } + if (buyingRequisition.getPayer() == null || buyingRequisition.getPayer().isEmpty()) { + message.append("运费支付方, "); + } + if (buyingRequisition.getModeOfPayment() == null || buyingRequisition.getModeOfPayment().isEmpty()) { + message.append("货款支付方式, "); + } + return message; + } + /** + * 上传合同的PDF + * + * @param id + * @param filePath + * @return + */ + @RequestMapping("/uploadContractPDF") + @ResponseBody + public AjaxResult uploadContractPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { + System.out.println(id); + String originalFilename = filePath.getOriginalFilename(); + if (originalFilename != null) { + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传"); + } else { + PwBuyingRequisition pwBuyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(Long.valueOf(id)); + //根据id 获取合同信息 + String newfilenname = generateUniqueFileName(originalFilename); + try (InputStream is = filePath.getInputStream(); + //在对应的文件夹下生成新的图片 + FileOutputStream fos = new FileOutputStream("D:/contract/" + newfilenname); + BufferedOutputStream bos = new BufferedOutputStream(fos)) { + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + //映射路径 + pwBuyingRequisition.setContractPath(newfilenname); + //更新 + pwBuyingRequisitionService.updatePwBuyingRequisition(pwBuyingRequisition); + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + } + } + } + return AjaxResult.success("文件上传成功"); + + } + + /** + * 生成随机文件名 + * + * @param originalFilename + * @return + */ + private String generateUniqueFileName(String originalFilename) { + String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); + String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); + //生成年月日加 毫秒值的 文件名称 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String date = dateFormat.format(new Date()); + return filename + "_" + date + System.currentTimeMillis() + extension; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionJjController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionJjController.java new file mode 100644 index 0000000..1ec6b77 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionJjController.java @@ -0,0 +1,186 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionJj; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialJj; +import com.ruoyi.project.management.service.IPwBuyingRequisitionJjService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialJjService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.poi.ExcelUtilPrint; +import com.ruoyi.common.utils.poi.ExcelUtilPrintJj; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 基建请购申请单Controller + * + * @author zhukangchao + * @date 2022-06-28 + */ +@RestController +@RequestMapping("/management/pwBuyingRequisitionJj") +public class PwBuyingRequisitionJjController extends BaseController +{ + @Autowired + private IPwBuyingRequisitionJjService pwBuyingRequisitionJjService; + //请购单详情信息 + @Autowired + private IPwBuyingRequisitionMaterialJjService pwBuyingRequisitionMaterialJjService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + + /** + * 查询基建请购申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionJj:list')") + @GetMapping("/list") + public TableDataInfo list(PwBuyingRequisitionJj pwBuyingRequisitionJj) + { + startPage(); + List list = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjList(pwBuyingRequisitionJj); + return getDataTable(list); + } + + /** + * 导出基建请购申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionJj:export')") + @Log(title = "基建请购申请单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBuyingRequisitionJj pwBuyingRequisitionJj) + { + List list = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjList(pwBuyingRequisitionJj); + ExcelUtil util = new ExcelUtil(PwBuyingRequisitionJj.class); + return util.exportExcel(list, "pwBuyingRequisitionJj"); + } + + /** + * 获取基建请购申请单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionJj:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(id)); + } + + /** + * 新增基建请购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionJj:add')") + @Log(title = "基建请购申请单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBuyingRequisitionJj pwBuyingRequisitionJj){ + + if(null==pwBuyingRequisitionJj.getName()){ + return AjaxResult.error("请输入名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + pwBuyingRequisitionJj.setCode("JJ"+sdf.format(new Date())); + pwBuyingRequisitionJj.setProposer(user.getNickName()); + //请购单状态初始值为1,(待审核状态) + pwBuyingRequisitionJj.setStatus(1); + return toAjax(pwBuyingRequisitionJjService.insertPwBuyingRequisitionJj(pwBuyingRequisitionJj)); + } + + /** + * 修改基建请购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionJj:edit')") + @Log(title = "基建请购申请单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBuyingRequisitionJj pwBuyingRequisitionJj) + { + return toAjax(pwBuyingRequisitionJjService.updatePwBuyingRequisitionJj(pwBuyingRequisitionJj)); + } + + /** + * 删除基建请购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionJj:remove')") + @Log(title = "基建请购申请单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwBuyingRequisitionJjService.deletePwBuyingRequisitionJjByIds(ids)); + } + + /** + * 审核请购单 + */ + @RequestMapping("/auditPwBuyingRequisitionJj") + public AjaxResult auditPwBuyingRequisitionJj(Long id){ + PwBuyingRequisitionJj buyingRequisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(id); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + buyingRequisitionJj.setStatus(2); + buyingRequisitionJj.setAuditor(user.getNickName()); + int i = pwBuyingRequisitionJjService.updatePwBuyingRequisitionJj(buyingRequisitionJj); + if(i<1){ + return AjaxResult.error("审核失败"); + } + return AjaxResult.success("审核成功"); + } + + /** + * 打印基建请购申请单 + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //根据id查询请购单信息 + PwBuyingRequisitionJj buyingRequisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(ids[0]); + + //根据请购单id查询详情表中的物料 + List list = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(buyingRequisitionJj.getId()); + Long i = 1L; + for (PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj : list) { + pwBuyingRequisitionMaterialJj.setSerialNumber(i); + i++; + } + // 创建excel文件 + ExcelUtilPrintJj util = new ExcelUtilPrintJj(PwBuyingRequisitionMaterialJj.class); + //一级表头 + String title = "河北伊特机械设备制造有限公司"; + //二级表头 + String titleTwo = "请购单"; + //三级表头 + String titleThree = " 摘要: "+"制单日期: "+sdf.format(new Date())+" "+"编号: "+buyingRequisitionJj.getCode(); + //表尾 + String footer = " 请购人: "+user.getNickName()+" 需求日期: "+sdf.format(buyingRequisitionJj.getDemandDate())+" 审核: "; + + return util.exportExcel(list,"请购单",title,titleTwo,"用途: "+buyingRequisitionJj.getPurpose(),titleThree,footer); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialController.java new file mode 100644 index 0000000..6438b0b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialController.java @@ -0,0 +1,919 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; +import com.ruoyi.project.management.domain.PwCompletionNotice; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.poi.ExcelUtilPrint; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 请购单物料详情Controller + * + * @author zhukangchao + * @date 2021-10-18 + */ +@RestController +@RequestMapping("/management/pwBuyingRequisitionMaterial") +public class PwBuyingRequisitionMaterialController extends BaseController{ + @Autowired + private IPwBuyingRequisitionMaterialService pwBuyingRequisitionMaterialService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //请购单详情信息 + @Autowired + private IPwBuyingRequisitionService pwBuyingRequisitionService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //用户信息 + @Autowired + private TokenService tokenService; + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询请购单物料详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial) + { + startPage(); + if(null!=pwBuyingRequisitionMaterial.getMaterialName()){ + pwBuyingRequisitionMaterial.setBuyingRequisitionId(null); + } + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialList(pwBuyingRequisitionMaterial); + //项目令号 + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial2 : list) { + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(pwBuyingRequisitionMaterial2.getBuyingRequisitionId()); + if(null!=buyingRequisition){ + pwBuyingRequisitionMaterial2.setCode(buyingRequisition.getPurpose()); + } + } + return getDataTable(list); + } + + /** + * 导出请购单物料详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterial:export')") + @Log(title = "请购单物料详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial) + { + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialList(pwBuyingRequisitionMaterial); + ExcelUtil util = new ExcelUtil(PwBuyingRequisitionMaterial.class); + return util.exportExcel(list, "pwBuyingRequisitionMaterial"); + } + + /** + * 获取请购单物料详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id){ + //查询剩余可入库的数量 + PwBuyingRequisitionMaterial material = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(id); + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(material.getBuyingRequisitionId()); + //根据令号和名称和图号查询质检管理列表中的合格数量 + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(buyingRequisition.getCode(), material.getMaterialName(), material.getFigureNumber()); + double i = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list) { + //可入库数量 = 总数量 - (已质检的合格数量+未质检的申请数量) + i += pwCompletionNoticeProduct.getQuantity()+pwCompletionNoticeProduct.getActualQuantity(); + } + PwBuyingRequisitionMaterial material2 = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(id); + material2.setQuantity(material2.getNumber()-i); + return AjaxResult.success(material2); + } + + /** + * 新增请购单物料详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterial:add')") + @Log(title = "请购单物料详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial){ + //判断物料id是否为null + if(null == pwBuyingRequisitionMaterial.getMaterialId()||"".equals(pwBuyingRequisitionMaterial.getMaterialId())){ + return AjaxResult.error("请选择物料"); + } + //判断单价是否为null + if(null==pwBuyingRequisitionMaterial.getUnivalence()||"".equals(pwBuyingRequisitionMaterial.getUnivalence())){ + return AjaxResult.error("请填写物料单价"); + } + //判断数量是否为null + if(null==pwBuyingRequisitionMaterial.getNumber()||"".equals(pwBuyingRequisitionMaterial.getNumber())){ + return AjaxResult.error("请填写需采购数量"); + } + //判断计量单位是否为null + if(null == pwBuyingRequisitionMaterial.getUnitOfMeasurementName()||"".equals(pwBuyingRequisitionMaterial.getUnitOfMeasurementName())){ + return AjaxResult.error("请选择计量单位"); + } + + //根据物料id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwBuyingRequisitionMaterial.getMaterialId()); + //物料名称 + pwBuyingRequisitionMaterial.setMaterialName(imMaterial.getMaterialName()); + //图号 + pwBuyingRequisitionMaterial.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterial.setMaterials(imMaterial.getMaterials()); + //单重 + pwBuyingRequisitionMaterial.setPieceWeight(imMaterial.getPieceWeight()); + //单位 +// pwBuyingRequisitionMaterial.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + //入库状态初始为 未入库 + pwBuyingRequisitionMaterial.setInventoryStatus("未入库"); + //计算总价 + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getNumber()*pwBuyingRequisitionMaterial.getUnivalence()); + //执行添加操作 + int i = pwBuyingRequisitionMaterialService.insertPwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + //根据采购单id查询当前所有的采购物料 + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(pwBuyingRequisitionMaterial.getBuyingRequisitionId()); + //总价 + Double zongjia = 0.0; + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial2 : list) { + zongjia += pwBuyingRequisitionMaterial2.getTotalprice(); + } + //根据采购单id查询采购单 + PwBuyingRequisition pwBuyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(pwBuyingRequisitionMaterial.getBuyingRequisitionId()); + //总价 + pwBuyingRequisition.setTotalPrices(zongjia); + //重置审核状态 + pwBuyingRequisition.setStatus(1); + int j = pwBuyingRequisitionService.updatePwBuyingRequisition(pwBuyingRequisition); + return toAjax(j); + } + + /** + * 修改请购单物料详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterial:edit')") + @Log(title = "请购单物料详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial){ + //根据id查询修改之前的采购数量 + PwBuyingRequisitionMaterial buyingRequisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(pwBuyingRequisitionMaterial.getId()); + //判断是否修改了采购数量 + if(pwBuyingRequisitionMaterial.getNumber()!=buyingRequisitionMaterial.getNumber()){ + //如果修改了采购数量,则同时修改库存的在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBuyingRequisitionMaterial.getMaterialName(), pwBuyingRequisitionMaterial.getFigureNumber()); + //在途数量减去修改之前,加上现在修改的 + if(pwBuyingRequisitionMaterial.getUnitOfMeasurementName().equals("米")){ + BigDecimal subtract = new BigDecimal(buyingRequisitionMaterial.getNumber()).subtract(new BigDecimal(pwBuyingRequisitionMaterial.getNumber())); + BigDecimal multiply = subtract.multiply(new BigDecimal(1000)); + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - multiply.longValue()); + }else if(pwBuyingRequisitionMaterial.getUnitOfMeasurementName().equals("平方米")){ + BigDecimal subtract = new BigDecimal(buyingRequisitionMaterial.getNumber()).subtract(new BigDecimal(pwBuyingRequisitionMaterial.getNumber())); + BigDecimal multiply = subtract.multiply(new BigDecimal(1000000)); + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - multiply.longValue()); + }else{ + BigDecimal subtract = new BigDecimal(buyingRequisitionMaterial.getNumber()).subtract(new BigDecimal(pwBuyingRequisitionMaterial.getNumber())); + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - subtract.longValue()); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + //如果填写了实际重量,则默认为单价为1Kg的单价 + if(null!=pwBuyingRequisitionMaterial.getPracticalNumber()&&pwBuyingRequisitionMaterial.getPracticalNumber()!=0){ + //重新计算总价 + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getPracticalNumber()*pwBuyingRequisitionMaterial.getUnivalence()); + }else{ + //重新计算总价 + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getNumber()*pwBuyingRequisitionMaterial.getUnivalence()); + } + int i = pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + //重新计算请购单总价 + //添加完之后遍历此单据下所有的物料,计算总价格后保存到请购单上 + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(pwBuyingRequisitionMaterial.getBuyingRequisitionId()); + //请购单总价 + double d = 0; + //遍历集合,获取所有物料的总价,相加 + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial2 : list) { + d = d + pwBuyingRequisitionMaterial2.getTotalprice(); + } + //获取请购单详情 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(pwBuyingRequisitionMaterial.getBuyingRequisitionId()); + buyingRequisition.setTotalPrices(d); + pwBuyingRequisitionService.updatePwBuyingRequisition(buyingRequisition); + + return toAjax(i); + } + + /** + * 删除请购单物料详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterial:remove')") + @Log(title = "请购单物料详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //根据物料详情id查询单据id + PwBuyingRequisitionMaterial requisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(ids[0]); + + //如果删除了采购数量,则同时删除库存的在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(requisitionMaterial.getMaterialName(), requisitionMaterial.getFigureNumber()); + //删除之前把在途减掉 + /*if(null != inventoryDetail){ + if(requisitionMaterial.getUnitOfMeasurementName().equals("米")){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - (long)(requisitionMaterial.getNumber() * 1000)); + }else if(requisitionMaterial.getUnitOfMeasurementName().equals("平方米")){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - (long)(requisitionMaterial.getNumber() * 1000000)); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - requisitionMaterial.getNumber().longValue()); + } + if(inventoryDetail.getPreliminaryInventory()<0){ + inventoryDetail.setPreliminaryInventory(0L); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }*/ + + int i = pwBuyingRequisitionMaterialService.deletePwBuyingRequisitionMaterialByIds(ids); + //删除之后从新计算请购单总价 + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(requisitionMaterial.getBuyingRequisitionId()); + //请购单总价 + double d = 0; + //遍历集合,获取所有物料的总价,相加 + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial2 : list) { + d = d + pwBuyingRequisitionMaterial2.getTotalprice(); + } + //获取请购单详情 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(requisitionMaterial.getBuyingRequisitionId()); + buyingRequisition.setTotalPrices(d); + pwBuyingRequisitionService.updatePwBuyingRequisition(buyingRequisition); + return toAjax(i); + } + + /** + * 打印单据功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据, + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdft= new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(ids.length==0){ + return AjaxResult.error("请选择物料"); + } + List list = new ArrayList(); + Long i = 1L; + String userName = ""; + //遍历ids + for (Long id : ids) { + //根据id获取物料信息 + PwBuyingRequisitionMaterial requisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(id); + requisitionMaterial.setSerialNumber(i); + //根据请购单id查询请购单信息 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(requisitionMaterial.getBuyingRequisitionId()); + requisitionMaterial.setCode(buyingRequisition.getPurpose()); + userName = buyingRequisition.getProposer(); + i++; + list.add(requisitionMaterial); + } + //首先把数据集合生成excel,然后调用打印机打印excel + // 创建excel文件 + ExcelUtilPrint util = new ExcelUtilPrint(PwBuyingRequisitionMaterial.class); + //一级表头 + String title = "河北伊特机械设备制造有限公司"; + //二级表头 + String titleTwo = "请购单"; + //三级表头 + String titleThree = "摘要: "+"日期: "+sdf.format(new Date())+" "+"编号: "+sdft.format(new Date()); + //表尾 + String footer = "核准: "+" 审核: "+" 请购人: "+userName; + +// AjaxResult result = util.exportExcel(list,"入库单",title,titleTwo,"供应商:"+preferentialOriginName,titleThree,footer); + //打印文件 + //获取文件路径 +// String filePath = RuoYiConfig.getDownloadPath() + result.get("msg"); +// File file = new File(filePath); +// boolean b = Print.printOfficeFile(file); +// if(b){ +// return AjaxResult.success(); +// }else{ +// return AjaxResult.error(); +// } + return util.exportExcel(list,"请购单",title,titleTwo,"",titleThree,footer); + } + + /** + * 生成采购单物料详情 + */ + @RequestMapping("/addPurchases/{ids}") + public AjaxResult addPurchases(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + + //创建采购单 + PwBuyingRequisition pwBuyingRequisition = new PwBuyingRequisition(); + pwBuyingRequisition.setCode("QG"+sdf.format(new Date())); + pwBuyingRequisition.setProposer(user.getNickName()); + //请购单状态初始值为1,(待审核状态) + pwBuyingRequisition.setStatus(1); + //总价 + Double d = 0.0; + for (Long long1 : ids) { + PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(long1); + d += pwBuyingRequisitionMaterial.getTotalprice(); + } + pwBuyingRequisition.setTotalPrices(d); + pwBuyingRequisition.setBigTotalPrices(MoneyUtil.toChinese(d.toString())); + int buyingRequisition = pwBuyingRequisitionService.insertPwBuyingRequisition(pwBuyingRequisition); + int i = 0; + if(buyingRequisition>0){ + for (Long long1 : ids) { + PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(long1); + pwBuyingRequisitionMaterial.setBuyingRequisitionId(pwBuyingRequisition.getId()); + i = pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + } + }else{ + return toAjax(buyingRequisition); + } + return toAjax(i); + } + + /** + * 申请入库 + */ + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial){ + + if(pwBuyingRequisitionMaterial.getQuantity() == 0){ + return AjaxResult.error("请输入申请数量"); + } + + //判断申请数量是否大于了应采购数量 + PwBuyingRequisition buyingRequisition2 = pwBuyingRequisitionService.selectPwBuyingRequisitionById(pwBuyingRequisitionMaterial.getBuyingRequisitionId()); + //根据令号和名称和图号查询质检管理列表中的合格数量 + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(buyingRequisition2.getCode(), pwBuyingRequisitionMaterial.getMaterialName(), pwBuyingRequisitionMaterial.getFigureNumber()); + //i = 可入库数量 + double r = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list) { + //可入库数量 = 总数量 - (已质检的合格数量+未质检的申请数量) + r += pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getActualQuantity(); + } + + if(pwBuyingRequisitionMaterial.getNumber() - r < pwBuyingRequisitionMaterial.getQuantity()){ + return AjaxResult.error("入库数量不可大于总数量"); + } + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据id查看待采购明细表 + PwBuyingRequisitionMaterial buyingRequisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(pwBuyingRequisitionMaterial.getId()); + //根据请购单id查询请购单号 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(buyingRequisitionMaterial.getBuyingRequisitionId()); + //根据合同id查看此合同是否已经添加到待入库申请表了,如果添加到了则不再添加,反之则直接添加 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(buyingRequisition.getCode()); + if(null!=productReceipt){ + //如果不等于null 则直接把物料添加到待入库详情表中 + //添加入库单详情 + if("已申请".equals(buyingRequisitionMaterial.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //判断单价是否为null,单价为null不允许入库 + if(null==pwBuyingRequisitionMaterial.getUnivalence()||pwBuyingRequisitionMaterial.getUnivalence()==0){ + return AjaxResult.error("请填写单价"); + } + //判断是否是原材料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBuyingRequisitionMaterial.getMaterialName(), pwBuyingRequisitionMaterial.getFigureNumber()); + if(null != material){ + if(material.getMaterialTypeName().equals("原材料")&&(buyingRequisitionMaterial.getUnitOfMeasurementName().equals("米")||buyingRequisitionMaterial.getUnitOfMeasurementName().equals("平方米"))){ + if(null==pwBuyingRequisitionMaterial.getPracticalNumber()||pwBuyingRequisitionMaterial.getPracticalNumber()==0){ + return AjaxResult.error("请输入总重"); + } + } + //修改单重(物料单重,加权平均) + if(null!=pwBuyingRequisitionMaterial.getPracticalNumber()&&pwBuyingRequisitionMaterial.getPracticalNumber()!=0){ + double d = pwBuyingRequisitionMaterial.getPracticalNumber()/buyingRequisitionMaterial.getNumber(); + if(null!=material.getPieceWeight()&&material.getPieceWeight()!=0){ + material.setPieceWeight((material.getPieceWeight()+d)/2); + }else{ + material.setPieceWeight(d); + } + imMaterialService.updateImMaterial(material); + //修改库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(null!=inventoryDetail){ + inventoryDetail.setPieceWeight(material.getPieceWeight()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + }else{ + return AjaxResult.error("未查询到此物料"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //根据请购单号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(buyingRequisition.getCode()); + //令号 + imProductReceiptMaterial.setCode(buyingRequisition.getCode()); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //物料名称 + imProductReceiptMaterial.setMaterialName(buyingRequisitionMaterial.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(buyingRequisitionMaterial.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(buyingRequisitionMaterial.getMaterials()); + //单重 +// imProductReceiptMaterial.set + //单位 + imProductReceiptMaterial.setUnit(buyingRequisitionMaterial.getUnitOfMeasurementName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(buyingRequisitionMaterial.getQuantity()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(buyingRequisitionMaterial.getQuantity()); + if(null==pwBuyingRequisitionMaterial.getPracticalNumber()||0==pwBuyingRequisitionMaterial.getPracticalNumber()){ + //实际重量 + imProductReceiptMaterial.setPracticalNumber(0.0); + //单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterial.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getQuantity()); + if(null==pwBuyingRequisitionMaterial.getSumNumber()){ + pwBuyingRequisitionMaterial.setSumNumber(0.0); + } + //累计数量 + pwBuyingRequisitionMaterial.setSumNumber(pwBuyingRequisitionMaterial.getSumNumber()+pwBuyingRequisitionMaterial.getQuantity()); + //采购单的总价 + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getSumNumber()); + }else{ + //实际重量 + imProductReceiptMaterial.setPracticalNumber(pwBuyingRequisitionMaterial.getPracticalNumber()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterial.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getPracticalNumber()); + if(null==pwBuyingRequisitionMaterial.getSumNumber()){ + pwBuyingRequisitionMaterial.setSumNumber(0.0); + } + //累计数量 + pwBuyingRequisitionMaterial.setSumNumber(pwBuyingRequisitionMaterial.getSumNumber()+pwBuyingRequisitionMaterial.getQuantity()); + //采购单的总价 + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getPracticalNumber()); + } + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwBuyingRequisitionMaterial.getPreferentialOriginName()); +// imProductReceiptMaterial.setQualityInspector("采购"); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(buyingRequisition.getCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(buyingRequisition.getCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(pwBuyingRequisitionMaterial.getMaterialName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(pwBuyingRequisitionMaterial.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(pwBuyingRequisitionMaterial.getMaterials()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(pwBuyingRequisitionMaterial.getPreferentialOriginName()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBuyingRequisitionMaterial.getQuantity()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBuyingRequisitionMaterial.getQuantity()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("原材料待质检",buyingRequisition.getCode(),pwBuyingRequisitionMaterial.getMaterialName(),pwBuyingRequisitionMaterial.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + //判断申请数量是否和应采购数量一致,如果一致,修改状态为已申请,如果不一致,则改为申请中 + + if(pwBuyingRequisitionMaterial.getSumNumber().toString().equals(buyingRequisitionMaterial.getNumber().toString())){ + //修改预制单详情的入库状态,改为已申请 + pwBuyingRequisitionMaterial.setInventoryStatus("已申请"); + }else{ + //修改预制单详情的入库状态,改为申请中 + pwBuyingRequisitionMaterial.setInventoryStatus("申请中"); + } + //累计已申请数量 + if(null==pwBuyingRequisitionMaterial.getSumNumber()){ + pwBuyingRequisitionMaterial.setSumNumber(0.0); + } + int y = pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + if(y<1){ + return AjaxResult.error("申请失败"); + } + } + }else{ + //判断是否是原材料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBuyingRequisitionMaterial.getMaterialName(), pwBuyingRequisitionMaterial.getFigureNumber()); + if(null != material){ + if(material.getMaterialTypeName().equals("原材料")&&(buyingRequisitionMaterial.getUnitOfMeasurementName().equals("米")||buyingRequisitionMaterial.getUnitOfMeasurementName().equals("平方米"))){ + if(null==pwBuyingRequisitionMaterial.getPracticalNumber()||pwBuyingRequisitionMaterial.getPracticalNumber()==0){ + return AjaxResult.error("请输入总重"); + } + } + //修改单重(物料单重,加权平均) + if(null!=pwBuyingRequisitionMaterial.getPracticalNumber()&&pwBuyingRequisitionMaterial.getPracticalNumber()!=0){ + double d = pwBuyingRequisitionMaterial.getPracticalNumber()/buyingRequisitionMaterial.getNumber(); + if(null!=material.getPieceWeight()&&material.getPieceWeight()!=0){ + material.setPieceWeight((material.getPieceWeight()+d)/2); + }else{ + material.setPieceWeight(d); + } + imMaterialService.updateImMaterial(material); + //修改库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(null!=inventoryDetail){ + inventoryDetail.setPieceWeight(material.getPieceWeight()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + }else{ + return AjaxResult.error("未查询到此物料"); + } + //如果等于null 则先添加待入库单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(buyingRequisition.getCode()); + //项目令号 + imProductReceipt.setCode(buyingRequisition.getPurpose()); + //项目名称 + imProductReceipt.setProjectName(buyingRequisition.getName()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(buyingRequisition.getCode()); + //保存项目名称 + pwCompletionNotice.setProjectName(buyingRequisition.getPurpose()+"(原材料)"); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + + //添加入库单详情 + if("已申请".equals(buyingRequisitionMaterial.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //判断单价是否为null,单价为null不允许入库 + if(null==pwBuyingRequisitionMaterial.getUnivalence()||pwBuyingRequisitionMaterial.getUnivalence()==0){ + return AjaxResult.error("请填写单价"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(buyingRequisition.getCode()); + //令号 + imProductReceiptMaterial.setCode(buyingRequisition.getCode()); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //物料名称 + imProductReceiptMaterial.setMaterialName(buyingRequisitionMaterial.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(buyingRequisitionMaterial.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(buyingRequisitionMaterial.getMaterials()); + //单重 +// imProductReceiptMaterial.set + //单位 + imProductReceiptMaterial.setUnit(buyingRequisitionMaterial.getUnitOfMeasurementName()); + + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(buyingRequisitionMaterial.getQuantity()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(buyingRequisitionMaterial.getQuantity()); + + if(null==pwBuyingRequisitionMaterial.getPracticalNumber()||0 == pwBuyingRequisitionMaterial.getPracticalNumber()){ + //实际重量 + imProductReceiptMaterial.setPracticalNumber(0.0); + //单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterial.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getQuantity()); + if(null==pwBuyingRequisitionMaterial.getSumNumber()){ + pwBuyingRequisitionMaterial.setSumNumber(0.0); + } + //累计数量 + pwBuyingRequisitionMaterial.setSumNumber(pwBuyingRequisitionMaterial.getSumNumber()+pwBuyingRequisitionMaterial.getQuantity()); + //采购单的总价 + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getSumNumber()); + }else{ + //实际重量 + imProductReceiptMaterial.setPracticalNumber(pwBuyingRequisitionMaterial.getPracticalNumber()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterial.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getPracticalNumber()); + if(null==pwBuyingRequisitionMaterial.getSumNumber()){ + pwBuyingRequisitionMaterial.setSumNumber(0.0); + } + //累计数量 + pwBuyingRequisitionMaterial.setSumNumber(pwBuyingRequisitionMaterial.getSumNumber()+pwBuyingRequisitionMaterial.getQuantity()); + //采购单的总价 + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getUnivalence()*pwBuyingRequisitionMaterial.getPracticalNumber()); + } + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwBuyingRequisitionMaterial.getPreferentialOriginName()); +// imProductReceiptMaterial.setQualityInspector("采购"); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(buyingRequisition.getCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(buyingRequisition.getCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(pwBuyingRequisitionMaterial.getMaterialName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(pwBuyingRequisitionMaterial.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(pwBuyingRequisitionMaterial.getMaterials()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(pwBuyingRequisitionMaterial.getPreferentialOriginName()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwBuyingRequisitionMaterial.getQuantity()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwBuyingRequisitionMaterial.getQuantity()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("原材料待质检",buyingRequisition.getCode(),pwBuyingRequisitionMaterial.getMaterialName(),pwBuyingRequisitionMaterial.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + //判断申请数量是否和应采购数量一致,如果一致,修改状态为已申请,如果不一致,则改为申请中 + if(pwBuyingRequisitionMaterial.getSumNumber().toString().equals(buyingRequisitionMaterial.getNumber().toString())){ + //修改预制单详情的入库状态,改为已申请 + pwBuyingRequisitionMaterial.setInventoryStatus("已申请"); + }else{ + //修改预制单详情的入库状态,改为申请中 + pwBuyingRequisitionMaterial.setInventoryStatus("申请中"); + } + int k = pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + return AjaxResult.success(); + } + + /** + * 确认采购按钮 + */ + @RequestMapping("/affirms/{ids}") + public AjaxResult affirms(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + PwBuyingRequisitionMaterial material = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(id); + if(material.getInventoryStatus().equals("已采购")){ + material.setInventoryStatus("未入库"); + }else{ + material.setInventoryStatus("已采购"); + } + i = pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(material); + } + return toAjax(i); + } + + /** + * 撤销申请入库按钮操作 + */ + @RequestMapping("/revocations/{ids}") + public AjaxResult revocations(@PathVariable Long[] ids){ + + int i = 0; + for (Long id : ids) { + //根据id查询采购单信息 + PwBuyingRequisitionMaterial material = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialById(id); + //根据采购单id查询采购单信息 + PwBuyingRequisition requisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(material.getBuyingRequisitionId()); + + //根据物料名称和图号和令号查找此物料最近一次申请的质检信息 + int a = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(requisition.getCode(), material.getMaterialName(), material.getFigureNumber()); + if(a==0){ + return AjaxResult.error("当前物料未申请质检,无需撤销"); + } + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById((long)a); + //判断是否已经质检,如果已经质检则需要查询入库信息,并退库,如果没有质检,则直接删除质检详情信息,然后把状态改为null + if(completionNoticeProduct.getCheckoutStatus().equals("已检验")||completionNoticeProduct.getCheckoutStatus().equals("正在检验")){ + return AjaxResult.error("已检验的物料不允许撤销"); + }else{ + //根据物料名称和图号和令号查询入库单详情信息,距离当前时间最近的一条数据 + //先查询是否有数据 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(requisition.getCode(), material.getMaterialName(), material.getFigureNumber()); + if(list.size()>0){ + int b = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(requisition.getCode(), material.getMaterialName(), material.getFigureNumber()); + ImProductReceiptMaterial receiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById((long)b); + //判断当前数据是否已经确认入库,如果确认入库则需要退库 + if(receiptMaterial.getInventoryStatus().equals("已入库")){ + //已经确认入库的则不允许撤销 + return AjaxResult.error("已经确认入库的物料不允许撤销"); + } + //删除当前数据 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(receiptMaterial.getId()); + //查询此单据下是否还有其他物料。如果没有,则把入库单也删掉 + List list3 = imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptId(receiptMaterial.getProductReceiptId()); + if(list3.size()==0){ + imProductReceiptService.deleteImProductReceiptById(receiptMaterial.getProductReceiptId()); + } + } + } + pwCompletionNoticeProductService.deletePwCompletionNoticeProductById(completionNoticeProduct.getId()); + List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCnpId(completionNoticeProduct.getCompletionNoticeId()); + if(list2.size()==0){ + pwCompletionNoticeService.deletePwCompletionNoticeById(completionNoticeProduct.getCompletionNoticeId()); + } + //修改采购单状态为已采购 + material.setInventoryStatus("已采购"); + material.setSumNumber(material.getSumNumber()-completionNoticeProduct.getReceivableQuantity()); + i = pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(material); + + //恢复单重 + //判断是否是原材料 + ImMaterial materials = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(material.getMaterialName(), material.getFigureNumber()); + if(null != materials){ + //修改单重(物料单重) + if(null!=material.getPracticalNumber()&&material.getPracticalNumber()!=0){ + //得到本次单重 + double d = material.getPracticalNumber()/material.getNumber(); + if(null!=materials.getPieceWeight()&&materials.getPieceWeight()!=0){ + materials.setPieceWeight(materials.getPieceWeight()*2-d); + } + imMaterialService.updateImMaterial(materials); + //修改库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(null!=inventoryDetail){ + inventoryDetail.setPieceWeight(materials.getPieceWeight()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + }else{ + return AjaxResult.error("未查询到此物料"); + } + } + return toAjax(i); + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialJjController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialJjController.java new file mode 100644 index 0000000..e6d53ca --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialJjController.java @@ -0,0 +1,491 @@ +package com.ruoyi.project.management.controller; + +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwBuyingRequisitionJj; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialJj; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionJjService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialJjService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 基建请购单详情Controller + * + * @author zhukangchao + * @date 2022-06-28 + */ +@RestController +@RequestMapping("/management/pwBuyingRequisitionMaterialJj") +public class PwBuyingRequisitionMaterialJjController extends BaseController +{ + @Autowired + private IPwBuyingRequisitionMaterialJjService pwBuyingRequisitionMaterialJjService; + //请购单信息 + @Autowired + private IPwBuyingRequisitionJjService pwBuyingRequisitionJjService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //用户信息 + @Autowired + private TokenService tokenService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService imStockRequisitionMaterialService; + + /** + * 查询基建请购单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialJj:list')") + @GetMapping("/list") + public TableDataInfo list(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj) + { + startPage(); + List list = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjList(pwBuyingRequisitionMaterialJj); + return getDataTable(list); + } + + /** + * 导出基建请购单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialJj:export')") + @Log(title = "基建请购单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj) + { + List list = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjList(pwBuyingRequisitionMaterialJj); + ExcelUtil util = new ExcelUtil(PwBuyingRequisitionMaterialJj.class); + return util.exportExcel(list, "pwBuyingRequisitionMaterialJj"); + } + + /** + * 获取基建请购单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialJj:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjById(id)); + } + + /** + * 新增基建请购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialJj:add')") + @Log(title = "基建请购单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj){ + //根据请购单id查询请购单信息 + PwBuyingRequisitionJj buyingRequisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(pwBuyingRequisitionMaterialJj.getBuyingRequisitionId()); + if(buyingRequisitionJj.getStatus()!=1){ + //说明已经审核过了,则不允许新增 + return AjaxResult.error("已审核的请购单不允许新增"); + } + + if(null==pwBuyingRequisitionMaterialJj.getMaterialId()){ + return AjaxResult.error("请选择物料"); + } + //判断数量是否为null + if(null==pwBuyingRequisitionMaterialJj.getNumber()||0==pwBuyingRequisitionMaterialJj.getNumber()){ + return AjaxResult.error("请输入采购数量"); + } + ImMaterial material = imMaterialService.selectImMaterialById(pwBuyingRequisitionMaterialJj.getMaterialId()); + if(null!=material){ + //名称 + pwBuyingRequisitionMaterialJj.setMaterialName(material.getMaterialName()); + //图号 + pwBuyingRequisitionMaterialJj.setFigureNumber(material.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterialJj.setMaterials(material.getMaterials()); + //单重 + pwBuyingRequisitionMaterialJj.setPieceWeight(material.getPieceWeight()); + //单位 + pwBuyingRequisitionMaterialJj.setUnitOfMeasurementName(material.getUnitOfMeasurementName()); + }else{ + return AjaxResult.error("未查询到此物料"); + } + //如果单价不为null,则计算总价 + if(null!=pwBuyingRequisitionMaterialJj.getUnivalence()){ + pwBuyingRequisitionMaterialJj.setTotalprice(pwBuyingRequisitionMaterialJj.getUnivalence()*pwBuyingRequisitionMaterialJj.getNumber()); + } + //入库状态为未申请 + pwBuyingRequisitionMaterialJj.setInventoryStatus("未入库"); + int i = pwBuyingRequisitionMaterialJjService.insertPwBuyingRequisitionMaterialJj(pwBuyingRequisitionMaterialJj); + //合并总价到请购单中 + Double d = 0.0; + PwBuyingRequisitionJj requisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(pwBuyingRequisitionMaterialJj.getBuyingRequisitionId()); + List list = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(requisitionJj.getId()); + for (PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj2 : list) { + if(null==pwBuyingRequisitionMaterialJj2.getTotalprice()){ + pwBuyingRequisitionMaterialJj2.setTotalprice(0.0); + } + if(null==requisitionJj.getTotalPrices()){ + requisitionJj.setTotalPrices(0.0); + } + d += pwBuyingRequisitionMaterialJj2.getTotalprice(); + } + //获取所有物料的总价 + requisitionJj.setTotalPrices(d); + //修改请购单信息 + pwBuyingRequisitionJjService.updatePwBuyingRequisitionJj(requisitionJj); + return toAjax(i); + } + + + /** + * 申请入库 + */ + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj){ + //申请入库 + //判断此单据是否已经审核 + //判断是否已经审核 + PwBuyingRequisitionJj buyingRequisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(pwBuyingRequisitionMaterialJj.getBuyingRequisitionId()); + if(buyingRequisitionJj.getStatus()!=2){ + //说明已经审核过了,则不允许新增 + return AjaxResult.error("未审核的请购单不允许申请入库"); + } + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //判断状态是否已经入库 + if(pwBuyingRequisitionMaterialJj.getInventoryStatus().equals("已入库")){ + return AjaxResult.error("无需重复申请"); + } + //判断单价是否为null,单价为null不允许入库 + if(null==pwBuyingRequisitionMaterialJj.getUnivalence()||pwBuyingRequisitionMaterialJj.getUnivalence()==0){ + return AjaxResult.error("请填写单价"); + } + //生成入库信息 + //根据请购单id查询 + PwBuyingRequisitionJj requisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(pwBuyingRequisitionMaterialJj.getBuyingRequisitionId()); + //根据请购单令号查询入库单信息 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(requisitionJj.getCode()); + //判断是否已经有此请购单号了,如果有则在此单号下新增,如果没有则新增 + if(null!=productReceipt){ + //说明有此请购单的入库单 + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //根据请购单号查询入库单id + //入库单id + imProductReceiptMaterial.setProductReceiptId(productReceipt.getId()); + //令号(请购单号) + imProductReceiptMaterial.setCode(requisitionJj.getCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwBuyingRequisitionMaterialJj.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwBuyingRequisitionMaterialJj.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwBuyingRequisitionMaterialJj.getMaterials()); + //单位 + imProductReceiptMaterial.setUnit(pwBuyingRequisitionMaterialJj.getUnitOfMeasurementName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBuyingRequisitionMaterialJj.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(pwBuyingRequisitionMaterialJj.getNumber().doubleValue()); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBuyingRequisitionMaterialJj.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterialJj.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterialJj.getTotalprice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwBuyingRequisitionMaterialJj.getPreferentialOriginName()); + imProductReceiptMaterial.setQualityInspector("基建"); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("已入库"); + imProductReceiptMaterial.setStorageDate(new Date()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //计算总价 + pwBuyingRequisitionMaterialJj.setTotalprice(pwBuyingRequisitionMaterialJj.getNumber()*pwBuyingRequisitionMaterialJj.getUnivalence()); + //修改采购单详情的入库状态,改为已申请 + pwBuyingRequisitionMaterialJj.setInventoryStatus("已入库"); + pwBuyingRequisitionMaterialJj.setPreferentialOriginName(pwBuyingRequisitionMaterialJj.getPreferentialOriginName()); + int j = pwBuyingRequisitionMaterialJjService.updatePwBuyingRequisitionMaterialJj(pwBuyingRequisitionMaterialJj); + if(j<1){ + return AjaxResult.error("申请失败"); + } + }else{ + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(requisitionJj.getCode()); + //项目名称 + imProductReceipt.setProjectName(requisitionJj.getName()); + //入库状态 + imProductReceipt.setInventoryStatus("已入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //令号(请购单号) + imProductReceiptMaterial.setCode(requisitionJj.getCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwBuyingRequisitionMaterialJj.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwBuyingRequisitionMaterialJj.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwBuyingRequisitionMaterialJj.getMaterials()); + //单位 + imProductReceiptMaterial.setUnit(pwBuyingRequisitionMaterialJj.getUnitOfMeasurementName()); + + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBuyingRequisitionMaterialJj.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(pwBuyingRequisitionMaterialJj.getNumber().doubleValue()); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBuyingRequisitionMaterialJj.getNumber().doubleValue()); + + //单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterialJj.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterialJj.getTotalprice()); + + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwBuyingRequisitionMaterialJj.getPreferentialOriginName()); + imProductReceiptMaterial.setQualityInspector("基建"); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("已入库"); + imProductReceiptMaterial.setStorageDate(new Date()); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + //计算总价 + pwBuyingRequisitionMaterialJj.setTotalprice(pwBuyingRequisitionMaterialJj.getNumber()*pwBuyingRequisitionMaterialJj.getUnivalence()); + //修改预制单详情的入库状态,改为已申请 + pwBuyingRequisitionMaterialJj.setInventoryStatus("已入库"); + pwBuyingRequisitionMaterialJj.setPreferentialOriginName(pwBuyingRequisitionMaterialJj.getPreferentialOriginName()); + int k = pwBuyingRequisitionMaterialJjService.updatePwBuyingRequisitionMaterialJj(pwBuyingRequisitionMaterialJj); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + + //生成出库信息 + int i = 0; + //判断是否已经有此出库单 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(requisitionJj.getCode()); + if(null!=stockRequisition){ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(requisitionJj.getCode()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBuyingRequisitionMaterialJj.getMaterialName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBuyingRequisitionMaterialJj.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBuyingRequisitionMaterialJj.getMaterials()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBuyingRequisitionMaterialJj.getNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBuyingRequisitionMaterialJj.getNumber()); + //单价 + imStockRequisitionMaterial.setUnivalence(pwBuyingRequisitionMaterialJj.getUnivalence()); + //总价 + imStockRequisitionMaterial.setTotalPrices(pwBuyingRequisitionMaterialJj.getTotalprice()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(pwBuyingRequisitionMaterialJj.getNumber()); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBuyingRequisitionMaterialJj.getNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("已出库"); + //出库时间 + imStockRequisitionMaterial.setOutboundDate(new Date()); + i = imStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + }else{ + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(requisitionJj.getCode()); + //项目名称 + imStockRequisition.setProjectName(requisitionJj.getName()); + //领料状态 + imStockRequisition.setGetStatus("已出库"); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(requisitionJj.getCode()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBuyingRequisitionMaterialJj.getMaterialName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBuyingRequisitionMaterialJj.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBuyingRequisitionMaterialJj.getMaterials()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBuyingRequisitionMaterialJj.getNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBuyingRequisitionMaterialJj.getNumber()); + //单价 + imStockRequisitionMaterial.setUnivalence(pwBuyingRequisitionMaterialJj.getUnivalence()); + //总价 + imStockRequisitionMaterial.setTotalPrices(pwBuyingRequisitionMaterialJj.getTotalprice()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(pwBuyingRequisitionMaterialJj.getNumber()); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBuyingRequisitionMaterialJj.getNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("已出库"); + //出库时间 + imStockRequisitionMaterial.setOutboundDate(new Date()); + i = imStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + } + //合并入库单总价 + //根据请购单id查询当前单据下所有的物料 + Double d = 0.0; + List list = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(buyingRequisitionJj.getId()); + for (PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj2 : list) { + if(null==pwBuyingRequisitionMaterialJj2.getTotalprice()){ + pwBuyingRequisitionMaterialJj2.setTotalprice(0.0); + } + if(null==requisitionJj.getTotalPrices()){ + requisitionJj.setTotalPrices(0.0); + } + d += pwBuyingRequisitionMaterialJj2.getTotalprice(); + } + //获取所有物料的总价 + buyingRequisitionJj.setTotalPrices(d); + //修改请购单信息 + pwBuyingRequisitionJjService.updatePwBuyingRequisitionJj(buyingRequisitionJj); + //修改入库状态及查询此单据下是否已全部申请入库,如果已全部申请入库,则修改单据状态 + + + return toAjax(i); + } + + /** + * 修改基建请购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialJj:edit')") + @Log(title = "基建请购单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj){ + if(null==pwBuyingRequisitionMaterialJj.getNumber()){ + return AjaxResult.error("请输入数量"); + } + //判断是否改变了其数量 + PwBuyingRequisitionMaterialJj requisitionMaterialJj = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjById(pwBuyingRequisitionMaterialJj.getId()); + if(requisitionMaterialJj.getNumber()!=pwBuyingRequisitionMaterialJj.getNumber()){ + //判断是否已经审核 + PwBuyingRequisitionJj buyingRequisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(pwBuyingRequisitionMaterialJj.getBuyingRequisitionId()); + if(buyingRequisitionJj.getStatus()!=1){ + //说明已经审核过了,则不允许新增 + return AjaxResult.error("已审核的请购单不允许修改数量"); + } + } + //重新计算总价 + pwBuyingRequisitionMaterialJj.setTotalprice(pwBuyingRequisitionMaterialJj.getNumber()*pwBuyingRequisitionMaterialJj.getUnivalence()); + int i = pwBuyingRequisitionMaterialJjService.updatePwBuyingRequisitionMaterialJj(pwBuyingRequisitionMaterialJj); + //合并总价 + Double d = 0.0; + PwBuyingRequisitionJj requisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(requisitionMaterialJj.getBuyingRequisitionId()); + List list = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(requisitionJj.getId()); + for (PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj2 : list) { + if(null==pwBuyingRequisitionMaterialJj2.getTotalprice()){ + pwBuyingRequisitionMaterialJj2.setTotalprice(0.0); + } + if(null==requisitionJj.getTotalPrices()){ + requisitionJj.setTotalPrices(0.0); + } + d += pwBuyingRequisitionMaterialJj2.getTotalprice(); + } + //获取所有物料的总价 + requisitionJj.setTotalPrices(d); + //修改请购单信息 + pwBuyingRequisitionJjService.updatePwBuyingRequisitionJj(requisitionJj); + return toAjax(i); + } + + /** + * 删除基建请购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialJj:remove')") + @Log(title = "基建请购单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwBuyingRequisitionMaterialJj requisitionMaterialJj = pwBuyingRequisitionMaterialJjService.selectPwBuyingRequisitionMaterialJjById(id); + //判断是否已经审核 + PwBuyingRequisitionJj buyingRequisitionJj = pwBuyingRequisitionJjService.selectPwBuyingRequisitionJjById(requisitionMaterialJj.getBuyingRequisitionId()); + if(buyingRequisitionJj.getStatus()!=1){ + //说明已经审核过了,则不允许新增 + return AjaxResult.error("已审核的请购单不允许删除"); + }else{ + if(null!=buyingRequisitionJj.getTotalPrices()&&null!=requisitionMaterialJj.getTotalprice()){ + if(buyingRequisitionJj.getTotalPrices()-requisitionMaterialJj.getTotalprice()>0){ + //减去请购单总价 + buyingRequisitionJj.setTotalPrices(buyingRequisitionJj.getTotalPrices()-requisitionMaterialJj.getTotalprice()); + }else{ + buyingRequisitionJj.setTotalPrices(0.0); + } + pwBuyingRequisitionJjService.updatePwBuyingRequisitionJj(buyingRequisitionJj); + } + } + } + return toAjax(pwBuyingRequisitionMaterialJjService.deletePwBuyingRequisitionMaterialJjByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialTwoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialTwoController.java new file mode 100644 index 0000000..27d760b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionMaterialTwoController.java @@ -0,0 +1,551 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; + +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.utils.MoneyUtil; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialTwo; +import com.ruoyi.project.management.domain.PwBuyingRequisitionTwo; +import com.ruoyi.project.management.domain.PwCompletionNotice; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialTwoService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionTwoService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 易耗品请购单详情Controller + * + * @author zhukangchao + * @date 2022-07-05 + */ +@RestController +@RequestMapping("/management/pwBuyingRequisitionMaterialTwo") +public class PwBuyingRequisitionMaterialTwoController extends BaseController +{ + @Autowired + private IPwBuyingRequisitionMaterialTwoService pwBuyingRequisitionMaterialTwoService; + //采购单信息 + @Autowired + private IPwBuyingRequisitionTwoService pwBuyingRequisitionTwoService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //用户信息 + @Autowired + private TokenService tokenService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询易耗品请购单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialTwo:list')") + @GetMapping("/list") + public TableDataInfo list(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo) + { + startPage(); + List list = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoList(pwBuyingRequisitionMaterialTwo); + return getDataTable(list); + } + + /** + * 导出易耗品请购单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialTwo:export')") + @Log(title = "易耗品请购单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo) + { + List list = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoList(pwBuyingRequisitionMaterialTwo); + ExcelUtil util = new ExcelUtil(PwBuyingRequisitionMaterialTwo.class); + return util.exportExcel(list, "pwBuyingRequisitionMaterialTwo"); + } + + /** + * 获取易耗品请购单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialTwo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoById(id)); + } + + /** + * 新增易耗品请购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialTwo:add')") + @Log(title = "易耗品请购单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo){ + //判断物料id是否为null + if(null == pwBuyingRequisitionMaterialTwo.getMaterialId()||"".equals(pwBuyingRequisitionMaterialTwo.getMaterialId())){ + return AjaxResult.error("请选择物料"); + } + //判断单价是否为null + if(null==pwBuyingRequisitionMaterialTwo.getUnivalence()||"".equals(pwBuyingRequisitionMaterialTwo.getUnivalence())){ + return AjaxResult.error("请填写物料单价"); + } + //判断数量是否为null + if(null==pwBuyingRequisitionMaterialTwo.getNumber()||"".equals(pwBuyingRequisitionMaterialTwo.getNumber())){ + return AjaxResult.error("请填写需采购数量"); + } + + //根据物料id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwBuyingRequisitionMaterialTwo.getMaterialId()); + //物料名称 + pwBuyingRequisitionMaterialTwo.setMaterialName(imMaterial.getMaterialName()); + //图号 + pwBuyingRequisitionMaterialTwo.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterialTwo.setMaterials(imMaterial.getMaterials()); + //单重 + pwBuyingRequisitionMaterialTwo.setPieceWeight(imMaterial.getPieceWeight()); + //单位 + pwBuyingRequisitionMaterialTwo.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + //入库状态初始为 未入库 + pwBuyingRequisitionMaterialTwo.setInventoryStatus("未入库"); + //计算总价 + pwBuyingRequisitionMaterialTwo.setTotalprice(pwBuyingRequisitionMaterialTwo.getNumber()*pwBuyingRequisitionMaterialTwo.getUnivalence()); + //执行添加操作 + int i = pwBuyingRequisitionMaterialTwoService.insertPwBuyingRequisitionMaterialTwo(pwBuyingRequisitionMaterialTwo); + //根据采购单id查询当前所有的采购物料 + List list = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + //总价 + Double zongjia = 0.0; + for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : list) { + zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); + } + //根据采购单id查询采购单 + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + //总价 + buyingRequisitionTwo.setTotalPrices(zongjia); + buyingRequisitionTwo.setBigTotalPrices( MoneyUtil.toChinese(zongjia.toString())); + + //重置审核状态 + int j = 0; + PwBuyingRequisitionTwo pwBuyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + if(!"自动出单".equals(pwBuyingRequisitionTwo.getName())){ + buyingRequisitionTwo.setStatus(1); + buyingRequisitionTwo.setAuditor(""); + j = pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + } + + return toAjax(j); + } + + /** + * 修改易耗品请购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialTwo:edit')") + @Log(title = "易耗品请购单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo){ + //判断物料id是否为null + if(null == pwBuyingRequisitionMaterialTwo.getMaterialId()||"".equals(pwBuyingRequisitionMaterialTwo.getMaterialId())){ + return AjaxResult.error("请选择物料"); + } + //判断单价是否为null + if(null==pwBuyingRequisitionMaterialTwo.getUnivalence()||"".equals(pwBuyingRequisitionMaterialTwo.getUnivalence())){ + return AjaxResult.error("请填写物料单价"); + } + //判断数量是否为null + if(null==pwBuyingRequisitionMaterialTwo.getNumber()||"".equals(pwBuyingRequisitionMaterialTwo.getNumber())){ + return AjaxResult.error("请填写需采购数量"); + } + + //判断当前单据是否是自动出单,如果为自动出单则不允许修改,只允许修改价格和供应商 + PwBuyingRequisitionTwo pwBuyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + if("自动出单".equals(pwBuyingRequisitionTwo.getName())){ + PwBuyingRequisitionMaterialTwo requisitionMaterialTwo = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoById(pwBuyingRequisitionMaterialTwo.getId()); + if(!requisitionMaterialTwo.getMaterialId().equals(pwBuyingRequisitionMaterialTwo.getMaterialId())){ + return AjaxResult.error("自动出单的单据不允许修改物料"); + } + if(!requisitionMaterialTwo.getNumber().equals(pwBuyingRequisitionMaterialTwo.getNumber())){ + return AjaxResult.error("自动出单的单据不允许请购数量"); + } + } + //根据物料id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwBuyingRequisitionMaterialTwo.getMaterialId()); + //物料名称 + pwBuyingRequisitionMaterialTwo.setMaterialName(imMaterial.getMaterialName()); + //图号 + pwBuyingRequisitionMaterialTwo.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterialTwo.setMaterials(imMaterial.getMaterials()); + //单重 + pwBuyingRequisitionMaterialTwo.setPieceWeight(imMaterial.getPieceWeight()); + //单位 + pwBuyingRequisitionMaterialTwo.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + //入库状态初始为 未入库 + pwBuyingRequisitionMaterialTwo.setInventoryStatus("未入库"); + //计算总价 + pwBuyingRequisitionMaterialTwo.setTotalprice(pwBuyingRequisitionMaterialTwo.getNumber()*pwBuyingRequisitionMaterialTwo.getUnivalence()); + //执行修改操作 + int i = pwBuyingRequisitionMaterialTwoService.updatePwBuyingRequisitionMaterialTwo(pwBuyingRequisitionMaterialTwo); + //根据采购单id查询当前所有的采购物料 + List list = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + //总价 + Double zongjia = 0.0; + for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : list) { + zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); + } + //根据采购单id查询采购单 + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + //总价 + buyingRequisitionTwo.setTotalPrices(zongjia); + buyingRequisitionTwo.setBigTotalPrices( MoneyUtil.toChinese(zongjia.toString())); + //重置审核状态 + if(!"自动出单".equals(pwBuyingRequisitionTwo.getName())){ + buyingRequisitionTwo.setStatus(1); + buyingRequisitionTwo.setAuditor(""); + pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + } +// //把单价保存到基本信息表 +// imMaterial.setUnivalence(new BigDecimal(pwBuyingRequisitionMaterialTwo.getUnivalence())); +// imMaterialService.updateImMaterial(imMaterial); + return toAjax(pwBuyingRequisitionMaterialTwoService.updatePwBuyingRequisitionMaterialTwo(pwBuyingRequisitionMaterialTwo)); + } + + /** + * 删除易耗品请购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionMaterialTwo:remove')") + @Log(title = "易耗品请购单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + Long ida = 0L; + int i = 0; + for (Long id : ids) { + //根据物料详情id查询单据id + PwBuyingRequisitionMaterialTwo buyingRequisitionMaterialTwo = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoById(id); + ida = buyingRequisitionMaterialTwo.getBuyingRequisitionId(); + + //减少在途数量 + //如果删除了采购数量,则同时删除库存的在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(buyingRequisitionMaterialTwo.getMaterialName(), buyingRequisitionMaterialTwo.getFigureNumber()); + //删除之前把在途减掉 + if(null != inventoryDetail){ + /*inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - buyingRequisitionMaterialTwo.getNumber().longValue()); + if(inventoryDetail.getPreliminaryInventory()<0){ + inventoryDetail.setPreliminaryInventory(0L); + }*/ + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + i = pwBuyingRequisitionMaterialTwoService.deletePwBuyingRequisitionMaterialTwoById(id); + } + //删除之后从新计算请购单总价 + List list = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(ida); + //请购单总价 + double d = 0; + //遍历集合,获取所有物料的总价,相加 + for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo : list) { + d = d + PwBuyingRequisitionMaterialTwo.getTotalprice(); + } + //获取请购单详情 + PwBuyingRequisitionTwo buyingRequisition = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(ida); + buyingRequisition.setTotalPrices(d); + pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisition); + return toAjax(i); + } + + /** + * 申请入库 + */ + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo){ + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据id查看待采购明细表 + PwBuyingRequisitionMaterialTwo buyingRequisitionMaterialTwo = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoById(pwBuyingRequisitionMaterialTwo.getId()); + //根据请购单id查询请购单号 + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(buyingRequisitionMaterialTwo.getBuyingRequisitionId()); + //判断是否是已经审核过的单据,如果没有审核过,则不允许入库 + if(StringUtils.isEmpty(buyingRequisitionTwo.getLeadership())){ + return AjaxResult.error("未审核的请购单不允许入库"); + } + //根据合同id查看此合同是否已经添加到待入库申请表了,如果添加到了则不再添加,反之则直接添加 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(buyingRequisitionTwo.getCode()); + if(null!=productReceipt){ + //如果不等于null 则直接把物料添加到待入库详情表中 + //添加入库单详情 + if("已申请".equals(buyingRequisitionMaterialTwo.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //判断单价是否为null,单价为null不允许入库 + if(null==pwBuyingRequisitionMaterialTwo.getUnivalence()||pwBuyingRequisitionMaterialTwo.getUnivalence()==0){ + return AjaxResult.error("请填写单价"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //根据请购单号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(buyingRequisitionTwo.getCode()); + //令号 + imProductReceiptMaterial.setCode(buyingRequisitionTwo.getCode()); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwBuyingRequisitionMaterialTwo.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwBuyingRequisitionMaterialTwo.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwBuyingRequisitionMaterialTwo.getMaterials()); + //单重 +// imProductReceiptMaterial.set + //单位 + imProductReceiptMaterial.setUnit(pwBuyingRequisitionMaterialTwo.getUnitOfMeasurementName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBuyingRequisitionMaterialTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBuyingRequisitionMaterialTwo.getNumber().doubleValue()); + //含税单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterialTwo.getUnivalence()); + + //未税单价 + //计算税率 + double d = buyingRequisitionTwo.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(pwBuyingRequisitionMaterialTwo.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterialTwo.getUnivalence()*pwBuyingRequisitionMaterialTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwBuyingRequisitionMaterialTwo.getPreferentialOriginName()); + imProductReceiptMaterial.setQualityInspector("免检"); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + + //修改采购单详情的入库状态,改为已申请 + pwBuyingRequisitionMaterialTwo.setInventoryStatus("已申请"); + int k = pwBuyingRequisitionMaterialTwoService.updatePwBuyingRequisitionMaterialTwo(pwBuyingRequisitionMaterialTwo); + if(k<1){ + return AjaxResult.error("申请失败"); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("易耗品待入库",imProductReceiptMaterial.getCode(),imProductReceiptMaterial.getMaterialName(),imProductReceiptMaterial.getSpecification(),user.getNickName(),"库管","审核入库","物料入库管理","/inventory/imProductReceiptMaterial?id="+imProductReceiptMaterial.getProductReceiptId()); + + } + }else{ + //如果等于null 则先添加待入库单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(buyingRequisitionTwo.getCode()); + //项目令号 + imProductReceipt.setCode(buyingRequisitionTwo.getPurpose()); + //项目名称 + imProductReceipt.setProjectName(buyingRequisitionTwo.getName()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + + //添加入库单详情 + if("已申请".equals(pwBuyingRequisitionMaterialTwo.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //判断单价是否为null,单价为null不允许入库 + if(null==pwBuyingRequisitionMaterialTwo.getUnivalence()||pwBuyingRequisitionMaterialTwo.getUnivalence()==0){ + return AjaxResult.error("请填写单价"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(buyingRequisitionTwo.getCode()); + //令号 + imProductReceiptMaterial.setCode(buyingRequisitionTwo.getCode()); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwBuyingRequisitionMaterialTwo.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwBuyingRequisitionMaterialTwo.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwBuyingRequisitionMaterialTwo.getMaterials()); + //单重 +// imProductReceiptMaterial.set + //单位 + imProductReceiptMaterial.setUnit(pwBuyingRequisitionMaterialTwo.getUnitOfMeasurementName()); + + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwBuyingRequisitionMaterialTwo.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwBuyingRequisitionMaterialTwo.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwBuyingRequisitionMaterialTwo.getUnivalence()); + + //未税单价 + //计算税率 + double d = buyingRequisitionTwo.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(pwBuyingRequisitionMaterialTwo.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwBuyingRequisitionMaterialTwo.getUnivalence()*pwBuyingRequisitionMaterialTwo.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwBuyingRequisitionMaterialTwo.getPreferentialOriginName()); + imProductReceiptMaterial.setQualityInspector("免检"); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + + //修改预制单详情的入库状态,改为已申请 + pwBuyingRequisitionMaterialTwo.setInventoryStatus("已申请"); + int k = pwBuyingRequisitionMaterialTwoService.updatePwBuyingRequisitionMaterialTwo(pwBuyingRequisitionMaterialTwo); + if(k<1){ + return AjaxResult.error("申请失败"); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("易耗品待入库",imProductReceiptMaterial.getCode(),imProductReceiptMaterial.getMaterialName(),imProductReceiptMaterial.getSpecification(),user.getNickName(),"库管","审核入库","物料入库管理","/inventory/imProductReceiptMaterial?id="+imProductReceiptMaterial.getProductReceiptId()); + + } + } + return AjaxResult.success(); + } + + /** + * 撤销申请入库按钮操作 + */ + @RequestMapping("/revocations/{ids}") + public AjaxResult revocations(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id查询采购单信息 + PwBuyingRequisitionMaterialTwo material = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoById(id); + //根据采购单id查询采购单信息 + PwBuyingRequisitionTwo requisition = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(material.getBuyingRequisitionId()); + + //根据采购单code查询入库单信息 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(requisition.getCode()); + if(null != productReceipt){ + //根据code和名称和图号查询 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(requisition.getCode(), material.getMaterialName(), material.getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + //如果未确认入库,则直接删除,如果已确认入库的则不允许删除 + if(imProductReceiptMaterial.getInventoryStatus().equals("已入库")){ + return AjaxResult.error("已入库的物料不允许撤销"); + }else{ + //直接删除此条信息 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(imProductReceiptMaterial.getId()); + //查询此单据下是否还有其他物料。如果没有,则把入库单也删掉 + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptId(productReceipt.getId()); + if(list2.size()==0){ + imProductReceiptService.deleteImProductReceiptById(productReceipt.getId()); + } + } + } + } + //修改采购单状态为已采购 + material.setInventoryStatus("未入库"); + i = pwBuyingRequisitionMaterialTwoService.updatePwBuyingRequisitionMaterialTwo(material); + } + return toAjax(i); + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionTwoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionTwoController.java new file mode 100644 index 0000000..e14024b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwBuyingRequisitionTwoController.java @@ -0,0 +1,567 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.MoneyUtil; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 易耗品请购单Controller + * + * @author zhukangchao + * @date 2022-07-05 + */ +@RestController +@RequestMapping("/management/pwBuyingRequisitionTwo") +public class PwBuyingRequisitionTwoController extends BaseController { + @Autowired + private IPwBuyingRequisitionTwoService pwBuyingRequisitionTwoService; + //请购单详情信息 + @Autowired + private IPwBuyingRequisitionMaterialTwoService pwBuyingRequisitionMaterialTwoService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //物流费用信息 + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + + /** + * 查询易耗品请购单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionTwo:list')") + @GetMapping("/list") + public TableDataInfo list(PwBuyingRequisitionTwo pwBuyingRequisitionTwo) { + startPage(); + List list = new ArrayList(); + if (null != pwBuyingRequisitionTwo.getMaterialName() && !"".equals(pwBuyingRequisitionTwo.getMaterialName())) { + List list2 = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByName(pwBuyingRequisitionTwo.getMaterialName()); + for (PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo : list2) { + //根据单据id查询请购单 + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + if (null != buyingRequisitionTwo) { + list.add(buyingRequisitionTwo); + } + } + } else { + list = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoList(pwBuyingRequisitionTwo); + } + return getDataTable(list); + } + + /** + * 导出易耗品请购单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionTwo:export')") + @Log(title = "易耗品请购单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwBuyingRequisitionTwo pwBuyingRequisitionTwo) { + List list = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoList(pwBuyingRequisitionTwo); + ExcelUtil util = new ExcelUtil(PwBuyingRequisitionTwo.class); + return util.exportExcel(list, "pwBuyingRequisitionTwo"); + } + + /** + * 获取易耗品请购单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionTwo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(id)); + } + + /** + * 新增易耗品请购单 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionTwo:add')") + @Log(title = "易耗品请购单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwBuyingRequisitionTwo pwBuyingRequisitionTwo) { + if (null == pwBuyingRequisitionTwo.getName()) { + return AjaxResult.error("请输入名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + pwBuyingRequisitionTwo.setContractStatus((long) 1); + pwBuyingRequisitionTwo.setAppointTime(new Date()); + SysUser user = loginUser.getUser(); + pwBuyingRequisitionTwo.setCode("QG" + sdf.format(new Date())); + pwBuyingRequisitionTwo.setProposer(user.getNickName()); + pwBuyingRequisitionTwo.setTotalPrices(0.0); + //请购单状态初始值为1,(待审核状态) + pwBuyingRequisitionTwo.setStatus(1); + return toAjax(pwBuyingRequisitionTwoService.insertPwBuyingRequisitionTwo(pwBuyingRequisitionTwo)); + } + + /** + * 修改易耗品请购单 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionTwo:edit')") + @Log(title = "易耗品请购单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwBuyingRequisitionTwo pwBuyingRequisitionTwo) { + PwBuyingRequisitionTwo pwBuyingRequisitionTwo2 = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionTwo.getId()); + if (!pwBuyingRequisitionTwo2.getName().equals(pwBuyingRequisitionTwo.getName())) { + if ("自动出单".equals(pwBuyingRequisitionTwo2.getName())) { + return AjaxResult.error("自动出单的单据不允许修改名称"); + } + } + return toAjax(pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(pwBuyingRequisitionTwo)); + } + + /** + * 删除易耗品请购单 + */ + @PreAuthorize("@ss.hasPermi('management:pwBuyingRequisitionTwo:remove')") + @Log(title = "易耗品请购单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(pwBuyingRequisitionTwoService.deletePwBuyingRequisitionTwoByIds(ids)); + } + + /** + * 审批请购单 + */ + @RequestMapping("/auditPwBuyingRequisitionTwo") + public AjaxResult auditPwBuyingRequisitionTwo(Long id) { + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(id); + if (StringUtils.isEmpty(buyingRequisitionTwo.getSellerName()) || StringUtils.isEmpty(buyingRequisitionTwo.getDeliveryType()) + || StringUtils.isEmpty(buyingRequisitionTwo.getPayer()) || StringUtils.isEmpty(buyingRequisitionTwo.getModeOfPayment()) + || 0 == buyingRequisitionTwo.getTaxRate()) { + return AjaxResult.error("请先补全信息,再审核"); + } + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + buyingRequisitionTwo.setStatus(2); + buyingRequisitionTwo.setAuditor(user.getNickName()); + int i = pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + if (i < 1) { + return AjaxResult.error("审核失败"); + } + return AjaxResult.success("审核成功"); + } + + /** + * 打印合同 + * + * @param ids + * @return + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids) { + HashMap printMessageMap = new HashMap<>(); + //根据id获取合同信息 + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(ids[0]); + if (StringUtils.isEmpty(buyingRequisitionTwo.getRemark())) { + buyingRequisitionTwo.setRemark(""); + } + if (buyingRequisitionTwo.getAppointTime() == null) { + buyingRequisitionTwo.setAppointTime(new Date()); + buyingRequisitionTwo.setContractStatus(1L); + pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + } + //获得产品列表 + PwBuyingRequisitionMaterialTwo materal = new PwBuyingRequisitionMaterialTwo(); + materal.setBuyingRequisitionId(buyingRequisitionTwo.getId()); + List list = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoList(materal); + int i = 1; + for (PwBuyingRequisitionMaterialTwo pwbuy : list) { + pwbuy.setNum(i); + if (pwbuy.getNumber() != null && pwbuy.getUnivalence() != null) { + String zj = String.format("%.2f", pwbuy.getNumber() * pwbuy.getUnivalence()); + pwbuy.setTotalprice(Double.parseDouble(zj)); + } + i++; + } + //根据供应商名称查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierByName(buyingRequisitionTwo.getSellerName()); + //产品列表 + printMessageMap.put("product", list); + printMessageMap.put("contract", buyingRequisitionTwo); + printMessageMap.put("supplier", supplier); + return AjaxResult.success("success", printMessageMap); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody PwBuyingRequisitionTwo pwBuyingRequisitionTwo) { + //校验付款金额 + if (null == pwBuyingRequisitionTwo.getPaymentAmount() || "".equals(pwBuyingRequisitionTwo.getPaymentAmount()) || 0 == pwBuyingRequisitionTwo.getPaymentAmount()) { + return AjaxResult.error("请填写付款金额"); + } + //获取合同id + Long[] ids = pwBuyingRequisitionTwo.getIds(); + //供应商名称 + String name = ""; + //合同总金额 + Double d = 0.0; + for (Long id : ids) { + PwBuyingRequisitionTwo requisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(id); + //校验当前选中的合同是否为同一个供应商 + if (!"".equals(name)) { + //校验name是否和供应商名称相同 + if (!name.equals(requisitionTwo.getSellerName())) { + return AjaxResult.error("不同供应商不可合并付款"); + } + } else { + name = requisitionTwo.getSellerName(); + } + + //计算合同总金额 + d += requisitionTwo.getTotalPrices(); + } + + //校验付款金额是否大于合同总金额 + if (d < pwBuyingRequisitionTwo.getPaymentAmount()) { + return AjaxResult.error("付款金额不能大于合同总金额"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //付款申请单 + CwOtherPayment cwOtherPayment = new CwOtherPayment(); + //申请单编号 + cwOtherPayment.setCode("FKSQ-" + sdf.format(new Date())); + //姓名 + cwOtherPayment.setUserName(user.getNickName()); + //部门 + cwOtherPayment.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwOtherPayment.setDateTime(new Date()); + //金额 + cwOtherPayment.setMoney(pwBuyingRequisitionTwo.getPaymentAmount()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = MoneyUtil.toChinese(cwOtherPayment.getMoney() + ""); + cwOtherPayment.setBigMoney(chinese); + //支付类型 + cwOtherPayment.setSparedOne("付款"); + //单位名称 + cwOtherPayment.setUnitName(name); + //未付款金额(初始为填写的金额) + cwOtherPayment.setNotInvoiceAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //未开票金额(初始为填写的金额) + cwOtherPayment.setNotProceedsAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //结算比例(初始为0) + cwOtherPayment.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwOtherPayment.getUnitName()); + if (null != supplier) { + //账号 + cwOtherPayment.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(supplier.getOpeningBank()); + } else { + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwOtherPayment.getUnitName()); + if (null != employeeInformation) { + //账号 + cwOtherPayment.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(employeeInformation.getOpeningBank()); + } else { + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwOtherPayment.getUnitName()); + if (null != customer) { + //账号 + cwOtherPayment.setAccountNumber(customer.getBankNumber()); + //开户行 + cwOtherPayment.setOpeningBank(customer.getBank()); + } else { + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwOtherPayment.getUnitName()); + if (null != otherCorrespondent) { + //账号 + cwOtherPayment.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(otherCorrespondent.getOpeningBank()); + } else { + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwOtherPaymentService.insertCwOtherPayment(cwOtherPayment); + if (i > 0) { + //生成付款申请单及付款申请单明细 + for (Long id : ids) { + PwBuyingRequisitionTwo requisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(id); + + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + //付款单id + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + //付款单编号 + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + //关联合同编号 + cwOtherPaymentInfo.setCode(requisitionTwo.getCode()); + //合同金额 + cwOtherPaymentInfo.setContractMoney(requisitionTwo.getTotalPrices()); + //付款金额(计算) 合同金额*(付款金额/总金额) + cwOtherPaymentInfo.setPaymentAmount(requisitionTwo.getTotalPrices() * (pwBuyingRequisitionTwo.getPaymentAmount() / d)); + //付款比例(计算) 付款金额/合同金额 + cwOtherPaymentInfo.setProportion(cwOtherPaymentInfo.getPaymentAmount() / requisitionTwo.getTotalPrices() * 100); + //合同类型 + cwOtherPaymentInfo.setSparedOne("请购单采购合同"); + cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + } + return toAjax(i); + } + + /** + * 生成物流费用单 + */ + @RequestMapping("/addLogistics") + public AjaxResult addLogistics(@RequestBody PwBuyingRequisitionTwo pwBuyingRequisitionTwo) { + //校验付款金额 + if (null == pwBuyingRequisitionTwo.getMoney() || "".equals(pwBuyingRequisitionTwo.getMoney()) || 0 == pwBuyingRequisitionTwo.getMoney()) { + return AjaxResult.error("请填写付款金额"); + } + //校验支付方式 + if(null==pwBuyingRequisitionTwo.getPayWay()||"".equals(pwBuyingRequisitionTwo.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==pwBuyingRequisitionTwo.getUnitName()||"".equals(pwBuyingRequisitionTwo.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //物料费用单 + CwLogisticsFeesInfo cwLogisticsFeesInfo = new CwLogisticsFeesInfo(); + + //编号 + cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); + //关联单据编号 所勾选的合同编号 + //获取合同id + Long[] ids = pwBuyingRequisitionTwo.getIds(); + //拼接合同编号 + String code = ""; + for (Long id : ids) { + PwBuyingRequisitionTwo requisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(id); + code += requisitionTwo.getCode()+","; + } + cwLogisticsFeesInfo.setRelevanceCode(code); + //单据类型 + cwLogisticsFeesInfo.setRelevanceType("请购单采购合同"); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //小写金额 + cwLogisticsFeesInfo.setMoney(pwBuyingRequisitionTwo.getMoney()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(pwBuyingRequisitionTwo.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //事由 + cwLogisticsFeesInfo.setCause("采购运费"); + //支付方式 + cwLogisticsFeesInfo.setPayWay(pwBuyingRequisitionTwo.getPayWay()); + //单位名称 + cwLogisticsFeesInfo.setUnitName(pwBuyingRequisitionTwo.getUnitName()); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(pwBuyingRequisitionTwo.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(pwBuyingRequisitionTwo.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(pwBuyingRequisitionTwo.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); + return toAjax(i); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids) { + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(id); + if (buyingRequisitionTwo.getSellerName() == null || buyingRequisitionTwo.getSellerName().isEmpty()) { + AjaxResult.error("供应商信息不全,请补充完整"); + } + if (buyingRequisitionTwo.getTaxRate() == null || buyingRequisitionTwo.getTaxRate() == 0) { + AjaxResult.error("税率信息不全,请补充完整"); + } + if (buyingRequisitionTwo.getTotalPrices() == null || buyingRequisitionTwo.getTaxRate() == 0.0) { + AjaxResult.error("总价不全,请补充完整"); + } + if (buyingRequisitionTwo.getDeliveryType() == null || buyingRequisitionTwo.getDeliveryType().isEmpty()) { + AjaxResult.error("交货方式不全,请补充完整"); + } + if (buyingRequisitionTwo.getPayer() == null || buyingRequisitionTwo.getPayer().isEmpty()) { + AjaxResult.error("运费支付方不全,请补充完整"); + } + if (buyingRequisitionTwo.getModeOfPayment() == null || buyingRequisitionTwo.getModeOfPayment().isEmpty()) { + AjaxResult.error("货款支付方式不全,请补充完整"); + } + if (StringUtils.isEmpty(buyingRequisitionTwo.getSellerName()) || null == buyingRequisitionTwo.getDemandDate()) { + return AjaxResult.error("信息补全,请补充完整"); + } + if (null != buyingRequisitionTwo.getLeadership()) { + buyingRequisitionTwo.setLeadership(""); + } else { + buyingRequisitionTwo.setLeadership(user.getNickName()); + //审批时间 + buyingRequisitionTwo.setLeadershipTime(new Date()); + } + i = pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + } + return toAjax(i); + } + + /** + * 上传合同的PDF + * + * @param id + * @param filePath + * @return + */ + @RequestMapping("/uploadContractPDF") + @ResponseBody + public AjaxResult uploadContractPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { + String originalFilename = filePath.getOriginalFilename(); + if (originalFilename != null) { + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传"); + } else { + PwBuyingRequisitionTwo pwBuyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(Long.valueOf(id)); + //根据id 获取合同信息 + String newfilenname = generateUniqueFileName(originalFilename); + try (InputStream is = filePath.getInputStream(); + //在对应的文件夹下生成新的图片 + FileOutputStream fos = new FileOutputStream("D:/contract/" + newfilenname); + BufferedOutputStream bos = new BufferedOutputStream(fos)) { + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + //映射路径 + pwBuyingRequisitionTwo.setContractPath(newfilenname); + //更新 + pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(pwBuyingRequisitionTwo); + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + } + } + } + return AjaxResult.success("文件上传成功"); + + } + + /** + * 生成随机文件名 + * + * @param originalFilename + * @return + */ + private String generateUniqueFileName(String originalFilename) { + String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); + String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); + //生成年月日加 毫秒值的 文件名称 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String date = dateFormat.format(new Date()); + return filename + "_" + date + System.currentTimeMillis() + extension; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCompletionNoticeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCompletionNoticeController.java new file mode 100644 index 0000000..a7f1ec7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCompletionNoticeController.java @@ -0,0 +1,230 @@ +package com.ruoyi.project.management.controller; + +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwCompletionNotice; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwContractService; +import com.ruoyi.project.management.service.IPwProductionBillProductService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 完工通知单Controller + * + * @author zhukangchao + * @date 2020-07-20 + */ +@RestController +@RequestMapping("/management/completionNotice") +public class PwCompletionNoticeController extends BaseController +{ + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //生产执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //生产执行单关联信息 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //完工通知单关联信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //合同信息 + @Autowired + private IPwContractService pwContractService; + //用户信息 + @Autowired + private TokenService tokenService; + + /** + * 查询完工通知单列表 + */ + @PreAuthorize("@ss.hasPermi('management:completionNotice:list')") + @GetMapping("/list") + public TableDataInfo list(PwCompletionNotice pwCompletionNotice) + { + startPage(); + List list = pwCompletionNoticeService.selectPwCompletionNoticeList(pwCompletionNotice); + return getDataTable(list); + } + + /** + * 导出完工通知单列表 + */ + @PreAuthorize("@ss.hasPermi('management:completionNotice:export')") + @Log(title = "完工通知单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCompletionNotice pwCompletionNotice) + { + List list = pwCompletionNoticeService.selectPwCompletionNoticeList(pwCompletionNotice); + ExcelUtil util = new ExcelUtil(PwCompletionNotice.class); + return util.exportExcel(list, "completionNotice"); + } + + /** + * 获取完工通知单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:completionNotice:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCompletionNoticeService.selectPwCompletionNoticeById(id)); + } + + /** + * 新增完工通知单 + */ + @PreAuthorize("@ss.hasPermi('management:completionNotice:add')") + @Log(title = "完工通知单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCompletionNotice pwCompletionNotice){ + //获取生产令号 + String productionCode = pwCompletionNotice.getProductionCode(); + //根据生产令号查询生产执行单信息 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(productionCode); +// //保存合同编号 +// pwCompletionNotice.setContractCode(productionBill.getContractCode()); + //保存项目名称 + pwCompletionNotice.setProjectName(productionBill.getProjectName()); + //发单日期(默认为当前) + pwCompletionNotice.setBillDate(new Date()); + //生产部审核(默认为未审核1) + pwCompletionNotice.setPdAudit(1); + //质检部审核(默认为未审核1) + pwCompletionNotice.setQualityInspectorAudit(1); + //删除标记默认为未删除0 + pwCompletionNotice.setDelFlag(0); + int i = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(i<1){ + return AjaxResult.error(); + } + //添加产品完成通知单列表信息 + //根据生产执行单id查询执行单列表信息 + PwProductionBillProduct pwProductionBillProduct = new PwProductionBillProduct(); + pwProductionBillProduct.setProductionBillId(productionBill.getId()); + List billProductList = pwProductionBillProductService.selectPwProductionBillProductList(pwProductionBillProduct); + for (PwProductionBillProduct pwProductionBillProduct2 : billProductList) { + for (int j = 0; j < pwProductionBillProduct2.getQuantity(); j++) { + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //完工通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(pwCompletionNotice.getId()); + //产品名称 + pwCompletionNoticeProduct.setProductName(pwProductionBillProduct2.getProductName()); + //产品型号名称 +// pwCompletionNoticeProduct.setProductTypeName(pwProductionBillProduct2.getProductType()); + //设备编号 +// pwCompletionNoticeProduct.setEquipmentCode(productionCode+"/"+); + //交货日期 +// pwCompletionNoticeProduct.setDeliveryDate(pwProductionBillProduct2.getCompleteDate()); + //包装方式 +// pwCompletionNoticeProduct.setPackType(pwProductionBillProduct2.getPackType()); + pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + } + + } + return toAjax(i); + } + + /** + * 修改完工通知单 + */ + @PreAuthorize("@ss.hasPermi('management:completionNotice:edit')") + @Log(title = "完工通知单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCompletionNotice pwCompletionNotice) + { + return toAjax(pwCompletionNoticeService.updatePwCompletionNotice(pwCompletionNotice)); + } + + /** + * 删除完工通知单 + */ + @PreAuthorize("@ss.hasPermi('management:completionNotice:remove')") + @Log(title = "完工通知单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCompletionNoticeService.deletePwCompletionNoticeByIds(ids)); + } + + /** + * 审核完工通知单(修改其审核状态) + */ + @RequestMapping("/editPdAudit") + public AjaxResult editPdAudit(Long id){ + //根据完工通知单id查询通知单 + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeById(id); + //修改完工通知单生产部审核状态为已审核2 + completionNotice.setPdAudit(2); + //获取当前登录的用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + //审核人名称默认为当前账号 + SysUser user = loginUser.getUser(); + completionNotice.setPdAuditUser(user.getNickName()); + int i = pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + if(i<1){ + return AjaxResult.error(); + } + //修改合同状态为待检验状态4 +// PwContract pwContract = pwContractService.selectByContractCode(completionNotice.getContractCode()); +// pwContract.setContractStatus(4); +// int j = pwContractService.updatePwContract(pwContract); +// if(j<1){ +// return AjaxResult.error(); +// } + return AjaxResult.success(); + } + + /** + * 审核完工通知单(修改其审核状态) + */ + @RequestMapping("/editQualityInspectorAudit") + public AjaxResult editQualityInspectorAudit(Long id){ + //根据完工通知单id查询通知单 + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeById(id); + //修改完工通知单质检部审核状态为已审核2 + completionNotice.setQualityInspectorAudit(2); + //获取当前登录的用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + //审核人名称默认为当前账号 + SysUser user = loginUser.getUser(); + completionNotice.setQualityInspectorAuditUser(user.getNickName()); + int i = pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + if(i<1){ + return AjaxResult.error(); + } + //修改合同状态为待入库状态5 +// PwContract pwContract = pwContractService.selectByContractCode(completionNotice.getContractCode()); +// pwContract.setContractStatus(5); +// int j = pwContractService.updatePwContract(pwContract); +// if(j<1){ +// return AjaxResult.error(); +// } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCompletionNoticeProductController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCompletionNoticeProductController.java new file mode 100644 index 0000000..ba8f250 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCompletionNoticeProductController.java @@ -0,0 +1,1334 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import cn.hutool.core.date.DateUtil; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.utils.SendEmail; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.poi.ExcelUtilPrint; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品完工通知单关联Controller + * + * @author zhukangchao + * @date 2020-07-20 + */ +@RestController +@RequestMapping("/management/completionNoticeProduct") +public class PwCompletionNoticeProductController extends BaseController { + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //用户信息 + @Autowired + private TokenService tokenService; + //入库单信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //预制单详情信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //产品入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //用户邮箱信息 + @Autowired + private IPwUserEmailService pwUserEmailService; + //副bom信息 + @Autowired + private IPwBomNumberTwoFuService pwBomNumberTwoFuService; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + @Autowired + private IPwProductionBillService iPwProductionBillService; + + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + //不良品信息 + @Autowired + private IEvoInvalidLibraryService evoInvalidLibraryService; + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + + /** + * 查询产品完工通知单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:completionNoticeProduct:list')") + @GetMapping("/list") + public TableDataInfo list(PwCompletionNoticeProduct pwCompletionNoticeProduct) { + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if (null != pwCompletionNoticeProduct.getBeginTime() && !"".equals(pwCompletionNoticeProduct.getBeginTime()) && null != pwCompletionNoticeProduct.getEndTime() && !"".equals(pwCompletionNoticeProduct.getEndTime())) { + try { + Date start = sdf.parse(pwCompletionNoticeProduct.getBeginTime()); + Date end = sdf.parse(pwCompletionNoticeProduct.getEndTime()); + pwCompletionNoticeProduct.setStart(start); + pwCompletionNoticeProduct.setEnd(end); + } catch (Exception e) { + // TODO: handle exception + } + } + if (null != pwCompletionNoticeProduct.getBeginTimeTwo() && !"".equals(pwCompletionNoticeProduct.getBeginTimeTwo()) && null != pwCompletionNoticeProduct.getEndTimeTwo() && !"".equals(pwCompletionNoticeProduct.getEndTimeTwo())) { + try { + Date startTwo = sdf.parse(pwCompletionNoticeProduct.getBeginTimeTwo()); + Date endTwo = sdf.parse(pwCompletionNoticeProduct.getEndTimeTwo()); + pwCompletionNoticeProduct.setStartTwo(startTwo); + pwCompletionNoticeProduct.setEndTwo(endTwo); + } catch (Exception e) { + // TODO: handle exception + } + } + + startPage(); + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(pwCompletionNoticeProduct); + //计算合格率 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + if (pwCompletionNoticeProduct2.getConcessionQuantity() > 0) { + Long d = (long) (((pwCompletionNoticeProduct2.getReceivableQuantity() - pwCompletionNoticeProduct2.getConcessionQuantity()) / pwCompletionNoticeProduct2.getReceivableQuantity()) * 100); + pwCompletionNoticeProduct2.setRetio(d + "%"); + } else { + Long d = (long) (((pwCompletionNoticeProduct2.getQuantity() - pwCompletionNoticeProduct2.getConcessionQuantity()) / pwCompletionNoticeProduct2.getReceivableQuantity()) * 100); + pwCompletionNoticeProduct2.setRetio(d + "%"); + } + } + return getDataTable(list); + } + + /** + * 导出产品完工通知单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:completionNoticeProduct:export')") + @Log(title = "产品完工通知单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCompletionNoticeProduct pwCompletionNoticeProduct) { + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(pwCompletionNoticeProduct); + //计算合格率 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + if (pwCompletionNoticeProduct2.getConcessionQuantity() > 0) { + Long d = (long) (((pwCompletionNoticeProduct2.getReceivableQuantity() - pwCompletionNoticeProduct2.getConcessionQuantity()) / pwCompletionNoticeProduct2.getReceivableQuantity()) * 100); + pwCompletionNoticeProduct2.setRetio(d + "%"); + } else { + Long d = (long) (((pwCompletionNoticeProduct2.getQuantity() - pwCompletionNoticeProduct2.getConcessionQuantity()) / pwCompletionNoticeProduct2.getReceivableQuantity()) * 100); + pwCompletionNoticeProduct2.setRetio(d + "%"); + } + } + ExcelUtil util = new ExcelUtil(PwCompletionNoticeProduct.class); + return util.exportExcel(list, "completionNoticeProduct"); + } + + /** + * 获取产品完工通知单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:completionNoticeProduct:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwCompletionNoticeProductService.selectPwCompletionNoticeProductById(id)); + } + + /** + * 根据令号和名称和图号查询 + */ + + @RequestMapping(value = "/getCompletionNoticeProductTwo") + public AjaxResult getCompletionNoticeProductTwo(String data) { + //解析收到的数据 + JSONObject jsonObject = JSONObject.parseObject(data); + String code = jsonObject.get("code").toString(); + String name = jsonObject.get("name").toString(); + String figureNumber = jsonObject.get("figureNumber").toString(); + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(code, name, figureNumber); + //返回最后一条记录 + return AjaxResult.success(list.get(list.size() - 1)); + } + + /** + * 新增产品完工通知单关联 + */ + @PreAuthorize("@ss.hasPermi('management:completionNoticeProduct:add')") + @Log(title = "产品完工通知单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCompletionNoticeProduct pwCompletionNoticeProduct) { + return toAjax(pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct)); + } + + /** + * 修改产品完工通知单关联 + */ + @PreAuthorize("@ss.hasPermi('management:completionNoticeProduct:edit')") + @Log(title = "产品完工通知单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCompletionNoticeProduct pwCompletionNoticeProduct) { + if (pwCompletionNoticeProduct.getActualQuantity().longValue() + pwCompletionNoticeProduct.getQuantity().longValue() > pwCompletionNoticeProduct.getReceivableQuantity().longValue()) { + return AjaxResult.error("实检数量不得大于应检数量"); + } + return toAjax(pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct)); + } + + /** + * 删除产品完工通知单关联 + */ + @PreAuthorize("@ss.hasPermi('management:completionNoticeProduct:remove')") + @Log(title = "产品完工通知单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(pwCompletionNoticeProductService.deletePwCompletionNoticeProductByIds(ids)); + } + + /** + * 打印企标单 + */ + @RequestMapping("/printCompletionNoticeProducts/{ids}") + public AjaxResult printCompletionNoticeProducts(@PathVariable Long[] ids) { + Map map = new HashedMap(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + //获取当前用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //用户昵称 + String nickName = user.getNickName(); + List list = new ArrayList(); + for (Long id : ids) { + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById(id); +// completionNoticeProduct.setUserName(nickName); + //根据令号查询当前令号下有哪些企标件 + list.add(completionNoticeProduct); + } + map.put("list", list); + map.put("nickName", nickName); + map.put("dateTime", sdf.format(new Date())); + return AjaxResult.success("success", map); + } + + + /** + * 打印单据功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据, + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdft = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if (ids.length == 0) { + return AjaxResult.error("请选择物料"); + } + List list = new ArrayList(); + Long i = 1L; + //遍历ids + for (Long id : ids) { + //根据id获取物料信息 + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById(id); + completionNoticeProduct.setSerialNumber(i); + i++; + list.add(completionNoticeProduct); + } + //供应商名称 + String preferentialOriginName = ""; + //检验员 +// String qualityInspector = ""; + PwCompletionNoticeProduct pwCompletionNoticeProduct2 = new PwCompletionNoticeProduct(); + //遍历统计数量和金额 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list) { + if (null == preferentialOriginName || "".equals(preferentialOriginName)) { +// preferentialOriginName = pwCompletionNoticeProduct.getPreferentialOriginName(); + } else { + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 +// if(!preferentialOriginName.equals(imProductReceiptMaterial.getPreferentialOriginName())){ +// return AjaxResult.error("不同供应商不可合并打印"); +// } + } + if (null == pwCompletionNoticeProduct2.getActualQuantity()) { + pwCompletionNoticeProduct2.setActualQuantity(0.0); + } +// pwCompletionNoticeProduct2.setActualQuantity(pwCompletionNoticeProduct2.getActualQuantity()+pwCompletionNoticeProduct.getActualQuantity()); +// if(null==pwCompletionNoticeProduct2.getTotalPrices()){ +// pwCompletionNoticeProduct2.setTotalPrices(0.0); +// } +// pwCompletionNoticeProduct2.setTotalPrices(pwCompletionNoticeProduct2.getTotalPrices()+pwCompletionNoticeProduct.getTotalPrices()); + } + //把小写转为大写 +// MoneyUtil moneyUtil = new MoneyUtil(); +// String chinese = moneyUtil.toChinese(productReceiptMaterial.getTotalPrices()+""); +// productReceiptMaterial.setCode("合计金额:"); +// productReceiptMaterial.setMaterialName(chinese); + list.add(pwCompletionNoticeProduct2); + //首先把数据集合生成excel,然后调用打印机打印excel + // 创建excel文件 + ExcelUtilPrint util = new ExcelUtilPrint(PwCompletionNoticeProduct.class); + //一级表头 + String title = "河北伊特机械设备制造有限公司"; + //二级表头 + String titleTwo = "入库单"; + //三级表头 + String titleThree = "摘要: " + "日期: " + sdf.format(new Date()) + " " + "编号: " + sdft.format(new Date()); + //表尾 + String footer = "库管: " + "经办: " + "检验员: " + "制单: " + user.getNickName(); + + AjaxResult result = util.exportExcel(list, "入库单", title, titleTwo, "供应商:" + preferentialOriginName, titleThree, footer); + //打印文件 + //获取文件路径 +// String filePath = RuoYiConfig.getDownloadPath() + result.get("msg"); +// File file = new File(filePath); +// boolean b = Print.printOfficeFile(file); +// if(b){ +// return AjaxResult.success(); +// }else{ +// return AjaxResult.error(); +// } + return util.exportExcel(list, "入库单", title, titleTwo, "供应商:" + preferentialOriginName, titleThree, footer); + } + + /** + * 确认质检 + */ + @RequestMapping("/affirmCheckoutProduct") + public AjaxResult affirmCheckoutProduct(@RequestBody PwCompletionNoticeProduct pwCompletionNoticeProduct) { + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //质检单id + long i = 0; + + if (i == 0) { + i = pwCompletionNoticeProduct.getCompletionNoticeId(); + } + //判断是否已经检验,如果已经检验则不需要再检验 + if (pwCompletionNoticeProduct.getCheckoutStatus().equals("已检验")) { + return AjaxResult.error("无需重复检验"); + } + + //判断让步接收数量 + if (null == pwCompletionNoticeProduct.getConcessionQuantity()) { + //让步接收数量置为0 + pwCompletionNoticeProduct.setConcessionQuantity(0.0); + } + //判断合格数量和返修数量和重制数量不能大于申请数量 + if (null == pwCompletionNoticeProduct.getRepairQuantity()) { + //返修数量置为0 + pwCompletionNoticeProduct.setRepairQuantity(0.0); + } + if (null == pwCompletionNoticeProduct.getRemakeQuantity()) { + //重制数量置为0 + pwCompletionNoticeProduct.setRemakeQuantity(0.0); + } + if (null == pwCompletionNoticeProduct.getInvailed()) { + //报废数量 + pwCompletionNoticeProduct.setInvailed(0.0); + } + + //判断是否填写了合格数量,让步接收数量,返修数量,重置数量 + if (0 == (pwCompletionNoticeProduct.getActualQuantity() + pwCompletionNoticeProduct.getConcessionQuantity() + pwCompletionNoticeProduct.getRepairQuantity() + pwCompletionNoticeProduct.getRemakeQuantity()) + pwCompletionNoticeProduct.getInvailed()) { + return AjaxResult.error("请填写数量"); + } + if (pwCompletionNoticeProduct.getActualQuantity() + pwCompletionNoticeProduct.getRepairQuantity() + pwCompletionNoticeProduct.getRemakeQuantity() + pwCompletionNoticeProduct.getConcessionQuantity() > pwCompletionNoticeProduct.getReceivableQuantity()) { + return AjaxResult.error("实检数量+让步接收数量+返修数量+重制数量不可大于申请数量"); + } + + //单独 出/入库管理的审核推送的数据 + if (pwCompletionNoticeProduct.getCode().contains("OBJ")) { + //修改关联单 + pwCompletionNoticeProduct.setCheckoutStatus("已检验"); + pwCompletionNoticeProduct.setInspector(user.getNickName()); + pwCompletionNoticeProduct.setCheckoutDate(new Date()); + pwCompletionNoticeProduct.setQuantity(pwCompletionNoticeProduct.getActualQuantity()); + pwCompletionNoticeProduct.setActualQuantity(pwCompletionNoticeProduct.getReceivableQuantity() - pwCompletionNoticeProduct.getQuantity()); + int p = pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct); + if (p < 1) { + AjaxResult.error("质检失败!"); + } + //把不良品入库 + EvoInvalidLibrary evoInvalidLibrary = new EvoInvalidLibrary(); + evoInvalidLibrary.setProductBillCode(pwCompletionNoticeProduct.getCode()); + evoInvalidLibrary.setInvalidNumber(pwCompletionNoticeProduct.getInvailed()); + evoInvalidLibrary.setMaterialName(pwCompletionNoticeProduct.getProductName()); + evoInvalidLibrary.setMaterials(pwCompletionNoticeProduct.getMaterials()); + evoInvalidLibrary.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber()); + evoInvalidLibrary.setOperator(pwCompletionNoticeProduct.getUserName()); + evoInvalidLibrary.setOperatorTime(pwCompletionNoticeProduct.getCreateTime()); + evoInvalidLibrary.setQualityInspector(user.getNickName()); + evoInvalidLibrary.setQualityTime(new Date()); + evoInvalidLibraryService.insertEvoInvalidLibrary(evoInvalidLibrary); + //修改质检单 + PwCompletionNotice notice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(pwCompletionNoticeProduct.getCode()); + notice.setQualityInspectorAudit(1); + notice.setQualityInspectorAuditUser(user.getNickName()); + p = pwCompletionNoticeService.updatePwCompletionNotice(notice); + if (p < 1) { + AjaxResult.error("修改质检失败!"); + } + return AjaxResult.success("质检成功!"); + } + + //如果重制数量大于0,则添加副bom表 + if (0 < pwCompletionNoticeProduct.getRemakeQuantity()) { + //添加副bom表 + //根据令号名称图号查询物料信息 + if (pwCompletionNoticeProduct.getCode().contains("QB")) { + //查询企标单 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(pwCompletionNoticeProduct.getCode(), pwCompletionNoticeProduct.getProductName(), pwCompletionNoticeProduct.getFigureNumber()); + //查询父级信息 + PwMakeDocumentsDetail documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + + PwBomNumberTwoFu pwBomNumberTwoFu = new PwBomNumberTwoFu(); + //令号 + pwBomNumberTwoFu.setProductionCode(documentsDetail.getMakeDocumentsCode()); + //名称 + pwBomNumberTwoFu.setName(documentsDetail.getName()); + //图号 + pwBomNumberTwoFu.setFigureNumber(documentsDetail.getFigureNumber()); + /** 材料 */ + pwBomNumberTwoFu.setType(documentsDetail.getMaterialType()); + /** 单重 */ + pwBomNumberTwoFu.setPieceWeight(0.0); + /** 本批数量 */ + pwBomNumberTwoFu.setSumNumber(pwCompletionNoticeProduct.getRemakeQuantity().longValue()); + pwBomNumberTwoFuService.insertPwBomNumberTwoFu(pwBomNumberTwoFu); + + //查询子集信息 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(documentsDetail.getMakeDocumentsCode(), documentsDetail.getId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + PwBomNumberTwoFu pwBomNumberTwoFu2 = new PwBomNumberTwoFu(); + //令号 + pwBomNumberTwoFu2.setProductionCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //名称 + pwBomNumberTwoFu2.setName(pwMakeDocumentsDetail.getName()); + //图号 + pwBomNumberTwoFu2.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + /** 材料 */ + pwBomNumberTwoFu2.setType(pwMakeDocumentsDetail.getMaterialType()); + /** 单重 */ + pwBomNumberTwoFu2.setPieceWeight(0.0); + /** 本批数量 */ + pwBomNumberTwoFu2.setSumNumber(pwCompletionNoticeProduct.getRemakeQuantity().longValue()); + //上级id + pwBomNumberTwoFu2.setSuperiorId(pwBomNumberTwoFu.getId()); + //父级名称 + pwBomNumberTwoFu2.setParentLevelName(pwMakeDocumentsDetail.getParentLevelName()); + //父级图号 + pwBomNumberTwoFu2.setParentLevelFigureNumber(pwMakeDocumentsDetail.getParentLevelFigureNumber()); + //工序名称 + pwBomNumberTwoFu2.setProcessName(pwMakeDocumentsDetail.getProcessName()); + //派工部门 +// pwBomNumberTwoFu2.setDepartmentName(pwMakeDocumentsDetail.getDepartmentName()); +// //是否入库 +// pwBomNumberTwoFu2.setGodownEntry(pwMakeDocumentsDetail.getGodownEntry()); +// //完成时间 +// pwBomNumberTwoFu2.setCompletionDate(pwMakeDocumentsDetail.getCompletionDate()); + + pwBomNumberTwoFuService.insertPwBomNumberTwoFu(pwBomNumberTwoFu2); + } + + } else { + /* //查询执行单 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwCompletionNoticeProduct.getCode(), pwCompletionNoticeProduct.getProductName(), pwCompletionNoticeProduct.getFigureNumber()); + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo.getSuperiorId()); + PwBomNumberTwoFu pwBomNumberTwoFu = new PwBomNumberTwoFu(); + //令号 + pwBomNumberTwoFu.setProductionCode(numberTwo.getProductionCode()); + //名称 + pwBomNumberTwoFu.setName(numberTwo.getName()); + //图号 + pwBomNumberTwoFu.setFigureNumber(numberTwo.getFigureNumber()); + *//** 材料 *//* + pwBomNumberTwoFu.setType(numberTwo.getType()); + *//** 单重 *//* + pwBomNumberTwoFu.setPieceWeight(numberTwo.getPieceWeight()); + *//** 本批数量 *//* + pwBomNumberTwoFu.setSumNumber(pwCompletionNoticeProduct.getRemakeQuantity().longValue()); + //产品型号 + pwBomNumberTwoFu.setSparedOne(numberTwo.getSparedOne()); + pwBomNumberTwoFu.setRemarks(numberTwo.getRemarks()); + pwBomNumberTwoFuService.insertPwBomNumberTwoFu(pwBomNumberTwoFu); + + //查询子集信息 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(numberTwo.getProductionCode(), numberTwo.getId()); + for (PwBomNumberTwo pwBomNumberTwo : list) { + PwBomNumberTwoFu pwBomNumberTwoFu2 = new PwBomNumberTwoFu(); + //令号 + pwBomNumberTwoFu2.setProductionCode(pwBomNumberTwo.getProductionCode()); + //名称 + pwBomNumberTwoFu2.setName(pwBomNumberTwo.getName()); + //图号 + pwBomNumberTwoFu2.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + *//** 材料 *//* + pwBomNumberTwoFu2.setType(pwBomNumberTwo.getType()); + *//** 单重 *//* + pwBomNumberTwoFu2.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + *//** 本批数量 *//* + pwBomNumberTwoFu2.setSumNumber(pwCompletionNoticeProduct.getRemakeQuantity().longValue()); + //上级id + pwBomNumberTwoFu2.setSuperiorId(pwBomNumberTwoFu.getId()); + //父级名称 + pwBomNumberTwoFu2.setParentLevelName(pwBomNumberTwo.getParentLevelName()); + //父级图号 + pwBomNumberTwoFu2.setParentLevelFigureNumber(pwBomNumberTwo.getParentLevelFigureNumber()); + //工序名称 + pwBomNumberTwoFu2.setProcessName(pwBomNumberTwo.getProcessName()); + //备注 + pwBomNumberTwoFu2.setRemarks(pwBomNumberTwo.getRemarks()); + //产品型号 + pwBomNumberTwoFu2.setSparedOne(pwBomNumberTwo.getSparedOne()); + //派工部门 +// pwBomNumberTwoFu2.setDepartmentName(pwBomNumberTwo.getDepartmentName()); +// //是否入库 +// pwBomNumberTwoFu2.setGodownEntry(pwBomNumberTwo.getGodownEntry()); +// //完成时间 +// pwBomNumberTwoFu2.setCompletionDate(pwBomNumberTwo.getCompletionDate()); + + pwBomNumberTwoFuService.insertPwBomNumberTwoFu(pwBomNumberTwoFu2); + } +*/ + } + } + + //如果合格数量为0时,且当前物料的申请状态为已申请时,需要重置当前状态 + if (pwCompletionNoticeProduct.getActualQuantity().longValue() != pwCompletionNoticeProduct.getReceivableQuantity().longValue()) { + //查询当前物料的状态 + if (pwCompletionNoticeProduct.getCode().contains("QB")) { + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(pwCompletionNoticeProduct.getCode(), pwCompletionNoticeProduct.getProductName(), pwCompletionNoticeProduct.getFigureNumber()); + if ("已申请".equals(makeDocumentsDetail.getInventoryStatus())) { + makeDocumentsDetail.setInventoryStatus("未入库"); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + } + } else { + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwCompletionNoticeProduct.getCode(), pwCompletionNoticeProduct.getProductName(), pwCompletionNoticeProduct.getFigureNumber()); + if (null != pwBomNumberTwo) { + if ("已申请".equals(pwBomNumberTwo.getInventoryStatus())) { + pwBomNumberTwo.setInventoryStatus(null); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + } + } + } + //检测不良品数量不为0,则记录不良品 合格數量<應檢數量 + if (pwCompletionNoticeProduct.getInvailed() != null&&pwCompletionNoticeProduct.getInvailed()!=0) { + //修改投产的总数量 =应检数量减去不良数量 重置当前数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwCompletionNoticeProduct.getReceivableQuantity() - pwCompletionNoticeProduct.getInvailed()); + pwCompletionNoticeProduct.setQuantity(pwCompletionNoticeProduct.getReceivableQuantity() - pwCompletionNoticeProduct.getInvailed()); + //检验员 + pwCompletionNoticeProduct.setInspector(user.getNickName()); + //修改已检验数量 + // pwCompletionNoticeProduct.setQuantity(pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getActualQuantity()); + //重置实检验数量 + pwCompletionNoticeProduct.setActualQuantity(0.0); + pwCompletionNoticeProduct.setInvailed(pwCompletionNoticeProduct.getInvailed()); + //修改检验状态 + pwCompletionNoticeProduct.setCheckoutStatus("已检验"); + pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct); + /* if (pwCompletionNoticeProduct.getCompletionNoticeId()){ + + }*/ + //創建不良品库对象 + EvoInvalidLibrary evoInvalidLibrary = new EvoInvalidLibrary(); + if (pwCompletionNoticeProduct.getCode().contains("QB")) { + String code = pwCompletionNoticeProduct.getCode(); + String figureNumber = pwCompletionNoticeProduct.getFigureNumber(); + //图号 + evoInvalidLibrary.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber()); + //如果是企标单的话需要查询企标制作单的详细信息 + + PwMakeDocumentsDetail pwMakeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(pwCompletionNoticeProduct.getCode(), pwCompletionNoticeProduct.getFigureNumber()); + PwMakeDocuments pwMakeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(pwCompletionNoticeProduct.getCode()); + if (pwMakeDocumentsDetail != null) { + //项目名称 + evoInvalidLibrary.setItemName(pwMakeDocuments.getName()); + //名称 + evoInvalidLibrary.setMaterialName(pwMakeDocumentsDetail.getName()); + //材质 + evoInvalidLibrary.setMaterials(pwMakeDocumentsDetail.getMaterialsName()); + //执行单号 + evoInvalidLibrary.setProductBillCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //工序 + if (pwCompletionNoticeProduct.getCode().contains("-") && pwCompletionNoticeProduct.getProductName() != null) { + String process = pwCompletionNoticeProduct.getProductName().substring(pwCompletionNoticeProduct.getProductName().indexOf("-") + 1); + //工序 + evoInvalidLibrary.setProcess(process); + } else { + evoInvalidLibrary.setProductBillCode(null); + } + evoInvalidLibrary.setOperator(pwCompletionNoticeProduct.getUserName()); + //evoInvalidLibrary.setType(); + evoInvalidLibrary.setRepairNumber(0.0); + evoInvalidLibrary.setInvalidNumber(pwCompletionNoticeProduct.getInvailed()); + evoInvalidLibrary.setUnit("个"); + evoInvalidLibrary.setQualityTime(new Date()); + evoInvalidLibrary.setOperatorTime(new Date()); + evoInvalidLibrary.setQualityInspector(pwCompletionNoticeProduct.getInspector()); + evoInvalidLibraryService.insertEvoInvalidLibrary(evoInvalidLibrary); + } + } else { + //图号 + evoInvalidLibrary.setFigureNumber(pwCompletionNoticeProduct.getFigureNumber()); + //项目名称 + PwProductionBill pwProductionBill = iPwProductionBillService.selectPwProductionBillByProductionCode(pwCompletionNoticeProduct.getCode()); + evoInvalidLibrary.setItemName(pwProductionBill.getProjectName()); + //名称 + evoInvalidLibrary.setMaterialName(pwCompletionNoticeProduct.getProductName()); + evoInvalidLibrary.setMaterials(pwCompletionNoticeProduct.getMaterials()); + //执行单号 + evoInvalidLibrary.setProductBillCode(pwCompletionNoticeProduct.getCode()); + //工序 + if (pwCompletionNoticeProduct.getProductName().contains("-") && pwCompletionNoticeProduct.getProductName() != null) { + // 截取 "-" 后面的工序 + String process = pwCompletionNoticeProduct.getProductName().substring(pwCompletionNoticeProduct.getProductName().indexOf("-") + 1); + evoInvalidLibrary.setProcess(process); + } + evoInvalidLibrary.setOperator(pwCompletionNoticeProduct.getUserName()); + //evoInvalidLibrary.setType(); + evoInvalidLibrary.setRepairNumber(0.0); + evoInvalidLibrary.setInvalidNumber(pwCompletionNoticeProduct.getInvailed()); + evoInvalidLibrary.setUnit("个"); + evoInvalidLibrary.setQualityTime(new Date()); + evoInvalidLibrary.setOperatorTime(new Date()); + evoInvalidLibrary.setQualityInspector(pwCompletionNoticeProduct.getInspector()); + evoInvalidLibraryService.insertEvoInvalidLibrary(evoInvalidLibrary); + } + + //判断企标或非标,减少下一工序数量 + if (pwCompletionNoticeProduct.getCode().contains("QB")) { + String code = pwCompletionNoticeProduct.getCode(); + System.out.println(code); + // String figureNumber = pwCompletionNoticeProduct.getFigureNumber(); + List pwMakeDocumentsDetails = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCode(code); + // 解析当前工序的顺序号 + Pattern pattern = Pattern.compile(".*-(\\d+)"); + Matcher currentMatcher = pattern.matcher(pwCompletionNoticeProduct.getFigureNumber()); + if (currentMatcher.find()) { + int currentProcessNumber = Integer.parseInt(currentMatcher.group(1)); + for (PwMakeDocumentsDetail detail : pwMakeDocumentsDetails) { + String nextFigureNumber = detail.getFigureNumber(); + Matcher nextMatcher = pattern.matcher(nextFigureNumber); + if (nextMatcher.find()) { + int nextProcessNumber = Integer.parseInt(nextMatcher.group(1)); + if (nextProcessNumber > currentProcessNumber) { + // 检查是否为后续工序 + System.out.println(pwCompletionNoticeProduct.getInvailed().longValue()); + detail.setQuantity(detail.getQuantity() - pwCompletionNoticeProduct.getInvailed().longValue()); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(detail); + } + } + } + } + + } else { + //非标 + String code = pwCompletionNoticeProduct.getCode(); + System.out.println(code); + // String figureNumber = pwCompletionNoticeProduct.getFigureNumber(); + List pwBomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCode(code); + // 解析当前工序的顺序号 + Pattern pattern = Pattern.compile(".*-(\\d+)"); + Matcher currentMatcher = pattern.matcher(pwCompletionNoticeProduct.getFigureNumber()); + if (currentMatcher.find()) { + int currentProcessNumber = Integer.parseInt(currentMatcher.group(1)); + for (PwBomNumberTwo bomtwo : pwBomNumberTwos) { + String nextFigureNumber = bomtwo.getFigureNumber(); + Matcher nextMatcher = pattern.matcher(nextFigureNumber); + if (nextMatcher.find()) { + int nextProcessNumber = Integer.parseInt(nextMatcher.group(1)); + if (nextProcessNumber > currentProcessNumber) { + // 检查是否为后续工序 + System.out.println(pwCompletionNoticeProduct.getInvailed().longValue()); + bomtwo.setOneNumber(bomtwo.getOneNumber() - pwCompletionNoticeProduct.getInvailed().longValue()); + pwBomNumberTwoService.updatePwBomNumberTwo(bomtwo); + } + } + } + } + //查询执行单 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwCompletionNoticeProduct.getCode(), pwCompletionNoticeProduct.getProductName(), pwCompletionNoticeProduct.getFigureNumber()); + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo.getSuperiorId()); + PwBomNumberTwoFu pwBomNumberTwoFu = new PwBomNumberTwoFu(); + //令号 + pwBomNumberTwoFu.setProductionCode(numberTwo.getProductionCode()); + //名称 + pwBomNumberTwoFu.setName(numberTwo.getName()); + //图号 + pwBomNumberTwoFu.setFigureNumber(numberTwo.getFigureNumber()); + /** 材料 */ + pwBomNumberTwoFu.setType(numberTwo.getType()); + /** 单重 */ + pwBomNumberTwoFu.setPieceWeight(numberTwo.getPieceWeight()); + /** 本批数量 */ + pwBomNumberTwoFu.setSumNumber(pwCompletionNoticeProduct.getRemakeQuantity().longValue()); + //产品型号 + pwBomNumberTwoFu.setSparedOne(numberTwo.getSparedOne()); + pwBomNumberTwoFu.setRemarks(numberTwo.getRemarks()); + pwBomNumberTwoFuService.insertPwBomNumberTwoFu(pwBomNumberTwoFu); + + //查询子集信息 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(numberTwo.getProductionCode(), numberTwo.getId()); + for (PwBomNumberTwo pwBomNumberTwo : list) { + PwBomNumberTwoFu pwBomNumberTwoFu2 = new PwBomNumberTwoFu(); + //令号 + pwBomNumberTwoFu2.setProductionCode(pwBomNumberTwo.getProductionCode()); + //名称 + pwBomNumberTwoFu2.setName(pwBomNumberTwo.getName()); + //图号 + pwBomNumberTwoFu2.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + /** 材料 */ + pwBomNumberTwoFu2.setType(pwBomNumberTwo.getType()); + /** 单重 */ + pwBomNumberTwoFu2.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + /** 本批数量 */ + pwBomNumberTwoFu2.setSumNumber(pwCompletionNoticeProduct.getInvailed().longValue()); + //上级id + pwBomNumberTwoFu2.setSuperiorId(pwBomNumberTwoFu.getId()); + //父级名称 + pwBomNumberTwoFu2.setParentLevelName(pwBomNumberTwo.getParentLevelName()); + //父级图号 + pwBomNumberTwoFu2.setParentLevelFigureNumber(pwBomNumberTwo.getParentLevelFigureNumber()); + //工序名称 + pwBomNumberTwoFu2.setProcessName(pwBomNumberTwo.getProcessName()); + //备注 + pwBomNumberTwoFu2.setRemarks(pwBomNumberTwo.getRemarks()); + //产品型号 + pwBomNumberTwoFu2.setSparedOne(pwBomNumberTwo.getSparedOne()); + //派工部门 +// pwBomNumberTwoFu2.setDepartmentName(pwBomNumberTwo.getDepartmentName()); +// //是否入库 +// pwBomNumberTwoFu2.setGodownEntry(pwBomNumberTwo.getGodownEntry()); +// //完成时间 +// pwBomNumberTwoFu2.setCompletionDate(pwBomNumberTwo.getCompletionDate()); + + pwBomNumberTwoFuService.insertPwBomNumberTwoFu(pwBomNumberTwoFu2); + } + + } + } + + //说明已检验完毕 + //检验日期 + pwCompletionNoticeProduct.setCheckoutDate(new Date()); + //检验员 + pwCompletionNoticeProduct.setInspector(user.getNickName()); + //修改已检验数量 + pwCompletionNoticeProduct.setQuantity(pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getActualQuantity()); + //重置实检验数量 + pwCompletionNoticeProduct.setActualQuantity(0.0); + //修改检验状态 + pwCompletionNoticeProduct.setCheckoutStatus("已检验"); + + + if (null != pwCompletionNoticeProduct.getProductReceiptMaterialId()) { + //根据入库单详情id查询入库单详情信息,添加其检验员信息 + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(pwCompletionNoticeProduct.getProductReceiptMaterialId()); + //修改申请数量为合格数量 + productReceiptMaterial.setReceivableQuantity(pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getConcessionQuantity()); + productReceiptMaterial.setActualQuantity(pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getConcessionQuantity()); + if (null != productReceiptMaterial.getPracticalNumber() && 0 != productReceiptMaterial.getPracticalNumber()) { + //判断当总重不为null时,如果合格数量不等于应检数量时,总重应相对应的减少(总重/应检数量*合格数量) + if (pwCompletionNoticeProduct.getReceivableQuantity() != pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getConcessionQuantity()) { + productReceiptMaterial.setPracticalNumber(productReceiptMaterial.getPracticalNumber() / pwCompletionNoticeProduct.getReceivableQuantity() * (pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getConcessionQuantity())); + } + //总价为总重*单价 + productReceiptMaterial.setTotalPrices(productReceiptMaterial.getPracticalNumber() * productReceiptMaterial.getUnivalence()); + } else { + //数量*单价 + //重新计算总价 + productReceiptMaterial.setTotalPrices(productReceiptMaterial.getReceivableQuantity() * productReceiptMaterial.getUnivalence()); + } + //检验员 + productReceiptMaterial.setQualityInspector(user.getNickName()); + //检验时间 + productReceiptMaterial.setCheckoutTime(pwCompletionNoticeProduct.getCheckoutDate()); + + if (!"虚拟入库".equals(productReceiptMaterial.getRecipient())) { + imProductReceiptMaterialService.updateImProductReceiptMaterial(productReceiptMaterial); + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) + //addBacklog("物料待入库",productReceiptMaterial.getCode(),productReceiptMaterial.getMaterialName(),productReceiptMaterial.getSpecification(),user.getNickName(),"库管","审核入库","物料入库管理","/inventory/imProductReceiptMaterial?id="+productReceiptMaterial.getProductReceiptId()); + } else { + //入库时间为检验时间 + productReceiptMaterial.setStorageDate(pwCompletionNoticeProduct.getCheckoutDate()); + //入库状态改为已入库 + productReceiptMaterial.setInventoryStatus("已入库"); + //已收数量 + productReceiptMaterial.setReceived(pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getConcessionQuantity()); + + if (productReceiptMaterial.getMaterialName().contains("(M)")) { + //判断是否是最后一道序,如果为最后一道序,则添加成品的库存数量,如果不是最后一道序,则增加本省的数量 + String code = pwCompletionNoticeProduct.getCode(); + //截取当前物料的最后一个-之后的字符 + String specification = productReceiptMaterial.getSpecification(); + String string = specification.substring(specification.lastIndexOf("-") + 1); + if (code.contains("QB")) { + //根据执行单code和物料名称和图号查询表中当前物料的上级 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(code, productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //根据执行单code和图号和名称查询其所有子集 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumbers(code, makeDocumentsDetail.getParentLevelName(), makeDocumentsDetail.getParentLevelFigureNumber()); + //如果最后一个字符的值等于list的长度,则代表是最后一道序,则处理它上级物料的库存数量及在途数量 + if (list.size() == Integer.valueOf(string)) { + //说明是最后一道序,需要处理当前物料的父级物料的数据 + //遍历其所有子集,获取其所有子集的未税单价,合并到父级本身 + BigDecimal b = new BigDecimal("0"); + for (PwMakeDocumentsDetail PwMakeDocumentsDetail : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(PwMakeDocumentsDetail.getName(), PwMakeDocumentsDetail.getFigureNumber()); + //获取其未税单价 + BigDecimal univalence = inventoryDetail.getUnivalence(); + b = b.add(univalence); + } + + //根据父级id查询父级信息 + PwMakeDocumentsDetail detail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(detail.getName(), detail.getFigureNumber()); + //查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(detail.getName(), detail.getFigureNumber()); + if (null != inventoryDetail) { + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity() + productReceiptMaterial.getActualQuantity().longValue()); + /*if (inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity() < 0) { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + } else { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if (inventoryDetail.getQuantity() - inventoryDetail.getLockNumber() < 0) { + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + } else { + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity() - inventoryDetail.getLockNumber()); + } + //更新未税单价(平均价格) + if (inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0) { + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(b)).divide(BigDecimal.valueOf(2))); + } else { + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + //仓库名称 + inventoryDetail.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if (j < 1) { + return AjaxResult.error("入库失败"); + } + } else { + //未查询到库存信息 + return AjaxResult.error("未查询到库存信息"); + } + //修改上级物料之后,也要修改当前物料本身的在途数量和锁定数量,未税单价 + PwInventoryDetail inventoryDetails = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //查询物料信息 + ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if (null != inventoryDetails) { + //增加库存数量 +// inventoryDetail.setQuantity(inventoryDetail.getQuantity()+productReceiptMaterial.getActualQuantity().longValue()); + /*if (inventoryDetails.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity() < 0) { + //减少在途数量 + inventoryDetails.setPreliminaryInventory(0L); + } else { + //减少在途数量 + inventoryDetails.setPreliminaryInventory(inventoryDetails.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity().longValue()); + }*/ + //减少预定数量 + if (inventoryDetails.getLockNumber() - productReceiptMaterial.getActualQuantity() < 0) { + inventoryDetails.setLockNumber(0L); + } else { + inventoryDetails.setLockNumber(inventoryDetails.getLockNumber() - productReceiptMaterial.getActualQuantity().longValue()); + } + //更新未税单价(平均价格) + if (inventoryDetails.getUnivalence().compareTo(BigDecimal.ZERO) != 0) { + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetails.setUnivalence((inventoryDetails.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + } else { + inventoryDetails.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + //仓库名称 + inventoryDetails.setWarehouseName(material2.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetails); + if (j < 1) { + return AjaxResult.error("入库失败"); + } + } else { + + } + } else { + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if (null != inventoryDetail) { + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity() + productReceiptMaterial.getActualQuantity().longValue()); + /*if (inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity() < 0) { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + } else { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if (inventoryDetail.getQuantity() - inventoryDetail.getLockNumber() < 0) { + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + } else { + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity() - inventoryDetail.getLockNumber()); + } + //更新未税单价(平均价格) + if (inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0) { + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + } else { + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if (j < 1) { + return AjaxResult.error("入库失败"); + } + } + } + } else { + //根据执行单code和物料名称和图号查询bomtwo表中当前物料的上级 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(code, productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //根据执行单code和图号和名称查询其所有子集 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(code, pwBomNumberTwo.getSuperiorId()); + //如果最后一个字符的值等于list的长度,则代表是最后一道序,则处理它上级物料的库存数量及在途数量 + if (list.size() == Integer.valueOf(string)) { + //说明是最后一道序,需要处理当前物料的父级物料的数据 + //遍历其所有子集,获取其所有子集的未税单价,合并到父级本身 + BigDecimal b = new BigDecimal("0"); + for (PwBomNumberTwo pwBomNumberTwo2 : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + //获取其未税单价 + BigDecimal univalence = inventoryDetail.getUnivalence(); + b = b.add(univalence); + } + + //根据父级id查询父级信息 + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getSuperiorId()); + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(numberTwo.getName(), numberTwo.getFigureNumber()); + //查询物料信息 + ImMaterial material2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(numberTwo.getName(), numberTwo.getFigureNumber()); + if (null != inventoryDetail) { + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity() + productReceiptMaterial.getActualQuantity().longValue()); + /* if (inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity() < 0) { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + } else { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if (inventoryDetail.getQuantity() - inventoryDetail.getLockNumber() < 0) { + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + } else { + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity() - inventoryDetail.getLockNumber()); + } + //更新未税单价(平均价格) + if (inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0) { + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(b)).divide(BigDecimal.valueOf(2))); + } else { + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + //仓库名称 + inventoryDetail.setWarehouseName(material2.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if (j < 1) { + return AjaxResult.error("入库失败"); + } + } else { + //未查询到库存信息 + return AjaxResult.error("未查询到库存信息"); + } + //修改上级物料之后,也要修改当前物料本身的在途数量和锁定数量,未税单价 + PwInventoryDetail inventoryDetails = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if (null != inventoryDetails) { + //增加库存数量 + /* if (inventoryDetails.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity() < 0) { + //减少在途数量 + inventoryDetails.setPreliminaryInventory(0L); + } else { + //减少在途数量 + inventoryDetails.setPreliminaryInventory(inventoryDetails.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity().longValue()); + }*/ + //减少预定数量 + if (inventoryDetails.getLockNumber() - productReceiptMaterial.getActualQuantity() < 0) { + inventoryDetails.setLockNumber(0L); + } else { + inventoryDetails.setLockNumber(inventoryDetails.getLockNumber() - productReceiptMaterial.getActualQuantity().longValue()); + } + //更新未税单价(平均价格) + if (inventoryDetails.getUnivalence().compareTo(BigDecimal.ZERO) != 0) { + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetails.setUnivalence((inventoryDetails.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + } else { + inventoryDetails.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + //仓库名称 + inventoryDetails.setWarehouseName(material.getWarehouseName()); + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetails); + if (j < 1) { + return AjaxResult.error("入库失败"); + } + } else { + //未查询到库存信息 + return AjaxResult.error("未查询到库存信息"); + } + } else { + //根据物料名称和图号查询库存表信息,修改其在途数量和库存数量(在途数量减少,库存数量增加),更新可用数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + if (null != inventoryDetail) { + //增加库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity() + productReceiptMaterial.getActualQuantity().longValue()); + /* if (inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity() < 0) { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(0L); + } else { + //减少在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory() - productReceiptMaterial.getActualQuantity().longValue()); + }*/ + if (inventoryDetail.getQuantity() - inventoryDetail.getLockNumber() < 0) { + //更新可用数量 + inventoryDetail.setAvailableNumber(0L); + } else { + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity() - inventoryDetail.getLockNumber()); + } + //更新未税单价(平均价格) + if (inventoryDetail.getUnivalence().compareTo(BigDecimal.ZERO) != 0) { + //如果库存信息中的未税单价不为0,则代表之前入库是带价格入的,则需要取出之前价格,和本次入库的价格相加然后除以2(获取平均价格)再保存进去 + inventoryDetail.setUnivalence((inventoryDetail.getUnivalence().add(BigDecimal.valueOf(productReceiptMaterial.getUnivalence()))).divide(BigDecimal.valueOf(2))); + } else { + inventoryDetail.setUnivalence(BigDecimal.valueOf(productReceiptMaterial.getUnivalence())); + } + //更新库存信息 + int j = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + if (j < 1) { + return AjaxResult.error("入库失败"); + } + } + } + } + } + + imProductReceiptMaterialService.updateImProductReceiptMaterial(productReceiptMaterial); + if (!pwCompletionNoticeProduct.getCode().contains("QB") && !pwCompletionNoticeProduct.getCode().contains("QG") && !pwCompletionNoticeProduct.getCode().contains("CG") && !pwCompletionNoticeProduct.getCode().contains("YG")) { + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(pwCompletionNoticeProduct.getCode()); + int s = 0; + //说明是执行单 + //根据令号和物料名称及图号查询bom表的物料,修改其入库状态 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwCompletionNoticeProduct.getCode(), productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(pwBomNumberTwo.getName()); + //图号 + im.setSpecification(pwBomNumberTwo.getFigureNumber()); + //材料 + im.setMaterialType(pwBomNumberTwo.getType()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + //判断当前物料的已收数量是否等于应收数量,如果相等则说明已全部入库 + if (s == pwBomNumberTwo.getSumNumber()) { + pwBomNumberTwo.setInventoryStatus("已入库"); + } + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + + } else if (pwCompletionNoticeProduct.getCode().contains("QB")) { + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(pwCompletionNoticeProduct.getCode()); + int s = 0; + //根据企标号和物料名称及图号查询预制单详情中的物料,修改其入库状态 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(pwCompletionNoticeProduct.getCode(), productReceiptMaterial.getMaterialName(), productReceiptMaterial.getSpecification()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(makeDocumentsDetail.getName()); + //图号 + im.setSpecification(makeDocumentsDetail.getFigureNumber()); + //材料 + im.setMaterialType(makeDocumentsDetail.getMaterialType()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list2) { + s += imProductReceiptMaterial2.getReceived(); + } + if (null != makeDocumentsDetail) { + if (s == makeDocumentsDetail.getQuantity()) { + makeDocumentsDetail.setInventoryStatus("已入库"); + } + int j = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + if (j < 1) { + return AjaxResult.error("入库失败"); + } + } + } + } +// imProductReceiptMaterialService.updateImProductReceiptMaterial(productReceiptMaterial); + } + pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct); +// + //根据令号查询质检单 + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeById(i); + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCode(completionNotice.getProductionCode()); + //未质检标识 + int a = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProducts : list) { + if (!pwCompletionNoticeProducts.getCheckoutStatus().equals("已检验")) { + a = 1; + } + break; + } + //修改质检员 + completionNotice.setQualityInspectorAuditUser(user.getNickName()); + //修改质检状态 + if (a == 0) { + completionNotice.setQualityInspectorAudit(1); + } + int j = pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //发送邮件通知申请质检人和库管人员 + //获取申请人 + String userName = pwCompletionNoticeProduct.getUserName(); + //根据申请人名称查询 + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName(userName); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + + if (null != userEmail) { + //拼接邮件内容 + content = "申请质检的物料:" + "\n
" + "令号:" + pwCompletionNoticeProduct.getCode() + "\n
" + "名称:" + pwCompletionNoticeProduct.getProductName() + + "\n
" + "图号:" + pwCompletionNoticeProduct.getFigureNumber() + "\n
" + "应检数量:" + pwCompletionNoticeProduct.getReceivableQuantity() + + "\n
" + "合格数量:" + (pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getActualQuantity()) + + "\n
" + "让步接收数量:" + pwCompletionNoticeProduct.getConcessionQuantity() + + "\n
" + "检验员:" + pwCompletionNoticeProduct.getInspector() + "\n
" + "检验时间:" + sdf.format(new Date()) + "\n
" + "已检验完毕!"; + try { + send.sendEmail("质检通知", content, userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + //判断此物料是否需要入库 + if (null != pwCompletionNoticeProduct.getGodownEntry() && pwCompletionNoticeProduct.getGodownEntry().equals("是")) { + //查询库管邮箱 + PwUserEmail userEmail2 = pwUserEmailService.selectPwUserEmailByName("库管"); + if (null != userEmail2) { + //拼接邮件内容 + content = "申请质检的物料:" + "\n
" + "令号:" + pwCompletionNoticeProduct.getCode() + "\n
" + "名称:" + pwCompletionNoticeProduct.getProductName() + + "\n
" + "图号:" + pwCompletionNoticeProduct.getFigureNumber() + "\n
" + "应检数量:" + pwCompletionNoticeProduct.getReceivableQuantity() + + "\n
" + "合格数量:" + (pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getActualQuantity()) + + "\n
" + "让步接收数量:" + pwCompletionNoticeProduct.getConcessionQuantity() + + "\n
" + "检验员:" + pwCompletionNoticeProduct.getInspector() + "\n
" + "检验时间:" + sdf.format(new Date()) + "\n
" + "已检验完毕,请核实入库!"; + try { + send.sendEmail("质检通知", content, userEmail2.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + return toAjax(j); + } + + /** + * 批量质检 + */ + @RequestMapping("/affirmCheckoutAlls/{ids}") + public AjaxResult affirmCheckoutAlls(@PathVariable Long[] ids) { + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //质检单id + long i = 0; + for (Long long1 : ids) { + PwCompletionNoticeProduct pwCompletionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById(long1); + if (i == 0) { + i = pwCompletionNoticeProduct.getCompletionNoticeId(); + } + //判断是否已经检验,如果已经检验则不需要再检验 + if (pwCompletionNoticeProduct.getCheckoutStatus().equals("已检验")) { + return AjaxResult.error("无需重复检验"); + } + //判断实践数量是否等于应检数量 + if (pwCompletionNoticeProduct.getActualQuantity() + pwCompletionNoticeProduct.getQuantity() == pwCompletionNoticeProduct.getReceivableQuantity()) { + //说明已检验完毕 + //检验日期 + pwCompletionNoticeProduct.setCheckoutDate(new Date()); + //检验员 + pwCompletionNoticeProduct.setInspector(user.getNickName()); + //修改已检验数量 + pwCompletionNoticeProduct.setQuantity(pwCompletionNoticeProduct.getQuantity() + pwCompletionNoticeProduct.getActualQuantity()); + //重置实检验数量 + pwCompletionNoticeProduct.setActualQuantity(0.0); + //修改检验状态 + pwCompletionNoticeProduct.setCheckoutStatus("已检验"); + } + if (null != pwCompletionNoticeProduct.getProductReceiptMaterialId()) { + //根据入库单详情id查询入库单详情信息,添加其检验员信息 + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(pwCompletionNoticeProduct.getProductReceiptMaterialId()); + //修改申请数量为合格数量 + productReceiptMaterial.setReceivableQuantity(pwCompletionNoticeProduct.getQuantity()); + productReceiptMaterial.setActualQuantity(pwCompletionNoticeProduct.getQuantity()); + if (null != productReceiptMaterial.getPracticalNumber() && 0 != productReceiptMaterial.getPracticalNumber()) { + //判断当总重不为null时,如果合格数量不等于应检数量时,总重应相对应的减少(总重/应检数量*合格数量) + if (pwCompletionNoticeProduct.getReceivableQuantity() != pwCompletionNoticeProduct.getQuantity()) { + productReceiptMaterial.setPracticalNumber(productReceiptMaterial.getPracticalNumber() / pwCompletionNoticeProduct.getReceivableQuantity() * pwCompletionNoticeProduct.getQuantity()); + } + //总价为总重*单价 + productReceiptMaterial.setTotalPrices(productReceiptMaterial.getPracticalNumber() * productReceiptMaterial.getUnivalence()); + } else { + //数量*单价 + //重新计算总价 + productReceiptMaterial.setTotalPrices(productReceiptMaterial.getReceivableQuantity() * productReceiptMaterial.getUnivalence()); + } + productReceiptMaterial.setQualityInspector(user.getNickName()); + imProductReceiptMaterialService.updateImProductReceiptMaterial(productReceiptMaterial); + } + pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct); + } +// + //根据令号查询质检单 + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeById(i); + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCode(completionNotice.getProductionCode()); + //未质检标识 + int a = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProducts : list) { + if (!pwCompletionNoticeProducts.getCheckoutStatus().equals("已检验")) { + a = 1; + } + break; + } + //修改质检员 + completionNotice.setQualityInspectorAuditUser(user.getNickName()); + //修改质检状态 + if (a == 0) { + completionNotice.setQualityInspectorAudit(1); + } + int j = pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + return toAjax(j); + } + + + /** + * 撤销质检 + */ + @RequestMapping("/revocations/{ids}") + public AjaxResult revocations(@PathVariable Long[] ids) { + int i = 0; + for (Long long1 : ids) { + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById(long1); + + //修改入库单的质检员为null + ImProductReceiptMaterial productReceiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById(completionNoticeProduct.getProductReceiptMaterialId()); + if (null != productReceiptMaterial) { + if (!"未入库".equals(productReceiptMaterial.getInventoryStatus())) { + return AjaxResult.error("已入库的物料不允许撤销"); + } + productReceiptMaterial.setQualityInspector(null); + imProductReceiptMaterialService.updateImProductReceiptMaterial(productReceiptMaterial); + } + + /* //合格数量置为0,待检数量加上合格数量 + if (completionNoticeProduct.getInvailed() != 0 && completionNoticeProduct.getInvailed() != null) { + //如果有不良数量就要加上不良数量并且撤销不良库得里的不良品 + EvoInvalidLibrary evoInvalidLibrary = evoInvalidLibraryService.selectEvoInvalidLibraryByFigureNumberAndProductBillCode(completionNoticeProduct.getFigureNumber(), completionNoticeProduct.getCode()); + + completionNoticeProduct.setActualQuantity(completionNoticeProduct.getReceivableQuantity() + completionNoticeProduct.getInvailed()); + //删除不良记录 + evoInvalidLibraryService.deleteEvoInvalidLibraryById(evoInvalidLibrary.getId()); + } else { + + }*/ + completionNoticeProduct.setActualQuantity(completionNoticeProduct.getReceivableQuantity()); + completionNoticeProduct.setQuantity(0.0); + completionNoticeProduct.setConcessionQuantity(0.0); + completionNoticeProduct.setCheckoutStatus("未检验"); + i = pwCompletionNoticeProductService.updatePwCompletionNoticeProduct(completionNoticeProduct); + } + return toAjax(i); + } + + private void addBacklog(String matterName, String code, String materialName, String figureNumber, String nickName, String recipientName, String processMode, String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwContractController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwContractController.java new file mode 100644 index 0000000..9e713b0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwContractController.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.controller; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.project.management.domain.*; import com.ruoyi.project.management.service.*; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.ruoyi.framework.aspectj.lang.annotation.DataScope; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.security.LoginUser; import com.ruoyi.framework.security.service.TokenService; import com.ruoyi.project.management.utils.MoneyUtil; import com.ruoyi.project.system.domain.SysUser; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.web.page.TableDataInfo; import org.springframework.web.multipart.MultipartFile; /** * 合同Controller * * @author zhukangchao * @date 2020-06-09 */ @RestController @RequestMapping("/management/contract") public class PwContractController extends BaseController { @Autowired private IPwContractService pwContractService; // 报价单信息 @Autowired private IPwQuotationService pwQuotationService; // 产品和报价单关联信息 @Autowired private IPwProductQuotationService pwProductQuotationService; //用户信息 @Autowired private TokenService tokenService; //客户信息 @Autowired private IImCustomerService imCustomerService; //合同明细信息 @Autowired private IPwContractInfoService pwContractInfoService; //员工信息 @Autowired private ICwNewEmployeeInformationService cwNewEmployeeInformationService; //其它往来单位信息 @Autowired private IPwOtherCorrespondentService pwOtherCorrespondentService; //物流费用信息 @Autowired private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; //供应商信息 @Autowired private IImSupplierService imSupplierService; /** * 查询合同列表 */ @PreAuthorize("@ss.hasPermi('management:contract:list')") @GetMapping("/list") @DataScope(userAlias = "c") public TableDataInfo list(PwContract pwContract) { startPage(); List list = pwContractService.selectPwContractList(pwContract); return getDataTable(list); } /** * 导出合同列表 */ @PreAuthorize("@ss.hasPermi('management:contract:export')") @Log(title = "合同", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(PwContract pwContract) { List list = pwContractService.selectPwContractList(pwContract); ExcelUtil util = new ExcelUtil(PwContract.class); return util.exportExcel(list, "contract"); } /** * 获取合同详细信息 */ @PreAuthorize("@ss.hasPermi('management:contract:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(pwContractService.selectPwContractById(id)); } /** * 修改合同 */ @PreAuthorize("@ss.hasPermi('management:contract:edit')") @Log(title = "合同", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody PwContract pwContract) { return toAjax(pwContractService.updatePwContract(pwContract)); } /** * 删除合同 */ @PreAuthorize("@ss.hasPermi('management:contract:remove')") @Log(title = "合同", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { //删除合同前,把合同明细数据删除 for (Long id : ids) { PwContractInfo pwContractInfo = new PwContractInfo(); pwContractInfo.setContractId(id); List list = pwContractInfoService.selectPwContractInfoList(pwContractInfo); for (PwContractInfo pwContractInfo2 : list) { //判断是否有生成生产订单的 if("是".equals(pwContractInfo2.getProductionOrder())){ return AjaxResult.error("已生成生产订单的合同,不允许删除"); } } for (PwContractInfo pwContractInfo2 : list) { pwContractInfoService.deletePwContractInfoById(pwContractInfo2.getId()); } } return toAjax(pwContractService.deletePwContractByIds(ids)); } /** * 查询合同列表,产品入库单查询使用 */ @GetMapping("/selectByContractStatus") public TableDataInfo selectByContractStatus(PwContract pwContract) { // 查询合同状态为未完成状态的 // pwContract.setContractStatus(pwContract.getContractStatus()); List list = pwContractService.selectPwContractList(pwContract); return getDataTable(list); } /** * 新增合同 * @param pwContract * @return */ @PostMapping public AjaxResult add(@RequestBody PwContract pwContract) { // 合同编号自动生成,生成规则按照日期(年月日)+排序号,查询当前日期的上一份合同,获取其编号 List list2 = pwContractService.selectPwContractDate(new Date()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String string = sdf.format(new Date()); if(list2.size()>0){ PwContract pwContract2 = list2.get(list2.size()-1); String contractCode = pwContract2.getContractCode(); String substring = contractCode.substring(contractCode.lastIndexOf("-")+1); int p = Integer.valueOf(substring)+1; String str = String.format("%03d", p); pwContract.setContractCode("PD-" + string+"-"+str); }else{ pwContract.setContractCode("PD-" + string+"-001"); } // 卖方名称(默认本公司名称) pwContract.setSeller("河北伊特机械设备制造有限公司"); // 卖方地址 pwContract.setSellerAddress("河北省石家庄市元氏县马村新兴产业聚集区伊特大道1号"); // 卖方电话 pwContract.setSellerPhone("0311-85960887"); // 卖方传真 pwContract.setSellerFax("0311-86106496"); // 卖方纳税人识别号 pwContract.setSellerTln("91130133MA08JW7T7B"); // 卖方开户行 pwContract.setSellerOpeningBank("中国农业银行股份有限公司石家庄中山东路支行"); // 卖方账号 pwContract.setSellerAcctountNumber("50356301040011696"); // 审核状态默认为1:已审核状态 pwContract.setAuditStatus(0); // 合同初始状态为未完成状态1 pwContract.setContractStatus(1); //生成合同的用户 //获取当前登录用户 LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); // 发料人名称默认为当前账号 SysUser user = loginUser.getUser(); pwContract.setUserId(user.getUserId()); //用户姓名 pwContract.setSparedOne(user.getNickName()); // 删除标记默认为未删除 pwContract.setDelFlag(0); int i = pwContractService.insertPwContract(pwContract); return toAjax(i); } /** * 生成合同 参数:报价单id */ @RequestMapping("/createContract") public AjaxResult createContract(Long id) { PwContract pwContract = new PwContract(); pwContract.setQuotationId(id.toString()); // 查看此报价单是否已经生成合同 List list = pwContractService.selectPwContractList(pwContract); if (list.size() > 0) { return AjaxResult.error("此报价单已经生成合同"); } // 根据报价单id查询报价单信息 PwQuotation pwQuotation = pwQuotationService.selectPwQuotationById(id); // 创建合同对象 pwContract = new PwContract(); // 合同编号自动生成,生成规则按照日期(年月日)+排序号,查询当前日期的上一份合同,获取其编号 List list2 = pwContractService.selectPwContractDate(new Date()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String string = sdf.format(new Date()); if(list2.size()>0){ PwContract pwContract2 = list2.get(list2.size()-1); String contractCode = pwContract2.getContractCode(); String substring = contractCode.substring(contractCode.lastIndexOf("-")+1); int p = Integer.valueOf(substring)+1; String str = String.format("%03d", p); pwContract.setContractCode("PD-" + string+"-"+str); }else{ pwContract.setContractCode("PD-" + string+"-001"); } //根据报价单中的单位名称查询客户信息 ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(pwQuotation.getUnitName()); if(null==customer){ return AjaxResult.error("未查询到相关客户信息"); } // 项目名称 pwContract.setItemName(pwQuotation.getItemName()); // 买方名称 pwContract.setPurchaser(pwQuotation.getUnitName()); //买方地址 pwContract.setPurchaserAddress(customer.getCustomerAddress()); //买方电话 pwContract.setPurchaserPhone(customer.getPhone()); //买方传真 // pwContract.setPurchaserFax(); //买方纳税人识别号 pwContract.setPurchaserTln(customer.getDutyParagraph()); //买方开户行 pwContract.setPurchaserOpeningBank(customer.getBank()); //买方账号 pwContract.setPurchaserAccountNumber(customer.getBankNumber()); //合同金额 pwContract.setMoney(pwQuotation.getTotalPrices()); // 卖方名称(默认本公司名称) pwContract.setSeller("河北伊特机械设备制造有限公司"); // 卖方地址 pwContract.setSellerAddress("河北省石家庄市元氏县马村新兴产业聚集区伊特大道1号"); // 卖方电话 pwContract.setSellerPhone("0311-85960887"); // 卖方传真 pwContract.setSellerFax("0311-86106496"); // 卖方纳税人识别号 pwContract.setSellerTln("91130133MA08JW7T7B"); // 卖方开户行 pwContract.setSellerOpeningBank("中国农业银行股份有限公司石家庄中山东路支行"); // 卖方账号 pwContract.setSellerAcctountNumber("50356301040011696"); // 保存报价单id到合同表 pwContract.setQuotationId(pwQuotation.getId().toString()); // 审核状态默认为1:已审核状态 pwContract.setAuditStatus(0); // 合同初始状态为未完成状态1 pwContract.setContractStatus(1); //生成合同的用户 //获取当前登录用户 LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); // 发料人名称默认为当前账号 SysUser user = loginUser.getUser(); pwContract.setUserId(user.getUserId()); //用户姓名 pwContract.setSparedOne(user.getNickName()); // 删除标记默认为未删除 pwContract.setDelFlag(0); int i = pwContractService.insertPwContract(pwContract); //生成合同明细 //查询报价单详情 PwProductQuotation pwProductQuotation = new PwProductQuotation(); pwProductQuotation.setQuotationId(pwQuotation.getId()); List list3 = pwProductQuotationService.selectPwProductQuotationList(pwProductQuotation); PwContractInfo pwContractInfo = new PwContractInfo(); for (PwProductQuotation pwProductQuotation2 : list3) { pwContractInfo = new PwContractInfo(); //合同id pwContractInfo.setContractId(pwContract.getId()); //产品类型 pwContractInfo.setProductType(pwProductQuotation2.getProductType()); //型号类型 pwContractInfo.setProductClassify(pwProductQuotation2.getProductClassify()); //型号名称 pwContractInfo.setTypeName(pwProductQuotation2.getTypeName()); //产品名称 pwContractInfo.setProductName(pwProductQuotation2.getProductName()); //物料图号 pwContractInfo.setFigureNumber(pwProductQuotation2.getFigureNumber()); //物料名称 pwContractInfo.setMaterialName(pwProductQuotation2.getMaterialName()); //计量单位 pwContractInfo.setUnit(pwProductQuotation2.getUnit()); //数量 pwContractInfo.setNumber(pwProductQuotation2.getNumber()); //单价 pwContractInfo.setUnivalence(pwProductQuotation2.getUnivalence().doubleValue()); //合计 pwContractInfo.setTotal(pwProductQuotation2.getTotal()); //是否已生成生产订单(默认为否) pwContractInfo.setProductionOrder("否"); pwContractInfoService.insertPwContractInfo(pwContractInfo); } return toAjax(i); } /** * 发布合同(修改合同状态为未完成) */ @RequestMapping("/editContractStatus") public AjaxResult editContractStatus(Long id) { // 根据合同id查询合同 PwContract pwContract = pwContractService.selectPwContractById(id); // 判断必要字段是否为null if (null == pwContract.getItemName() || "".equals(pwContract.getItemName().trim()) || null == pwContract.getPurchaser() || "".equals(pwContract.getPurchaser().trim()) || null == pwContract.getDeliveryPoints() || "".equals(pwContract.getDeliveryPoints().trim()) || null == pwContract.getDeliveryTime() || "".equals(pwContract.getDeliveryTime()) || null == pwContract.getPaymentMethod() || "".equals(pwContract.getPaymentMethod().trim()) || null == pwContract.getContractAgreement() || "".equals(pwContract.getContractAgreement().trim()) || null == pwContract.getPurchaserAddress() || "".equals(pwContract.getPurchaserAddress().trim()) || null == pwContract.getPurchaserPhone() || "".equals(pwContract.getPurchaserPhone().trim()) || null == pwContract.getPurchaserTln() || "".equals(pwContract.getPurchaserTln().trim()) || null == pwContract.getPurchaserOpeningBank() || "".equals(pwContract.getPurchaserOpeningBank().trim()) || null == pwContract.getPurchaserAccountNumber() || "".equals(pwContract.getPurchaserAccountNumber().trim())) { return AjaxResult.error("请完善合同信息"); } if(0==pwContract.getAuditStatus()){ return AjaxResult.error("此合同还未审核通过"); } // 把合同状态置为2(未完成状态) pwContract.setContractStatus(2); // 修改 int i = pwContractService.updatePwContract(pwContract); if (i < 1) { return AjaxResult.error("发布失败"); } return AjaxResult.success("发布成功"); } //打印合同 @RequestMapping("/prints/{ids}") public AjaxResult prints(@PathVariable Long[] ids) { if (ids.length>1){ return AjaxResult.error("不同合同不允许合并打印"); } HashMap printMessageMap = new HashMap<>(); //根据id获取合同信息 PwContract pwContract = pwContractService.selectPwContractById(ids[0]); //获得产品列表 PwProductQuotation pwProductQuotation = new PwProductQuotation(); pwProductQuotation.setQuotationId(Long.valueOf(pwContract.getQuotationId())); List pwProductQuotations = pwProductQuotationService.selectPwProductQuotationList(pwProductQuotation); //计算总价格 double sumQuotation=0L; for (PwProductQuotation productQuotation:pwProductQuotations) { if(null==productQuotation.getUnivalence()){ productQuotation.setUnivalence(0.0); } //计算合计 productQuotation.setTotal(productQuotation.getUnivalence().doubleValue()*productQuotation.getNumber()); //计算总计 sumQuotation+=productQuotation.getNumber()*productQuotation.getUnivalence(); } //如果备注为null则显示空 if (pwContract.getRemark()==null){ pwContract.setRemark(""); } //將小写转为大写 MoneyUtil moneyUtil = new MoneyUtil(); String chinese = moneyUtil.toChinese(String.valueOf(sumQuotation)); String heji=sumQuotation+"元(人民币大写:"+chinese+")"; //合计金额 printMessageMap.put("sumQuotation", heji); //合同签订时间 Date date = new Date(); SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd"); printMessageMap.put("qianDingDate", dateFormat.format(date)); //产品列表 printMessageMap.put("pwProductQuotations", pwProductQuotations); printMessageMap.put("contractObj", pwContract); return AjaxResult.success("success", printMessageMap); } /** * 生成物流费用单 */ @RequestMapping("/addLogistics") public AjaxResult addLogistics(@RequestBody PwContract pwContract) { //校验付款金额 if (null == pwContract.getMoneyTwo() || "".equals(pwContract.getMoneyTwo()) || 0 == pwContract.getMoneyTwo()) { return AjaxResult.error("请填写付款金额"); } //校验支付方式 if(null==pwContract.getPayWay()||"".equals(pwContract.getPayWay())){ return AjaxResult.error("请选择支付方式"); } //校验单位名称 if(null==pwContract.getUnitName()||"".equals(pwContract.getUnitName())){ return AjaxResult.error("请选择单位名称"); } SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); //获取当前登录用户 LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); // 发料人名称默认为当前账号 SysUser user = loginUser.getUser(); //物料费用单 CwLogisticsFeesInfo cwLogisticsFeesInfo = new CwLogisticsFeesInfo(); //编号 cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); //关联单据编号 所勾选的合同编号 //获取合同id Long[] ids = pwContract.getIds(); //拼接合同编号 String code = ""; for (Long id : ids) { PwContract pwContract2 = pwContractService.selectPwContractById(id); code += pwContract2.getContractCode()+","; } cwLogisticsFeesInfo.setRelevanceCode(code); //单据类型 cwLogisticsFeesInfo.setRelevanceType("销售合同"); //记录申请人 cwLogisticsFeesInfo.setUserName(user.getNickName()); //部门 cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); //申请时间 cwLogisticsFeesInfo.setDate(new Date()); //小写金额 cwLogisticsFeesInfo.setMoney(pwContract.getMoneyTwo()); //大写金额 MoneyUtil moneyUtil = new MoneyUtil(); String chinese = moneyUtil.toChinese(pwContract.getMoneyTwo()+""); cwLogisticsFeesInfo.setBigMoney(chinese); //事由 cwLogisticsFeesInfo.setCause("销售运费"); //支付方式 cwLogisticsFeesInfo.setPayWay(pwContract.getPayWay()); //单位名称 cwLogisticsFeesInfo.setUnitName(pwContract.getUnitName()); //未付款金额(初始为填写的金额) cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(pwContract.getMoneyTwo())); //未开票金额(初始为填写的金额) cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(pwContract.getMoneyTwo())); //结算比例(初始为0) cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 ImSupplier supplier = imSupplierService.selectImSupplierByName(pwContract.getUnitName()); if(null!=supplier){ //账号 cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); //开户行 cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); }else{ //查询员工信息表 CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); if(null!=employeeInformation){ //账号 cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); //开户行 cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); }else{ //查询客户信息表 ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); if(null!=customer){ //账号 cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); //开户行 cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); }else{ //查询其他往来单位信息 PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); if(null!=otherCorrespondent){ //账号 cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); //开户行 cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); }else{ return AjaxResult.error("未查询到相关往来单位"); } } } } int i = cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); return toAjax(i); } /** * 领导审批 */ @RequestMapping("/lingDaoApprover/{ids}") public AjaxResult lingDaoApprover(@PathVariable Long[] ids){ //获取当前登录用户 LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); // 发料人名称默认为当前账号 SysUser user = loginUser.getUser(); int i = 0; for (Long id : ids) { PwContract pwContract = pwContractService.selectPwContractById(id); if(StringUtils.isEmpty(pwContract.getPurchaser()) || null == pwContract.getDeliveryTime()){ return AjaxResult.error("信息不完整,请补充!"); } if(StringUtils.isNotEmpty(pwContract.getLeadership())){ pwContract.setLeadership(""); }else{ pwContract.setLeadership(user.getNickName()); //审批时间 pwContract.setLeadershipTime(new Date()); } i = pwContractService.updatePwContract(pwContract); } return toAjax(i); } /** * 上传合同的PDF * * @param id * @param filePath * @return */ @RequestMapping("/uploadContractPDF") @ResponseBody public AjaxResult uploadContractPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { String originalFilename = filePath.getOriginalFilename(); if (originalFilename != null) { //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { return AjaxResult.error("禁止非法文件上传"); } else { PwContract pwContract = pwContractService.selectPwContractById(Long.valueOf(id)); //根据id 获取合同信息 String newfilenname = generateUniqueFileName(originalFilename); try (InputStream is = filePath.getInputStream(); //在对应的文件夹下生成新的图片 FileOutputStream fos = new FileOutputStream("D:/contract/contractPDF/" + newfilenname); BufferedOutputStream bos = new BufferedOutputStream(fos)) { // 读取输入流并写入文件 byte[] buffer = new byte[1024]; int bytesRead; while ((bytesRead = is.read(buffer)) != -1) { bos.write(buffer, 0, bytesRead); } bos.flush(); //映射路径 pwContract.setContractPath(newfilenname); //更新 pwContractService.updatePwContract(pwContract); } catch (IOException e) { e.printStackTrace(); return AjaxResult.error("文件上传失败"); } } } return AjaxResult.success("文件上传成功"); } /** * 生成随机文件名 * * @param originalFilename * @return */ private String generateUniqueFileName(String originalFilename) { String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); //生成年月日加 毫秒值的 文件名称 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); String date = dateFormat.format(new Date()); return filename + "_" + date + System.currentTimeMillis() + extension; } } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwContractInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwContractInfoController.java new file mode 100644 index 0000000..c947918 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwContractInfoController.java @@ -0,0 +1,226 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.*; + +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 合同信息明细Controller + * + * @author zhukangchao + * @date 2023-12-06 + */ +@RestController +@RequestMapping("/management/pwContractInfo") +public class PwContractInfoController extends BaseController +{ + @Autowired + private IPwContractInfoService pwContractInfoService; + //生产订单信息 + @Autowired + private IPwProductionOrderService pwProductionOrderService; + //生产订单详情信息 + @Autowired + private IPwProductionOrderInfoService pwProductionOrderInfoService; + //合同信息 + @Autowired + private IPwContractService pwContractService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //销齿链 + @Autowired + private IPcRigidChainService pcRigidChainService; + //行程检测 + @Autowired + private IPcStrokeMeasurementService pcStrokeMeasurementService; + //非标产品 + @Autowired + private IPwDanceNotStandardService pwDanceNotStandardService; + /** + * 查询合同信息明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwContractInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwContractInfo pwContractInfo) + { + startPage(); + List list = pwContractInfoService.selectPwContractInfoList(pwContractInfo); + for (PwContractInfo pwContractInfo2 : list) { + //根据当前物料查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwContractInfo2.getMaterialName(), pwContractInfo2.getFigureNumber()); + if(null != inventoryDetail){ + pwContractInfo2.setSparedThree(inventoryDetail.getQuantity()); + }else{ + pwContractInfo2.setSparedThree(0L); + } + } + return getDataTable(list); + } + + /** + * 导出合同信息明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwContractInfo:export')") + @Log(title = "合同信息明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwContractInfo pwContractInfo) + { + List list = pwContractInfoService.selectPwContractInfoList(pwContractInfo); + ExcelUtil util = new ExcelUtil(PwContractInfo.class); + return util.exportExcel(list, "pwContractInfo"); + } + + /** + * 获取合同信息明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwContractInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwContractInfoService.selectPwContractInfoById(id)); + } + + /** + * 新增合同信息明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwContractInfo:add')") + @Log(title = "合同信息明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwContractInfo pwContractInfo) + { + return toAjax(pwContractInfoService.insertPwContractInfo(pwContractInfo)); + } + + /** + * 修改合同信息明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwContractInfo:edit')") + @Log(title = "合同信息明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwContractInfo pwContractInfo) + { + return toAjax(pwContractInfoService.updatePwContractInfo(pwContractInfo)); + } + + /** + * 生成生产订单 + */ + @RequestMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwContractInfo contractInfo = pwContractInfoService.selectPwContractInfoById(id); + if("是".equals(contractInfo.getProductionOrder())){ + return AjaxResult.error("已生成生产订单的明细,不允许再次生成"); + } + } + //查询当前合同详情信息 + PwContractInfo contractInfo2 = pwContractInfoService.selectPwContractInfoById(ids[0]); + //根据当前合同详情id查询合同 + PwContract pwContract = pwContractService.selectPwContractById(contractInfo2.getContractId()); + //创建生产订单信息 + PwProductionOrder pwProductionOrder = new PwProductionOrder(); + //生产订单编号 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + pwProductionOrder.setCode("PO-"+sdf.format(new Date())); + //项目名称 + pwProductionOrder.setItemName(pwContract.getItemName()); + //客户名称 + pwProductionOrder.setUnitName(pwContract.getPurchaser()); + //订单状态(默认为未下发) + pwProductionOrder.setStatus("未下发"); + //图纸地址 + + //合同编号 + pwProductionOrder.setSparedOne(pwContract.getContractCode()); + + int i = pwProductionOrderService.insertPwProductionOrder(pwProductionOrder); + + if(i<1){ + return AjaxResult.error("生成生产订单失败"); + } + int j = 0; + //创建生产订单详情信息 + PwProductionOrderInfo pwProductionOrderInfo = new PwProductionOrderInfo(); + for (Long id : ids) { + PwContractInfo contractInfo = pwContractInfoService.selectPwContractInfoById(id); + + pwProductionOrderInfo = new PwProductionOrderInfo(); + //生产订单id + pwProductionOrderInfo.setProductionOrderId(pwProductionOrder.getId()); + //产品类型 + pwProductionOrderInfo.setProductType(contractInfo.getProductType()); + //型号类型 + pwProductionOrderInfo.setProductClassify(contractInfo.getProductClassify()); + //所属产品名称 + pwProductionOrderInfo.setProductName(contractInfo.getProductName()); + //所属型号名称 + pwProductionOrderInfo.setTypeName(contractInfo.getTypeName()); + //物料图号 + pwProductionOrderInfo.setFigureNumber(contractInfo.getFigureNumber()); + //物料名称 + pwProductionOrderInfo.setMaterialName(contractInfo.getMaterialName()); + //计量单位 + pwProductionOrderInfo.setUnit(contractInfo.getUnit()); + //数量 + pwProductionOrderInfo.setNumber(contractInfo.getNumber()); + //状态 + + //合同明细id + pwProductionOrderInfo.setSparedThree(contractInfo.getId()); + j = pwProductionOrderInfoService.insertPwProductionOrderInfo(pwProductionOrderInfo); + + //修改其状态 + contractInfo.setProductionOrder("是"); + pwContractInfoService.updatePwContractInfo(contractInfo); + } + return toAjax(j); + } + + /** + * 获取相应的产品信息 + */ + @GetMapping(value = "/queryProduct/{id}") + public Map queryProduct(@PathVariable("id") String id) + { + Map map = new HashMap<>(); + if("销齿链".equals(id)){ + List list = pcRigidChainService.selectPcRigidChainList(null); + map.put("typeNameList",list); + map.put("typeList",list); + map.put("nameList",list); + }else if("行程检测装置".equals(id)){ + List sm_list = pcStrokeMeasurementService.selectPcStrokeMeasurementList(null); + map.put("typeNameList",sm_list); + map.put("typeList",sm_list); + map.put("nameList",sm_list); + }else if("非标产品".equals(id)){ + List dns_list = pwDanceNotStandardService.selectPwDanceNotStandardList(null); + for (PwDanceNotStandard pwDanceNotStandard : dns_list) { + pwDanceNotStandard.setProductName(pwDanceNotStandard.getName()); + } + map.put("typeNameList",dns_list); + map.put("typeList",dns_list); + map.put("nameList",dns_list); + } + return map; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolApplyController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolApplyController.java new file mode 100644 index 0000000..a29f4ae --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolApplyController.java @@ -0,0 +1,269 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwCuttingToolApply; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; +import com.ruoyi.project.management.domain.PwStoresRequisition; +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; +import com.ruoyi.project.management.service.IPwCuttingToolApplyDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolApplyService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具领用申请单Controller + * + * @author zhukangchao + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/management/pwCuttingToolApply") +public class PwCuttingToolApplyController extends BaseController +{ + @Autowired + private IPwCuttingToolApplyService pwCuttingToolApplyService; + //刀具领用单详情信息 + @Autowired + private IPwCuttingToolApplyDetailService pwCuttingToolApplyDetailService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + //刀具出库单信息 + @Autowired + private IPwCuttingToolDeliveryService pwCuttingToolDeliveryService; + //刀具出库单详情信息 + @Autowired + private IPwCuttingToolDeliveryDetailService pwCuttingToolDeliveryDetailService; + + + + /** + * 查询刀具领用申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApply:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolApply pwCuttingToolApply){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(null!=pwCuttingToolApply.getBeginTime()&&!"".equals(pwCuttingToolApply.getBeginTime())&&null!=pwCuttingToolApply.getEndTime()&&!"".equals(pwCuttingToolApply.getEndTime())){ + try { + Date start = sdf.parse(pwCuttingToolApply.getBeginTime()); + Date end = sdf.parse(pwCuttingToolApply.getEndTime()); + pwCuttingToolApply.setStart(start); + pwCuttingToolApply.setEnd(end); + } catch (Exception e) { + // TODO: handle exception + } + } + startPage(); + List list = new ArrayList(); + if(null!=pwCuttingToolApply.getName()&&!"".equals(pwCuttingToolApply.getName())){ + List list2 = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailByName(pwCuttingToolApply.getName()); + for (PwCuttingToolApplyDetail pwCuttingToolApplyDetail : list2) { + //根据单据id查询请购单 + PwCuttingToolApply cuttingToolApply = pwCuttingToolApplyService.selectPwCuttingToolApplyById(pwCuttingToolApplyDetail.getApplyId()); + if(null!=cuttingToolApply){ + list.add(cuttingToolApply); + } + + } + }else{ + list = pwCuttingToolApplyService.selectPwCuttingToolApplyList(pwCuttingToolApply); + } + return getDataTable(list); + } + + /** + * 导出刀具领用申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApply:export')") + @Log(title = "刀具领用申请单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolApply pwCuttingToolApply){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(null!=pwCuttingToolApply.getBeginTime()&&!"".equals(pwCuttingToolApply.getBeginTime())&&null!=pwCuttingToolApply.getEndTime()&&!"".equals(pwCuttingToolApply.getEndTime())){ + try { + Date start = sdf.parse(pwCuttingToolApply.getBeginTime()); + Date end = sdf.parse(pwCuttingToolApply.getEndTime()); + pwCuttingToolApply.setStart(start); + pwCuttingToolApply.setEnd(end); + } catch (Exception e) { + // TODO: handle exception + } + } + + List list = pwCuttingToolApplyService.selectPwCuttingToolApplyList(pwCuttingToolApply); + LinkedList list2 = new LinkedList(); + for (PwCuttingToolApply pwCuttingToolApply2 : list) { + List list3 = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailByApplyDetailId(pwCuttingToolApply2.getId()); + for (PwCuttingToolApplyDetail pwCuttingToolApplyDetail : list3) { + list2.add(pwCuttingToolApplyDetail); + } + } + ExcelUtil util = new ExcelUtil(PwCuttingToolApplyDetail.class); + return util.exportExcel(list2, "pwCuttingToolApplyDetail"); + } + + /** + * 获取刀具领用申请单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApply:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolApplyService.selectPwCuttingToolApplyById(id)); + } + + /** + * 新增刀具领用申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApply:add')") + @Log(title = "刀具领用申请单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolApply pwCuttingToolApply) + { + return toAjax(pwCuttingToolApplyService.insertPwCuttingToolApply(pwCuttingToolApply)); + } + + /** + * 修改刀具领用申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApply:edit')") + @Log(title = "刀具领用申请单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolApply pwCuttingToolApply) + { + return toAjax(pwCuttingToolApplyService.updatePwCuttingToolApply(pwCuttingToolApply)); + } + + /** + * 删除刀具领用申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApply:remove')") + @Log(title = "刀具领用申请单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolApplyService.deletePwCuttingToolApplyByIds(ids)); + } + + + /** + * 审核刀具领用单 + */ + @RequestMapping("/auditPwCuttingToolApply") + public AjaxResult auditPwCuttingToolApply(Long id){ + PwCuttingToolApply pwCuttingToolApply = pwCuttingToolApplyService.selectPwCuttingToolApplyById(id); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + pwCuttingToolApply.setApplyStatus("已审核"); + pwCuttingToolApply.setAuditor(user.getNickName()); + int i = pwCuttingToolApplyService.updatePwCuttingToolApply(pwCuttingToolApply); + if(i<1){ + return AjaxResult.error("审核失败"); + } + return AjaxResult.success("审核成功"); + } + + /** + * 申请领料 + */ + @RequestMapping("/applyForReceives/{ids}") + public AjaxResult applyForReceives(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + //根据id查询当前领料单下所有的物料 + for (Long id : ids) { + //根据id查询领料单详情 + PwCuttingToolApply pwCuttingToolApply = pwCuttingToolApplyService.selectPwCuttingToolApplyById(id); + //根据领料单id查询领料单详情信息 + List list = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailByApplyDetailId(id); + if(list.size()==0){ + return AjaxResult.error("此单据下无可领用刀具"); + }else{ + //根据code查询此单据是否领过物料 + PwCuttingToolDelivery toolDelivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryByCode(pwCuttingToolApply.getCode()); + if(null!=toolDelivery){ + return AjaxResult.error("此单据已申请出库"); + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + PwCuttingToolDelivery pwCuttingToolDelivery = new PwCuttingToolDelivery(); + //关联单据(执行单code) + pwCuttingToolDelivery.setCode(pwCuttingToolApply.getCode()); + //项目名称 +// imStockRequisition.setProjectName(pwCuttingToolApply.getName()); + //申请人 + pwCuttingToolDelivery.setUserName(user.getNickName()); + //领料状态 + pwCuttingToolDelivery.setStatus("未出库"); + pwCuttingToolDeliveryService.insertPwCuttingToolDelivery(pwCuttingToolDelivery); + //把当前领料单下所有物料添加到领料单下 + for (PwCuttingToolApplyDetail cuttingToolApplyDetail : list) { + //创建领料单详情对象,保存该单据下所有的物料(待出库) + PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail = new PwCuttingToolDeliveryDetail(); + //领料单id + pwCuttingToolDeliveryDetail.setDeliveryId(pwCuttingToolDelivery.getId()); + //刀具名称 + pwCuttingToolDeliveryDetail.setName(cuttingToolApplyDetail.getName()); + //刀具品牌 + pwCuttingToolDeliveryDetail.setBrand(cuttingToolApplyDetail.getBrand()); + //规格型号 + pwCuttingToolDeliveryDetail.setType(cuttingToolApplyDetail.getType()); + //单位 + pwCuttingToolDeliveryDetail.setUnit(cuttingToolApplyDetail.getUnit()); + //刀具厂商 + pwCuttingToolDeliveryDetail.setSupplier(cuttingToolApplyDetail.getSupplier()); + //生产厂商 + pwCuttingToolDeliveryDetail.setManufacturer(cuttingToolApplyDetail.getManufacturer()); + //申请数量 + pwCuttingToolDeliveryDetail.setQuantity(cuttingToolApplyDetail.getQuantity()); + //单价 + pwCuttingToolDeliveryDetail.setUnitPrice(cuttingToolApplyDetail.getUnitPrice().doubleValue()); + //总价 + pwCuttingToolDeliveryDetail.setTotalPrices(cuttingToolApplyDetail.getUnitPrice().doubleValue()*cuttingToolApplyDetail.getQuantity()); + //出库状态 + pwCuttingToolDeliveryDetail.setDeliveryStatus("未出库"); + pwCuttingToolDeliveryDetailService.insertPwCuttingToolDeliveryDetail(pwCuttingToolDeliveryDetail); + } + //修改领料单的状态为已申请 + pwCuttingToolApply.setApplyStatus("已申请"); + i = pwCuttingToolApplyService.updatePwCuttingToolApply(pwCuttingToolApply); + } + } + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolApplyDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolApplyDetailController.java new file mode 100644 index 0000000..2301009 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolApplyDetailController.java @@ -0,0 +1,421 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwCuttingToolApply; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolInventoryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.service.IPwCuttingToolApplyDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolApplyService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryService; +import com.ruoyi.project.management.service.IPwCuttingToolInventoryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具领用申请单详情Controller + * + * @author zhukangchao + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/management/pwCuttingToolApplyDetail") +public class PwCuttingToolApplyDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolApplyDetailService pwCuttingToolApplyDetailService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //刀具领用单信息 + @Autowired + private IPwCuttingToolApplyService pwCuttingToolApplyService; + //用户信息 + @Autowired + private TokenService tokenService; + //刀具出库单信息 + @Autowired + private IPwCuttingToolDeliveryService pwCuttingToolDeliveryService; + //刀具出库单详情信息 + @Autowired + private IPwCuttingToolDeliveryDetailService pwCuttingToolDeliveryDetailService; + //刀具库存信息 + @Autowired + private IPwCuttingToolInventoryDetailService pwCuttingToolInventoryDetailService; + + /** + * 查询刀具领用申请单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApplyDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolApplyDetail pwCuttingToolApplyDetail){ + startPage(); + List list = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailList(pwCuttingToolApplyDetail); + //查询库存信息 + for (PwCuttingToolApplyDetail pwCuttingToolApplyDetail2 : list) { + PwCuttingToolInventoryDetail inventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(pwCuttingToolApplyDetail2.getName(), pwCuttingToolApplyDetail2.getBrand(), pwCuttingToolApplyDetail2.getType()); + if(null!=inventoryDetail){ + pwCuttingToolApplyDetail2.setSapredThree(inventoryDetail.getQuantity()); + } + } + return getDataTable(list); + } + + /** + * 导出刀具领用申请单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApplyDetail:export')") + @Log(title = "刀具领用申请单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolApplyDetail pwCuttingToolApplyDetail) + { + List list = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailList(pwCuttingToolApplyDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolApplyDetail.class); + return util.exportExcel(list, "pwCuttingToolApplyDetail"); + } + + /** + * 获取刀具领用申请单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApplyDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailById(id)); + } + + /** + * 新增刀具领用申请单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApplyDetail:add')") + @Log(title = "刀具领用申请单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolApplyDetail pwCuttingToolApplyDetail){ + //获取刀具id + if(null==pwCuttingToolApplyDetail.getCuttingToolId()||"".equals(pwCuttingToolApplyDetail.getCuttingToolId())){ + return AjaxResult.error("请选择需要领用的刀具"); + } + if(1>pwCuttingToolApplyDetail.getQuantity()){ + return AjaxResult.error("请输入需要领用的数量"); + } + //根据id获取刀具信息 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(pwCuttingToolApplyDetail.getCuttingToolId()); + if(null!=cuttingTool){ + //刀具名称 + pwCuttingToolApplyDetail.setName(cuttingTool.getName()); + //刀具品牌 + pwCuttingToolApplyDetail.setBrand(cuttingTool.getBrand()); + //规格型号 + pwCuttingToolApplyDetail.setType(cuttingTool.getType()); + //单位 + pwCuttingToolApplyDetail.setUnit(cuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolApplyDetail.setSupplier(cuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolApplyDetail.setManufacturer(cuttingTool.getManufacturer()); + //单价 + pwCuttingToolApplyDetail.setUnitPrice(cuttingTool.getUnitPrice()); + //总价 + pwCuttingToolApplyDetail.setTotalPrices(cuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolApplyDetail.getQuantity()))); + }else{ + return AjaxResult.error("未查询到刀具信息"); + } + return toAjax(pwCuttingToolApplyDetailService.insertPwCuttingToolApplyDetail(pwCuttingToolApplyDetail)); + } + + /** + * 修改刀具领用申请单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApplyDetail:edit')") + @Log(title = "刀具领用申请单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolApplyDetail pwCuttingToolApplyDetail){ + //获取刀具id + if(null==pwCuttingToolApplyDetail.getCuttingToolId()||"".equals(pwCuttingToolApplyDetail.getCuttingToolId())){ + return AjaxResult.error("请选择需要领用的刀具"); + } + if(1>pwCuttingToolApplyDetail.getQuantity()){ + return AjaxResult.error("请输入需要领用的数量"); + } + //根据id获取刀具信息 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(pwCuttingToolApplyDetail.getCuttingToolId()); + if(null!=cuttingTool){ + //刀具名称 + pwCuttingToolApplyDetail.setName(cuttingTool.getName()); + //刀具品牌 + pwCuttingToolApplyDetail.setBrand(cuttingTool.getBrand()); + //规格型号 + pwCuttingToolApplyDetail.setType(cuttingTool.getType()); + //单位 + pwCuttingToolApplyDetail.setUnit(cuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolApplyDetail.setSupplier(cuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolApplyDetail.setManufacturer(cuttingTool.getManufacturer()); + //单价 + pwCuttingToolApplyDetail.setUnitPrice(cuttingTool.getUnitPrice()); + //总价 + pwCuttingToolApplyDetail.setTotalPrices(cuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolApplyDetail.getQuantity()))); + }else{ + return AjaxResult.error("未查询到刀具信息"); + } + int i = pwCuttingToolApplyDetailService.updatePwCuttingToolApplyDetail(pwCuttingToolApplyDetail); + if(i<1){ + return toAjax(i); + } + //判断此刀具是否有采购单id,如果有,根据采购单id查询采购单信息,更新其总价和审核状态 + if(null!=pwCuttingToolApplyDetail.getApplyId()){ + //刀具领用单信息 + PwCuttingToolApply cuttingToolApply = pwCuttingToolApplyService.selectPwCuttingToolApplyById(pwCuttingToolApplyDetail.getApplyId()); + //查询此刀具采购单下所有的刀具信息 + cuttingToolApply.setAuditor(null); + //审核状态 + cuttingToolApply.setApplyStatus("未审核"); + int j = pwCuttingToolApplyService.updatePwCuttingToolApply(cuttingToolApply); + return toAjax(j); + }else{ + return toAjax(i); + } + } + + /** + * 删除刀具领用申请单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolApplyDetail:remove')") + @Log(title = "刀具领用申请单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwCuttingToolApplyDetail cuttingToolApplyDetail = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailById(id); + //判断此刀具是否有采购单id,如果有,根据采购单id查询采购单信息,更新其审核状态 + if(null!=cuttingToolApplyDetail.getApplyId()){ + //刀具领用单信息 + PwCuttingToolApply cuttingToolApply = pwCuttingToolApplyService.selectPwCuttingToolApplyById(cuttingToolApplyDetail.getApplyId()); + cuttingToolApply.setAuditor(null); + cuttingToolApply.setApplyStatus("未审核"); + pwCuttingToolApplyService.updatePwCuttingToolApply(cuttingToolApply); + + //查询出库单信息,判断其出库单详情是否已经出库,如果已出库,则需要把出的数量退回到库存信息中,然后删除其出库详情信息,判断出库详情中是否还有其他数据,如果没有则需要把出库单删除 + PwCuttingToolDelivery delivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryByCode(cuttingToolApply.getCode()); + //根据出库单id和名称和品牌和型号查询刀具入库信息 + PwCuttingToolDeliveryDetail deliveryDetail = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailByDeliveryIdAndNameAndBrandAndType(delivery.getId(),cuttingToolApplyDetail.getName(),cuttingToolApplyDetail.getBrand(),cuttingToolApplyDetail.getType()); + if("已出库".equals(deliveryDetail.getDeliveryStatus())){ + //如果已出库则需要退回其出库数量 + PwCuttingToolInventoryDetail inventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(deliveryDetail.getName(), deliveryDetail.getBrand(), deliveryDetail.getType()); + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+deliveryDetail.getQuantity()); + pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(inventoryDetail); + } + //删除其信息 + pwCuttingToolDeliveryDetailService.deletePwCuttingToolDeliveryDetailById(deliveryDetail.getId()); + //判断其出库单下是否还有其他刀具信息 + List list = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailByDeliveryId(delivery.getId()); + if(list.size()==0){ + pwCuttingToolDeliveryService.deletePwCuttingToolDeliveryById(delivery.getId()); + } + } + } + return toAjax(pwCuttingToolApplyDetailService.deletePwCuttingToolApplyDetailByIds(ids)); + } + + /** + * 生成刀具领用单 + */ + @RequestMapping("/addApplyDetail/{ids}") + public AjaxResult addApplyDetail(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss-SSS"); + //获取用户信息 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //创建领用单 + PwCuttingToolApply pwCuttingToolApply = new PwCuttingToolApply(); + //领用单编号 + pwCuttingToolApply.setCode("LY"+sdf.format(new Date())); + //日期 + pwCuttingToolApply.setApplyDate(new Date()); + //申请人 + pwCuttingToolApply.setUserName(user.getNickName()); + //状态(初始状态为未申请) + pwCuttingToolApply.setApplyStatus("未申请"); + int i = pwCuttingToolApplyService.insertPwCuttingToolApply(pwCuttingToolApply); + int j = 0; + if(i<1){ + return AjaxResult.error("生成采购单失败"); + }else{ + for (Long long1 : ids) { + PwCuttingToolApplyDetail applyDetail = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailById(long1); + applyDetail.setApplyId(pwCuttingToolApply.getId()); + j = pwCuttingToolApplyDetailService.updatePwCuttingToolApplyDetail(applyDetail); + } + } + return toAjax(j); + } + + /** + * 申请退还刀具 + */ + @RequestMapping("/handBacks/{ids}") + public AjaxResult handBacks(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + for (Long id : ids) { + PwCuttingToolApplyDetail cuttingToolApplyDetail = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailById(id); + //根据刀具的领用单id查询领用单信息 + PwCuttingToolApply cuttingToolApply = pwCuttingToolApplyService.selectPwCuttingToolApplyById(cuttingToolApplyDetail.getApplyId()); + //根据领用单和名称和图号查询 + PwCuttingToolDelivery cuttingToolDelivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryByCode(cuttingToolApply.getCode()); + if(null!=cuttingToolApply){ + //添加一条退库记录 + PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail = new PwCuttingToolDeliveryDetail(); + //出库单id + pwCuttingToolDeliveryDetail.setDeliveryId(cuttingToolDelivery.getId()); + //刀具名称 + pwCuttingToolDeliveryDetail.setName(cuttingToolApplyDetail.getName()); + //刀具品牌 + pwCuttingToolDeliveryDetail.setBrand(cuttingToolApplyDetail.getBrand()); + //规格型号 + pwCuttingToolDeliveryDetail.setType(cuttingToolApplyDetail.getType()); + //单位 + pwCuttingToolDeliveryDetail.setUnit(cuttingToolApplyDetail.getUnit()); + //刀具厂商 + pwCuttingToolDeliveryDetail.setSupplier(cuttingToolApplyDetail.getSupplier()); + //生产厂商 + pwCuttingToolDeliveryDetail.setManufacturer(cuttingToolApplyDetail.getManufacturer()); + //单价 + pwCuttingToolDeliveryDetail.setUnitPrice(cuttingToolApplyDetail.getUnitPrice().doubleValue()); + //数量 + pwCuttingToolDeliveryDetail.setQuantity(cuttingToolApplyDetail.getQuantity()); + //总价 + pwCuttingToolDeliveryDetail.setTotalPrices(cuttingToolApplyDetail.getQuantity()*cuttingToolApplyDetail.getUnitPrice().doubleValue()); + //申请人 + pwCuttingToolDeliveryDetail.setUserName(user.getNickName()); + //状态(待退还) + pwCuttingToolDeliveryDetail.setDeliveryStatus("待退还"); + pwCuttingToolDeliveryDetailService.insertPwCuttingToolDeliveryDetail(pwCuttingToolDeliveryDetail); + }else{ + return AjaxResult.error("未查询到此产品的出库记录"); + } + //修改当前刀具状态为已退还 + cuttingToolApplyDetail.setStatus("待退还"); + pwCuttingToolApplyDetailService.updatePwCuttingToolApplyDetail(cuttingToolApplyDetail); + } + return toAjax(1); + } + + /** + * 上传领用信息 + */ + @RequestMapping("/uploadDispatchings") + @ResponseBody + public AjaxResult uploadDispatchings(@RequestParam("file") MultipartFile filePath){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/ruoyi/Dispatchings/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + for (int i = 1; i < result.size(); i++) { + String name2 = result.get(i).get(12).toString(); + String[] split = name2.split("/"); + String name = split[split.length-1]; + String brand = result.get(i).get(10).toString(); + String type = result.get(i).get(11).toString(); + //查询刀具信息是否有此数据 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolByName(name, brand, type, null); + if(null==cuttingTool){ + return AjaxResult.error("未查询到:"+name+"的刀具信息"); + } + } + PwCuttingToolApplyDetail pwCuttingToolApplyDetail = new PwCuttingToolApplyDetail(); + for (int i = 1; i < result.size(); i++) { + pwCuttingToolApplyDetail = new PwCuttingToolApplyDetail(); + String name2 = result.get(i).get(12).toString(); + String[] split = name2.split("/"); + String name = split[split.length-1]; + String brand = result.get(i).get(10).toString(); + String type = result.get(i).get(11).toString(); + //查询刀具信息是否有此数据 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolByName(name, brand, type, null); + + pwCuttingToolApplyDetail.setName(name); + pwCuttingToolApplyDetail.setBrand(brand); + pwCuttingToolApplyDetail.setType(type); + pwCuttingToolApplyDetail.setUnit(cuttingTool.getUnit()); + pwCuttingToolApplyDetail.setSupplier(cuttingTool.getSupplier()); + pwCuttingToolApplyDetail.setQuantity(Double.valueOf(result.get(i).get(16).toString()).longValue()); + pwCuttingToolApplyDetail.setUnitPrice(cuttingTool.getUnitPrice()); + //总价 + pwCuttingToolApplyDetail.setTotalPrices(cuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolApplyDetail.getQuantity()))); + pwCuttingToolApplyDetail.setCreateTime(sdf.parse(result.get(i).get(17).toString())); + pwCuttingToolApplyDetail.setRemarks(result.get(i).get(2).toString()); + + pwCuttingToolApplyDetailService.insertPwCuttingToolApplyDetail(pwCuttingToolApplyDetail); + } + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.success("文件上传失败"); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolController.java new file mode 100644 index 0000000..e7330b8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolController.java @@ -0,0 +1,437 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具Controller + * + * @author zhukangchao + * @date 2022-01-27 + */ +@RestController +@RequestMapping("/management/pwCuttingTool") +public class PwCuttingToolController extends BaseController +{ + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //刀具库存信息 + @Autowired + private IPwCuttingToolInventoryDetailService pwCuttingToolInventoryDetailService; + //刀具采购单详情 + @Autowired + private IPwCuttingToolPurchaseDetailService pwCuttingToolPurchaseDetailService; + //计量单位 + @Autowired + private IImMeteringUnitService imMeteringUnitService; + //物料分组 + @Autowired + private IImMaterialGroupService imMaterialGroupService; + //物料类型 + @Autowired + private IImMaterialTypeService imMaterialTypeService; + /** + * 查询刀具列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingTool:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingTool pwCuttingTool){ + startPage(); + List list = pwCuttingToolService.selectPwCuttingToolList(pwCuttingTool); + return getDataTable(list); + } + + /** + * 查询刀具列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingTool:list')") + @GetMapping("/getList") + public TableDataInfo getList(PwCuttingTool pwCuttingTool){ + startPage(); + List list = pwCuttingToolService.selectPwCuttingToolList(pwCuttingTool); +// for (PwCuttingTool pwCuttingTool2 : list) { +// if(!pwCuttingTool2.getWarehouseName().equals("刀具库")){ +// PwCuttingToolInventoryDetail inventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(pwCuttingTool2.getName(), pwCuttingTool2.getBrand(), pwCuttingTool2.getType()); +// pwCuttingTool2.setName(pwCuttingTool2.getName()+"<"+inventoryDetail.getQuantity()+">"); +// } +// } + return getDataTable(list); + } + + /** + * 导出刀具列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingTool:export')") + @Log(title = "刀具", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingTool pwCuttingTool) + { + List list = pwCuttingToolService.selectPwCuttingToolList(pwCuttingTool); + ExcelUtil util = new ExcelUtil(PwCuttingTool.class); + return util.exportExcel(list, "pwCuttingTool"); + } + + /** + * 获取刀具详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingTool:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolService.selectPwCuttingToolById(id)); + } + + /** + * 数据库中添加数据 + */ + public void updateDatas(){ + List list = pwCuttingToolService.selectPwCuttingToolList(null); + for(PwCuttingTool tool : list){ + tool.setUntaxedPrice(tool.getUnitPrice().divide(new BigDecimal("1.13"),4)); + pwCuttingToolService.updatePwCuttingTool(tool); + } + + List list_1 = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailList(null); + for(PwCuttingToolInventoryDetail det : list_1){ + det.setUntaxedPrice(det.getUnitPrice().divide(new BigDecimal("1.13"),4)); + pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(det); + } + + List list_2 = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailList(null); + for(PwCuttingToolPurchaseDetail detppp : list_2){ + detppp.setUntaxedPrice(detppp.getUnitPrice().divide(new BigDecimal("1.13"),4)); + pwCuttingToolPurchaseDetailService.updatePwCuttingToolPurchaseDetail(detppp); + } + } + + /** + * 新增刀具 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingTool:add')") + @Log(title = "刀具", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingTool pwCuttingTool){ + if(null==pwCuttingTool.getName()||"".equals(pwCuttingTool.getName())){ + return AjaxResult.error("请填写刀具名称"); + } +// if(null==pwCuttingTool.getBrand()||"".equals(pwCuttingTool.getBrand())){ +// return AjaxResult.error("请填写刀具品牌"); +// } + if(null==pwCuttingTool.getType()||"".equals(pwCuttingTool.getType())){ + return AjaxResult.error("请填写规格型号"); + } + if(null==pwCuttingTool.getSupplier()||"".equals(pwCuttingTool.getSupplier())){ + return AjaxResult.error("请填写刀具厂商"); + } + if(null==pwCuttingTool.getUnitPrice()||"".equals(pwCuttingTool.getUnitPrice())||"0.0".equals(pwCuttingTool.getUnitPrice())){ + return AjaxResult.error("请填写刀具价格"); + } + pwCuttingTool.setUntaxedPrice(pwCuttingTool.getUnitPrice().divide(new BigDecimal("1.13"),4)); + //添加之前先根据名称和品牌和规格型号和刀具厂商查询,如果已经有了此刀具则不再添加新的 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolByName(pwCuttingTool.getName(),pwCuttingTool.getBrand(),pwCuttingTool.getType(),pwCuttingTool.getSupplier()); + if(null!=cuttingTool){ + return AjaxResult.error("此刀具已存在"); + } + int i = pwCuttingToolService.insertPwCuttingTool(pwCuttingTool); + int j = 0; + if(i<1){ + return AjaxResult.error("添加失败"); + }else{ + //增加刀具表的同时把刀具也增加到库存信息表 + PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail = new PwCuttingToolInventoryDetail(); + //刀具名称 + pwCuttingToolInventoryDetail.setName(pwCuttingTool.getName()); + //刀具品牌 + pwCuttingToolInventoryDetail.setBrand(pwCuttingTool.getBrand()); + //规格型号 + pwCuttingToolInventoryDetail.setType(pwCuttingTool.getType()); + //计量单位 + pwCuttingToolInventoryDetail.setUnit(pwCuttingTool.getUnit()); + //所属仓库 + pwCuttingToolInventoryDetail.setWarehouseName(pwCuttingTool.getWarehouseName()); + //刀具厂商 + pwCuttingToolInventoryDetail.setSupplier(pwCuttingTool.getSupplier()); + //生产厂家 + pwCuttingToolInventoryDetail.setManufacturer(pwCuttingTool.getManufacturer()); + //单价 + pwCuttingToolInventoryDetail.setUnitPrice(pwCuttingTool.getUnitPrice()); + pwCuttingToolInventoryDetail.setUntaxedPrice(pwCuttingTool.getUntaxedPrice()); + //数量(初始数量为0) + pwCuttingToolInventoryDetail.setQuantity(0L); + //在途数量(初始在途数量为0) + pwCuttingToolInventoryDetail.setOnPassage(0L); + //备注 + pwCuttingToolInventoryDetail.setRemarks(pwCuttingTool.getRemarks()); + j = pwCuttingToolInventoryDetailService.insertPwCuttingToolInventoryDetail(pwCuttingToolInventoryDetail); + + } + + //判断是否设置了安全库存,如果设置了安全库存,则直接触发采购单 + if(null!=pwCuttingTool.getMinimumNumber()&&pwCuttingTool.getMinimumNumber()>0&&null!=pwCuttingTool.getHeightNumber()&&pwCuttingTool.getHeightNumber()>0){ + PwCuttingToolInventoryDetail toolInventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(pwCuttingTool.getName(),pwCuttingTool.getBrand(), pwCuttingTool.getType()); + if(null==toolInventoryDetail){ + return AjaxResult.error("未查询到此刀具的库存信息"); + } + //创建刀具采购单详情 + PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail = new PwCuttingToolPurchaseDetail(); + //刀具名称 + pwCuttingToolPurchaseDetail.setName(pwCuttingTool.getName()); + //刀具品牌 + pwCuttingToolPurchaseDetail.setBrand(pwCuttingTool.getBrand()); + //规格型号 + pwCuttingToolPurchaseDetail.setType(pwCuttingTool.getType()); + //单位 + pwCuttingToolPurchaseDetail.setUnit(pwCuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolPurchaseDetail.setSupplier(pwCuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolPurchaseDetail.setManufacturer(pwCuttingTool.getManufacturer()); + //数量(最高安全库存-现有库存-现有在途数量) +// pwCuttingToolPurchaseDetail.setQuantity(cuttingTool.getHeightNumber()-toolInventoryDetail.getQuantity()-toolInventoryDetail.getOnPassage()); + //修改采购数量为(最高安全库存-最低安全库存) + pwCuttingToolPurchaseDetail.setQuantity(pwCuttingTool.getHeightNumber()-pwCuttingTool.getMinimumNumber()); + //单价 + pwCuttingToolPurchaseDetail.setUnitPrice(pwCuttingTool.getUnitPrice()); + //总价(单价*数量) + pwCuttingToolPurchaseDetail.setTotalPrice(pwCuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolPurchaseDetail.getQuantity()))); + int detail = pwCuttingToolPurchaseDetailService.insertPwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); + if(detail<1){ + return AjaxResult.error("添加失败"); + } + //更新在途数量 + toolInventoryDetail.setOnPassage(toolInventoryDetail.getOnPassage()+pwCuttingToolPurchaseDetail.getQuantity()); + int detail2 = pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(toolInventoryDetail); + if(detail2<1){ + return AjaxResult.error("添加失败"); + } + } + return toAjax(j); + } + + /** + * 修改刀具 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingTool:edit')") + @Log(title = "刀具", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingTool pwCuttingTool){ + if(null==pwCuttingTool.getName()||"".equals(pwCuttingTool.getName())){ + return AjaxResult.error("请填写刀具名称"); + } +// if(null==pwCuttingTool.getBrand()||"".equals(pwCuttingTool.getBrand())){ +// return AjaxResult.error("请填写刀具品牌"); +// } + if(null==pwCuttingTool.getType()||"".equals(pwCuttingTool.getType())){ + return AjaxResult.error("请填写规格型号"); + } + if(null==pwCuttingTool.getSupplier()||"".equals(pwCuttingTool.getSupplier())){ + return AjaxResult.error("请填写刀具厂商"); + } + if(null==pwCuttingTool.getUnitPrice()||"".equals(pwCuttingTool.getUnitPrice())||"0.0".equals(pwCuttingTool.getUnitPrice())){ + return AjaxResult.error("请填写刀具价格"); + } + //修改之前根据id查询刀具信息 + PwCuttingTool pwCuttingTool2 = pwCuttingToolService.selectPwCuttingToolById(pwCuttingTool.getId()); + int i = pwCuttingToolService.updatePwCuttingTool(pwCuttingTool); + //修改刀具之后同时修改库存信息表中的数据 + int j = 0; + if(i<1){ + return AjaxResult.error("修改失败"); + }else{ + //根据刀具名称和品牌和规格型号查询库存信息表中数据 + PwCuttingToolInventoryDetail cuttingToolInventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(pwCuttingTool2.getName(),pwCuttingTool2.getBrand(),pwCuttingTool2.getType()); + //刀具名称 + cuttingToolInventoryDetail.setName(pwCuttingTool.getName()); + //刀具品牌 + cuttingToolInventoryDetail.setBrand(pwCuttingTool.getBrand()); + //规格型号 + cuttingToolInventoryDetail.setType(pwCuttingTool.getType()); + //计量单位 + cuttingToolInventoryDetail.setUnit(pwCuttingTool.getUnit()); + //所属仓库 + cuttingToolInventoryDetail.setWarehouseName(pwCuttingTool.getWarehouseName()); + //刀具厂商 + cuttingToolInventoryDetail.setSupplier(pwCuttingTool.getSupplier()); + //生产厂家 + cuttingToolInventoryDetail.setManufacturer(pwCuttingTool.getManufacturer()); + //单价 + cuttingToolInventoryDetail.setUnitPrice(pwCuttingTool.getUnitPrice()); + //备注 + cuttingToolInventoryDetail.setRemarks(pwCuttingTool.getRemarks()); + j = pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(cuttingToolInventoryDetail); + } + + //判断是否设置了安全库存,如果设置了安全库存,则直接触发采购单 + if(pwCuttingTool.getMinimumNumber()>0&&pwCuttingTool.getHeightNumber()>0){ + PwCuttingToolInventoryDetail toolInventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(pwCuttingTool.getName(),pwCuttingTool.getBrand(), pwCuttingTool.getType()); + if(null==toolInventoryDetail){ + return AjaxResult.error("未查询到此刀具的库存信息"); + } + //创建刀具采购单详情 + PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail = new PwCuttingToolPurchaseDetail(); + //刀具名称 + pwCuttingToolPurchaseDetail.setName(pwCuttingTool.getName()); + //刀具品牌 + pwCuttingToolPurchaseDetail.setBrand(pwCuttingTool.getBrand()); + //规格型号 + pwCuttingToolPurchaseDetail.setType(pwCuttingTool.getType()); + //单位 + pwCuttingToolPurchaseDetail.setUnit(pwCuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolPurchaseDetail.setSupplier(pwCuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolPurchaseDetail.setManufacturer(pwCuttingTool.getManufacturer()); + //数量(最高安全库存-现有库存-现有在途数量) +// pwCuttingToolPurchaseDetail.setQuantity(cuttingTool.getHeightNumber()-toolInventoryDetail.getQuantity()-toolInventoryDetail.getOnPassage()); + //修改采购数量为(最高安全库存-最低安全库存) + pwCuttingToolPurchaseDetail.setQuantity(pwCuttingTool.getHeightNumber()-pwCuttingTool.getMinimumNumber()); + //单价 + pwCuttingToolPurchaseDetail.setUnitPrice(pwCuttingTool.getUnitPrice()); + //总价(单价*数量) + pwCuttingToolPurchaseDetail.setTotalPrice(pwCuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolPurchaseDetail.getQuantity()))); + int detail = pwCuttingToolPurchaseDetailService.insertPwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); + if(detail<1){ + return AjaxResult.error("添加失败"); + } + //更新在途数量 + toolInventoryDetail.setOnPassage(toolInventoryDetail.getOnPassage()+pwCuttingToolPurchaseDetail.getQuantity()); + int detail2 = pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(toolInventoryDetail); + if(detail2<1){ + return AjaxResult.error("添加失败"); + } + } + return toAjax(j); + } + + /** + * 删除刀具 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingTool:remove')") + @Log(title = "刀具", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + + //同时删除库存信息 + for (Long id : ids) { + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(id); + //根据刀具名称和品牌和规格型号查询库存信息表中数据 + PwCuttingToolInventoryDetail cuttingToolInventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(cuttingTool.getName(),cuttingTool.getBrand(),cuttingTool.getType()); + if(null!=cuttingToolInventoryDetail){ + if(cuttingToolInventoryDetail.getQuantity()>0){ + return AjaxResult.error("有库存的产品不允许删除"); + }else{ + pwCuttingToolInventoryDetailService.deletePwCuttingToolInventoryDetailById(cuttingToolInventoryDetail.getId()); + } + } + } + return toAjax(pwCuttingToolService.deletePwCuttingToolByIds(ids)); + } + + /** + * 批量上传物料信息 + */ + @RequestMapping("/upload") + @ResponseBody + public AjaxResult uploadLableNumber(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + List list2 = new ArrayList(); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + List lis = new ArrayList(); + for (int i = 1; i < result.size(); i++) { + PwCuttingTool pwCuttingTool = new PwCuttingTool(); + //根据名称查询刀具信息 + List list = pwCuttingToolService.selectPwCuttingToolByNameAndType(result.get(i).get(0).toString()); + //判断是否查到了此数据 + if(list.size()>0){ + //如果有数据,则需要判断是否是刀具库的数据 + + }else{ + //说明是新产品,新产品的编号需要根据仓库拼接编号 + //名称 + pwCuttingTool.setName(result.get(i).get(0).toString()); + //品牌 + pwCuttingTool.setBrand(result.get(i).get(1).toString()); + //仓库不同,编号不同 + if(result.get(i).get(4).toString().equals("刀具库")){ +// //查询DJ开头的数据排到了多少 +// pwCuttingToolService.selectPwCuttingToolByWarehouseName(); +// //编号 +// pwCuttingTool.setType("DJ"+); + }else if(result.get(i).get(4).toString().equals("刀体库")){ + + }else if(result.get(i).get(4).toString().equals("量具库")){ + + }else if(result.get(i).get(4).toString().equals("工具库")){ + + } + //计量单位 + pwCuttingTool.setUnit(result.get(i).get(3).toString()); + //默认仓库 + pwCuttingTool.setWarehouseName(result.get(i).get(4).toString()); + //单价 + pwCuttingTool.setUnitPrice(new BigDecimal(result.get(i).get(5).toString())); + //最低库存 + pwCuttingTool.setMinimumNumber(Long.valueOf(result.get(i).get(6).toString())); + //最高库存 + pwCuttingTool.setHeightNumber(Long.valueOf(result.get(i).get(7).toString())); + //刀具厂商 + pwCuttingTool.setSupplier(result.get(i).get(8).toString()); + //生产厂商 + pwCuttingTool.setManufacturer(result.get(i).get(9).toString()); + pwCuttingToolService.insertPwCuttingTool(pwCuttingTool); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolDeliveryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolDeliveryController.java new file mode 100644 index 0000000..faf3cc6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolDeliveryController.java @@ -0,0 +1,121 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; +import com.ruoyi.project.management.domain.PwStoresRequisition; +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具出库单Controller + * + * @author zhukangchao + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/management/pwCuttingToolDelivery") +public class PwCuttingToolDeliveryController extends BaseController +{ + @Autowired + private IPwCuttingToolDeliveryService pwCuttingToolDeliveryService; + @Autowired + private IPwCuttingToolDeliveryDetailService pwCuttingToolDeliveryDetailService; + + /** + * 查询刀具出库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDelivery:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolDelivery pwCuttingToolDelivery){ + startPage(); + List list = new ArrayList(); + if(null!=pwCuttingToolDelivery.getName()&&!"".equals(pwCuttingToolDelivery.getName())){ + List list2 = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailByName(pwCuttingToolDelivery.getName()); + for (PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail2 : list2) { + //根据单据id查询请购单 + PwCuttingToolDelivery delivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryById(pwCuttingToolDeliveryDetail2.getDeliveryId()); + if(null!=delivery){ + list.add(delivery); + } + } + }else{ + list = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryList(pwCuttingToolDelivery); + } + return getDataTable(list); + } + + /** + * 导出刀具出库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDelivery:export')") + @Log(title = "刀具出库单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolDelivery pwCuttingToolDelivery) + { + List list = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryList(pwCuttingToolDelivery); + ExcelUtil util = new ExcelUtil(PwCuttingToolDelivery.class); + return util.exportExcel(list, "pwCuttingToolDelivery"); + } + + /** + * 获取刀具出库单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDelivery:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryById(id)); + } + + /** + * 新增刀具出库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDelivery:add')") + @Log(title = "刀具出库单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolDelivery pwCuttingToolDelivery) + { + return toAjax(pwCuttingToolDeliveryService.insertPwCuttingToolDelivery(pwCuttingToolDelivery)); + } + + /** + * 修改刀具出库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDelivery:edit')") + @Log(title = "刀具出库单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolDelivery pwCuttingToolDelivery) + { + return toAjax(pwCuttingToolDeliveryService.updatePwCuttingToolDelivery(pwCuttingToolDelivery)); + } + + /** + * 删除刀具出库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDelivery:remove')") + @Log(title = "刀具出库单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolDeliveryService.deletePwCuttingToolDeliveryByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolDeliveryDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolDeliveryDetailController.java new file mode 100644 index 0000000..bd6cb89 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolDeliveryDetailController.java @@ -0,0 +1,398 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwCuttingToolApply; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolInventoryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwLetterOfAdvice; +import com.ruoyi.project.management.domain.PwLetterOfAdviceProduct; +import com.ruoyi.project.management.service.IPwCuttingToolApplyDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolApplyService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryService; +import com.ruoyi.project.management.service.IPwCuttingToolInventoryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolPurchaseDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具出库单详情Controller + * + * @author zhukangchao + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/management/pwCuttingToolDeliveryDetail") +public class PwCuttingToolDeliveryDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolDeliveryDetailService pwCuttingToolDeliveryDetailService; + //刀具库存信息 + @Autowired + private IPwCuttingToolInventoryDetailService pwCuttingToolInventoryDetailService; + //用户信息 + @Autowired + private TokenService tokenService; + //刀具出库单信息 + @Autowired + private IPwCuttingToolDeliveryService pwCuttingToolDeliveryService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //刀具采购单详情 + @Autowired + private IPwCuttingToolPurchaseDetailService pwCuttingToolPurchaseDetailService; + //刀具领用单信息 + @Autowired + private IPwCuttingToolApplyService pwCuttingToolApplyService; + @Autowired + private IPwCuttingToolApplyDetailService pwCuttingToolApplyDetailService; + + /** + * 查询刀具出库单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDeliveryDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail) + { + startPage(); + List list = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailList(pwCuttingToolDeliveryDetail); + return getDataTable(list); + } + + /** + * 导出刀具出库单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDeliveryDetail:export')") + @Log(title = "刀具出库单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail) + { + List list = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailList(pwCuttingToolDeliveryDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolDeliveryDetail.class); + return util.exportExcel(list, "pwCuttingToolDeliveryDetail"); + } + + /** + * 获取刀具出库单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDeliveryDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailById(id)); + } + + /** + * 新增刀具出库单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDeliveryDetail:add')") + @Log(title = "刀具出库单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail) + { + return toAjax(pwCuttingToolDeliveryDetailService.insertPwCuttingToolDeliveryDetail(pwCuttingToolDeliveryDetail)); + } + + /** + * 修改刀具出库单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDeliveryDetail:edit')") + @Log(title = "刀具出库单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail) + { + return toAjax(pwCuttingToolDeliveryDetailService.updatePwCuttingToolDeliveryDetail(pwCuttingToolDeliveryDetail)); + } + + /** + * 删除刀具出库单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolDeliveryDetail:remove')") + @Log(title = "刀具出库单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolDeliveryDetailService.deletePwCuttingToolDeliveryDetailByIds(ids)); + } + + /** + * 单个确认出库 + */ + @RequestMapping("/affirmOne/{ids}") + public AjaxResult affirmOne(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + for (Long id : ids) { + //根据id查询物料信息 + PwCuttingToolDeliveryDetail deliveryDetail = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailById(id); + //查询关联单据 + PwCuttingToolDelivery delivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryById(deliveryDetail.getDeliveryId()); + if("已出库".equals(deliveryDetail.getDeliveryStatus())){ + return AjaxResult.error("不可重复出库"); + } + PwCuttingToolInventoryDetail toolInventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(deliveryDetail.getName(),deliveryDetail.getBrand(), deliveryDetail.getType()); + if(null==toolInventoryDetail){ + return AjaxResult.error("未查询到此刀具的库存信息"); + } + //判断是维修单出库还是领用单出库 + if(delivery.getCode().contains("WX")){ + //说明是维修单出库,应减少待维修数量 + //判断出库的数量是否大于库存数量 + if(toolInventoryDetail.getNumber()>=deliveryDetail.getQuantity()){ + //减少库存数量 + toolInventoryDetail.setNumber(toolInventoryDetail.getNumber()-deliveryDetail.getQuantity()); + //添加在途数量 + toolInventoryDetail.setOnPassage(deliveryDetail.getQuantity()); + if(toolInventoryDetail.getNumber()==0){ + toolInventoryDetail.setMaintain(""); + } + //修改库存信息 + int j = pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(toolInventoryDetail); + if(j<1){ + return AjaxResult.error("出库失败"); + } + //修改出库单详情状态 + deliveryDetail.setDeliveryStatus("已出库"); + //出库人 + deliveryDetail.setUserName(user.getNickName()); + //出库时间 + deliveryDetail.setDeliveryDate(new Date()); + int k = pwCuttingToolDeliveryDetailService.updatePwCuttingToolDeliveryDetail(deliveryDetail); + if(k<1){ + return AjaxResult.error("出库失败"); + } + //根据出库单id查询此出库单下所有的道具 + List list = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailByDeliveryId(deliveryDetail.getDeliveryId()); + int i = 0; + for (PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail : list) { + if(pwCuttingToolDeliveryDetail.getDeliveryStatus().equals("未出库")){ + i = 1; + } + } + if(i == 0){ + //修改刀具入库单状态 + PwCuttingToolDelivery toolDelivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryById(deliveryDetail.getDeliveryId()); + toolDelivery.setStatus("已出库"); + int l = pwCuttingToolDeliveryService.updatePwCuttingToolDelivery(toolDelivery); + if(l<1){ + return AjaxResult.error("出库失败"); + } + } + //查询刀具的安全库存,有安全库存设置的,则根据库存数量自动生成刀具采购详情 + //查询刀具信息 +// PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolByName(deliveryDetail.getName(),deliveryDetail.getBrand(), deliveryDetail.getType(), deliveryDetail.getSupplier()); +// if(null==cuttingTool){ +// return AjaxResult.error("未查询到此刀具信息"); +// } +// if(cuttingTool.getMinimumNumber()>0&&cuttingTool.getHeightNumber()>0){ +// //判断是否是刀具,如果是刀具则生成采购单,如果不是刀具则不生成 +// if(cuttingTool.getWarehouseName().equals("刀具库")){ +// //说明有安全库存设置 +// if(toolInventoryDetail.getQuantity()+toolInventoryDetail.getOnPassage()<=cuttingTool.getMinimumNumber()){ +// //说明触发安全库存最低数量了 +// //创建刀具采购单详情 +// PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail = new PwCuttingToolPurchaseDetail(); +// //刀具名称 +// pwCuttingToolPurchaseDetail.setName(cuttingTool.getName()); +// //刀具品牌 +// pwCuttingToolPurchaseDetail.setBrand(cuttingTool.getBrand()); +// //规格型号 +// pwCuttingToolPurchaseDetail.setType(cuttingTool.getType()); +// //单位 +// pwCuttingToolPurchaseDetail.setUnit(cuttingTool.getUnit()); +// //刀具厂商 +// pwCuttingToolPurchaseDetail.setSupplier(cuttingTool.getSupplier()); +// //生产厂商 +// pwCuttingToolPurchaseDetail.setManufacturer(cuttingTool.getManufacturer()); +// //数量(最高安全库存-现有库存-现有在途数量) +// pwCuttingToolPurchaseDetail.setQuantity(cuttingTool.getHeightNumber()-toolInventoryDetail.getQuantity()-toolInventoryDetail.getOnPassage()); +// //单价 +// pwCuttingToolPurchaseDetail.setUnitPrice(cuttingTool.getUnitPrice()); +// //总价(单价*数量) +// pwCuttingToolPurchaseDetail.setTotalPrice(cuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolPurchaseDetail.getQuantity()))); +// int detail = pwCuttingToolPurchaseDetailService.insertPwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); +// if(detail<1){ +// return AjaxResult.error("出库失败"); +// } +// //更新在途数量 +// toolInventoryDetail.setOnPassage(pwCuttingToolPurchaseDetail.getQuantity()); +// int detail2 = pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(toolInventoryDetail); +// if(detail2<1){ +// return AjaxResult.error("出库失败"); +// } +// } +// } +// } + }else{ + return AjaxResult.error("库存数量不足"); + } + }else{ + //判断出库的数量是否大于库存数量 + if(toolInventoryDetail.getQuantity()>=deliveryDetail.getQuantity()){ + //减少库存数量 + toolInventoryDetail.setQuantity(toolInventoryDetail.getQuantity()-deliveryDetail.getQuantity()); + //修改库存信息 + int j = pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(toolInventoryDetail); + if(j<1){ + return AjaxResult.error("出库失败"); + } + //修改出库单详情状态 + deliveryDetail.setDeliveryStatus("已出库"); + //出库人 + deliveryDetail.setUserName(user.getNickName()); + //出库时间 + deliveryDetail.setDeliveryDate(new Date()); + int k = pwCuttingToolDeliveryDetailService.updatePwCuttingToolDeliveryDetail(deliveryDetail); + if(k<1){ + return AjaxResult.error("出库失败"); + } + //根据出库单id查询此出库单下所有的道具 + List list = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailByDeliveryId(deliveryDetail.getDeliveryId()); + int i = 0; + for (PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail : list) { + if(pwCuttingToolDeliveryDetail.getDeliveryStatus().equals("未出库")){ + i = 1; + } + } + if(i == 0){ + //修改刀具入库单状态 + PwCuttingToolDelivery toolDelivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryById(deliveryDetail.getDeliveryId()); + toolDelivery.setStatus("已出库"); + int l = pwCuttingToolDeliveryService.updatePwCuttingToolDelivery(toolDelivery); + if(l<1){ + return AjaxResult.error("出库失败"); + } + } + + //定时器自动查询触发采购单 + +// //查询刀具的安全库存,有安全库存设置的,则根据库存数量自动生成刀具采购详情 +// //查询刀具信息 +// PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolByName(deliveryDetail.getName(),deliveryDetail.getBrand(), deliveryDetail.getType(), deliveryDetail.getSupplier()); +// if(null==cuttingTool){ +// return AjaxResult.error("未查询到此刀具信息"); +// } +// if(cuttingTool.getMinimumNumber()>0&&cuttingTool.getHeightNumber()>0){ +// //判断是否是刀具,如果是刀具则生成采购单,如果不是刀具则不生成 +// if("刀具库".equals(cuttingTool.getWarehouseName())){ +// //说明有安全库存设置 +// if(toolInventoryDetail.getQuantity()+toolInventoryDetail.getOnPassage()<=cuttingTool.getMinimumNumber()){ +// //说明触发安全库存最低数量了 +// //创建刀具采购单详情 +// PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail = new PwCuttingToolPurchaseDetail(); +// //刀具名称 +// pwCuttingToolPurchaseDetail.setName(cuttingTool.getName()); +// //刀具品牌 +// pwCuttingToolPurchaseDetail.setBrand(cuttingTool.getBrand()); +// //规格型号 +// pwCuttingToolPurchaseDetail.setType(cuttingTool.getType()); +// //单位 +// pwCuttingToolPurchaseDetail.setUnit(cuttingTool.getUnit()); +// //刀具厂商 +// pwCuttingToolPurchaseDetail.setSupplier(cuttingTool.getSupplier()); +// //生产厂商 +// pwCuttingToolPurchaseDetail.setManufacturer(cuttingTool.getManufacturer()); +// //数量(最高安全库存-现有库存-现有在途数量) +//// pwCuttingToolPurchaseDetail.setQuantity(cuttingTool.getHeightNumber()-toolInventoryDetail.getQuantity()-toolInventoryDetail.getOnPassage()); +// //修改采购数量为(最高安全库存-最低安全库存) +// pwCuttingToolPurchaseDetail.setQuantity(cuttingTool.getHeightNumber()-cuttingTool.getMinimumNumber()); +// //单价 +// pwCuttingToolPurchaseDetail.setUnitPrice(cuttingTool.getUnitPrice()); +// //总价(单价*数量) +// pwCuttingToolPurchaseDetail.setTotalPrice(cuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolPurchaseDetail.getQuantity()))); +// int detail = pwCuttingToolPurchaseDetailService.insertPwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); +// if(detail<1){ +// return AjaxResult.error("出库失败"); +// } +// //更新在途数量 +// toolInventoryDetail.setOnPassage(toolInventoryDetail.getOnPassage()+pwCuttingToolPurchaseDetail.getQuantity()); +// int detail2 = pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(toolInventoryDetail); +// if(detail2<1){ +// return AjaxResult.error("出库失败"); +// } +// } +// } +// } + + + }else{ + return AjaxResult.error("库存数量不足"); + } + } + } + return toAjax(1); + } + + //退还入库 + @RequestMapping("/handBacks/{ids}") + public AjaxResult handBacks(@PathVariable Long[] ids){ + + PwCuttingToolDeliveryDetail deliveryDetail = new PwCuttingToolDeliveryDetail(); + int i = 0; + for (Long id : ids) { + //根据id查询产品信息 + deliveryDetail = pwCuttingToolDeliveryDetailService.selectPwCuttingToolDeliveryDetailById(id); + if(deliveryDetail.getDeliveryStatus().equals("已退还")){ + return AjaxResult.error("无需重复退还"); + }else{ + //增加库存 + PwCuttingToolInventoryDetail inventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(deliveryDetail.getName(), deliveryDetail.getBrand(), deliveryDetail.getType()); + if(null != inventoryDetail){ + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+deliveryDetail.getQuantity()); + }else{ + return AjaxResult.error("未查询到此产品的库存信息"); + } + deliveryDetail.setDeliveryStatus("已退还"); + deliveryDetail.setDeliveryDate(new Date()); + pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(inventoryDetail); + } + + //修改领用单状态 + PwCuttingToolDelivery cuttingToolDelivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryById(deliveryDetail.getDeliveryId()); + + //根据出库单code查询领用单 + PwCuttingToolApply cuttingToolApply = pwCuttingToolApplyService.selectPwCuttingToolApplyByCode(cuttingToolDelivery.getCode()); + + PwCuttingToolApplyDetail toolApplyDetail = pwCuttingToolApplyDetailService.selectPwCuttingToolApplyDetailByApplyDetailIdAndNameAndType(cuttingToolApply.getId(),deliveryDetail.getName(),deliveryDetail.getType()); + + if(null!=toolApplyDetail){ + toolApplyDetail.setStatus("已退还"); + } + pwCuttingToolApplyDetailService.updatePwCuttingToolApplyDetail(toolApplyDetail); + i = pwCuttingToolDeliveryDetailService.updatePwCuttingToolDeliveryDetail(deliveryDetail); + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolGodownEntryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolGodownEntryController.java new file mode 100644 index 0000000..383b055 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolGodownEntryController.java @@ -0,0 +1,121 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntry; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntryDetail; +import com.ruoyi.project.management.domain.PwStoresRequisition; +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具入库单Controller + * + * @author zhukangchao + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/management/pwCuttingToolGodownEntry") +public class PwCuttingToolGodownEntryController extends BaseController +{ + @Autowired + private IPwCuttingToolGodownEntryService pwCuttingToolGodownEntryService; + @Autowired + private IPwCuttingToolGodownEntryDetailService pwCuttingToolGodownEntryDetailService; + + /** + * 查询刀具入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntry:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolGodownEntry pwCuttingToolGodownEntry){ + startPage(); + List list = new ArrayList(); + if(null!=pwCuttingToolGodownEntry.getName()&&!"".equals(pwCuttingToolGodownEntry.getName())){ + List list2 = pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailByName(pwCuttingToolGodownEntry.getName()); + for (PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail : list2) { + //根据单据id查询请购单 + PwCuttingToolGodownEntry godownEntry = pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryById(pwCuttingToolGodownEntryDetail.getGosownEntryId()); + if(null!=godownEntry){ + list.add(godownEntry); + } + } + }else{ + list = pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryList(pwCuttingToolGodownEntry); + } + return getDataTable(list); + } + + /** + * 导出刀具入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntry:export')") + @Log(title = "刀具入库单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolGodownEntry pwCuttingToolGodownEntry) + { + List list = pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryList(pwCuttingToolGodownEntry); + ExcelUtil util = new ExcelUtil(PwCuttingToolGodownEntry.class); + return util.exportExcel(list, "pwCuttingToolGodownEntry"); + } + + /** + * 获取刀具入库单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntry:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryById(id)); + } + + /** + * 新增刀具入库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntry:add')") + @Log(title = "刀具入库单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolGodownEntry pwCuttingToolGodownEntry) + { + return toAjax(pwCuttingToolGodownEntryService.insertPwCuttingToolGodownEntry(pwCuttingToolGodownEntry)); + } + + /** + * 修改刀具入库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntry:edit')") + @Log(title = "刀具入库单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolGodownEntry pwCuttingToolGodownEntry) + { + return toAjax(pwCuttingToolGodownEntryService.updatePwCuttingToolGodownEntry(pwCuttingToolGodownEntry)); + } + + /** + * 删除刀具入库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntry:remove')") + @Log(title = "刀具入库单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolGodownEntryService.deletePwCuttingToolGodownEntryByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolGodownEntryDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolGodownEntryDetailController.java new file mode 100644 index 0000000..e9bddfb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolGodownEntryDetailController.java @@ -0,0 +1,336 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.poi.ExcelUtilPrintDaoJu; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具入库详情Controller + * + * @author zhukangchao + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/management/pwCuttingToolGodownEntryDetail") +public class PwCuttingToolGodownEntryDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolGodownEntryDetailService pwCuttingToolGodownEntryDetailService; + //刀具入库单信息 + @Autowired + private IPwCuttingToolGodownEntryService pwCuttingToolGodownEntryService; + //用户信息 + @Autowired + private TokenService tokenService; + //刀具库存信息 + @Autowired + private IPwCuttingToolInventoryDetailService pwCuttingToolInventoryDetailService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //刀具采购单详情 + @Autowired + private IPwCuttingToolPurchaseDetailService pwCuttingToolPurchaseDetailService; + @Autowired + private IPwCuttingToolPurchaseService pwCuttingToolPurchaseService; + + /** + * 查询刀具入库详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntryDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail) + { + startPage(); + List list = pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailList(pwCuttingToolGodownEntryDetail); + return getDataTable(list); + } + + /** + * 导出刀具入库详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntryDetail:export')") + @Log(title = "刀具入库详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail) + { + List list = pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailList(pwCuttingToolGodownEntryDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolGodownEntryDetail.class); + return util.exportExcel(list, "pwCuttingToolGodownEntryDetail"); + } + + /** + * 获取刀具入库详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntryDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailById(id)); + } + + /** + * 新增刀具入库详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntryDetail:add')") + @Log(title = "刀具入库详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail) + { + return toAjax(pwCuttingToolGodownEntryDetailService.insertPwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail)); + } + + /** + * 修改刀具入库详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntryDetail:edit')") + @Log(title = "刀具入库详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail) + { + return toAjax(pwCuttingToolGodownEntryDetailService.updatePwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail)); + } + + /** + * 删除刀具入库详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolGodownEntryDetail:remove')") + @Log(title = "刀具入库详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolGodownEntryDetailService.deletePwCuttingToolGodownEntryDetailByIds(ids)); + } + + /** + * 确认入库 + * @param ids + * @return + */ + @RequestMapping("/affirms/{ids}") + public AjaxResult affirms(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + for (Long id : ids) { + //根据id查询刀具信息 + PwCuttingToolGodownEntryDetail cuttingToolGodownEntryDetail = pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailById(id); + if("已入库".equals(cuttingToolGodownEntryDetail.getGodownEntryStatus())){ + return AjaxResult.error("不允许重复入库"); + } + //根据刀具名称和品牌和规格型号查询库存信息 + PwCuttingToolInventoryDetail inventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(cuttingToolGodownEntryDetail.getName(), cuttingToolGodownEntryDetail.getBrand(), cuttingToolGodownEntryDetail.getType()); + //修改库存数量和在途数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+cuttingToolGodownEntryDetail.getQuantity()); + if(inventoryDetail.getOnPassage()-cuttingToolGodownEntryDetail.getQuantity()<0){ + inventoryDetail.setOnPassage(0L); + }else{ + //减少在途数量 + inventoryDetail.setOnPassage(inventoryDetail.getOnPassage()-cuttingToolGodownEntryDetail.getQuantity()); + } + //修改库存信息 + pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(inventoryDetail); + //修改入库状态 + cuttingToolGodownEntryDetail.setGodownEntryStatus("已入库"); + //入库人 + cuttingToolGodownEntryDetail.setUserName(user.getNickName()); + //入库时间 + cuttingToolGodownEntryDetail.setGodownEntryDate(new Date()); + int i = pwCuttingToolGodownEntryDetailService.updatePwCuttingToolGodownEntryDetail(cuttingToolGodownEntryDetail); + if(i<1){ + return AjaxResult.error("入库失败"); + } + //查询此入库单下所有的刀具明细 + List list = pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailByGosownEntryId(cuttingToolGodownEntryDetail.getGosownEntryId()); + int s = 0; + for (PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail : list) { + if(!("已入库").equals(pwCuttingToolGodownEntryDetail.getGodownEntryStatus())){ + s = 1; + break; + } + } + if(s == 0){ + //说明此单据下的刀具都已入库,则需要修改入库单的状态 + PwCuttingToolGodownEntry cuttingToolGodownEntry = pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryById(cuttingToolGodownEntryDetail.getGosownEntryId()); + cuttingToolGodownEntry.setInventoryStatus("已入库"); + pwCuttingToolGodownEntryService.updatePwCuttingToolGodownEntry(cuttingToolGodownEntry); + + //修改合同状态 + PwCuttingToolPurchase ptp = new PwCuttingToolPurchase(); + ptp.setCode(cuttingToolGodownEntry.getContractCode()); + ptp.setContractStatus(2l); + pwCuttingToolPurchaseService.updatePwCuttingToolPurchaseByCode(ptp); + } + + //查询刀具的安全库存,有安全库存设置的,则根据库存数量自动生成刀具采购详情 + //查询刀具信息 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolByName(cuttingToolGodownEntryDetail.getName(),cuttingToolGodownEntryDetail.getBrand(), cuttingToolGodownEntryDetail.getType(), cuttingToolGodownEntryDetail.getSupplier()); + //库存信息 + PwCuttingToolInventoryDetail toolInventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(cuttingToolGodownEntryDetail.getName(),cuttingToolGodownEntryDetail.getBrand(), cuttingToolGodownEntryDetail.getType()); + if(null==cuttingTool){ + return AjaxResult.error("未查询到此刀具信息"); + } + if(null==toolInventoryDetail){ + return AjaxResult.error("未查询到此刀具的库存信息"); + } + if(cuttingTool.getMinimumNumber()>0&&cuttingTool.getHeightNumber()>0){ + //判断是否是刀具,如果是刀具则生成采购单,如果不是刀具则不生成 +// if("刀具库".equals(cuttingTool.getWarehouseName())){ + //说明有安全库存设置 + if(toolInventoryDetail.getQuantity()+toolInventoryDetail.getOnPassage() list = new ArrayList(); + Long i = 1L; + //遍历ids + for (Long id : ids) { + //根据id获取物料信息 + PwCuttingToolGodownEntryDetail godownEntryDetail = pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailById(id); + godownEntryDetail.setSerialNumber(i); + i++; + list.add(godownEntryDetail); + } + //供应商名称 + String preferentialOriginName = ""; + //检验员 + String qualityInspector = ""; + //库管 + String kuguan = ""; + PwCuttingToolGodownEntryDetail godownEntryDetail = new PwCuttingToolGodownEntryDetail(); + //遍历统计数量和金额 + for (PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail : list) { + if(null==preferentialOriginName||"".equals(preferentialOriginName)){ + if(null!=pwCuttingToolGodownEntryDetail.getSupplier()){ + preferentialOriginName = pwCuttingToolGodownEntryDetail.getSupplier(); + }else{ + preferentialOriginName = "无"; + } + }else{ + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if(!preferentialOriginName.equals(pwCuttingToolGodownEntryDetail.getSupplier())){ + return AjaxResult.error("不同经销商不可合并打印"); + } + } + //接收人 + if(null!=pwCuttingToolGodownEntryDetail.getUserName()){ + kuguan = pwCuttingToolGodownEntryDetail.getUserName(); + }else{ + kuguan = "无"; + } + //数量合计 + if(null==godownEntryDetail.getQuantity()){ + godownEntryDetail.setQuantity(0L); + } + godownEntryDetail.setQuantity(godownEntryDetail.getQuantity()+pwCuttingToolGodownEntryDetail.getQuantity()); + //金额合计 + if(null==godownEntryDetail.getTotalPrice()){ + godownEntryDetail.setTotalPrice(0.0); + } + DecimalFormat df = new DecimalFormat("#.00"); + godownEntryDetail.setTotalPrice(Double.valueOf(df.format(godownEntryDetail.getTotalPrice()+pwCuttingToolGodownEntryDetail.getTotalPrice()))); + } + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(godownEntryDetail.getTotalPrice()+""); + godownEntryDetail.setName("合计金额:"); + godownEntryDetail.setBrand(chinese); + list.add(godownEntryDetail); + //首先把数据集合生成excel,然后调用打印机打印excel + // 创建excel文件 + ExcelUtilPrintDaoJu util = new ExcelUtilPrintDaoJu(PwCuttingToolGodownEntryDetail.class); + //一级表头 + String title = "河北伊特机械设备制造有限公司"; + //二级表头 + String titleTwo = "刀具入库单"; + //三级表头 + String titleThree = "摘要: "+"日期: "+sdf.format(new Date())+" "+"编号: "+sdft.format(new Date()); + //表尾 + String footer = "库管: "+kuguan+" 经办: "+"检验员: "+qualityInspector+" 制单: "+user.getNickName(); + + return util.exportExcel(list,"入库单",title,titleTwo,"供应商:"+preferentialOriginName,titleThree,footer); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolInventoryDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolInventoryDetailController.java new file mode 100644 index 0000000..ced64b7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolInventoryDetailController.java @@ -0,0 +1,118 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwCuttingToolInventoryDetail; +import com.ruoyi.project.management.service.IPwCuttingToolInventoryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具库存Controller + * + * @author zhukangchao + * @date 2022-01-27 + */ +@RestController +@RequestMapping("/management/pwCuttingToolInventoryDetail") +public class PwCuttingToolInventoryDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolInventoryDetailService pwCuttingToolInventoryDetailService; + @Autowired + private IPwCuttingToolService pwCuttingToolService; + + /** + * 查询刀具库存列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolInventoryDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail) + { + startPage(); + List list = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailList(pwCuttingToolInventoryDetail); + //更新刀具库存信息中的所属仓库 +// for (PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail2 : list) { +// if(null==pwCuttingToolInventoryDetail2.getWarehouseName()){ +// PwCuttingTool pwCuttingTool = pwCuttingToolService.selectPwCuttingToolByName(pwCuttingToolInventoryDetail2.getName(), pwCuttingToolInventoryDetail2.getBrand(), pwCuttingToolInventoryDetail2.getType(), pwCuttingToolInventoryDetail2.getSupplier()); +// if(null!=pwCuttingTool){ +// pwCuttingToolInventoryDetail2.setWarehouseName(pwCuttingTool.getWarehouseName()); +// pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(pwCuttingToolInventoryDetail2); +// } +// } +// } + return getDataTable(list); + } + + /** + * 导出刀具库存列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolInventoryDetail:export')") + @Log(title = "刀具库存", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail) + { + List list = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailList(pwCuttingToolInventoryDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolInventoryDetail.class); + return util.exportExcel(list, "pwCuttingToolInventoryDetail"); + } + + /** + * 获取刀具库存详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolInventoryDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailById(id)); + } + + /** + * 新增刀具库存 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolInventoryDetail:add')") + @Log(title = "刀具库存", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail) + { + + return toAjax(pwCuttingToolInventoryDetailService.insertPwCuttingToolInventoryDetail(pwCuttingToolInventoryDetail)); + } + + /** + * 修改刀具库存 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolInventoryDetail:edit')") + @Log(title = "刀具库存", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail) + { + return toAjax(pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(pwCuttingToolInventoryDetail)); + } + + /** + * 删除刀具库存 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolInventoryDetail:remove')") + @Log(title = "刀具库存", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolInventoryDetailService.deletePwCuttingToolInventoryDetailByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolMaintainController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolMaintainController.java new file mode 100644 index 0000000..ed36f28 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolMaintainController.java @@ -0,0 +1,221 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwCuttingToolApply; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolMaintain; +import com.ruoyi.project.management.domain.PwCuttingToolMaintainDetail; +import com.ruoyi.project.management.domain.PwCuttingToolScrap; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryService; +import com.ruoyi.project.management.service.IPwCuttingToolMaintainDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolMaintainService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具维修申请单Controller + * + * @author zhukangchao + * @date 2022-03-21 + */ +@RestController +@RequestMapping("/management/pwCuttingToolMaintain") +public class PwCuttingToolMaintainController extends BaseController +{ + @Autowired + private IPwCuttingToolMaintainService pwCuttingToolMaintainService; + //用户信息 + @Autowired + private TokenService tokenService; + //维修单详情信息 + @Autowired + private IPwCuttingToolMaintainDetailService pwCuttingToolMaintainDetailService; + //刀具出库单信息 + @Autowired + private IPwCuttingToolDeliveryService pwCuttingToolDeliveryService; + //刀具出库单详情信息 + @Autowired + private IPwCuttingToolDeliveryDetailService pwCuttingToolDeliveryDetailService; + + + /** + * 查询刀具维修申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintain:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolMaintain pwCuttingToolMaintain) + { + startPage(); + List list = pwCuttingToolMaintainService.selectPwCuttingToolMaintainList(pwCuttingToolMaintain); + return getDataTable(list); + } + + /** + * 导出刀具维修申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintain:export')") + @Log(title = "刀具维修申请单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolMaintain pwCuttingToolMaintain) + { + List list = pwCuttingToolMaintainService.selectPwCuttingToolMaintainList(pwCuttingToolMaintain); + ExcelUtil util = new ExcelUtil(PwCuttingToolMaintain.class); + return util.exportExcel(list, "pwCuttingToolMaintain"); + } + + /** + * 获取刀具维修申请单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintain:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolMaintainService.selectPwCuttingToolMaintainById(id)); + } + + /** + * 新增刀具维修申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintain:add')") + @Log(title = "刀具维修申请单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolMaintain pwCuttingToolMaintain) + { + return toAjax(pwCuttingToolMaintainService.insertPwCuttingToolMaintain(pwCuttingToolMaintain)); + } + + /** + * 修改刀具维修申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintain:edit')") + @Log(title = "刀具维修申请单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolMaintain pwCuttingToolMaintain) + { + return toAjax(pwCuttingToolMaintainService.updatePwCuttingToolMaintain(pwCuttingToolMaintain)); + } + + /** + * 删除刀具维修申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintain:remove')") + @Log(title = "刀具维修申请单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolMaintainService.deletePwCuttingToolMaintainByIds(ids)); + } + + + /** + * 审核刀具报废单 + */ + @RequestMapping("/auditPwCuttingToolMaintain") + public AjaxResult auditPwCuttingToolMaintain(Long id){ + PwCuttingToolMaintain cuttingToolMaintain = pwCuttingToolMaintainService.selectPwCuttingToolMaintainById(id); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + cuttingToolMaintain.setStatus("已审核"); + cuttingToolMaintain.setAuditor(user.getNickName()); + int i = pwCuttingToolMaintainService.updatePwCuttingToolMaintain(cuttingToolMaintain); + if(i<1){ + return AjaxResult.error("审核失败"); + } + return AjaxResult.success("审核成功"); + } + + /** + * 申请领料 + */ + @RequestMapping("/maintainForReceives/{ids}") + public AjaxResult maintainForReceives(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + //根据id查询当前领料单下所有的物料 + for (Long id : ids) { + //根据id查询领料单详情 + PwCuttingToolMaintain cuttingToolMaintain = pwCuttingToolMaintainService.selectPwCuttingToolMaintainById(id); + //根据领料单id查询领料单详情信息 + List list = pwCuttingToolMaintainDetailService.selectPwCuttingToolMaintainDetailByMaintainId(id); + if(list.size()==0){ + return AjaxResult.error("此单据下无可领用刀具"); + }else{ + //根据code查询此单据是否领过物料 + PwCuttingToolDelivery toolDelivery = pwCuttingToolDeliveryService.selectPwCuttingToolDeliveryByCode(cuttingToolMaintain.getCode()); + if(null!=toolDelivery){ + return AjaxResult.error("此单据已申请出库"); + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + PwCuttingToolDelivery pwCuttingToolDelivery = new PwCuttingToolDelivery(); + //关联单据(执行单code) + pwCuttingToolDelivery.setCode(cuttingToolMaintain.getCode()); + //项目名称 +// imStockRequisition.setProjectName(pwCuttingToolApply.getName()); + //申请人 + pwCuttingToolDelivery.setUserName(user.getNickName()); + //领料状态 + pwCuttingToolDelivery.setStatus("未出库"); + pwCuttingToolDeliveryService.insertPwCuttingToolDelivery(pwCuttingToolDelivery); + //把当前领料单下所有物料添加到领料单下 + for (PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail : list) { + //创建领料单详情对象,保存该单据下所有的物料(待出库) + PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail = new PwCuttingToolDeliveryDetail(); + //领料单id + pwCuttingToolDeliveryDetail.setDeliveryId(pwCuttingToolDelivery.getId()); + //刀具名称 + pwCuttingToolDeliveryDetail.setName(pwCuttingToolMaintainDetail.getName()); + //刀具品牌 + pwCuttingToolDeliveryDetail.setBrand(pwCuttingToolMaintainDetail.getBrand()); + //规格型号 + pwCuttingToolDeliveryDetail.setType(pwCuttingToolMaintainDetail.getType()); + //单位 + pwCuttingToolDeliveryDetail.setUnit(pwCuttingToolMaintainDetail.getUnit()); + //刀具厂商 + pwCuttingToolDeliveryDetail.setSupplier(pwCuttingToolMaintainDetail.getSupplier()); + //生产厂商 + pwCuttingToolDeliveryDetail.setManufacturer(pwCuttingToolMaintainDetail.getManufacturer()); + //申请数量 + pwCuttingToolDeliveryDetail.setQuantity(pwCuttingToolMaintainDetail.getQuantity()); + //单价 + pwCuttingToolDeliveryDetail.setUnitPrice(pwCuttingToolMaintainDetail.getUnitPrice().doubleValue()); + //总价 + pwCuttingToolDeliveryDetail.setTotalPrices(pwCuttingToolMaintainDetail.getUnitPrice().doubleValue()*pwCuttingToolMaintainDetail.getQuantity()); + //出库状态 + pwCuttingToolDeliveryDetail.setDeliveryStatus("未出库"); + pwCuttingToolDeliveryDetailService.insertPwCuttingToolDeliveryDetail(pwCuttingToolDeliveryDetail); + } + //修改领料单的状态为已申请 + cuttingToolMaintain.setStatus("已申请"); + i = pwCuttingToolMaintainService.updatePwCuttingToolMaintain(cuttingToolMaintain); + } + } + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolMaintainDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolMaintainDetailController.java new file mode 100644 index 0000000..e210a3a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolMaintainDetailController.java @@ -0,0 +1,322 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntry; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolMaintain; +import com.ruoyi.project.management.domain.PwCuttingToolMaintainDetail; +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; +import com.ruoyi.project.management.domain.PwCuttingToolScrap; +import com.ruoyi.project.management.domain.PwCuttingToolScrapDetail; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryService; +import com.ruoyi.project.management.service.IPwCuttingToolMaintainDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolMaintainService; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具维修申请单详情Controller + * + * @author zhukangchao + * @date 2022-03-21 + */ +@RestController +@RequestMapping("/management/pwCuttingToolMaintainDetail") +public class PwCuttingToolMaintainDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolMaintainDetailService pwCuttingToolMaintainDetailService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //用户信息 + @Autowired + private TokenService tokenService; + //维修单信息 + @Autowired + private IPwCuttingToolMaintainService pwCuttingToolMaintainService; + //刀具入库单信息 + @Autowired + private IPwCuttingToolGodownEntryService pwCuttingToolGodownEntryService; + //刀具入库单详情信息 + @Autowired + private IPwCuttingToolGodownEntryDetailService pwCuttingToolGodownEntryDetailService; + + + /** + * 查询刀具维修申请单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintainDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail) + { + startPage(); + List list = pwCuttingToolMaintainDetailService.selectPwCuttingToolMaintainDetailList(pwCuttingToolMaintainDetail); + return getDataTable(list); + } + + /** + * 导出刀具维修申请单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintainDetail:export')") + @Log(title = "刀具维修申请单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail) + { + List list = pwCuttingToolMaintainDetailService.selectPwCuttingToolMaintainDetailList(pwCuttingToolMaintainDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolMaintainDetail.class); + return util.exportExcel(list, "pwCuttingToolMaintainDetail"); + } + + /** + * 获取刀具维修申请单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintainDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolMaintainDetailService.selectPwCuttingToolMaintainDetailById(id)); + } + + /** + * 新增刀具维修申请单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintainDetail:add')") + @Log(title = "刀具维修申请单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail){ + //获取刀具id + if(null==pwCuttingToolMaintainDetail.getCuttingToolId()||"".equals(pwCuttingToolMaintainDetail.getCuttingToolId())){ + return AjaxResult.error("请选择需要领用的刀具"); + } + if(1>pwCuttingToolMaintainDetail.getQuantity()){ + return AjaxResult.error("请输入需要领用的数量"); + } + //根据id获取刀具信息 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(pwCuttingToolMaintainDetail.getCuttingToolId()); + if(null!=cuttingTool){ + //刀具名称 + pwCuttingToolMaintainDetail.setName(cuttingTool.getName()); + //刀具品牌 + pwCuttingToolMaintainDetail.setBrand(cuttingTool.getBrand()); + //规格型号 + pwCuttingToolMaintainDetail.setType(cuttingTool.getType()); + //单位 + pwCuttingToolMaintainDetail.setUnit(cuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolMaintainDetail.setSupplier(cuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolMaintainDetail.setManufacturer(cuttingTool.getManufacturer()); + }else{ + return AjaxResult.error("未查询到刀具信息"); + } + return toAjax(pwCuttingToolMaintainDetailService.insertPwCuttingToolMaintainDetail(pwCuttingToolMaintainDetail)); + } + + /** + * 修改刀具维修申请单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintainDetail:edit')") + @Log(title = "刀具维修申请单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail){ + if(null!=pwCuttingToolMaintainDetail.getCuttingToolId()){ + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(pwCuttingToolMaintainDetail.getCuttingToolId()); + pwCuttingToolMaintainDetail.setNewName(cuttingTool.getName()); + pwCuttingToolMaintainDetail.setNewBrand(cuttingTool.getBrand()); + pwCuttingToolMaintainDetail.setNewType(cuttingTool.getType()); + } + //计算总价 + pwCuttingToolMaintainDetail.setTotalPrice(pwCuttingToolMaintainDetail.getQuantity()*pwCuttingToolMaintainDetail.getUnitPrice()); + return toAjax(pwCuttingToolMaintainDetailService.updatePwCuttingToolMaintainDetail(pwCuttingToolMaintainDetail)); + } + + /** + * 删除刀具维修申请单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolMaintainDetail:remove')") + @Log(title = "刀具维修申请单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolMaintainDetailService.deletePwCuttingToolMaintainDetailByIds(ids)); + } + + /** + * 生成刀具维修单 + */ + @RequestMapping("/addMaintainDetail/{ids}") + public AjaxResult addMaintainDetail(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss-SSS"); + //获取用户信息 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //创建维修单 + PwCuttingToolMaintain pwCuttingToolMaintain = new PwCuttingToolMaintain(); + //维修单编号 + pwCuttingToolMaintain.setCode("WX"+sdf.format(new Date())); + //日期 + pwCuttingToolMaintain.setDate(new Date()); + //申请人 + pwCuttingToolMaintain.setUserName(user.getNickName()); + //状态(初始状态为未申请) + pwCuttingToolMaintain.setStatus("未申请"); + int i = pwCuttingToolMaintainService.insertPwCuttingToolMaintain(pwCuttingToolMaintain); + int j = 0; + if(i<1){ + return AjaxResult.error("生成单据失败"); + }else{ + for (Long long1 : ids) { + PwCuttingToolMaintainDetail maintainDetail = pwCuttingToolMaintainDetailService.selectPwCuttingToolMaintainDetailById(long1); + maintainDetail.setMaintainId(pwCuttingToolMaintain.getId()); + j = pwCuttingToolMaintainDetailService.updatePwCuttingToolMaintainDetail(maintainDetail); + } + } + return toAjax(j); + } + + /** + * 申请入库刀具详情 + */ + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据id查询详情 + if(null==pwCuttingToolMaintainDetail.getUnitPrice()||"".equals(pwCuttingToolMaintainDetail.getUnitPrice())||0==pwCuttingToolMaintainDetail.getUnitPrice()){ + return AjaxResult.error("请输入此刀具的价格"); + } + //判断新刀具名称和编号是否为null,如果为null则不允许申请入库 + if(null==pwCuttingToolMaintainDetail.getNewName()){ + return AjaxResult.error("请选择修磨后的刀具名称"); + } + //根据刀具采购单id查询采购单信息 + PwCuttingToolMaintain pwCuttingToolMaintain = pwCuttingToolMaintainService.selectPwCuttingToolMaintainById(pwCuttingToolMaintainDetail.getMaintainId()); + //根据单据编号查询 + PwCuttingToolGodownEntry godownEntry = pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryByContractCode(pwCuttingToolMaintain.getCode()); + if(null!=godownEntry){ + if("已申请".equals(pwCuttingToolMaintainDetail.getStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建待入库明细 + PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail = new PwCuttingToolGodownEntryDetail(); + //入库单id + pwCuttingToolGodownEntryDetail.setGosownEntryId(godownEntry.getId()); + //刀具名称(新) + pwCuttingToolGodownEntryDetail.setName(pwCuttingToolMaintainDetail.getNewName()); + //刀具品牌 + pwCuttingToolGodownEntryDetail.setBrand(pwCuttingToolMaintainDetail.getNewBrand()); + //规格型号(新) + pwCuttingToolGodownEntryDetail.setType(pwCuttingToolMaintainDetail.getNewType()); + //单位 + pwCuttingToolGodownEntryDetail.setUnit(pwCuttingToolMaintainDetail.getUnit()); + //刀具厂商 + pwCuttingToolGodownEntryDetail.setSupplier(pwCuttingToolMaintainDetail.getSupplier()); + //生产厂商 + pwCuttingToolGodownEntryDetail.setManufacturer(pwCuttingToolMaintainDetail.getManufacturer()); + //单价 + pwCuttingToolGodownEntryDetail.setUnitPrice(pwCuttingToolMaintainDetail.getUnitPrice().doubleValue()); + //申请数量 + pwCuttingToolGodownEntryDetail.setQuantity(pwCuttingToolMaintainDetail.getQuantity()); + //总价 + pwCuttingToolGodownEntryDetail.setTotalPrice(pwCuttingToolMaintainDetail.getUnitPrice()*pwCuttingToolMaintainDetail.getQuantity()); + //申请人 + pwCuttingToolGodownEntryDetail.setUserName(user.getNickName()); + //入库状态 + pwCuttingToolGodownEntryDetail.setGodownEntryStatus("未入库"); + int i = pwCuttingToolGodownEntryDetailService.insertPwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //修改刀具状态 + pwCuttingToolMaintainDetail.setStatus("已申请"); + //总价 + pwCuttingToolMaintainDetail.setTotalPrice(pwCuttingToolMaintainDetail.getUnitPrice()*pwCuttingToolMaintainDetail.getQuantity()); + int j = pwCuttingToolMaintainDetailService.updatePwCuttingToolMaintainDetail(pwCuttingToolMaintainDetail); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + } + }else{ + //添加入库单详情 + if("已申请".equals(pwCuttingToolMaintainDetail.getStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建刀具采购入库单对象 + PwCuttingToolGodownEntry pwCuttingToolGodownEntry = new PwCuttingToolGodownEntry(); + //关联单据编号 + pwCuttingToolGodownEntry.setContractCode(pwCuttingToolMaintain.getCode()); + //入库状态 + pwCuttingToolGodownEntry.setInventoryStatus("未入库"); + pwCuttingToolGodownEntryService.insertPwCuttingToolGodownEntry(pwCuttingToolGodownEntry); + //创建待入库明细 + PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail = new PwCuttingToolGodownEntryDetail(); + //入库单id + pwCuttingToolGodownEntryDetail.setGosownEntryId(pwCuttingToolGodownEntry.getId()); + //刀具名称 + pwCuttingToolGodownEntryDetail.setName(pwCuttingToolMaintainDetail.getNewName()); + //刀具品牌 + pwCuttingToolGodownEntryDetail.setBrand(pwCuttingToolMaintainDetail.getNewBrand()); + //规格型号 + pwCuttingToolGodownEntryDetail.setType(pwCuttingToolMaintainDetail.getNewType()); + //单位 + pwCuttingToolGodownEntryDetail.setUnit(pwCuttingToolMaintainDetail.getUnit()); + //刀具厂商 + pwCuttingToolGodownEntryDetail.setSupplier(pwCuttingToolMaintainDetail.getSupplier()); + //生产厂商 + pwCuttingToolGodownEntryDetail.setManufacturer(pwCuttingToolMaintainDetail.getManufacturer()); + //单价 + pwCuttingToolGodownEntryDetail.setUnitPrice(pwCuttingToolMaintainDetail.getUnitPrice().doubleValue()); + //申请数量 + pwCuttingToolGodownEntryDetail.setQuantity(pwCuttingToolMaintainDetail.getQuantity()); + //总价 + pwCuttingToolGodownEntryDetail.setTotalPrice(pwCuttingToolMaintainDetail.getUnitPrice()*pwCuttingToolMaintainDetail.getQuantity()); + //申请人 + pwCuttingToolGodownEntryDetail.setUserName(user.getNickName()); + //入库状态 + pwCuttingToolGodownEntryDetail.setGodownEntryStatus("未入库"); + int i = pwCuttingToolGodownEntryDetailService.insertPwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //修改刀具状态 + pwCuttingToolMaintainDetail.setStatus("已申请"); + //总价 + pwCuttingToolMaintainDetail.setTotalPrice(pwCuttingToolMaintainDetail.getUnitPrice()*pwCuttingToolMaintainDetail.getQuantity()); + int j = pwCuttingToolMaintainDetailService.updatePwCuttingToolMaintainDetail(pwCuttingToolMaintainDetail); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + } + } + return toAjax(1); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolPurchaseController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolPurchaseController.java new file mode 100644 index 0000000..f2f4249 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolPurchaseController.java @@ -0,0 +1,559 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.MoneyUtil; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 刀具采购申请单Controller + * + * @author zhukangchao + * @date 2022-03-10 + */ +@RestController +@RequestMapping("/management/pwCuttingToolPurchase") +public class PwCuttingToolPurchaseController extends BaseController { + @Autowired + private IPwCuttingToolPurchaseService pwCuttingToolPurchaseService; + //刀具详情信息 + @Autowired + private IPwCuttingToolPurchaseDetailService pwCuttingToolPurchaseDetailService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + @Autowired + private IImSupplierService imSupplierService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //物流费用信息 + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + /** + * 查询刀具采购申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchase:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolPurchase pwCuttingToolPurchase) { + startPage(); + List list = new ArrayList(); + if (null != pwCuttingToolPurchase.getName() && !"".equals(pwCuttingToolPurchase.getName())) { + List list2 = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailByName(pwCuttingToolPurchase.getName()); + for (PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail : list2) { + //根据单据id查询请购单 + PwCuttingToolPurchase purchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(pwCuttingToolPurchaseDetail.getPurchaseId()); + if (null != purchase) { + list.add(purchase); + } + } + } else { + list = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseList(pwCuttingToolPurchase); + } + return getDataTable(list); + } + + /** + * 导出刀具采购申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchase:export')") + @Log(title = "刀具采购申请单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolPurchase pwCuttingToolPurchase) { + List list = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseList(pwCuttingToolPurchase); + ExcelUtil util = new ExcelUtil(PwCuttingToolPurchase.class); + return util.exportExcel(list, "pwCuttingToolPurchase"); + } + + /** + * 获取刀具采购申请单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchase:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(id)); + } + + /** + * 新增刀具采购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchase:add')") + @Log(title = "刀具采购申请单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolPurchase pwCuttingToolPurchase) { + pwCuttingToolPurchase.setContractStatus((long) 1); + pwCuttingToolPurchase.setAppointTime(new Date()); + return toAjax(pwCuttingToolPurchaseService.insertPwCuttingToolPurchase(pwCuttingToolPurchase)); + } + + /** + * 修改刀具采购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchase:edit')") + @Log(title = "刀具采购申请单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolPurchase pwCuttingToolPurchase) { + pwCuttingToolPurchase.setBigTotalPrices(MoneyUtil.toChinese(pwCuttingToolPurchase.getTotalPrices().toString())); + return toAjax(pwCuttingToolPurchaseService.updatePwCuttingToolPurchase(pwCuttingToolPurchase)); + } + + /** + * 删除刀具采购申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchase:remove')") + @Log(title = "刀具采购申请单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + //删除之前先根据id查询此单据下所有的刀具详情 + for (Long id : ids) { + List list = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailByPurchaseId(id); + for (PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail : list) { + pwCuttingToolPurchaseDetail.setPurchaseId(null); + pwCuttingToolPurchaseDetailService.updatePwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); + } + } + return toAjax(pwCuttingToolPurchaseService.deletePwCuttingToolPurchaseByIds(ids)); + } + + /** + * 审核刀具采购单 + */ + @RequestMapping("/auditPwCuttingToolPurchase") + public AjaxResult auditPwCuttingToolPurchase(Long id) { + PwCuttingToolPurchase pwCuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(id); + if (StringUtils.isEmpty(pwCuttingToolPurchase.getDeliveryType()) || StringUtils.isEmpty(pwCuttingToolPurchase.getPayer()) + || StringUtils.isEmpty(pwCuttingToolPurchase.getModeOfPayment()) || 0 == pwCuttingToolPurchase.getTaxRate() + || StringUtils.isEmpty(pwCuttingToolPurchase.getSellerName())) { + return AjaxResult.error("请补全信息"); + } + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + pwCuttingToolPurchase.setStatus("已审核"); + pwCuttingToolPurchase.setAuditor(user.getNickName()); + int i = pwCuttingToolPurchaseService.updatePwCuttingToolPurchase(pwCuttingToolPurchase); + if (i < 1) { + return AjaxResult.error("审核失败"); + } + return AjaxResult.success("审核成功"); + } + + /** + * 打印合同 + * + * @param ids + * @return + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids) { + HashMap printMessageMap = new HashMap<>(); + //根据id获取合同信息 + PwCuttingToolPurchase pwCuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(ids[0]); + if (StringUtils.isEmpty(pwCuttingToolPurchase.getRemark())) { + pwCuttingToolPurchase.setRemark(""); + } + //第一次打印合同时,修改合同时间为当前时间,合同状态为进行时 + if (null == pwCuttingToolPurchase.getAppointTime()) { + pwCuttingToolPurchase.setAppointTime(new Date()); + pwCuttingToolPurchase.setContractStatus(1L); + pwCuttingToolPurchaseService.updatePwCuttingToolPurchase(pwCuttingToolPurchase); + } + //获得产品列表 + List list = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailByPurchaseId(ids[0]); + int i = 1; + for (PwCuttingToolPurchaseDetail pwcutting : list) { + pwcutting.setNum(i); + i++; + } + //根据供应商名称查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierByName(pwCuttingToolPurchase.getSellerName()); + //产品列表 + printMessageMap.put("product", list); + printMessageMap.put("contract", pwCuttingToolPurchase); + printMessageMap.put("supplier", supplier); + return AjaxResult.success("success", printMessageMap); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody PwCuttingToolPurchase pwCuttingToolPurchase) { + //校验付款金额 + if (null == pwCuttingToolPurchase.getPaymentAmount() || "".equals(pwCuttingToolPurchase.getPaymentAmount()) || 0 == pwCuttingToolPurchase.getPaymentAmount()) { + return AjaxResult.error("请填写付款金额"); + } + //获取合同id + Long[] ids = pwCuttingToolPurchase.getIds(); + //供应商名称 + String name = ""; + //合同总金额 + Double d = 0.0; + for (Long id : ids) { + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(id); + //校验当前选中的合同是否为同一个供应商 + if (!"".equals(name)) { + //校验name是否和供应商名称相同 + if (!name.equals(cuttingToolPurchase.getSellerName())) { + return AjaxResult.error("不同供应商不可合并付款"); + } + } else { + name = cuttingToolPurchase.getSellerName(); + } + + //计算合同总金额 + d += cuttingToolPurchase.getTotalPrices(); + } + + //校验付款金额是否大于合同总金额 + if (d < pwCuttingToolPurchase.getPaymentAmount()) { + return AjaxResult.error("付款金额不能大于合同总金额"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //付款申请单 + CwOtherPayment cwOtherPayment = new CwOtherPayment(); + //申请单编号 + cwOtherPayment.setCode("FKSQ-" + sdf.format(new Date())); + //姓名 + cwOtherPayment.setUserName(user.getNickName()); + //部门 + cwOtherPayment.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwOtherPayment.setDateTime(new Date()); + //金额 + cwOtherPayment.setMoney(pwCuttingToolPurchase.getPaymentAmount()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = MoneyUtil.toChinese(cwOtherPayment.getMoney() + ""); + cwOtherPayment.setBigMoney(chinese); + //支付类型 + cwOtherPayment.setSparedOne("付款"); + //单位名称 + cwOtherPayment.setUnitName(name); + //未付款金额(初始为填写的金额) + cwOtherPayment.setNotInvoiceAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //未开票金额(初始为填写的金额) + cwOtherPayment.setNotProceedsAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //结算比例(初始为0) + cwOtherPayment.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwOtherPayment.getUnitName()); + if (null != supplier) { + //账号 + cwOtherPayment.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(supplier.getOpeningBank()); + } else { + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwOtherPayment.getUnitName()); + if (null != employeeInformation) { + //账号 + cwOtherPayment.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(employeeInformation.getOpeningBank()); + } else { + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwOtherPayment.getUnitName()); + if (null != customer) { + //账号 + cwOtherPayment.setAccountNumber(customer.getBankNumber()); + //开户行 + cwOtherPayment.setOpeningBank(customer.getBank()); + } else { + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwOtherPayment.getUnitName()); + if (null != otherCorrespondent) { + //账号 + cwOtherPayment.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(otherCorrespondent.getOpeningBank()); + } else { + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwOtherPaymentService.insertCwOtherPayment(cwOtherPayment); + if (i > 0) { + //生成付款申请单及付款申请单明细 + for (Long id : ids) { + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(id); + + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + //付款单id + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + //付款单编号 + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + //关联合同编号 + cwOtherPaymentInfo.setCode(cuttingToolPurchase.getCode()); + //合同金额 + cwOtherPaymentInfo.setContractMoney(cuttingToolPurchase.getTotalPrices()); + //付款金额(计算) 合同金额*(付款金额/总金额) + cwOtherPaymentInfo.setPaymentAmount(cuttingToolPurchase.getTotalPrices() * (pwCuttingToolPurchase.getPaymentAmount() / d)); + //付款比例(计算) 付款金额/合同金额 + cwOtherPaymentInfo.setProportion(cwOtherPaymentInfo.getPaymentAmount() / cuttingToolPurchase.getTotalPrices() * 100); + //合同类型 + cwOtherPaymentInfo.setSparedOne("工量具采购合同"); + cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + } + return toAjax(i); + } + + /** + * 生成物流费用单 + */ + @RequestMapping("/addLogistics") + public AjaxResult addLogistics(@RequestBody PwCuttingToolPurchase cuttingToolPurchase) { + //校验付款金额 + if (null == cuttingToolPurchase.getMoney() || "".equals(cuttingToolPurchase.getMoney()) || 0 == cuttingToolPurchase.getMoney()) { + return AjaxResult.error("请填写付款金额"); + } + //校验支付方式 + if(null==cuttingToolPurchase.getPayWay()||"".equals(cuttingToolPurchase.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==cuttingToolPurchase.getUnitName()||"".equals(cuttingToolPurchase.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //物料费用单 + CwLogisticsFeesInfo cwLogisticsFeesInfo = new CwLogisticsFeesInfo(); + + //编号 + cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); + //关联单据编号 所勾选的合同编号 + //获取合同id + Long[] ids = cuttingToolPurchase.getIds(); + //拼接合同编号 + String code = ""; + for (Long id : ids) { + PwCuttingToolPurchase cuttingToolPurchase2 = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(id); + code += cuttingToolPurchase2.getCode()+","; + } + cwLogisticsFeesInfo.setRelevanceCode(code); + //单据类型 + cwLogisticsFeesInfo.setRelevanceType("工量具采购合同"); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //小写金额 + cwLogisticsFeesInfo.setMoney(cuttingToolPurchase.getMoney()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(cuttingToolPurchase.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //事由 + cwLogisticsFeesInfo.setCause("采购运费"); + //支付方式 + cwLogisticsFeesInfo.setPayWay(cuttingToolPurchase.getPayWay()); + //单位名称 + cwLogisticsFeesInfo.setUnitName(cuttingToolPurchase.getUnitName()); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(cuttingToolPurchase.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(cuttingToolPurchase.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cuttingToolPurchase.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); + return toAjax(i); + } + + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids) { + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwCuttingToolPurchase purchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(id); + if (purchase.getSellerName() == null || purchase.getSellerName().isEmpty()) { + AjaxResult.error("供应商信息不全,请补充完整"); + } + if (purchase.getTaxRate() == null || purchase.getTaxRate() == 0) { + AjaxResult.error("税率信息不全,请补充完整"); + } + if (purchase.getTotalPrices() == null || purchase.getTaxRate() == 0.0) { + AjaxResult.error("总价不全,请补充完整"); + } + if (purchase.getDeliveryType() == null || purchase.getDeliveryType().isEmpty()) { + AjaxResult.error("交货方式不全,请补充完整"); + } + if (purchase.getPayer() == null || purchase.getPayer().isEmpty()) { + AjaxResult.error("货运费支付方不全,请补充完整"); + } + if (purchase.getModeOfPayment() == null || purchase.getModeOfPayment().isEmpty()) { + AjaxResult.error("货款支付方式不全,请补充完整"); + } + if (null != purchase.getLeadership()) { + purchase.setLeadership(""); + } else { + purchase.setLeadership(user.getNickName()); + //审批时间 + purchase.setLeadershipTime(new Date()); + } + i = pwCuttingToolPurchaseService.updatePwCuttingToolPurchase(purchase); + + //触发金蝶接口 + if (null != purchase.getLeadership() && !"".equals(purchase.getLeadership())) { + + } else { + + } + + } + return toAjax(i); + } + + /* + * 上传合同的PDF + * + * @param id + * @param filePath + * @return + */ + @RequestMapping("/uploadContractPDF") + @ResponseBody + public AjaxResult uploadContractPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { + String originalFilename = filePath.getOriginalFilename(); + if (originalFilename != null) { + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传"); + } else { + PwCuttingToolPurchase pwCuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(Long.valueOf(id)); + //根据id 获取合同信息 + String newfilenname = generateUniqueFileName(originalFilename); + try (InputStream is = filePath.getInputStream(); + //在对应的文件夹下生成新的图片 + FileOutputStream fos = new FileOutputStream("D:/contract/" + newfilenname); + BufferedOutputStream bos = new BufferedOutputStream(fos)) { + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + //映射路径 + pwCuttingToolPurchase.setContractPath(newfilenname); + //更新 + pwCuttingToolPurchaseService.updatePwCuttingToolPurchase(pwCuttingToolPurchase); + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + } + } + } + return AjaxResult.success("文件上传成功"); + + } + + /** + * 生成随机文件名 + * + * @param originalFilename + * @return + */ + private String generateUniqueFileName(String originalFilename) { + String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); + String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); + //生成年月日加 毫秒值的 文件名称 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String date = dateFormat.format(new Date()); + return filename + "_" + date + System.currentTimeMillis() + extension; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolPurchaseDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolPurchaseDetailController.java new file mode 100644 index 0000000..cd661f8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolPurchaseDetailController.java @@ -0,0 +1,423 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntry; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryService; +import com.ruoyi.project.management.service.IPwCuttingToolPurchaseDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolPurchaseService; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具采购详情Controller + * + * @author zhukangchao + * @date 2022-03-09 + */ +@RestController +@RequestMapping("/management/pwCuttingToolPurchaseDetail") +public class PwCuttingToolPurchaseDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolPurchaseDetailService pwCuttingToolPurchaseDetailService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //采购单信息 + @Autowired + private IPwCuttingToolPurchaseService pwCuttingToolPurchaseService; + //用户信息 + @Autowired + private TokenService tokenService; + //刀具入库单信息 + @Autowired + private IPwCuttingToolGodownEntryService pwCuttingToolGodownEntryService; + //刀具入库单详情信息 + @Autowired + private IPwCuttingToolGodownEntryDetailService pwCuttingToolGodownEntryDetailService; + + /** + * 查询刀具采购详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchaseDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail) + { + startPage(); + List list = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailList(pwCuttingToolPurchaseDetail); + return getDataTable(list); + } + + /** + * 导出刀具采购详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchaseDetail:export')") + @Log(title = "刀具采购详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail) + { + List list = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailList(pwCuttingToolPurchaseDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolPurchaseDetail.class); + return util.exportExcel(list, "pwCuttingToolPurchaseDetail"); + } + + /** + * 获取刀具采购详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchaseDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailById(id)); + } + + /** + * 新增刀具采购详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchaseDetail:add')") + @Log(title = "刀具采购详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail){ + //判断是否选择了刀具 + if(null==pwCuttingToolPurchaseDetail.getCuttingToolId()||"".equals(pwCuttingToolPurchaseDetail.getCuttingToolId())){ + return AjaxResult.error("请选择需要采购的刀具"); + } + //判断是否填写了采购数量 + if(null==pwCuttingToolPurchaseDetail.getQuantity()||"".equals(pwCuttingToolPurchaseDetail.getQuantity())||pwCuttingToolPurchaseDetail.getQuantity()==0){ + return AjaxResult.error("请输入需要采购的数量"); + } + //根据id获取刀具信息 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(pwCuttingToolPurchaseDetail.getCuttingToolId()); + if(null!=cuttingTool){ + //刀具名称 + pwCuttingToolPurchaseDetail.setName(cuttingTool.getName()); + //刀具品牌 + pwCuttingToolPurchaseDetail.setBrand(cuttingTool.getBrand()); + //规格型号 + pwCuttingToolPurchaseDetail.setType(cuttingTool.getType()); + //单位 + pwCuttingToolPurchaseDetail.setUnit(cuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolPurchaseDetail.setSupplier(cuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolPurchaseDetail.setManufacturer(cuttingTool.getManufacturer()); + //单价 + pwCuttingToolPurchaseDetail.setUnitPrice(cuttingTool.getUnitPrice()); + //总价(单价*数量) + pwCuttingToolPurchaseDetail.setTotalPrice(cuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolPurchaseDetail.getQuantity()))); + }else{ + return AjaxResult.error("未查询到刀具信息"); + } + return toAjax(pwCuttingToolPurchaseDetailService.insertPwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail)); + } + + /** + * 修改刀具采购详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchaseDetail:edit')") + @Log(title = "刀具采购详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail){ + //判断是否选择了刀具 +// if(null==pwCuttingToolPurchaseDetail.getCuttingToolId()||"".equals(pwCuttingToolPurchaseDetail.getCuttingToolId())){ +// return AjaxResult.error("请选择需要采购的刀具"); +// } + //判断是否填写了采购数量 + if(null==pwCuttingToolPurchaseDetail.getQuantity()||"".equals(pwCuttingToolPurchaseDetail.getQuantity())||pwCuttingToolPurchaseDetail.getQuantity()==0){ + return AjaxResult.error("请输入需要采购的数量"); + } + //根据id获取刀具信息 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(pwCuttingToolPurchaseDetail.getCuttingToolId()); + if(null!=cuttingTool){ + //刀具名称 + pwCuttingToolPurchaseDetail.setName(cuttingTool.getName()); + //刀具品牌 + pwCuttingToolPurchaseDetail.setBrand(cuttingTool.getBrand()); + //规格型号 + pwCuttingToolPurchaseDetail.setType(cuttingTool.getType()); + //单位 + pwCuttingToolPurchaseDetail.setUnit(cuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolPurchaseDetail.setSupplier(cuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolPurchaseDetail.setManufacturer(cuttingTool.getManufacturer()); + //单价 + pwCuttingToolPurchaseDetail.setUnitPrice(cuttingTool.getUnitPrice()); + //总价(单价*数量) + pwCuttingToolPurchaseDetail.setTotalPrice(cuttingTool.getUnitPrice().multiply(new BigDecimal(pwCuttingToolPurchaseDetail.getQuantity()))); + }else{ + return AjaxResult.error("未查询到刀具信息"); + } + int i = pwCuttingToolPurchaseDetailService.updatePwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); + if(i<1){ + return toAjax(i); + } + //判断此刀具是否有采购单id,如果有,根据采购单id查询采购单信息,更新其总价和审核状态 + if(null!=pwCuttingToolPurchaseDetail.getPurchaseId()){ + //刀具采购单信息 + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(pwCuttingToolPurchaseDetail.getPurchaseId()); + //查询此刀具采购单下所有的刀具信息 + List list = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailByPurchaseId(cuttingToolPurchase.getId()); + Double d = 0.0; + for (PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail2 : list) { + d += pwCuttingToolPurchaseDetail2.getTotalPrice().doubleValue(); + } + //总价 + cuttingToolPurchase.setTotalPrices(d); + cuttingToolPurchase.setAuditor(null); + //审核状态 + cuttingToolPurchase.setStatus("未审核"); + int j = pwCuttingToolPurchaseService.updatePwCuttingToolPurchase(cuttingToolPurchase); + return toAjax(j); + }else{ + return toAjax(i); + } + } + + /** + * 删除刀具采购详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolPurchaseDetail:remove')") + @Log(title = "刀具采购详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwCuttingToolPurchaseDetail purchaseDetail = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailById(id); + //判断此刀具是否已入库,如果已入库,则不允许删除,如果已申请,则需要撤销申请 + if(null!=purchaseDetail.getStatus()&&!"".equals(purchaseDetail.getStatus())){ + return AjaxResult.error("删除前,请撤销申请入库"); + } + //判断此刀具是否有采购单id,如果有,根据采购单id查询采购单信息,更新其总价和审核状态 + if(null!=purchaseDetail.getPurchaseId()){ + //刀具采购单信息 + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(purchaseDetail.getPurchaseId()); + cuttingToolPurchase.setTotalPrices(cuttingToolPurchase.getTotalPrices().doubleValue()-purchaseDetail.getTotalPrice().doubleValue()); + cuttingToolPurchase.setAuditor(null); + cuttingToolPurchase.setStatus("未审核"); + pwCuttingToolPurchaseService.updatePwCuttingToolPurchase(cuttingToolPurchase); + } + } + return toAjax(pwCuttingToolPurchaseDetailService.deletePwCuttingToolPurchaseDetailByIds(ids)); + } + + /** + * 生成刀具采购单 + */ + @RequestMapping("/addPurchaseDetail/{ids}") + public AjaxResult addPurchaseDetail(@PathVariable Long[] ids){ + Double d = 0.0; + for (Long id : ids) { + PwCuttingToolPurchaseDetail purchaseDetail = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailById(id); + d += purchaseDetail.getTotalPrice().doubleValue(); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss-SSS"); + //获取用户信息 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //创建采购单 + PwCuttingToolPurchase pwCuttingToolPurchase = new PwCuttingToolPurchase(); + //采购单编号 + pwCuttingToolPurchase.setCode("DJ"+sdf.format(new Date())); + //总价 + pwCuttingToolPurchase.setTotalPrices(d); + //日期 + pwCuttingToolPurchase.setDate(new Date()); + //申请人 + pwCuttingToolPurchase.setUserName(user.getNickName()); + //状态(初始状态为未申请) + pwCuttingToolPurchase.setStatus("未申请"); + int i = pwCuttingToolPurchaseService.insertPwCuttingToolPurchase(pwCuttingToolPurchase); + int j = 0; + if(i<1){ + return AjaxResult.error("生成采购单失败"); + }else{ + for (Long long1 : ids) { + PwCuttingToolPurchaseDetail purchaseDetail = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailById(long1); + purchaseDetail.setPurchaseId(pwCuttingToolPurchase.getId()); + j = pwCuttingToolPurchaseDetailService.updatePwCuttingToolPurchaseDetail(purchaseDetail); + } + } + + return toAjax(j); + } + + /** + * 申请入库刀具详情 + */ + @RequestMapping("/storage/{ids}") + public AjaxResult storage(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + for (Long id : ids) { + //根据id查询详情 + PwCuttingToolPurchaseDetail purchaseDetail = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailById(id); + //根据刀具采购单id查询采购单信息 + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(purchaseDetail.getPurchaseId()); + //根据单据编号查询 + PwCuttingToolGodownEntry godownEntry = pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryByContractCode(cuttingToolPurchase.getCode()); + if(null!=godownEntry){ + if("已申请".equals(purchaseDetail.getStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建待入库明细 + PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail = new PwCuttingToolGodownEntryDetail(); + //入库单id + pwCuttingToolGodownEntryDetail.setGosownEntryId(godownEntry.getId()); + //刀具名称 + pwCuttingToolGodownEntryDetail.setName(purchaseDetail.getName()); + //刀具品牌 + pwCuttingToolGodownEntryDetail.setBrand(purchaseDetail.getBrand()); + //规格型号 + pwCuttingToolGodownEntryDetail.setType(purchaseDetail.getType()); + //单位 + pwCuttingToolGodownEntryDetail.setUnit(purchaseDetail.getUnit()); + //刀具厂商 + pwCuttingToolGodownEntryDetail.setSupplier(purchaseDetail.getSupplier()); + //生产厂商 + pwCuttingToolGodownEntryDetail.setManufacturer(purchaseDetail.getManufacturer()); + //单价 + pwCuttingToolGodownEntryDetail.setUnitPrice(purchaseDetail.getUnitPrice().doubleValue()); + //申请数量 + pwCuttingToolGodownEntryDetail.setQuantity(purchaseDetail.getQuantity()); + //总价 + pwCuttingToolGodownEntryDetail.setTotalPrice(purchaseDetail.getTotalPrice().doubleValue()); + //申请人 +// pwCuttingToolGodownEntryDetail.setUserName(user.getNickName()); + //入库状态 + pwCuttingToolGodownEntryDetail.setGodownEntryStatus("未入库"); + + int i = pwCuttingToolGodownEntryDetailService.insertPwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //修改刀具状态 + purchaseDetail.setStatus("已申请"); + int j = pwCuttingToolPurchaseDetailService.updatePwCuttingToolPurchaseDetail(purchaseDetail); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + } + }else{ + //添加入库单详情 + if("已申请".equals(purchaseDetail.getStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建刀具采购入库单对象 + PwCuttingToolGodownEntry pwCuttingToolGodownEntry = new PwCuttingToolGodownEntry(); + //关联单据编号 + pwCuttingToolGodownEntry.setContractCode(cuttingToolPurchase.getCode()); + //入库状态 + pwCuttingToolGodownEntry.setInventoryStatus("未入库"); + pwCuttingToolGodownEntryService.insertPwCuttingToolGodownEntry(pwCuttingToolGodownEntry); + //创建待入库明细 + PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail = new PwCuttingToolGodownEntryDetail(); + //入库单id + pwCuttingToolGodownEntryDetail.setGosownEntryId(pwCuttingToolGodownEntry.getId()); + //刀具名称 + pwCuttingToolGodownEntryDetail.setName(purchaseDetail.getName()); + //刀具品牌 + pwCuttingToolGodownEntryDetail.setBrand(purchaseDetail.getBrand()); + //规格型号 + pwCuttingToolGodownEntryDetail.setType(purchaseDetail.getType()); + //单位 + pwCuttingToolGodownEntryDetail.setUnit(purchaseDetail.getUnit()); + //刀具厂商 + pwCuttingToolGodownEntryDetail.setSupplier(purchaseDetail.getSupplier()); + //生产厂商 + pwCuttingToolGodownEntryDetail.setManufacturer(purchaseDetail.getManufacturer()); + //单价 + pwCuttingToolGodownEntryDetail.setUnitPrice(purchaseDetail.getUnitPrice().doubleValue()); + //申请数量 + pwCuttingToolGodownEntryDetail.setQuantity(purchaseDetail.getQuantity()); + //总价 + pwCuttingToolGodownEntryDetail.setTotalPrice(purchaseDetail.getTotalPrice().doubleValue()); + //申请人 +// pwCuttingToolGodownEntryDetail.setUserName(user.getNickName()); + //入库状态 + pwCuttingToolGodownEntryDetail.setGodownEntryStatus("未入库"); + + int i = pwCuttingToolGodownEntryDetailService.insertPwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //修改刀具状态 + purchaseDetail.setStatus("已申请"); + int j = pwCuttingToolPurchaseDetailService.updatePwCuttingToolPurchaseDetail(purchaseDetail); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + } + } + } + return toAjax(1); + } + + + /** + * 撤销刀具入库申请 + */ + @RequestMapping("/revocations/{ids}") + public AjaxResult revocations(@PathVariable Long[] ids){ + int j = 0; + for (Long id : ids) { + PwCuttingToolPurchaseDetail purchaseDetail = pwCuttingToolPurchaseDetailService.selectPwCuttingToolPurchaseDetailById(id); + //根据刀具采购单id查询采购单信息 + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseService.selectPwCuttingToolPurchaseById(purchaseDetail.getPurchaseId()); + //根据单据编号查询 + PwCuttingToolGodownEntry godownEntry = pwCuttingToolGodownEntryService.selectPwCuttingToolGodownEntryByContractCode(cuttingToolPurchase.getCode()); + //根据单号和名称和品牌和编号查询入库单详情 + List list = pwCuttingToolGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailByIdAndNameAndBrandAndType(godownEntry.getId(),purchaseDetail.getName(),purchaseDetail.getBrand(),purchaseDetail.getType()); + //是否入库标记 + int i = 0; + for (PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail : list) { + if("已入库".equals(pwCuttingToolGodownEntryDetail.getGodownEntryStatus())){ + i = 1; + } + } + if(i==1){ + //说明有已入库的,不允许撤销 + return AjaxResult.error("已入库的不允许撤销"); + }else{ + //直接删除待入库申请 + for (PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail : list) { + pwCuttingToolGodownEntryDetailService.deletePwCuttingToolGodownEntryDetailById(pwCuttingToolGodownEntryDetail.getId()); + } + //修改采购单详情的申请状态 + purchaseDetail.setStatus(""); + j = pwCuttingToolPurchaseDetailService.updatePwCuttingToolPurchaseDetail(purchaseDetail); + } + } + return toAjax(j); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapController.java new file mode 100644 index 0000000..bb09f8a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapController.java @@ -0,0 +1,306 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwCuttingToolApply; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolScrap; +import com.ruoyi.project.management.domain.PwCuttingToolScrapDetail; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntry; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntryDetail; +import com.ruoyi.project.management.service.IPwCuttingToolScrapDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolScrapGodownEntryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolScrapGodownEntryService; +import com.ruoyi.project.management.service.IPwCuttingToolScrapService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具报废申请单Controller + * + * @author zhukangchao + * @date 2022-03-19 + */ +@RestController +@RequestMapping("/management/pwCuttingToolScrap") +public class PwCuttingToolScrapController extends BaseController +{ + @Autowired + private IPwCuttingToolScrapService pwCuttingToolScrapService; + //用户信息 + @Autowired + private TokenService tokenService; + //报废单详情 + @Autowired + private IPwCuttingToolScrapDetailService pwCuttingToolScrapDetailService; + //刀具报废入库单信息 + @Autowired + private IPwCuttingToolScrapGodownEntryService pwCuttingToolScrapGodownEntryService; + //刀具报废入库单详情信息 + @Autowired + private IPwCuttingToolScrapGodownEntryDetailService pwCuttingToolScrapGodownEntryDetailService; + + + /** + * 查询刀具报废申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrap:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolScrap pwCuttingToolScrap) + { + startPage(); + List list = pwCuttingToolScrapService.selectPwCuttingToolScrapList(pwCuttingToolScrap); + return getDataTable(list); + } + + /** + * 导出刀具报废申请单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrap:export')") + @Log(title = "刀具报废申请单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolScrap pwCuttingToolScrap) + { + List list = pwCuttingToolScrapService.selectPwCuttingToolScrapList(pwCuttingToolScrap); + ExcelUtil util = new ExcelUtil(PwCuttingToolScrap.class); + return util.exportExcel(list, "pwCuttingToolScrap"); + } + + /** + * 获取刀具报废申请单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrap:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolScrapService.selectPwCuttingToolScrapById(id)); + } + + /** + * 新增刀具报废申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrap:add')") + @Log(title = "刀具报废申请单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolScrap pwCuttingToolScrap) + { + return toAjax(pwCuttingToolScrapService.insertPwCuttingToolScrap(pwCuttingToolScrap)); + } + + /** + * 修改刀具报废申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrap:edit')") + @Log(title = "刀具报废申请单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolScrap pwCuttingToolScrap) + { + return toAjax(pwCuttingToolScrapService.updatePwCuttingToolScrap(pwCuttingToolScrap)); + } + + /** + * 删除刀具报废申请单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrap:remove')") + @Log(title = "刀具报废申请单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolScrapService.deletePwCuttingToolScrapByIds(ids)); + } + + /** + * 审核刀具报废单 + */ + @RequestMapping("/auditPwCuttingToolScrap") + public AjaxResult auditPwCuttingToolScrap(Long id){ + PwCuttingToolScrap cuttingToolScrap = pwCuttingToolScrapService.selectPwCuttingToolScrapById(id); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + cuttingToolScrap.setStatus("已审核"); + cuttingToolScrap.setAuditor(user.getNickName()); + int i = pwCuttingToolScrapService.updatePwCuttingToolScrap(cuttingToolScrap); + if(i<1){ + return AjaxResult.error("审核失败"); + } + return AjaxResult.success("审核成功"); + } + + /** + * 报废申请入库 + */ + @RequestMapping("/scrapForReceives/{ids}") + public AjaxResult scrapForReceives(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + //根据id查询当前领料单下所有的物料 + for (Long id : ids) { + //根据id查询领料单详情 + PwCuttingToolScrap cuttingToolScrap = pwCuttingToolScrapService.selectPwCuttingToolScrapById(id); + //根据领料单id查询领料单详情信息 + List list = pwCuttingToolScrapDetailService.selectPwCuttingToolScrapDetailByScrapId(id); + if(list.size()==0){ + return AjaxResult.error("此单据下无可入库刀具"); + }else{ + //根据code查询此单据是否领过物料 + PwCuttingToolScrapGodownEntry scrapGodownEntry = pwCuttingToolScrapGodownEntryService.selectPwCuttingToolScrapGodownEntryByCode(cuttingToolScrap.getCode()); + if(null!=scrapGodownEntry){ + return AjaxResult.error("此单据已申请入库"); + }else{ + //说明是此单据是第一次入库 + //创建领料单对象 + PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry = new PwCuttingToolScrapGodownEntry(); + //关联单据(执行单code) + pwCuttingToolScrapGodownEntry.setContractCode(cuttingToolScrap.getCode()); + //项目名称 +// imStockRequisition.setProjectName(pwCuttingToolApply.getName()); + //申请人 + pwCuttingToolScrapGodownEntry.setSeller(user.getNickName()); + //领料状态 + pwCuttingToolScrapGodownEntry.setInventoryStatus("未入库"); + //备注 + pwCuttingToolScrapGodownEntry.setRemarks("报废"); + pwCuttingToolScrapGodownEntryService.insertPwCuttingToolScrapGodownEntry(pwCuttingToolScrapGodownEntry); + //把当前领料单下所有物料添加到领料单下 + for (PwCuttingToolScrapDetail pwCuttingToolScrapDetail : list) { + //创建入库单详情对象,保存该单据下所有的物料(待入库) + PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail = new PwCuttingToolScrapGodownEntryDetail(); + //入库单id + pwCuttingToolScrapGodownEntryDetail.setGosownEntryId(pwCuttingToolScrapGodownEntry.getId()); + //添加报废标识 + String name = pwCuttingToolScrapDetail.getName()+"-报废"; + //刀具名称 + pwCuttingToolScrapGodownEntryDetail.setName(name); + //刀具品牌 + pwCuttingToolScrapGodownEntryDetail.setBrand(pwCuttingToolScrapDetail.getBrand()); + //规格型号 + pwCuttingToolScrapGodownEntryDetail.setType(pwCuttingToolScrapDetail.getType()); + //单位 + pwCuttingToolScrapGodownEntryDetail.setUnit(pwCuttingToolScrapDetail.getUnit()); + //刀具厂商 + pwCuttingToolScrapGodownEntryDetail.setSupplier(pwCuttingToolScrapDetail.getSupplier()); + //生产厂商 + pwCuttingToolScrapGodownEntryDetail.setManufacturer(pwCuttingToolScrapDetail.getManufacturer()); + //申请数量 + pwCuttingToolScrapGodownEntryDetail.setQuantity(pwCuttingToolScrapDetail.getQuantity()); + //入库状态 + pwCuttingToolScrapGodownEntryDetail.setGodownEntryStatus("未入库"); + //备注 + pwCuttingToolScrapGodownEntryDetail.setRemarks("报废"); + pwCuttingToolScrapGodownEntryDetailService.insertPwCuttingToolScrapGodownEntryDetail(pwCuttingToolScrapGodownEntryDetail); + } + //修改领料单的状态为已申请 + cuttingToolScrap.setStatus("已申请"); + i =pwCuttingToolScrapService.updatePwCuttingToolScrap(cuttingToolScrap); + } + } + } + return toAjax(i); + } + + /** + * 维修申请入库 + */ + @RequestMapping("/maintainForReceives/{ids}") + public AjaxResult maintainForReceives(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + //根据id查询当前领料单下所有的物料 + for (Long id : ids) { + //根据id查询领料单详情 + PwCuttingToolScrap cuttingToolScrap = pwCuttingToolScrapService.selectPwCuttingToolScrapById(id); + //根据领料单id查询领料单详情信息 + List list = pwCuttingToolScrapDetailService.selectPwCuttingToolScrapDetailByScrapId(id); + if(list.size()==0){ + return AjaxResult.error("此单据下无可入库刀具"); + }else{ + //根据code查询此单据是否领过物料 + PwCuttingToolScrapGodownEntry scrapGodownEntry = pwCuttingToolScrapGodownEntryService.selectPwCuttingToolScrapGodownEntryByCode(cuttingToolScrap.getCode()); + if(null!=scrapGodownEntry){ + return AjaxResult.error("此单据已申请入库"); + }else{ + //说明是此单据是第一次入库 + //创建领料单对象 + PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry = new PwCuttingToolScrapGodownEntry(); + //关联单据(执行单code) + pwCuttingToolScrapGodownEntry.setContractCode(cuttingToolScrap.getCode()); + //项目名称 +// imStockRequisition.setProjectName(pwCuttingToolApply.getName()); + //申请人 + pwCuttingToolScrapGodownEntry.setSeller(user.getNickName()); + //领料状态 + pwCuttingToolScrapGodownEntry.setInventoryStatus("未入库"); + //备注 + pwCuttingToolScrapGodownEntry.setRemarks("维修"); + pwCuttingToolScrapGodownEntryService.insertPwCuttingToolScrapGodownEntry(pwCuttingToolScrapGodownEntry); + //把当前领料单下所有物料添加到领料单下 + for (PwCuttingToolScrapDetail pwCuttingToolScrapDetail : list) { + //创建入库单详情对象,保存该单据下所有的物料(待入库) + PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail = new PwCuttingToolScrapGodownEntryDetail(); + //入库单id + pwCuttingToolScrapGodownEntryDetail.setGosownEntryId(pwCuttingToolScrapGodownEntry.getId()); +// String name = ""; +// //判断是第几次维修 +// if(pwCuttingToolScrapDetail.getName().contains("-1")||pwCuttingToolScrapDetail.getName().contains("-2")||pwCuttingToolScrapDetail.getName().contains("-3")||pwCuttingToolScrapDetail.getName().contains("-4")||pwCuttingToolScrapDetail.getName().contains("-5")){ +// String string = pwCuttingToolScrapDetail.getName().substring(pwCuttingToolScrapDetail.getName().lastIndexOf("-")+1); +// int a = Integer.valueOf(string)+1; +// name = pwCuttingToolScrapDetail.getName().substring(0,pwCuttingToolScrapDetail.getName().lastIndexOf("-"))+"-"+a; +// }else{ +// //添加维修标识 +// name = pwCuttingToolScrapDetail.getName()+"-1"; +// } + //刀具名称 + pwCuttingToolScrapGodownEntryDetail.setName(pwCuttingToolScrapDetail.getName()+"-待修"); + //刀具品牌 + pwCuttingToolScrapGodownEntryDetail.setBrand(pwCuttingToolScrapDetail.getBrand()); + //规格型号 + pwCuttingToolScrapGodownEntryDetail.setType(pwCuttingToolScrapDetail.getType()); + //单位 + pwCuttingToolScrapGodownEntryDetail.setUnit(pwCuttingToolScrapDetail.getUnit()); + //刀具厂商 + pwCuttingToolScrapGodownEntryDetail.setSupplier(pwCuttingToolScrapDetail.getSupplier()); + //生产厂商 + pwCuttingToolScrapGodownEntryDetail.setManufacturer(pwCuttingToolScrapDetail.getManufacturer()); + //申请数量 + pwCuttingToolScrapGodownEntryDetail.setQuantity(pwCuttingToolScrapDetail.getQuantity()); + //入库状态 + pwCuttingToolScrapGodownEntryDetail.setGodownEntryStatus("未入库"); + //备注 + pwCuttingToolScrapGodownEntryDetail.setRemarks("维修"); + pwCuttingToolScrapGodownEntryDetailService.insertPwCuttingToolScrapGodownEntryDetail(pwCuttingToolScrapGodownEntryDetail); + } + //修改领料单的状态为已申请 + cuttingToolScrap.setStatus("已申请"); + i =pwCuttingToolScrapService.updatePwCuttingToolScrap(cuttingToolScrap); + } + } + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapDetailController.java new file mode 100644 index 0000000..7ac8c01 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapDetailController.java @@ -0,0 +1,184 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwCuttingToolApply; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; +import com.ruoyi.project.management.domain.PwCuttingToolScrap; +import com.ruoyi.project.management.domain.PwCuttingToolScrapDetail; +import com.ruoyi.project.management.service.IPwCuttingToolScrapDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolScrapService; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具报废详情Controller + * + * @author zhukangchao + * @date 2022-03-19 + */ +@RestController +@RequestMapping("/management/pwCuttingToolScrapDetail") +public class PwCuttingToolScrapDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolScrapDetailService pwCuttingToolScrapDetailService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //用户信息 + @Autowired + private TokenService tokenService; + //报废单信息 + @Autowired + private IPwCuttingToolScrapService pwCuttingToolScrapService; + + /** + * 查询刀具报废详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolScrapDetail pwCuttingToolScrapDetail) + { + startPage(); + List list = pwCuttingToolScrapDetailService.selectPwCuttingToolScrapDetailList(pwCuttingToolScrapDetail); + return getDataTable(list); + } + + /** + * 导出刀具报废详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapDetail:export')") + @Log(title = "刀具报废详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolScrapDetail pwCuttingToolScrapDetail) + { + List list = pwCuttingToolScrapDetailService.selectPwCuttingToolScrapDetailList(pwCuttingToolScrapDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolScrapDetail.class); + return util.exportExcel(list, "pwCuttingToolScrapDetail"); + } + + /** + * 获取刀具报废详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolScrapDetailService.selectPwCuttingToolScrapDetailById(id)); + } + + /** + * 新增刀具报废详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapDetail:add')") + @Log(title = "刀具报废详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolScrapDetail pwCuttingToolScrapDetail){ + //获取刀具id + if(null==pwCuttingToolScrapDetail.getCuttingToolId()||"".equals(pwCuttingToolScrapDetail.getCuttingToolId())){ + return AjaxResult.error("请选择需要领用的刀具"); + } + if(1>pwCuttingToolScrapDetail.getQuantity()){ + return AjaxResult.error("请输入需要领用的数量"); + } + //根据id获取刀具信息 + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolById(pwCuttingToolScrapDetail.getCuttingToolId()); + if(null!=cuttingTool){ + //刀具名称 + pwCuttingToolScrapDetail.setName(cuttingTool.getName()); + //刀具品牌 + pwCuttingToolScrapDetail.setBrand(cuttingTool.getBrand()); + //规格型号 + pwCuttingToolScrapDetail.setType(cuttingTool.getType()); + //单位 + pwCuttingToolScrapDetail.setUnit(cuttingTool.getUnit()); + //刀具厂商 + pwCuttingToolScrapDetail.setSupplier(cuttingTool.getSupplier()); + //生产厂商 + pwCuttingToolScrapDetail.setManufacturer(cuttingTool.getManufacturer()); + }else{ + return AjaxResult.error("未查询到刀具信息"); + } + return toAjax(pwCuttingToolScrapDetailService.insertPwCuttingToolScrapDetail(pwCuttingToolScrapDetail)); + } + + /** + * 修改刀具报废详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapDetail:edit')") + @Log(title = "刀具报废详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolScrapDetail pwCuttingToolScrapDetail) + { + return toAjax(pwCuttingToolScrapDetailService.updatePwCuttingToolScrapDetail(pwCuttingToolScrapDetail)); + } + + /** + * 删除刀具报废详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapDetail:remove')") + @Log(title = "刀具报废详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolScrapDetailService.deletePwCuttingToolScrapDetailByIds(ids)); + } + + /** + * 生成刀具领用单 + */ + @RequestMapping("/addScrapDetail/{ids}") + public AjaxResult addScrapDetail(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss-SSS"); + //获取用户信息 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //创建领用单 + PwCuttingToolScrap pwCuttingToolScrap = new PwCuttingToolScrap(); + //报废单编号 + pwCuttingToolScrap.setCode("BF(WX)"+sdf.format(new Date())); + //日期 + pwCuttingToolScrap.setDate(new Date()); + //申请人 + pwCuttingToolScrap.setUserName(user.getNickName()); + //状态(初始状态为未申请) + pwCuttingToolScrap.setStatus("未申请"); + int i = pwCuttingToolScrapService.insertPwCuttingToolScrap(pwCuttingToolScrap); + int j = 0; + if(i<1){ + return AjaxResult.error("生成单据失败"); + }else{ + for (Long long1 : ids) { + PwCuttingToolScrapDetail cuttingToolScrapDetail = pwCuttingToolScrapDetailService.selectPwCuttingToolScrapDetailById(long1); + cuttingToolScrapDetail.setScrapId(pwCuttingToolScrap.getId()); + j = pwCuttingToolScrapDetailService.updatePwCuttingToolScrapDetail(cuttingToolScrapDetail); + } + } + return toAjax(j); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapGodownEntryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapGodownEntryController.java new file mode 100644 index 0000000..c3bdd78 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapGodownEntryController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntry; +import com.ruoyi.project.management.service.IPwCuttingToolScrapGodownEntryService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具报废入库单Controller + * + * @author zhukangchao + * @date 2022-03-19 + */ +@RestController +@RequestMapping("/management/pwCuttingToolScrapGodownEntry") +public class PwCuttingToolScrapGodownEntryController extends BaseController +{ + @Autowired + private IPwCuttingToolScrapGodownEntryService pwCuttingToolScrapGodownEntryService; + + /** + * 查询刀具报废入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapGodownEntry:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry) + { + startPage(); + List list = pwCuttingToolScrapGodownEntryService.selectPwCuttingToolScrapGodownEntryList(pwCuttingToolScrapGodownEntry); + return getDataTable(list); + } + + /** + * 导出刀具报废入库单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapGodownEntry:export')") + @Log(title = "刀具报废入库单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry) + { + List list = pwCuttingToolScrapGodownEntryService.selectPwCuttingToolScrapGodownEntryList(pwCuttingToolScrapGodownEntry); + ExcelUtil util = new ExcelUtil(PwCuttingToolScrapGodownEntry.class); + return util.exportExcel(list, "pwCuttingToolScrapGodownEntry"); + } + + /** + * 获取刀具报废入库单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapGodownEntry:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolScrapGodownEntryService.selectPwCuttingToolScrapGodownEntryById(id)); + } + + /** + * 新增刀具报废入库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapGodownEntry:add')") + @Log(title = "刀具报废入库单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry) + { + return toAjax(pwCuttingToolScrapGodownEntryService.insertPwCuttingToolScrapGodownEntry(pwCuttingToolScrapGodownEntry)); + } + + /** + * 修改刀具报废入库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapGodownEntry:edit')") + @Log(title = "刀具报废入库单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry) + { + return toAjax(pwCuttingToolScrapGodownEntryService.updatePwCuttingToolScrapGodownEntry(pwCuttingToolScrapGodownEntry)); + } + + /** + * 删除刀具报废入库单 + */ + @PreAuthorize("@ss.hasPermi('management:pwCuttingToolScrapGodownEntry:remove')") + @Log(title = "刀具报废入库单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolScrapGodownEntryService.deletePwCuttingToolScrapGodownEntryByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapGodownEntryDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapGodownEntryDetailController.java new file mode 100644 index 0000000..8973eea --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwCuttingToolScrapGodownEntryDetailController.java @@ -0,0 +1,337 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntry; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolInventoryDetail; +import com.ruoyi.project.management.domain.PwCuttingToolMaintainDetail; +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntry; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntryDetail; +import com.ruoyi.project.management.service.IPwCuttingToolInventoryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolMaintainDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolPurchaseDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolScrapGodownEntryDetailService; +import com.ruoyi.project.management.service.IPwCuttingToolScrapGodownEntryService; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 刀具报废入库详情Controller + * + * @author zhukangchao + * @date 2022-03-19 + */ +@RestController +@RequestMapping("/management/cuttingToolScrapGodownEntryDe") +public class PwCuttingToolScrapGodownEntryDetailController extends BaseController +{ + @Autowired + private IPwCuttingToolScrapGodownEntryDetailService pwCuttingToolScrapGodownEntryDetailService; + //用户信息 + @Autowired + private TokenService tokenService; + //刀具库存信息 + @Autowired + private IPwCuttingToolInventoryDetailService pwCuttingToolInventoryDetailService; + //报废入库单信息 + @Autowired + private IPwCuttingToolScrapGodownEntryService pwCuttingToolScrapGodownEntryService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + //刀具采购单详情 + @Autowired + private IPwCuttingToolPurchaseDetailService pwCuttingToolPurchaseDetailService; + @Autowired + private IPwCuttingToolMaintainDetailService pwCuttingToolMaintainDetailService; + + /** + * 查询刀具报废入库详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:cuttingToolScrapGodownEntryDe:list')") + @GetMapping("/list") + public TableDataInfo list(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail) + { + startPage(); + List list = pwCuttingToolScrapGodownEntryDetailService.selectPwCuttingToolScrapGodownEntryDetailList(pwCuttingToolScrapGodownEntryDetail); + return getDataTable(list); + } + + /** + * 导出刀具报废入库详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:cuttingToolScrapGodownEntryDe:export')") + @Log(title = "刀具报废入库详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail) + { + List list = pwCuttingToolScrapGodownEntryDetailService.selectPwCuttingToolScrapGodownEntryDetailList(pwCuttingToolScrapGodownEntryDetail); + ExcelUtil util = new ExcelUtil(PwCuttingToolScrapGodownEntryDetail.class); + return util.exportExcel(list, "cuttingToolScrapGodownEntryDe"); + } + + /** + * 获取刀具报废入库详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:cuttingToolScrapGodownEntryDe:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwCuttingToolScrapGodownEntryDetailService.selectPwCuttingToolScrapGodownEntryDetailById(id)); + } + + /** + * 新增刀具报废入库详情 + */ + @PreAuthorize("@ss.hasPermi('management:cuttingToolScrapGodownEntryDe:add')") + @Log(title = "刀具报废入库详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail) + { + return toAjax(pwCuttingToolScrapGodownEntryDetailService.insertPwCuttingToolScrapGodownEntryDetail(pwCuttingToolScrapGodownEntryDetail)); + } + + /** + * 修改刀具报废入库详情 + */ + @PreAuthorize("@ss.hasPermi('management:cuttingToolScrapGodownEntryDe:edit')") + @Log(title = "刀具报废入库详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail) + { + return toAjax(pwCuttingToolScrapGodownEntryDetailService.updatePwCuttingToolScrapGodownEntryDetail(pwCuttingToolScrapGodownEntryDetail)); + } + + /** + * 删除刀具报废入库详情 + */ + @PreAuthorize("@ss.hasPermi('management:cuttingToolScrapGodownEntryDe:remove')") + @Log(title = "刀具报废入库详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwCuttingToolScrapGodownEntryDetailService.deletePwCuttingToolScrapGodownEntryDetailByIds(ids)); + } + + /** + * 确认入库 + * @param ids + * @return + */ + @RequestMapping("/affirms/{ids}") + public AjaxResult affirms(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + //根据id查询刀具信息 + PwCuttingToolScrapGodownEntryDetail cuttingToolScrapGodownEntryDetail = pwCuttingToolScrapGodownEntryDetailService.selectPwCuttingToolScrapGodownEntryDetailById(id); + + if(cuttingToolScrapGodownEntryDetail.getGodownEntryStatus().equals("已入库")){ + return AjaxResult.error("无需重复入库"); + } + + //根据刀具名称和品牌和规格型号查询库存信息 + PwCuttingToolInventoryDetail inventoryDetail = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(cuttingToolScrapGodownEntryDetail.getName(), cuttingToolScrapGodownEntryDetail.getBrand(), cuttingToolScrapGodownEntryDetail.getType()); + if(null==inventoryDetail){ + inventoryDetail = new PwCuttingToolInventoryDetail(); + //名称 + inventoryDetail.setName(cuttingToolScrapGodownEntryDetail.getName()); + //品牌 + inventoryDetail.setBrand(cuttingToolScrapGodownEntryDetail.getBrand()); + //规格型号 + inventoryDetail.setType(cuttingToolScrapGodownEntryDetail.getType()); + //计量单位 + inventoryDetail.setUnit(cuttingToolScrapGodownEntryDetail.getUnit()); + //刀具厂商 + inventoryDetail.setSupplier(cuttingToolScrapGodownEntryDetail.getSupplier()); + //生产厂商 + inventoryDetail.setManufacturer(cuttingToolScrapGodownEntryDetail.getManufacturer()); + if(inventoryDetail.getName().contains("-报废")){ + //数量 + inventoryDetail.setQuantity(cuttingToolScrapGodownEntryDetail.getQuantity()); + //报废标记 + inventoryDetail.setScrap("报废"); + }else{ + //数量 + inventoryDetail.setQuantity(cuttingToolScrapGodownEntryDetail.getQuantity()); + //维修标记 + inventoryDetail.setMaintain("待维修"); + } + pwCuttingToolInventoryDetailService.insertPwCuttingToolInventoryDetail(inventoryDetail); + //添加刀具信息 +// PwCuttingTool pwCuttingTool = new PwCuttingTool(); +// //名称 +// pwCuttingTool.setName(inventoryDetail.getName()); +// //品牌 +// pwCuttingTool.setBrand(inventoryDetail.getBrand()); +// //规格型号 +// pwCuttingTool.setType(inventoryDetail.getType()); +// //计量单位 +// pwCuttingTool.setUnit(inventoryDetail.getUnit()); +// //刀具厂商 +// pwCuttingTool.setSupplier(inventoryDetail.getSupplier()); +// //生产厂商 +// pwCuttingTool.setManufacturer(inventoryDetail.getManufacturer()); +// //所属仓库(默认进刀具库) +// pwCuttingTool.setWarehouseName("刀具库"); +// pwCuttingToolService.insertPwCuttingTool(pwCuttingTool); + }else{ + //修改库存数量和在途数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()+cuttingToolScrapGodownEntryDetail.getQuantity()); + //修改库存信息 + pwCuttingToolInventoryDetailService.updatePwCuttingToolInventoryDetail(inventoryDetail); + } + + if(cuttingToolScrapGodownEntryDetail.getName().contains("-报废")){ + //查询产品信息,判断库存数量是否已经触发安全库存 + String replaceAll = cuttingToolScrapGodownEntryDetail.getName().replaceAll("-报废", ""); + PwCuttingTool cuttingTool = pwCuttingToolService.selectPwCuttingToolByName(replaceAll, cuttingToolScrapGodownEntryDetail.getBrand(), cuttingToolScrapGodownEntryDetail.getType(), cuttingToolScrapGodownEntryDetail.getSupplier()); + if(null==cuttingTool){ + + return AjaxResult.error("未查询到此产品信息"); + }else{ + //查询库存信息 + PwCuttingToolInventoryDetail inventoryDetail2 = pwCuttingToolInventoryDetailService.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(replaceAll, cuttingToolScrapGodownEntryDetail.getBrand(), cuttingToolScrapGodownEntryDetail.getType()); + if(null == inventoryDetail2){ + + return AjaxResult.error("未查询到此产品的库存信息"); + }else{ + //判断是否有安全库存设置 + if(cuttingTool.getMinimumNumber()>0&&cuttingTool.getHeightNumber()>0){ + //判断库存数量是否触发安全库存 + if(inventoryDetail2.getQuantity()+inventoryDetail2.getOnPassage()0){ + //判断库存数量是否触发最小维修数量,如果触发最小维修数量,则生成维修单详情信息 + if(cuttingTool.getMaintainNumber()<=inventoryDetail2.getQuantity()){ + //产生维修单详情 + PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail = new PwCuttingToolMaintainDetail(); + //刀具名称 + pwCuttingToolMaintainDetail.setName(cuttingToolScrapGodownEntryDetail.getName()); + //刀具品牌 + pwCuttingToolMaintainDetail.setBrand(cuttingToolScrapGodownEntryDetail.getBrand()); + //规格型号 + pwCuttingToolMaintainDetail.setType(cuttingToolScrapGodownEntryDetail.getType()); + //单位 + pwCuttingToolMaintainDetail.setUnit(cuttingToolScrapGodownEntryDetail.getUnit()); + //刀具厂商 + pwCuttingToolMaintainDetail.setSupplier(cuttingToolScrapGodownEntryDetail.getSupplier()); + //生产厂商 + pwCuttingToolMaintainDetail.setManufacturer(cuttingToolScrapGodownEntryDetail.getManufacturer()); + //数量 + pwCuttingToolMaintainDetail.setQuantity(inventoryDetail2.getQuantity()); + //单价(0) + pwCuttingToolMaintainDetail.setUnitPrice(0.0); + //总价(0) + pwCuttingToolMaintainDetail.setTotalPrice(0.0); + //状态(未维修) + pwCuttingToolMaintainDetail.setStatus("未维修"); + pwCuttingToolMaintainDetailService.insertPwCuttingToolMaintainDetail(pwCuttingToolMaintainDetail); + } + } + } + } + + } + + //修改入库状态 + cuttingToolScrapGodownEntryDetail.setGodownEntryStatus("已入库"); + //入库人 + cuttingToolScrapGodownEntryDetail.setUserName(user.getNickName()); + //入库时间 + cuttingToolScrapGodownEntryDetail.setGodownEntryDate(new Date()); + i = pwCuttingToolScrapGodownEntryDetailService.updatePwCuttingToolScrapGodownEntryDetail(cuttingToolScrapGodownEntryDetail); + if(i<1){ + return AjaxResult.error("入库失败"); + } + //查询此入库单下所有的刀具明细 + List list = pwCuttingToolScrapGodownEntryDetailService.selectPwCuttingToolGodownEntryDetailByGosownEntryId(cuttingToolScrapGodownEntryDetail.getGosownEntryId()); + int s = 0; + for (PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail : list) { + if(!("已入库").equals(pwCuttingToolScrapGodownEntryDetail.getGodownEntryStatus())){ + s = 1; + break; + } + } + if(s == 0){ + //说明此单据下的刀具都已入库,则需要修改入库单的状态 + PwCuttingToolScrapGodownEntry scrapGodownEntry = pwCuttingToolScrapGodownEntryService.selectPwCuttingToolScrapGodownEntryById(cuttingToolScrapGodownEntryDetail.getGosownEntryId()); + scrapGodownEntry.setInventoryStatus("已入库"); + pwCuttingToolScrapGodownEntryService.updatePwCuttingToolScrapGodownEntry(scrapGodownEntry); + } + } + return toAjax(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwDanceNotStandardController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwDanceNotStandardController.java new file mode 100644 index 0000000..dfe62c3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwDanceNotStandardController.java @@ -0,0 +1,181 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.List; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.IImMaterialGroupService; +import com.ruoyi.project.management.service.IImMaterialTypeService; +import com.ruoyi.project.management.service.IImMeteringUnitService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.service.IPwDanceNotStandardService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 舞非型号Controller + * + * @author zhukangchao + * @date 2021-08-02 + */ +@RestController +@RequestMapping("/management/pwDanceNotStandard") +public class PwDanceNotStandardController extends BaseController +{ + @Autowired + private IPwDanceNotStandardService pwDanceNotStandardService; + //用户标识信息 + @Autowired + private TokenService tokenService; + //存货类别 + @Autowired + private IImMaterialTypeService imMaterialTypeService; + //计量单位 + @Autowired + private IImMeteringUnitService imMeteringUnitService; + //物料分组 + @Autowired + private IImMaterialGroupService imMaterialGroupService; + /** + * 查询舞非型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwDanceNotStandard:list')") + @GetMapping("/list") + public TableDataInfo list(PwDanceNotStandard pwDanceNotStandard) + { + startPage(); + List list = pwDanceNotStandardService.selectPwDanceNotStandardList(pwDanceNotStandard); + return getDataTable(list); + } + + /** + * 导出舞非型号列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwDanceNotStandard:export')") + @Log(title = "舞非型号", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwDanceNotStandard pwDanceNotStandard) + { + List list = pwDanceNotStandardService.selectPwDanceNotStandardList(pwDanceNotStandard); + ExcelUtil util = new ExcelUtil(PwDanceNotStandard.class); + return util.exportExcel(list, "pwDanceNotStandard"); + } + + /** + * 获取舞非型号详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwDanceNotStandard:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwDanceNotStandardService.selectPwDanceNotStandardById(id)); + } + + /** + * 新增舞非型号 + */ + @PreAuthorize("@ss.hasPermi('management:pwDanceNotStandard:add')") + @Log(title = "舞非型号", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwDanceNotStandard pwDanceNotStandard) + { + return toAjax(pwDanceNotStandardService.insertPwDanceNotStandard(pwDanceNotStandard)); + } + + /** + * 修改舞非型号 + */ + @PreAuthorize("@ss.hasPermi('management:pwDanceNotStandard:edit')") + @Log(title = "舞非型号", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwDanceNotStandard pwDanceNotStandard) + { + return toAjax(pwDanceNotStandardService.updatePwDanceNotStandard(pwDanceNotStandard)); + } + + /** + * 删除舞非型号 + */ + @PreAuthorize("@ss.hasPermi('management:pwDanceNotStandard:remove')") + @Log(title = "舞非型号", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwDanceNotStandardService.deletePwDanceNotStandardByIds(ids)); + } + + + /** + * 根据型号全称查询详细信息 + * 参数:typeName + */ + @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") + @RequestMapping("/getPwDanceNotStandardByType") + public AjaxResult getPwDanceNotStandardByType(String type){ + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //根据型号全称查询型号信息 + PwDanceNotStandard danceNotStandard = pwDanceNotStandardService.selectPwDanceNotStandardByType(type); + if(null==danceNotStandard){ + return AjaxResult.error("暂无此型号"); + } + danceNotStandard.setVipLevel(vipLevel); + return AjaxResult.success(danceNotStandard); + } + + /** + * 上传WF图纸文件 + */ + @RequestMapping("/uploadWF") + @ResponseBody + public AjaxResult uploadWF(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + //判断是否是dwg文件 + if("dwg".equals(postfix)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/evoEngine/evo_engine/dwg/WF/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwDefectiveMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwDefectiveMaterialController.java new file mode 100644 index 0000000..e0e808d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwDefectiveMaterialController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwDefectiveMaterial; +import com.ruoyi.project.management.service.IPwDefectiveMaterialService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 残料Controller + * + * @author zhukangchao + * @date 2022-12-14 + */ +@RestController +@RequestMapping("/management/pwDefectiveMaterial") +public class PwDefectiveMaterialController extends BaseController +{ + @Autowired + private IPwDefectiveMaterialService pwDefectiveMaterialService; + + /** + * 查询残料列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwDefectiveMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(PwDefectiveMaterial pwDefectiveMaterial) + { + startPage(); + List list = pwDefectiveMaterialService.selectPwDefectiveMaterialList(pwDefectiveMaterial); + return getDataTable(list); + } + + /** + * 导出残料列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwDefectiveMaterial:export')") + @Log(title = "残料", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwDefectiveMaterial pwDefectiveMaterial) + { + List list = pwDefectiveMaterialService.selectPwDefectiveMaterialList(pwDefectiveMaterial); + ExcelUtil util = new ExcelUtil(PwDefectiveMaterial.class); + return util.exportExcel(list, "pwDefectiveMaterial"); + } + + /** + * 获取残料详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwDefectiveMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwDefectiveMaterialService.selectPwDefectiveMaterialById(id)); + } + + /** + * 新增残料 + */ + @PreAuthorize("@ss.hasPermi('management:pwDefectiveMaterial:add')") + @Log(title = "残料", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwDefectiveMaterial pwDefectiveMaterial) + { + return toAjax(pwDefectiveMaterialService.insertPwDefectiveMaterial(pwDefectiveMaterial)); + } + + /** + * 修改残料 + */ + @PreAuthorize("@ss.hasPermi('management:pwDefectiveMaterial:edit')") + @Log(title = "残料", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwDefectiveMaterial pwDefectiveMaterial) + { + return toAjax(pwDefectiveMaterialService.updatePwDefectiveMaterial(pwDefectiveMaterial)); + } + + /** + * 删除残料 + */ + @PreAuthorize("@ss.hasPermi('management:pwDefectiveMaterial:remove')") + @Log(title = "残料", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwDefectiveMaterialService.deletePwDefectiveMaterialByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwEquipmentInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwEquipmentInfoController.java new file mode 100644 index 0000000..f84ff91 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwEquipmentInfoController.java @@ -0,0 +1,118 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwEquipmentInfo; +import com.ruoyi.project.management.service.IPwEquipmentInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 生产设备信息Controller + * + * @author zhukangchao + * @date 2023-08-01 + */ +@RestController +@RequestMapping("/management/pwEquipmentInfo") +public class PwEquipmentInfoController extends BaseController +{ + @Autowired + private IPwEquipmentInfoService pwEquipmentInfoService; + + /** + * 查询生产设备信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwEquipmentInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwEquipmentInfo pwEquipmentInfo) + { + startPage(); + List list = pwEquipmentInfoService.selectPwEquipmentInfoList(pwEquipmentInfo); + return getDataTable(list); + } + + /** + * 导出生产设备信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwEquipmentInfo:export')") + @Log(title = "生产设备信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwEquipmentInfo pwEquipmentInfo) + { + List list = pwEquipmentInfoService.selectPwEquipmentInfoList(pwEquipmentInfo); + ExcelUtil util = new ExcelUtil(PwEquipmentInfo.class); + return util.exportExcel(list, "pwEquipmentInfo"); + } + + /** + * 获取生产设备信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwEquipmentInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwEquipmentInfoService.selectPwEquipmentInfoById(id)); + } + + /** + * 新增生产设备信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwEquipmentInfo:add')") + @Log(title = "生产设备信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwEquipmentInfo pwEquipmentInfo){ + //根据设备编号查询,设备编号必须唯一 + PwEquipmentInfo equipmentInfo = new PwEquipmentInfo(); + equipmentInfo.setCode(pwEquipmentInfo.getCode()); + List list = pwEquipmentInfoService.selectPwEquipmentInfoList(equipmentInfo); + if(list.size()>1){ + return AjaxResult.error("此设备编号已存在,请重新编号"); + } + + return toAjax(pwEquipmentInfoService.insertPwEquipmentInfo(pwEquipmentInfo)); + } + + /** + * 修改生产设备信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwEquipmentInfo:edit')") + @Log(title = "生产设备信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwEquipmentInfo pwEquipmentInfo){ + //根据设备编号查询,设备编号必须唯一 + PwEquipmentInfo equipmentInfo = new PwEquipmentInfo(); + equipmentInfo.setCode(pwEquipmentInfo.getCode()); + List list = pwEquipmentInfoService.selectPwEquipmentInfoList(equipmentInfo); + for (PwEquipmentInfo pwEquipmentInfo2 : list) { + if(pwEquipmentInfo2.getId()!=pwEquipmentInfo.getId()){ + return AjaxResult.error("此设备编号已存在,请重新编号"); + } + } + return toAjax(pwEquipmentInfoService.updatePwEquipmentInfo(pwEquipmentInfo)); + } + + /** + * 删除生产设备信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwEquipmentInfo:remove')") + @Log(title = "生产设备信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwEquipmentInfoService.deletePwEquipmentInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersController.java new file mode 100644 index 0000000..77da8d6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersController.java @@ -0,0 +1,173 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; +import com.ruoyi.project.management.domain.PwFuturesOrders; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetail; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetailTwo; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionService; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailService; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailTwoService; +import com.ruoyi.project.management.service.IPwFuturesOrdersService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 预采购单Controller + * + * @author zhukangchao + * @date 2022-06-22 + */ +@RestController +@RequestMapping("/management/pwFuturesOrders") +public class PwFuturesOrdersController extends BaseController +{ + @Autowired + private IPwFuturesOrdersService pwFuturesOrdersService; + //预采购单明细信息 + @Autowired + private IPwFuturesOrdersDetailService pwFuturesOrdersDetailService; + @Autowired + private IPwFuturesOrdersDetailTwoService pwFuturesOrdersDetailTwoService; + //请购单信息 + @Autowired + private IPwBuyingRequisitionService pwBuyingRequisitionService; + //请购单详情信息 + @Autowired + private IPwBuyingRequisitionMaterialService pwBuyingRequisitionMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + + /** + * 查询预采购单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrders:list')") + @GetMapping("/list") + public TableDataInfo list(PwFuturesOrders pwFuturesOrders) + { + startPage(); + List list = pwFuturesOrdersService.selectPwFuturesOrdersList(pwFuturesOrders); + return getDataTable(list); + } + + /** + * 导出预采购单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrders:export')") + @Log(title = "预采购单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwFuturesOrders pwFuturesOrders) + { + List list = pwFuturesOrdersService.selectPwFuturesOrdersList(pwFuturesOrders); + ExcelUtil util = new ExcelUtil(PwFuturesOrders.class); + return util.exportExcel(list, "pwFuturesOrders"); + } + + /** + * 获取预采购单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrders:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwFuturesOrdersService.selectPwFuturesOrdersById(id)); + } + + /** + * 新增预采购单 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrders:add')") + @Log(title = "预采购单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwFuturesOrders pwFuturesOrders) + { + return toAjax(pwFuturesOrdersService.insertPwFuturesOrders(pwFuturesOrders)); + } + + /** + * 修改预采购单 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrders:edit')") + @Log(title = "预采购单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwFuturesOrders pwFuturesOrders) + { + return toAjax(pwFuturesOrdersService.updatePwFuturesOrders(pwFuturesOrders)); + } + + /** + * 删除预采购单 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrders:remove')") + @Log(title = "预采购单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //删除之前把详情表也删掉 + for (Long id : ids) { + PwFuturesOrders futuresOrders = pwFuturesOrdersService.selectPwFuturesOrdersById(id); + List list = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCode(futuresOrders.getCode()); + for (PwFuturesOrdersDetail pwFuturesOrdersDetail : list) { + pwFuturesOrdersDetailService.deletePwFuturesOrdersDetailById(pwFuturesOrdersDetail.getId()); + } + //根据code查询详情表2 + List list2 = pwFuturesOrdersDetailTwoService.selectPwFuturesOrdersDetailTwoByCode(futuresOrders.getCode()); + for (PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo : list2) { + pwFuturesOrdersDetailTwoService.deletePwFuturesOrdersDetailTwoById(pwFuturesOrdersDetailTwo.getId()); + } + } + return toAjax(pwFuturesOrdersService.deletePwFuturesOrdersByIds(ids)); + } + + /** + * 审核预采购单,审核之后生成采购单 + */ + + @RequestMapping("/audits/{ids}") + public AjaxResult audits(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + PwFuturesOrders futuresOrders = pwFuturesOrdersService.selectPwFuturesOrdersById(id); + if("已审核".equals(futuresOrders.getStatus())){ + futuresOrders.setStatus("未审核"); + }else{ + futuresOrders.setStatus("已审核"); + } + i = pwFuturesOrdersService.updatePwFuturesOrders(futuresOrders); + } + return toAjax(i); + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersDetailController.java new file mode 100644 index 0000000..9e8fad4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersDetailController.java @@ -0,0 +1,418 @@ +package com.ruoyi.project.management.controller; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; +import com.ruoyi.project.management.domain.PwFuturesOrders; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetail; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionService; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailService; +import com.ruoyi.project.management.service.IPwFuturesOrdersService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 预采购单明细Controller + * + * @author zhukangchao + * @date 2022-06-22 + */ +@RestController +@RequestMapping("/management/pwFuturesOrdersDetail") +public class PwFuturesOrdersDetailController extends BaseController +{ + @Autowired + private IPwFuturesOrdersDetailService pwFuturesOrdersDetailService; + @Autowired + private IPwFuturesOrdersService pwFuturesOrdersService; + //请购单信息 + @Autowired + private IPwBuyingRequisitionService pwBuyingRequisitionService; + //请购单详情信息 + @Autowired + private IPwBuyingRequisitionMaterialService pwBuyingRequisitionMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + //执行单bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //企标单bom表信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + + /** + * 查询预采购单明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwFuturesOrdersDetail pwFuturesOrdersDetail) + { + startPage(); + if(null!=pwFuturesOrdersDetail.getName()){ + pwFuturesOrdersDetail.setOrdersId(null); + } + List list = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailList(pwFuturesOrdersDetail); + return getDataTable(list); + } + + /** + * 导出预采购单明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetail:export')") + @Log(title = "预采购单明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwFuturesOrdersDetail pwFuturesOrdersDetail) + { + List list = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailList(pwFuturesOrdersDetail); + ExcelUtil util = new ExcelUtil(PwFuturesOrdersDetail.class); + return util.exportExcel(list, "pwFuturesOrdersDetail"); + } + + /** + * 获取预采购单明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailById(id)); + } + + /** + * 新增预采购单明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetail:add')") + @Log(title = "预采购单明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwFuturesOrdersDetail pwFuturesOrdersDetail) + { + return toAjax(pwFuturesOrdersDetailService.insertPwFuturesOrdersDetail(pwFuturesOrdersDetail)); + } + + /** + * 修改预采购单明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetail:edit')") + @Log(title = "预采购单明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwFuturesOrdersDetail pwFuturesOrdersDetail){ + //修改之前的数据 + PwFuturesOrdersDetail detail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailById(pwFuturesOrdersDetail.getId()); + + //重新计算总重 + pwFuturesOrdersDetail.setReferenceNumber(pwFuturesOrdersDetail.getPieceWeight()*pwFuturesOrdersDetail.getQuantity()); + + //查询是否已经生成采购单,如果已经生成采购单则需要把对应的采购单也修改掉 + if(null!=pwFuturesOrdersDetail.getStatus()&&pwFuturesOrdersDetail.getStatus().equals("已生成")){ + //查询采购单信息 + List list2 = pwBuyingRequisitionService.selectPwBuyingRequisitionByPurpose(pwFuturesOrdersDetail.getCode()); + for (PwBuyingRequisition pwBuyingRequisition : list2) { + //根据采购单id和名称和图号查询采购单详情信息 + PwBuyingRequisitionMaterial buyingRequisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(pwBuyingRequisition.getId(), pwFuturesOrdersDetail.getName(), pwFuturesOrdersDetail.getFigureNumber()); + if(null!=buyingRequisitionMaterial){ + //判断是否已经申请入库 + if(buyingRequisitionMaterial.getInventoryStatus().equals("已采购")){ + return AjaxResult.error("已经采购的物料不允许修改"); + }else{ + //修改此条信息 + //数量 + buyingRequisitionMaterial.setNumber(pwFuturesOrdersDetail.getQuantity()); + //备注 + buyingRequisitionMaterial.setRemarks(pwFuturesOrdersDetail.getRemarks()); + pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(buyingRequisitionMaterial); + } + } + } + } + if("毫米".equals(pwFuturesOrdersDetail.getUnit())){ + //重新计算采购数量(最小单位) + pwFuturesOrdersDetail.setNumber(pwFuturesOrdersDetail.getQuantity()*1000); + }else if("平方毫米".equals(pwFuturesOrdersDetail.getUnit())){ + //重新计算采购数量(最小单位) + pwFuturesOrdersDetail.setNumber(pwFuturesOrdersDetail.getQuantity()*1000000); + }else{ + //重新计算采购数量(最小单位) + pwFuturesOrdersDetail.setNumber(pwFuturesOrdersDetail.getQuantity()); + } + + //修改在途数量 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwFuturesOrdersDetail.getName(), pwFuturesOrdersDetail.getFigureNumber()); +// if(null!=inventoryDetail){ +// //修改在途 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-detail.getNumber().longValue()+pwFuturesOrdersDetail.getNumber().longValue()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// } + + return toAjax(pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(pwFuturesOrdersDetail)); + } + + /** + * 删除预采购单明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetail:remove')") + @Log(title = "预采购单明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //删除时,释放被锁定的数量 + //限制生成采购单的不能删除,必须先撤销采购单 撤销采购单时就释放了在途数量了 + for (Long id : ids) { + PwFuturesOrdersDetail futuresOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailById(id); + if("已生成".equals(futuresOrdersDetail.getStatus())){ + return AjaxResult.error("已生成采购单的不允许删除,请先撤销采购单"); + } + } + return toAjax(pwFuturesOrdersDetailService.deletePwFuturesOrdersDetailByIds(ids)); + } + + /** + * 生成采购单 + */ + @RequestMapping("/generates/{ids}") + public AjaxResult generates(@PathVariable Long[] ids){ + for (Long id : ids) { + PwFuturesOrdersDetail detail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailById(id); + if(null!=detail.getStatus()&&detail.getStatus().equals("已生成")){ + return AjaxResult.error("不可重复生成采购单"); + } + } + int i = 0; + PwFuturesOrdersDetail detail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailById(ids[0]); + //根据id查询预采购单 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + + PwBuyingRequisition pwBuyingRequisition = new PwBuyingRequisition(); + //令号 + pwBuyingRequisition.setCode("QG"+sdf.format(new Date())); + //名称(默认为原材料) + pwBuyingRequisition.setName("原材料"); + //用途(默认为项目令号) + pwBuyingRequisition.setPurpose(detail.getCode()); + //采购完成时间 + //计算当前日期+3天为采购周期 + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DATE, 3); //得到后一天 + Date date = calendar.getTime(); + pwBuyingRequisition.setDemandDate(date); + //申请人 + pwBuyingRequisition.setProposer(user.getNickName()); + //总价初始值为0 + pwBuyingRequisition.setTotalPrices(0.0); + //请购单状态初始值为1,(待审核状态) + pwBuyingRequisition.setStatus(1); + //生成新的请购单 + i = pwBuyingRequisitionService.insertPwBuyingRequisition(pwBuyingRequisition); + for (Long id : ids) { + PwFuturesOrdersDetail pwFuturesOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailById(id); + + //根据令号和材料名称和图号查询物料信息,把采购完成时间同步到bom表中 + if(pwFuturesOrdersDetail.getCode().contains("QB")){ + //说明是企标单 + List list = pwMakeDocumentsDetailService.selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(pwFuturesOrdersDetail.getCode(), pwFuturesOrdersDetail.getName(), pwFuturesOrdersDetail.getFigureNumber()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + pwMakeDocumentsDetail.setMaterialsDate(pwBuyingRequisition.getDemandDate()); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + }else{ + //说明是执行单 + List list = pwBomNumberTwoService.selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(pwFuturesOrdersDetail.getCode(), pwFuturesOrdersDetail.getName(), pwFuturesOrdersDetail.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo : list) { + pwBomNumberTwo.setMaterialsDate(pwBuyingRequisition.getDemandDate()); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + } + + //添加之前根据名称和图号查询采购单中是否有了此物料,如果有,则合并数量,合并总重 + PwBuyingRequisitionMaterial requisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(pwBuyingRequisition.getId(), pwFuturesOrdersDetail.getName(), pwFuturesOrdersDetail.getFigureNumber()); + if(null!=requisitionMaterial){ + //说明已经有此物料了,只需合并数量和总重即可 + requisitionMaterial.setNumber(requisitionMaterial.getNumber()+pwFuturesOrdersDetail.getQuantity().longValue()); + //重新计算总重 + requisitionMaterial.setReferenceNumber(requisitionMaterial.getNumber()*requisitionMaterial.getPieceWeight()); + //重新计算总价 + requisitionMaterial.setTotalprice(requisitionMaterial.getNumber()*requisitionMaterial.getUnivalence()); + pwBuyingRequisitionMaterialService.updatePwBuyingRequisitionMaterial(requisitionMaterial); + }else{ + //说明是第一次添加 + PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial = new PwBuyingRequisitionMaterial(); + //请购单id + pwBuyingRequisitionMaterial.setBuyingRequisitionId(pwBuyingRequisition.getId()); + //物料名称 + pwBuyingRequisitionMaterial.setMaterialName(pwFuturesOrdersDetail.getName()); + //图号 + pwBuyingRequisitionMaterial.setFigureNumber(pwFuturesOrdersDetail.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterial.setMaterials(pwFuturesOrdersDetail.getMaterials()); + //单重 + pwBuyingRequisitionMaterial.setPieceWeight(pwFuturesOrdersDetail.getPieceWeight()); + //单位 + pwBuyingRequisitionMaterial.setUnitOfMeasurementName(pwFuturesOrdersDetail.getUnitTwo()); + //数量 + pwBuyingRequisitionMaterial.setNumber(pwFuturesOrdersDetail.getQuantity()); + //单价 + pwBuyingRequisitionMaterial.setUnivalence(0.0); + //总价 + pwBuyingRequisitionMaterial.setTotalprice(0.0); + //总重 + pwBuyingRequisitionMaterial.setReferenceNumber(pwBuyingRequisitionMaterial.getPieceWeight()*pwFuturesOrdersDetail.getQuantity()); + //供应商 + + //入库状态(初始值,未入库) + pwBuyingRequisitionMaterial.setInventoryStatus("未入库"); + + //备注 + pwBuyingRequisitionMaterial.setRemarks(pwFuturesOrdersDetail.getRemarks()); + pwBuyingRequisitionMaterialService.insertPwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + pwFuturesOrdersDetail.setStatus("已生成"); + pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(pwFuturesOrdersDetail); + + } + + //修改在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwFuturesOrdersDetail.getName(), pwFuturesOrdersDetail.getFigureNumber()); + if(null!=inventoryDetail){ + //修改在途 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwFuturesOrdersDetail.getNumber().longValue()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("原材料待采购",pwBuyingRequisition.getCode(),detail.getCode(),"",user.getNickName(),"原材料采购","原材料采购","原材料采购单","/purchase/pwBuyingRequisitionMaterial?id="+pwBuyingRequisition.getId()); + + return toAjax(i); + } + + + /** + * 撤销生成的采购单 + */ + @RequestMapping("/revocations/{ids}") + public AjaxResult revocations(@PathVariable Long[] ids){ + //撤销生成的采购单 同时把在途数量也撤销掉 + //跟据预采购单id查询预采购单信息 + int i = 0; + for (Long id : ids) { + PwFuturesOrdersDetail futuresOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailById(id); + //根据令号查询采购单信息 + List list2 = pwBuyingRequisitionService.selectPwBuyingRequisitionByPurpose(futuresOrdersDetail.getCode()); + for (PwBuyingRequisition pwBuyingRequisition : list2) { + //根据采购单id和名称和图号查询采购单详情信息 + PwBuyingRequisitionMaterial buyingRequisitionMaterial = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(pwBuyingRequisition.getId(), futuresOrdersDetail.getName(), futuresOrdersDetail.getFigureNumber()); + if(null!=buyingRequisitionMaterial){ + //判断是否已经申请入库 + if(null!=buyingRequisitionMaterial.getInventoryStatus()&&buyingRequisitionMaterial.getInventoryStatus().equals("已采购")){ + return AjaxResult.error("已经采购的物料不允许撤销"); + }else{ + + //撤销在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(futuresOrdersDetail.getName(), futuresOrdersDetail.getFigureNumber()); + if(null!=inventoryDetail){ + //修改在途 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-futuresOrdersDetail.getNumber().longValue()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + + //删除此条信息,然后判断此采购单下是否还有其他物料,如果没有,则把此采购单也删掉 + pwBuyingRequisitionMaterialService.deletePwBuyingRequisitionMaterialById(buyingRequisitionMaterial.getId()); + //根据id查询详情 + List list = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(pwBuyingRequisition.getId()); + if(list.size()==0){ + pwBuyingRequisitionService.deletePwBuyingRequisitionById(pwBuyingRequisition.getId()); + } + } + } + } + //修改预采购单的状态 + futuresOrdersDetail.setStatus(null); + i = pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(futuresOrdersDetail); + } + return toAjax(i); + } + + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersDetailTwoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersDetailTwoController.java new file mode 100644 index 0000000..b47cc36 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwFuturesOrdersDetailTwoController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetailTwo; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailTwoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 预采购单明细详情Controller + * + * @author zhukangchao + * @date 2022-06-27 + */ +@RestController +@RequestMapping("/management/pwFuturesOrdersDetailTwo") +public class PwFuturesOrdersDetailTwoController extends BaseController +{ + @Autowired + private IPwFuturesOrdersDetailTwoService pwFuturesOrdersDetailTwoService; + + /** + * 查询预采购单明细详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetailTwo:list')") + @GetMapping("/list") + public TableDataInfo list(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo) + { + startPage(); + List list = pwFuturesOrdersDetailTwoService.selectPwFuturesOrdersDetailTwoList(pwFuturesOrdersDetailTwo); + return getDataTable(list); + } + + /** + * 导出预采购单明细详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetailTwo:export')") + @Log(title = "预采购单明细详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo) + { + List list = pwFuturesOrdersDetailTwoService.selectPwFuturesOrdersDetailTwoList(pwFuturesOrdersDetailTwo); + ExcelUtil util = new ExcelUtil(PwFuturesOrdersDetailTwo.class); + return util.exportExcel(list, "pwFuturesOrdersDetailTwo"); + } + + /** + * 获取预采购单明细详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetailTwo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwFuturesOrdersDetailTwoService.selectPwFuturesOrdersDetailTwoById(id)); + } + + /** + * 新增预采购单明细详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetailTwo:add')") + @Log(title = "预采购单明细详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo) + { + return toAjax(pwFuturesOrdersDetailTwoService.insertPwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo)); + } + + /** + * 修改预采购单明细详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetailTwo:edit')") + @Log(title = "预采购单明细详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo) + { + return toAjax(pwFuturesOrdersDetailTwoService.updatePwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo)); + } + + /** + * 删除预采购单明细详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwFuturesOrdersDetailTwo:remove')") + @Log(title = "预采购单明细详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwFuturesOrdersDetailTwoService.deletePwFuturesOrdersDetailTwoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwGxProcessController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwGxProcessController.java new file mode 100644 index 0000000..26c5293 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwGxProcessController.java @@ -0,0 +1,130 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.project.management.domain.GxProcessVo; +import com.ruoyi.project.management.domain.PwGxProcess; +import com.ruoyi.project.management.service.IPwGxProcessService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 物料工序信息Controller + * + * @author chenyongjiang + * @date 2024-08-06 + */ +@RestController +@RequestMapping("/management/process") +public class PwGxProcessController extends BaseController +{ + @Autowired + private IPwGxProcessService pwMaterialProcessService; + + /** + * 查询物料工序信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:process:list')") + @GetMapping("/list") + public TableDataInfo list(PwGxProcess pwGxProcess) + { + startPage(); + List list = pwMaterialProcessService.selectPwMaterialProcessList(pwGxProcess); + return getDataTable(list); + } + + /** + * 导出物料工序信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:process:export')") + @Log(title = "物料工序信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwGxProcess pwGxProcess) + { + pwGxProcess.setParentId(1l); + List list = pwMaterialProcessService.selectPwMaterialProcessList(pwGxProcess); + ExcelUtil util = new ExcelUtil(PwGxProcess.class); + return util.exportExcel(list, "process"); + } + + /** + * 获取物料工序信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:process:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwMaterialProcessService.selectPwMaterialProcessById(id)); + } + + /** + * 新增物料工序信息 + */ + @PreAuthorize("@ss.hasPermi('management:process:add')") + @Log(title = "物料工序信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwGxProcess pwGxProcess) + { + return pwMaterialProcessService.insertPwMaterialProcess(pwGxProcess); + } + + /** + * 修改物料工序信息 + */ + @PreAuthorize("@ss.hasPermi('management:process:edit')") + @Log(title = "物料工序信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwGxProcess pwGxProcess) + { + return toAjax(pwMaterialProcessService.updatePwMaterialProcess(pwGxProcess)); + } + + /** + * 删除物料工序信息 + */ + @PreAuthorize("@ss.hasPermi('management:process:remove')") + @Log(title = "物料工序信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(pwMaterialProcessService.deletePwMaterialProcessById(id)); + } + + /** + * 下载模板 + * @return + */ + @GetMapping("/importTemplate") + public AjaxResult importTemplate() + { + ExcelUtil util = new ExcelUtil(GxProcessVo.class); + return util.importTemplateExcel("工序数据模板"); + } + + @Log(title = "工艺路线导入", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('management:process:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file) throws Exception + { + ExcelUtil util = new ExcelUtil(GxProcessVo.class); + List userList = util.importExcel(file.getInputStream()); + String message = pwMaterialProcessService.importGxProcesses(userList, SecurityUtils.getUsername()); + return AjaxResult.success(message); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwHeightPermittedInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwHeightPermittedInfoController.java new file mode 100644 index 0000000..07a96d1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwHeightPermittedInfoController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwHeightPermittedInfo; +import com.ruoyi.project.management.service.IPwHeightPermittedInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 安全库存限制信息Controller + * + * @author zhukangchao + * @date 2023-03-29 + */ +@RestController +@RequestMapping("/management/pwHeightPermittedInfo") +public class PwHeightPermittedInfoController extends BaseController +{ + @Autowired + private IPwHeightPermittedInfoService pwHeightPermittedInfoService; + + /** + * 查询安全库存限制信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwHeightPermittedInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwHeightPermittedInfo pwHeightPermittedInfo) + { + startPage(); + List list = pwHeightPermittedInfoService.selectPwHeightPermittedInfoList(pwHeightPermittedInfo); + return getDataTable(list); + } + + /** + * 导出安全库存限制信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwHeightPermittedInfo:export')") + @Log(title = "安全库存限制信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwHeightPermittedInfo pwHeightPermittedInfo) + { + List list = pwHeightPermittedInfoService.selectPwHeightPermittedInfoList(pwHeightPermittedInfo); + ExcelUtil util = new ExcelUtil(PwHeightPermittedInfo.class); + return util.exportExcel(list, "pwHeightPermittedInfo"); + } + + /** + * 获取安全库存限制信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwHeightPermittedInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwHeightPermittedInfoService.selectPwHeightPermittedInfoById(id)); + } + + /** + * 新增安全库存限制信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwHeightPermittedInfo:add')") + @Log(title = "安全库存限制信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwHeightPermittedInfo pwHeightPermittedInfo) + { + return toAjax(pwHeightPermittedInfoService.insertPwHeightPermittedInfo(pwHeightPermittedInfo)); + } + + /** + * 修改安全库存限制信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwHeightPermittedInfo:edit')") + @Log(title = "安全库存限制信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwHeightPermittedInfo pwHeightPermittedInfo) + { + return toAjax(pwHeightPermittedInfoService.updatePwHeightPermittedInfo(pwHeightPermittedInfo)); + } + + /** + * 删除安全库存限制信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwHeightPermittedInfo:remove')") + @Log(title = "安全库存限制信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwHeightPermittedInfoService.deletePwHeightPermittedInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwInspectionCardController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwInspectionCardController.java new file mode 100644 index 0000000..57cd6c4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwInspectionCardController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwInspectionCard; +import com.ruoyi.project.management.service.IPwInspectionCardService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 检验单Controller + * + * @author zhukangchao + * @date 2022-07-20 + */ +@RestController +@RequestMapping("/management/pwInspectionCard") +public class PwInspectionCardController extends BaseController +{ + @Autowired + private IPwInspectionCardService pwInspectionCardService; + + /** + * 查询检验单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCard:list')") + @GetMapping("/list") + public TableDataInfo list(PwInspectionCard pwInspectionCard) + { + startPage(); + List list = pwInspectionCardService.selectPwInspectionCardList(pwInspectionCard); + return getDataTable(list); + } + + /** + * 导出检验单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCard:export')") + @Log(title = "检验单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwInspectionCard pwInspectionCard) + { + List list = pwInspectionCardService.selectPwInspectionCardList(pwInspectionCard); + ExcelUtil util = new ExcelUtil(PwInspectionCard.class); + return util.exportExcel(list, "pwInspectionCard"); + } + + /** + * 获取检验单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCard:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwInspectionCardService.selectPwInspectionCardById(id)); + } + + /** + * 新增检验单 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCard:add')") + @Log(title = "检验单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwInspectionCard pwInspectionCard) + { + return toAjax(pwInspectionCardService.insertPwInspectionCard(pwInspectionCard)); + } + + /** + * 修改检验单 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCard:edit')") + @Log(title = "检验单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwInspectionCard pwInspectionCard) + { + return toAjax(pwInspectionCardService.updatePwInspectionCard(pwInspectionCard)); + } + + /** + * 删除检验单 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCard:remove')") + @Log(title = "检验单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwInspectionCardService.deletePwInspectionCardByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwInspectionCardDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwInspectionCardDetailController.java new file mode 100644 index 0000000..6d64bba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwInspectionCardDetailController.java @@ -0,0 +1,256 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.domain.PwInspectionCard; +import com.ruoyi.project.management.domain.PwInspectionCardDetail; +import com.ruoyi.project.management.service.IPwCuttingToolService; +import com.ruoyi.project.management.service.IPwInspectionCardDetailService; +import com.ruoyi.project.management.service.IPwInspectionCardService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 检验单详情Controller + * + * @author zhukangchao + * @date 2022-07-20 + */ + +@EnableScheduling +@RestController +@RequestMapping("/management/pwInspectionCardDetail") +public class PwInspectionCardDetailController extends BaseController +{ + @Autowired + private IPwInspectionCardDetailService pwInspectionCardDetailService; + //检验单信息 + @Autowired + private IPwInspectionCardService pwInspectionCardService; + //刀具信息 + @Autowired + private IPwCuttingToolService pwCuttingToolService; + + /** + * 查询检验单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCardDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwInspectionCardDetail pwInspectionCardDetail) + { + startPage(); + List list = pwInspectionCardDetailService.selectPwInspectionCardDetailList(pwInspectionCardDetail); + return getDataTable(list); + } + + /** + * 导出检验单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCardDetail:export')") + @Log(title = "检验单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwInspectionCardDetail pwInspectionCardDetail) + { + List list = pwInspectionCardDetailService.selectPwInspectionCardDetailList(pwInspectionCardDetail); + ExcelUtil util = new ExcelUtil(PwInspectionCardDetail.class); + return util.exportExcel(list, "pwInspectionCardDetail"); + } + + /** + * 获取检验单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCardDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwInspectionCardDetailService.selectPwInspectionCardDetailById(id)); + } + + /** + * 新增检验单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCardDetail:add')") + @Log(title = "检验单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwInspectionCardDetail pwInspectionCardDetail) + { + return toAjax(pwInspectionCardDetailService.insertPwInspectionCardDetail(pwInspectionCardDetail)); + } + + /** + * 修改检验单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCardDetail:edit')") + @Log(title = "检验单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwInspectionCardDetail pwInspectionCardDetail){ + //如果单价不为null。则计算总价 + if(null!=pwInspectionCardDetail.getUnitPrice()){ + pwInspectionCardDetail.setTotalPrices(pwInspectionCardDetail.getUnitPrice()*pwInspectionCardDetail.getQuantity()); + } + return toAjax(pwInspectionCardDetailService.updatePwInspectionCardDetail(pwInspectionCardDetail)); + } + + /** + * 删除检验单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwInspectionCardDetail:remove')") + @Log(title = "检验单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwInspectionCardDetailService.deletePwInspectionCardDetailByIds(ids)); + } + + /** + * 确认检验 + */ + @RequestMapping("/affirms/{ids}") + public AjaxResult affirms(@PathVariable Long[] ids){ + //根据id获取检验单详情信息 + PwInspectionCardDetail inspectionCardDetail = pwInspectionCardDetailService.selectPwInspectionCardDetailById(ids[0]); + PwInspectionCard inspectionCard = pwInspectionCardService.selectPwInspectionCardById(inspectionCardDetail.getCardId()); + if(null==inspectionCard.getName()||"".equals(inspectionCard.getName())){ + return AjaxResult.error("请输入检验方名称"); + } + for (Long id : ids) { + PwInspectionCardDetail inspectionCardDetail2 = pwInspectionCardDetailService.selectPwInspectionCardDetailById(id); + if(inspectionCardDetail2.getUnitPrice()==0||null==inspectionCardDetail2.getUnitPrice()){ + return AjaxResult.error("请填写检验单价"); + }else{ + inspectionCardDetail2.setTotalPrices(inspectionCardDetail2.getQuantity()*inspectionCardDetail2.getUnitPrice()); + } + + //判断检验日期是否为null,如果为null,则用当前日期 + if(null==inspectionCardDetail2.getCheckoutDate()||"".equals(inspectionCardDetail2.getCheckoutDate())){ + inspectionCardDetail2.setCheckoutDate(new Date()); + } + //检验状态置为已检验 + inspectionCardDetail2.setStatus("已检验"); + pwInspectionCardDetailService.updatePwInspectionCardDetail(inspectionCardDetail2); + + } + + //把价格累加到检验单中 + List list = pwInspectionCardDetailService.selectPwInspectionCardDetailByCardId(inspectionCard.getId()); + //总价 + Double d = 0.0; + //标识 + int p = 0; + for (PwInspectionCardDetail pwInspectionCardDetail : list) { + d += pwInspectionCardDetail.getTotalPrices(); + if(pwInspectionCardDetail.getStatus().equals("未检验")){ + p = 1; + } + } + if(p == 0){ + //说明全部已检验,则修改检验单状态 + inspectionCard.setStatus("已检验"); + } + inspectionCard.setTotalPrices(d); + return toAjax(pwInspectionCardService.updatePwInspectionCard(inspectionCard)); + } + + /** + * 生产检验单 + * @param ids + * @return + */ + @RequestMapping("/generates/{ids}") + public AjaxResult generates(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd-SSS"); + //创建检验单 + PwInspectionCard pwInspectionCard = new PwInspectionCard(); + //编号 + pwInspectionCard.setCode("JY-"+sdf.format(new Date())); + //单据日期(当前日期) + pwInspectionCard.setReceiptsDate(new Date()); + Double b = 0.0; + for (Long id : ids) { + PwInspectionCardDetail inspectionCardDetail = pwInspectionCardDetailService.selectPwInspectionCardDetailById(id); + if(null!=inspectionCardDetail.getTotalPrices()){ + b += inspectionCardDetail.getTotalPrices(); + } + } + //总价 + pwInspectionCard.setTotalPrices(b); + //检验状态 + pwInspectionCard.setStatus("未检验"); + int i = pwInspectionCardService.insertPwInspectionCard(pwInspectionCard); + for (Long id : ids) { + PwInspectionCardDetail inspectionCardDetail = pwInspectionCardDetailService.selectPwInspectionCardDetailById(id); + inspectionCardDetail.setCardId(pwInspectionCard.getId()); + pwInspectionCardDetailService.updatePwInspectionCardDetail(inspectionCardDetail); + } + return toAjax(i); + } + + /** + * 定时器,每天凌晨12:01查询刀具信息中的所有检测日期和检测周期不为null的数据,判断其检测日期+周期是否大于等于当前日期,如果等于判断其是否已经添加到检验单详情中,如果没有,则添加到检验单详情中等待检验 + */ + @Scheduled(cron = "0 0 01 * * ?") + public void autoDetection(){ + //获取当前时间的毫秒数 + long time = new Date().getTime(); + //查询检测日期和检测周期不为null的刀具信息 + List pwCuttingTool = pwCuttingToolService.selectPwCuttingToolByPeriodNotIsNull(); + for (PwCuttingTool pwCuttingTool2 : pwCuttingTool) { + Calendar calendars = Calendar.getInstance(); + calendars.setTime(pwCuttingTool2.getExpirationDate()); + calendars.add(Calendar.DATE, pwCuttingTool2.getPeriod().intValue()); + //判断是否超出了检测日期 + if(calendars.getTime().getTime() <= time){ + //说明到了检测日期 + //判读是否加到了检测详情单中,且检验状态为未检测 + PwInspectionCardDetail inspectionCardDetail = pwInspectionCardDetailService.selectPwInspectionCardDetailByNameAndType(pwCuttingTool2.getName(),pwCuttingTool2.getType()); + if(null == inspectionCardDetail){ + //说明没有添加到检验单中 + PwInspectionCardDetail pwInspectionCardDetail = new PwInspectionCardDetail(); + //名称 + pwInspectionCardDetail.setName(pwCuttingTool2.getName()); + //品牌 + pwInspectionCardDetail.setBrand(pwCuttingTool2.getBrand()); + //编号 + pwInspectionCardDetail.setType(pwCuttingTool2.getType()); + //计量单位 + pwInspectionCardDetail.setUnit(pwCuttingTool2.getUnit()); + //生产厂家 + pwInspectionCardDetail.setManufacturer(pwCuttingTool2.getManufacturer()); + //需检日期(当前日期) + pwInspectionCardDetail.setNeedDate(calendars.getTime()); + //检验日期(默认为null,手动选择时间) +// pwInspectionCardDetail.setCheckoutDate(checkoutDate); + //数量 + pwInspectionCardDetail.setQuantity(1L); + //单价(默认为0) + pwInspectionCardDetail.setUnitPrice(0.0); + //总价(默认为0) + pwInspectionCardDetail.setTotalPrices(0.0); + //检验状态(未检验) + pwInspectionCardDetail.setStatus("未检验"); + pwInspectionCardDetailService.insertPwInspectionCardDetail(pwInspectionCardDetail); + } + } + } + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwInventoryComparisonController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwInventoryComparisonController.java new file mode 100644 index 0000000..84e3178 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwInventoryComparisonController.java @@ -0,0 +1,184 @@ +package com.ruoyi.project.management.controller; + +import java.util.*; + +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.service.IPwInventoryComparisonService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 盘库对比Controller + * + * @author zhukangchao + * @date 2023-11-06 + */ +@RestController +@RequestMapping("/management/comparison") +public class PwInventoryComparisonController extends BaseController { + //对比 + @Autowired + private IPwInventoryComparisonService pwInventoryComparisonService; + //库存 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //入库 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //出库 + @Autowired + private IImStockRequisitionMaterialService imStockRequisitionMaterialService; + @Autowired + private TokenService tokenService; + + /** + * 查询盘库对比列表 + */ + @PreAuthorize("@ss.hasPermi('management:comparison:list')") + @GetMapping("/list") + public TableDataInfo list(PwInventoryComparison pwInventoryComparison) { + startPage(); + if (null == pwInventoryComparison.getInventoryDate()) { + pwInventoryComparison.setInventoryDate(new Date()); + } + List list = pwInventoryComparisonService.selectPwInventoryComparisonList(pwInventoryComparison); + return getDataTable(list); + } + + /** + * 导出盘库对比列表 + */ + @PreAuthorize("@ss.hasPermi('management:comparison:export')") + @Log(title = "盘库对比", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwInventoryComparison pwInventoryComparison) { + List list = pwInventoryComparisonService.selectPwInventoryComparisonList(pwInventoryComparison); + ExcelUtil util = new ExcelUtil(PwInventoryComparison.class); + return util.exportExcel(list, "comparison"); + } + + + /** + * 获取盘库对比详细信息 + */ + @GetMapping(value = "/getComparisonDetail") + public List getComparisonDetail(ComparisonExcel inventory) { + List res_list = new ArrayList(); + //根据图号和名称查询入库详情 + List inList = imProductReceiptMaterialService + .queryImProductReceiptMaterialByNameAndFigureNumber(inventory.getName(), inventory.getFigureNumber(), inventory.getInventoryDate()); + PwInventoryComparison obj = null; + for (ImProductReceiptMaterial prm : inList) { + obj = new PwInventoryComparison(); + /* obj.setInDate(new SimpleDateFormat("yyyy-MM-dd").format(prm.getStorageDate())); + obj.setInSum(prm.getActualQuantity());*/ + res_list.add(obj); + } + //根据图号和名称查询出库详情 + List outList = imStockRequisitionMaterialService + .queryImStockRequisitionMaterialByNameAndFigureNumber(inventory.getName(), inventory.getFigureNumber(), inventory.getInventoryDate()); + for (ImStockRequisitionMaterial srm : outList) { + obj = new PwInventoryComparison(); + /* obj.setOutDate(new SimpleDateFormat("yyyy-MM-dd").format(srm.getOutboundDate())); + obj.setOutSum(srm.getActualQuantityIssued());*/ + res_list.add(obj); + } + return res_list; + } + + /** + * 批量上传物料信息 + */ + @RequestMapping("/upload") + @ResponseBody + public AjaxResult uploadLableNumber(MultipartFile file) { + LoginUser user = tokenService.getLoginUser(ServletUtils.getRequest()); + String userStr = user.toString(); + try { + ExcelUtil util = new ExcelUtil(ComparisonExcel.class); + List pic_list = util.importExcel(file.getInputStream()); + //计算合并相同数据 + for (int i = 0; i < pic_list.size(); i++) { + for (int p = i + 1; p < pic_list.size(); p++) { + if (pic_list.get(i).getFigureNumber().equals(pic_list.get(p).getFigureNumber()) && pic_list.get(i).getName().equals(pic_list.get(p).getName())) { + pic_list.get(i).setInventoryNum(pic_list.get(i).getInventoryNum() + pic_list.get(p).getInventoryNum()); + pic_list.remove(p); + p--; + } + } + } + PwInventoryComparison pic = null; + //获取当前erp中数据 + List pid_list = pwInventoryDetailService.selectPwInventoryDetailList(null); + //erp和盘点数据对比不同数据入库 + for (int i = 0; i < pic_list.size(); i++) { + for (int p = 0; p < pid_list.size(); p++) { + //不同数据提取入库 + if (pic_list.get(i).getName().equals(pid_list.get(p).getName()) && pic_list.get(i).getFigureNumber().equals(pid_list.get(p).getFigureNumber())) { + pic = new PwInventoryComparison(); + if (pic_list.get(i).getInventoryNum() != Integer.parseInt(pid_list.get(p).getQuantity() + "")) { + pic.setInventoryNum(pic_list.get(i).getInventoryNum()); + pic.setName(pic_list.get(i).getName()); + pic.setFigureNumber(pic_list.get(i).getFigureNumber()); + //判断盈亏情况 + if (pic_list.get(i).getInventoryNum() - Integer.parseInt(pid_list.get(p).getQuantity() + "") > 0) { + pic.setDifferences(pic_list.get(i).getInventoryNum() - Integer.parseInt(pid_list.get(p).getQuantity() + "")); + pic.setProfitAndLoss("盈"); + } else { + pic.setDifferences(Integer.parseInt(pid_list.get(p).getQuantity() + "") - pic_list.get(i).getInventoryNum()); + pic.setProfitAndLoss("亏"); + } + pic.setErpNum(pid_list.get(p).getQuantity()); + pic.setInventoryDate(new Date()); + pic.setCreateBy(userStr); + pwInventoryComparisonService.insertPwInventoryComparison(pic); + } + } + } + } + return AjaxResult.success("文件上传成功"); + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传失败"); + } + + +/* + @RequestMapping("/upload") + @ResponseBody + public AjaxResult uploadLableNumber1(MultipartFile file) throws Exception { + LoginUser user = tokenService.getLoginUser(ServletUtils.getRequest()); + String userStr = user.toString(); + ExcelUtil util = new ExcelUtil(ComparisonExcel.class); + List excelsList = util.importExcel(file.getInputStream()); + //调用合并数据方法 + List list = meregeData(excelsList); + //获取库存 + return null; + + } + + private List meregeData(List picList) { + + for (ComparisonExcel pic : picList) { + + } + return null; + }*/ + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwInventoryDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwInventoryDetailController.java new file mode 100644 index 0000000..4bde780 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwInventoryDetailController.java @@ -0,0 +1,262 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwPankuRecord; +import com.ruoyi.project.management.domain.PwScrapInfo; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwPankuRecordService; +import com.ruoyi.project.management.service.IPwScrapInfoService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 库存明细Controller + * + * @author zhukangchao + * @date 2020-07-18 + */ +@RestController +@RequestMapping("/management/inventoryDetail") +public class PwInventoryDetailController extends BaseController { + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //盘库记录信息 + @Autowired + private IPwPankuRecordService pwPankuRecordService; + //报废信息 + @Autowired + private IPwScrapInfoService pwScrapInfoService; + //用户标识信息 + @Autowired + private TokenService tokenService; + + + /** + * 查询库存明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:inventoryDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwInventoryDetail pwInventoryDetail) { + startPage(); + List list = pwInventoryDetailService.selectPwInventoryDetailList(pwInventoryDetail); + return getDataTable(list); + } + + /** + * 导出库存明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:inventoryDetail:export')") + @Log(title = "库存明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwInventoryDetail pwInventoryDetail) { + List list = pwInventoryDetailService.selectPwInventoryDetailList(pwInventoryDetail); + ExcelUtil util = new ExcelUtil(PwInventoryDetail.class); + return util.exportExcel(list, "inventoryDetail"); + } + + /** + * 获取库存明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:inventoryDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwInventoryDetailService.selectPwInventoryDetailById(id)); + } + + /** + * 新增库存明细 + */ + @PreAuthorize("@ss.hasPermi('management:inventoryDetail:add')") + @Log(title = "库存明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwInventoryDetail pwInventoryDetail) { + return toAjax(pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail)); + } + + /** + * 报废物料信息 + */ + @RequestMapping("/scrapsubmitForms") + public AjaxResult scrapsubmitForms(@RequestBody PwInventoryDetail pwInventoryDetail) { + if (null == pwInventoryDetail.getNumber() || "".equals(pwInventoryDetail.getNumber()) || 0 == pwInventoryDetail.getNumber()) { + return AjaxResult.error("请填写报废数量"); + } + if (pwInventoryDetail.getNumber() > pwInventoryDetail.getQuantity()) { + return AjaxResult.error("报废数量不可大于库存数量"); + } + //获取当前用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + PwScrapInfo pwScrapInfo = new PwScrapInfo(); + //物料名称 + pwScrapInfo.setName(pwInventoryDetail.getName()); + //物料图号 + pwScrapInfo.setFigureNumber(pwInventoryDetail.getFigureNumber()); + //材料 + pwScrapInfo.setMaterials(pwInventoryDetail.getMaterials()); + //单重 + pwScrapInfo.setPieceWeight(pwInventoryDetail.getPieceWeight()); + //库存数量 + pwScrapInfo.setQuantity(pwInventoryDetail.getQuantity()); + //报废数量 + pwScrapInfo.setNumber(pwInventoryDetail.getNumber()); + //剩余数量 + pwScrapInfo.setResidueNumber(pwInventoryDetail.getQuantity() - pwInventoryDetail.getNumber()); + //操作人 + pwScrapInfo.setUserName(user.getNickName()); + //报废原因 + pwScrapInfo.setCause(pwInventoryDetail.getCause()); + //备注 + pwScrapInfo.setRemarks(pwInventoryDetail.getRemarks()); + int i = pwScrapInfoService.insertPwScrapInfo(pwScrapInfo); + int j = 0; + if (i > 0) { + //同时减少库存数量 + pwInventoryDetail.setQuantity(pwInventoryDetail.getQuantity() - pwInventoryDetail.getNumber()); + //更新可用数量 + pwInventoryDetail.setAvailableNumber(pwInventoryDetail.getQuantity() - pwInventoryDetail.getLockNumber()); + j = pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail); + } + return toAjax(j); + } + + /** + * 修改库存明细 + */ + @PreAuthorize("@ss.hasPermi('management:inventoryDetail:edit')") + @Log(title = "库存明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwInventoryDetail pwInventoryDetail) { + //获取当前用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(pwInventoryDetail.getId()); + //如果两者不等说明修改了库存数量,此时应加上盘库记录 + if (inventoryDetail.getQuantity() != pwInventoryDetail.getQuantity()) { + PwPankuRecord pwPankuRecord = new PwPankuRecord(); + pwPankuRecord.setSparedThree(inventoryDetail.getId()); + pwPankuRecord.setName(inventoryDetail.getName()); + pwPankuRecord.setTypeName(inventoryDetail.getFigureNumber()); + pwPankuRecord.setWarehouseName(inventoryDetail.getWarehouseName()); + pwPankuRecord.setUnit(inventoryDetail.getUnit()); + //盘库前数量 + pwPankuRecord.setQuantity(inventoryDetail.getQuantity()); + //盘库后数量 + pwPankuRecord.setPracticalQuantity(pwInventoryDetail.getQuantity()); + //盘库人 + pwPankuRecord.setSparedOne(user.getNickName()); + //盘盈 盘亏数量(盘的数量-库存数量)正数代表盘盈,负数代表盘亏 + pwPankuRecord.setSparedFour(pwInventoryDetail.getQuantity() - inventoryDetail.getQuantity()); + //删除标记 + pwPankuRecord.setDelFlag(0); + int i = pwPankuRecordService.addCollateInventory(pwPankuRecord); + if (i < 1) { + return AjaxResult.error("盘库失败"); + } + //盘库后更新可用数量 + pwInventoryDetail.setAvailableNumber(pwInventoryDetail.getQuantity() - pwInventoryDetail.getLockNumber()); + } + return toAjax(pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail)); + } + + /** + * 删除库存明细 + */ + @PreAuthorize("@ss.hasPermi('management:inventoryDetail:remove')") + @Log(title = "库存明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(pwInventoryDetailService.deletePwInventoryDetailByIds(ids)); + } + + /** + * + * 上传库存信息记录文件 计算截止执行单之后的在途和预定数量 + */ + @RequestMapping("/uploadInventoryDetailFile") + @ResponseBody + public AjaxResult uploadInventoryDetailFile(@RequestParam("file") MultipartFile filePath) { + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length() - 3); + String substring = originalFilename.substring(originalFilename.length() - 4); + //判断是否是xlsx文件或xls文件 + if ("xls".equals(postfix) || "xlsx".equals(substring)) { + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/" + originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + List list = new ArrayList(); + + for (int i = 1; i < result.size(); i++) { + //根据图号和名称查询库存的物料信息 + PwInventoryDetail pwInventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(result.get(i).get(1).toString(), result.get(i).get(0).toString()); + if (null != pwInventoryDetail) { + //库存数量 + pwInventoryDetail.setQuantity(Long.valueOf(result.get(i).get(2).toString())); + //在途数量 +// pwInventoryDetail.setPreliminaryInventory(pwInventoryDetail.getPreliminaryInventory()+Long.valueOf(result.get(i).get(2).toString())); + pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail); + } else { + //如果未查询到的物料,写入到list中 + pwInventoryDetail = new PwInventoryDetail(); + pwInventoryDetail.setName(result.get(i).get(1).toString()); + pwInventoryDetail.setFigureNumber(result.get(i).get(0).toString()); + list.add(pwInventoryDetail); + } + } + for (PwInventoryDetail pwInventoryDetail : list) { + System.out.println(pwInventoryDetail.getName() + "----" + pwInventoryDetail.getFigureNumber()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwInvoiceInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwInvoiceInfoController.java new file mode 100644 index 0000000..76034ca --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwInvoiceInfoController.java @@ -0,0 +1,227 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwInvoiceInfo; +import com.ruoyi.project.management.domain.PwOutsourceContract; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.service.IPwInvoiceInfoService; +import com.ruoyi.project.management.service.IPwOutsourceContractService; +import com.ruoyi.project.management.service.IPwPurchaseContractService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 发票信息Controller + * + * @author zhukangchao + * @date 2023-04-09 + */ +@RestController +@RequestMapping("/management/pwInvoiceInfo") +public class PwInvoiceInfoController extends BaseController +{ + @Autowired + private IPwInvoiceInfoService pwInvoiceInfoService; + //合同信息 + @Autowired + private IPwOutsourceContractService pwOutsourceContractService; + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + + /** + * 查询发票信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwInvoiceInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwInvoiceInfo pwInvoiceInfo) + { + startPage(); + List list = pwInvoiceInfoService.selectPwInvoiceInfoList(pwInvoiceInfo); + return getDataTable(list); + } + + /** + * 导出发票信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwInvoiceInfo:export')") + @Log(title = "发票信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwInvoiceInfo pwInvoiceInfo) + { + List list = pwInvoiceInfoService.selectPwInvoiceInfoList(pwInvoiceInfo); + ExcelUtil util = new ExcelUtil(PwInvoiceInfo.class); + return util.exportExcel(list, "pwInvoiceInfo"); + } + + /** + * 获取发票信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwInvoiceInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwInvoiceInfoService.selectPwInvoiceInfoById(id)); + } + + /** + * 新增发票信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwInvoiceInfo:add')") + @Log(title = "发票信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwInvoiceInfo pwInvoiceInfo) + { + return toAjax(pwInvoiceInfoService.insertPwInvoiceInfo(pwInvoiceInfo)); + } + + /** + * 上传发票文件 + * @param productionBillProduceId + * @param filePath + * @return + */ + @RequestMapping("/uploadInvoice") + @ResponseBody + public AjaxResult uploadInvoice(@RequestParam("id") String id,@RequestParam("file") MultipartFile filePath){ + //根据id查询发票信息 + PwInvoiceInfo invoiceInfo = pwInvoiceInfoService.selectPwInvoiceInfoById(Long.valueOf(id)); + if(null != invoiceInfo){ + String originalFilename = filePath.getOriginalFilename(); + if(!originalFilename.contains(".pdf")&&!originalFilename.contains(".jpg")&&!originalFilename.contains(".jpeg")&&!originalFilename.contains(".png")){ + return AjaxResult.error("非法文件不允许上传"); + }else{ + //图片保存到服务器 + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/java/invoice/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + invoiceInfo.setUrl("http://localhost:8088/invoice/"+originalFilename); + } + }else{ + return AjaxResult.error("未查询到发票信息"); + } + int i = pwInvoiceInfoService.updatePwInvoiceInfo(invoiceInfo); + return AjaxResult.success(i); + } + + /** + * 修改发票信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwInvoiceInfo:edit')") + @Log(title = "发票信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwInvoiceInfo pwInvoiceInfo){ + PwInvoiceInfo invoiceInfo2 = pwInvoiceInfoService.selectPwInvoiceInfoById(pwInvoiceInfo.getId()); + if("是".equals(invoiceInfo2.getPayment())){ + return AjaxResult.error("已经付款的发票,不允许修改"); + } + //判断发票号码 + if("".equals(pwInvoiceInfo.getCode())||null==pwInvoiceInfo.getCode()){ + return AjaxResult.error("请输入发票号码"); + } + //根据供应商和发票号码查询,是否存在了此发票 + PwInvoiceInfo invoiceInfo = pwInvoiceInfoService.selectPwInvoiceInfoByCodeAndName(pwInvoiceInfo.getCode(),pwInvoiceInfo.getSupplierName()); + if(null!=invoiceInfo&&pwInvoiceInfo.getId()!=invoiceInfo.getId()){ + //说明已经存在此发票 + return AjaxResult.error("票据重复,此供应商已开具此发票"); + } + if("".equals(pwInvoiceInfo.getUrl())||null==pwInvoiceInfo.getUrl()){ + return AjaxResult.error("请先上传发票信息"); + } + //判断发票金额 + if(null==pwInvoiceInfo.getMoney()||"".equals(pwInvoiceInfo.getMoney())||0==pwInvoiceInfo.getMoney()){ + return AjaxResult.error("请输入发票金额"); + } + + //校验发票金额是否和合同金额一致 + List list = pwOutsourceContractService.selectPwOutsourceContractByInvoiceInfoId(pwInvoiceInfo.getId()); + //获取所有合同的总价 + Double d = 0.0; + //总扣款金额 + Double a = 0.0; + for (PwOutsourceContract pwOutsourceContract : list) { + d += pwOutsourceContract.getTotalPricesSmall(); + a += pwOutsourceContract.getWithhold(); + } + //发票金额 = 合同总额-扣款金额 + Double s = pwInvoiceInfo.getMoney() - (d-a) ; + if(s > 0.4 || s < -0.4){ + return AjaxResult.error("合同金额和发票金额不允许相差超过0.4元"); + } + return toAjax(pwInvoiceInfoService.updatePwInvoiceInfo(pwInvoiceInfo)); + } + + /** + * 删除发票信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwInvoiceInfo:remove')") + @Log(title = "发票信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwInvoiceInfo invoiceInfo = pwInvoiceInfoService.selectPwInvoiceInfoById(id); + if("是".equals(invoiceInfo.getPayment())){ + return AjaxResult.error("已经付款的发票,不允许删除"); + } + //删除发票时把合同信息的发票状态改变 + if("标准件".equals(invoiceInfo.getSource())){ + //查询标准件合同 + PwPurchaseContract pwPurchaseContract = new PwPurchaseContract(); + pwPurchaseContract.setInvoice(invoiceInfo.getId()); + List list = pwPurchaseContractService.selectPwPurchaseContractList(pwPurchaseContract); + for (PwPurchaseContract pwPurchaseContract2 : list) { + pwPurchaseContract2.setBillingInformation(null); + pwPurchaseContract2.setInvoice(null); + pwPurchaseContractService.updatePwPurchaseContract(pwPurchaseContract2); + } + }else if("外协".equals(invoiceInfo.getSource())){ + PwOutsourceContract pwOutsourceContract = new PwOutsourceContract(); + pwOutsourceContract.setInvoice(invoiceInfo.getId()); + List list = pwOutsourceContractService.selectPwOutsourceContractList(pwOutsourceContract); + for (PwOutsourceContract pwOutsourceContract2 : list) { + pwOutsourceContract2.setBillingInformation(null); + pwOutsourceContract2.setInvoice(null); + pwOutsourceContractService.updatePwOutsourceContract(pwOutsourceContract2); + } + }else if("原材料".equals(invoiceInfo.getSource())){ + + }else if("易耗品".equals(invoiceInfo.getSource())){ + + } + } + return toAjax(pwInvoiceInfoService.deletePwInvoiceInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceController.java new file mode 100644 index 0000000..d3770f9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceController.java @@ -0,0 +1,664 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwDanceNotStandard; +import com.ruoyi.project.management.domain.PwLetterOfAdvice; +import com.ruoyi.project.management.domain.PwLetterOfAdviceDetails; +import com.ruoyi.project.management.domain.PwLetterOfAdviceProduct; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwContractService; +import com.ruoyi.project.management.service.IPwDanceNotStandardService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceDetailsService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceProductService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 发运通知单Controller + * + * @author zhukangchao + * @date 2020-07-20 + */ +@RestController +@RequestMapping("/management/letterOfAdvice") +public class PwLetterOfAdviceController extends BaseController { + @Autowired + private IPwLetterOfAdviceService pwLetterOfAdviceService; + //发运单详情信息 + @Autowired + private IPwLetterOfAdviceProductService pwLetterOfAdviceProductService; + //合同信息 + @Autowired + private IPwContractService pwContractService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService imStockRequisitionMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //发运单详情列表 + @Autowired + private IPwLetterOfAdviceDetailsService pwLetterOfAdviceDetailsService; + //用户信息 + @Autowired + private TokenService tokenService; + //非标产品表信息 + @Autowired + private IPwDanceNotStandardService pwDanceNotStandardService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询发运通知单列表 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdvice:list')") + @GetMapping("/list") + public TableDataInfo list(PwLetterOfAdvice pwLetterOfAdvice) { + startPage(); + List list = pwLetterOfAdviceService.selectPwLetterOfAdviceList(pwLetterOfAdvice); + return getDataTable(list); + } + + /** + * 导出发运通知单列表 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdvice:export')") + @Log(title = "发运通知单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwLetterOfAdvice pwLetterOfAdvice) { + List list = pwLetterOfAdviceService.selectPwLetterOfAdviceList(pwLetterOfAdvice); + ExcelUtil util = new ExcelUtil(PwLetterOfAdvice.class); + return util.exportExcel(list, "letterOfAdvice"); + } + + /** + * 获取发运通知单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdvice:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwLetterOfAdviceService.selectPwLetterOfAdviceById(id)); + } + + /** + * 新增发运通知单 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdvice:add')") + @Log(title = "发运通知单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwLetterOfAdvice pwLetterOfAdvice) { + //获取合同编号 + String contractCode = pwLetterOfAdvice.getContractCode(); + //根据合同编号查询合同信息 + PwContract pwContract = pwContractService.selectByContractCode(contractCode); + //购买方名称 + pwLetterOfAdvice.setPurchaserUnitName(pwContract.getPurchaser()); + //收货人 + pwLetterOfAdvice.setConsignee(pwContract.getConsignee()); + //收货地址 + pwLetterOfAdvice.setShippingAddress(pwContract.getDeliveryPoints()); + //收货人电话 + pwLetterOfAdvice.setPurchaserUnitPhone(pwContract.getPurchaserPhone()); + //财务审核状态默认为未审核0 + pwLetterOfAdvice.setFinancialAudit(0); + //领导审核状态默认为未审核1 + pwLetterOfAdvice.setRatify(0); + //运单状态默认为未完成1 + pwLetterOfAdvice.setStatus(0); + //删除标记 + pwLetterOfAdvice.setDelFlag(0); + int i = pwLetterOfAdviceService.insertPwLetterOfAdvice(pwLetterOfAdvice); + if (i < 1) { + return AjaxResult.error(); + } + //添加运单关联信息 + return toAjax(i); + } + + /** + * 修改发运通知单 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdvice:edit')") + @Log(title = "发运通知单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwLetterOfAdvice pwLetterOfAdvice) { + //领导审核状态置为1已审核 +// pwLetterOfAdvice.setRatify(1); +// //审核时间为当前时间 +// pwLetterOfAdvice.setRatifyTime(new Date()); + return toAjax(pwLetterOfAdviceService.updatePwLetterOfAdvice(pwLetterOfAdvice)); + } + + /** + * 删除发运通知单 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdvice:remove')") + @Log(title = "发运通知单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + //删除发运单的同时,释放发运单详情中的发运单id和已申请数量 + for (Long long1 : ids) { + //根据发运单id查询发运单详情列表的数据 + List list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceId(long1); + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list) { + //删除之前把发运单列表中的已发数量恢复 + PwLetterOfAdviceDetails letterOfAdviceDetails = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsById(pwLetterOfAdviceDetails.getId()); + //根据执行单code和产品型号查询 + PwLetterOfAdviceProduct letterOfAdviceProduct = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductByCodeAndFigureNumber(letterOfAdviceDetails.getProductionBillCode(), letterOfAdviceDetails.getProductType()); + letterOfAdviceProduct.setSentNumber(letterOfAdviceProduct.getSentNumber() - letterOfAdviceDetails.getApplyNumber()); + pwLetterOfAdviceProductService.updatePwLetterOfAdviceProduct(letterOfAdviceProduct); + pwLetterOfAdviceDetailsService.deletePwLetterOfAdviceDetailsById(pwLetterOfAdviceDetails.getId()); + } + } + return toAjax(pwLetterOfAdviceService.deletePwLetterOfAdviceByIds(ids)); + } + + /** + * 财务审核发运通知单 + */ + @RequestMapping("editFinancialAudits") + public AjaxResult editFinancialAudits(@RequestBody PwLetterOfAdvice pwLetterOfAdvice) { + //根据code查询领料单,如果领料单不为null,则直接在此领料单下添加产品,如果为null 则创建新的领料单 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(pwLetterOfAdvice.getContractCode()); + if ("已结清尾款".equals(pwLetterOfAdvice.getFinancialAuditSuggest())||"不计入决算".equals(pwLetterOfAdvice.getFinancialAuditSuggest())) { + //财务审核状态改为已审核状态1 + pwLetterOfAdvice.setFinancialAudit(1); + //财务审核时间 + pwLetterOfAdvice.setFinancialAuditTime(new Date()); + //领导审核状态改为已审核状态1 + pwLetterOfAdvice.setRatify(1); + //领导审核时间 + pwLetterOfAdvice.setRatifyTime(new Date()); + + //审核人默认 + pwLetterOfAdvice.setRatifyName("免签"); + + //直接生产领料单 + //生成领料单,领料单code合同code + List list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceId(pwLetterOfAdvice.getId()); + if (null != stockRequisition) { + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list) { + //判断是否之前发过此型号的产品,如果发过,则把数量合并,没发过则新增 +// List list2 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(stockRequisition.getCode(), pwLetterOfAdviceDetails.getProductType()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { +// if (null != imStockRequisitionMaterial) { +// //实发数量 +// imStockRequisitionMaterial.setActualQuantityIssued(pwLetterOfAdviceDetails.getApplyNumber()); +// //申请数量 +// imStockRequisitionMaterial.setApplyForQuantity(pwLetterOfAdviceDetails.getApplyNumber()); +// imStockRequisitionMaterialService.updateImStockRequisitionMaterial(imStockRequisitionMaterial); +// } +// } + //把当前单据下所有的产品添加到领料单详情中 + ImStockRequisitionMaterial imStockRequisitionMaterials = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterials.setStockRequisitionId(stockRequisition.getId()); + //关联code + imStockRequisitionMaterials.setCode(stockRequisition.getCode()); + //产品型号 + if(pwLetterOfAdviceDetails.getProductType().contains("XCL")){ + String xinghao = pwLetterOfAdviceDetails.getProductType().replaceAll("XCL", ""); + String replaceAll = xinghao.replaceAll("R[+]L", "L+R"); + imStockRequisitionMaterials.setFigureNumber(replaceAll); + }else{ + imStockRequisitionMaterials.setFigureNumber(pwLetterOfAdviceDetails.getProductType()); + } + //产品名称 + imStockRequisitionMaterials.setMaterialName(pwLetterOfAdviceDetails.getName()); + //申领人 + imStockRequisitionMaterials.setMaterialHandlerName(pwLetterOfAdvice.getProposer()); + //应发数量 + imStockRequisitionMaterials.setSalaryQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //申请数量 + imStockRequisitionMaterials.setApplyForQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //实发数量 + imStockRequisitionMaterials.setActualQuantityIssued(pwLetterOfAdviceDetails.getApplyNumber()); + // //库存数量 + // PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(pwLetterOfAdviceProduct.getProductType()); + // imStockRequisitionMaterial.setInventoryQuantity(inventoryDetail.getQuantity()); + //出库状态 + imStockRequisitionMaterials.setGetStatus("未出库"); + imStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterials); + } + } else { + //创建新的领料单 + stockRequisition = new ImStockRequisition(); + //关联单据code + stockRequisition.setCode(pwLetterOfAdvice.getContractCode()); + //根据领料单据code(合同code)查询合同信息 + PwContract pwContract = pwContractService.selectByContractCode(pwLetterOfAdvice.getContractCode()); + if (null != pwContract) { + //项目名称 + stockRequisition.setProjectName(pwContract.getItemName()); + } + //领料人姓名 + stockRequisition.setMaterialHandlerName(pwContract.getSparedOne()); + //领料状态 + stockRequisition.setGetStatus("未出库"); + //添加领料单 + imStockRequisitionService.insertImStockRequisition(stockRequisition); + //查询当前单据下所有的产品 + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list) { + //把当前单据下所有的产品添加到领料单详情中 + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联code + imStockRequisitionMaterial.setCode(stockRequisition.getCode()); + //产品型号 + if(pwLetterOfAdviceDetails.getProductType().contains("XCL")){ + String xinghao = pwLetterOfAdviceDetails.getProductType().replaceAll("XCL", ""); + String replaceAll = xinghao.replaceAll("R[+]L", "L+R"); + imStockRequisitionMaterial.setFigureNumber(replaceAll); + }else{ + imStockRequisitionMaterial.setFigureNumber(pwLetterOfAdviceDetails.getProductType()); + } + //产品名称 + imStockRequisitionMaterial.setMaterialName(pwLetterOfAdviceDetails.getName()); + //申领人 + imStockRequisitionMaterial.setMaterialHandlerName(pwLetterOfAdvice.getProposer()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //已发数量 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //实发数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwLetterOfAdviceDetails.getApplyNumber()); +// //库存数量 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(pwLetterOfAdviceProduct.getProductType()); +// imStockRequisitionMaterial.setInventoryQuantity(inventoryDetail.getQuantity()); + //出库状态 + imStockRequisitionMaterial.setGetStatus("未出库"); + imStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + } + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("成品出库",stockRequisition.getCode(),"","",pwLetterOfAdvice.getProposer(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+stockRequisition.getId()); + }else{ + //财务审核状态改为已审核状态1 + pwLetterOfAdvice.setFinancialAudit(1); + //财务审核时间 + pwLetterOfAdvice.setFinancialAuditTime(new Date()); + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("审核发运单",pwLetterOfAdvice.getContractCode(),pwLetterOfAdvice.getPurchaserUnitName(),"",pwLetterOfAdvice.getProposer(),"总经理","审核发运单","发运通知单管理","/letterOfAdvice/letterOfAdvice"); + //通知领导审核 TODO 暂时不知道通知谁 + + } + int i = pwLetterOfAdviceService.updatePwLetterOfAdvice(pwLetterOfAdvice); + if (i < 1) { + return AjaxResult.error(); + } + return AjaxResult.success(i); + } + + /** + * 领导审核发运通知单 + */ + @DeleteMapping("editRatifys/{ids}") + public AjaxResult editRatifys(@PathVariable Long[] ids) { + //获取审核人信息 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + for (Long long1 : ids) { + //根据id查询发运通知单信息 + PwLetterOfAdvice letterOfAdvice = pwLetterOfAdviceService.selectPwLetterOfAdviceById(long1); + //领导审核状态改为已审核状态1 + letterOfAdvice.setRatify(1); + //领导审核时间 + letterOfAdvice.setRatifyTime(new Date()); + //审核人 + letterOfAdvice.setRatifyName(user.getNickName()); + int i = pwLetterOfAdviceService.updatePwLetterOfAdvice(letterOfAdvice); + if (i < 1) { + return AjaxResult.error(); + } + //生成领料单,领料单code合同code + List list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceId(long1); + //根据code查询领料单,如果领料单不为null,则直接在此领料单下添加产品,如果为null 则创建新的领料单 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(letterOfAdvice.getContractCode()); + if (null != stockRequisition) { + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list) { + //判断是否之前发过此型号的产品,如果发过,则把数量合并,没发过则新增 +// List list2 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(stockRequisition.getCode(), pwLetterOfAdviceDetails.getProductType()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { +// if (null != imStockRequisitionMaterial) { +// //实发数量 +// imStockRequisitionMaterial.setActualQuantityIssued(pwLetterOfAdviceDetails.getApplyNumber()); +// //申请数量 +// imStockRequisitionMaterial.setApplyForQuantity(pwLetterOfAdviceDetails.getApplyNumber()); +// imStockRequisitionMaterialService.updateImStockRequisitionMaterial(imStockRequisitionMaterial); +// } +// } + //把当前单据下所有的产品添加到领料单详情中 + ImStockRequisitionMaterial imStockRequisitionMaterials = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterials.setStockRequisitionId(stockRequisition.getId()); + //关联code + imStockRequisitionMaterials.setCode(stockRequisition.getCode()); + //产品型号 + if(pwLetterOfAdviceDetails.getProductType().contains("XCL")){ + String xinghao = pwLetterOfAdviceDetails.getProductType().replaceAll("XCL", ""); + String replaceAll = xinghao.replaceAll("R[+]L", "L+R"); + imStockRequisitionMaterials.setFigureNumber(replaceAll); + }else{ + imStockRequisitionMaterials.setFigureNumber(pwLetterOfAdviceDetails.getProductType()); + } + //产品名称 + imStockRequisitionMaterials.setMaterialName(pwLetterOfAdviceDetails.getName()); + //申领人 + imStockRequisitionMaterials.setMaterialHandlerName(letterOfAdvice.getProposer()); + //应发数量 + imStockRequisitionMaterials.setSalaryQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //申请数量 + imStockRequisitionMaterials.setApplyForQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //实发数量 + imStockRequisitionMaterials.setActualQuantityIssued(pwLetterOfAdviceDetails.getApplyNumber()); + // //库存数量 + // PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(pwLetterOfAdviceProduct.getProductType()); + // imStockRequisitionMaterial.setInventoryQuantity(inventoryDetail.getQuantity()); + //出库状态 + imStockRequisitionMaterials.setGetStatus("未出库"); + imStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterials); + } + } else { + //创建新的领料单 + stockRequisition = new ImStockRequisition(); + //关联单据code + stockRequisition.setCode(letterOfAdvice.getContractCode()); + //根据领料单据code(合同code)查询合同信息 + PwContract pwContract = pwContractService.selectByContractCode(letterOfAdvice.getContractCode()); + if (null != pwContract) { + //项目名称 + stockRequisition.setProjectName(pwContract.getItemName()); + } + //领料人姓名 + stockRequisition.setMaterialHandlerName(pwContract.getSparedOne()); + //领料状态 + stockRequisition.setGetStatus("未出库"); + //添加领料单 + imStockRequisitionService.insertImStockRequisition(stockRequisition); + //查询当前单据下所有的产品 + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list) { + //把当前单据下所有的产品添加到领料单详情中 + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联code + imStockRequisitionMaterial.setCode(stockRequisition.getCode()); + //产品型号 + imStockRequisitionMaterial.setFigureNumber(pwLetterOfAdviceDetails.getProductType()); + if(pwLetterOfAdviceDetails.getProductType().contains("XCL")){ + String xinghao = pwLetterOfAdviceDetails.getProductType().replaceAll("XCL", ""); + String replaceAll = xinghao.replaceAll("R[+]L", "L+R"); + imStockRequisitionMaterial.setFigureNumber(replaceAll); + }else{ + imStockRequisitionMaterial.setFigureNumber(pwLetterOfAdviceDetails.getProductType()); + } + //产品名称 + imStockRequisitionMaterial.setMaterialName(pwLetterOfAdviceDetails.getName()); + //申领人 + imStockRequisitionMaterial.setMaterialHandlerName(letterOfAdvice.getProposer()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //已发数量 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwLetterOfAdviceDetails.getApplyNumber()); + //实发数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwLetterOfAdviceDetails.getApplyNumber()); +// //库存数量 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByFigureNumber(pwLetterOfAdviceProduct.getProductType()); +// imStockRequisitionMaterial.setInventoryQuantity(inventoryDetail.getQuantity()); + //出库状态 + imStockRequisitionMaterial.setGetStatus("未出库"); + imStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + } + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("成品出库",stockRequisition.getCode(),"","",letterOfAdvice.getProposer(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+stockRequisition.getId()); + } + + return AjaxResult.success(); + } + + /** + * 提交申请发运通知单 + */ + @DeleteMapping("editStatuss/{ids}") + public AjaxResult editStatuss(@PathVariable Long[] ids) { + for (Long long1 : ids) { + //根据id查询发运通知单信息 + PwLetterOfAdvice letterOfAdvice = pwLetterOfAdviceService.selectPwLetterOfAdviceById(long1); + //发运状态改为已申请状态1 + letterOfAdvice.setStatus(1); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + letterOfAdvice.setProposer(user.getNickName()); + int i = pwLetterOfAdviceService.updatePwLetterOfAdvice(letterOfAdvice); + if (i < 1) { + return AjaxResult.error(); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("审核发运单",letterOfAdvice.getContractCode(),letterOfAdvice.getPurchaserUnitName(),"",letterOfAdvice.getProposer(),"会记","审核发运","发运通知单管理","/letterOfAdvice/letterOfAdvice"); + } + return AjaxResult.success(); + } + + /** + * 打印发运单单据 + */ + @RequestMapping(value = "prints/{id}") + public AjaxResult prints(@PathVariable("id") Long id) { + + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if (null == id) { + return AjaxResult.error("请选择需要打印的发运单"); + } + + + //根据id查询发运单信息 + PwLetterOfAdvice letterOfAdvice = pwLetterOfAdviceService.selectPwLetterOfAdviceById(id); + //根据发运单id查询发运单详情信息 + List list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByLetterOfAdviceId(id); + //生产令号 + String code = ""; + Long i = 1L; + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list) { + pwLetterOfAdviceDetails.setSerialNumber(i); + code = pwLetterOfAdviceDetails.getProductionBillCode(); + //根据型号去非标产品表中查询,如果未差询到则认为是销齿链,如果查询到则获取其名称 + PwDanceNotStandard danceNotStandard = pwDanceNotStandardService.selectPwDanceNotStandardByType(pwLetterOfAdviceDetails.getProductType()); + if (null != danceNotStandard) { + //产品名称 + pwLetterOfAdviceDetails.setName(danceNotStandard.getName()); + } else { + //产品名称 + pwLetterOfAdviceDetails.setName("销齿链"); + } + i++; + } + //返回获得到的发运单信息 + HashMap godownMessage = new HashMap<>(); + //发运单信息 + godownMessage.put("letterOfAdvice", letterOfAdvice); + //发运单详情信息 + godownMessage.put("list", list); + //生产令号 + godownMessage.put("code", code); + //制单人 + godownMessage.put("nickName", user.getNickName()); + //日期 + godownMessage.put("createDate",sdf.format(new Date())); +// // 创建excel文件 +// ExcelUtilPrintFaYun util = new ExcelUtilPrintFaYun(PwLetterOfAdviceDetails.class); +// //一级表头 +// String title = "河北伊特机械设备制造有限公司"; +// //二级表头 +// String titleTwo = "产品发运单"; +// +// //表尾 +// String footer = "本单据一式四份,生产部、财务部、库房、存档各一份"; + +// return util.exportExcel(letterOfAdvice, list, title, titleTwo, footer, user.getNickName(), code); + return AjaxResult.success("success",godownMessage); + } + + /** + * 上传合同的PDF + * + * @param id + * @param filePath + * @return + */ + @RequestMapping("/uploadPDF") + @ResponseBody + public AjaxResult uploadPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { + String originalFilename = filePath.getOriginalFilename(); + if (originalFilename != null) { + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传"); + } else { + //根据id查询发运通知单信息 + PwLetterOfAdvice letterOfAdvice = pwLetterOfAdviceService.selectPwLetterOfAdviceById(Long.valueOf(id)); + + if(null!=letterOfAdvice.getSparedOne()&&!"".equals(letterOfAdvice.getSparedOne())){ + return AjaxResult.error("此发运单已上传过电子签收单,不可重复上传"); + } + + //根据id 获取合同信息 + String newfilenname = generateUniqueFileName(originalFilename); + try (InputStream is = filePath.getInputStream(); + //在对应的文件夹下生成新的图片 + FileOutputStream fos = new FileOutputStream("D:/contract/confirmationPDF/" + newfilenname); + BufferedOutputStream bos = new BufferedOutputStream(fos)) { + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + //映射路径 + letterOfAdvice.setSparedOne(newfilenname); + //更新 + pwLetterOfAdviceService.updatePwLetterOfAdvice(letterOfAdvice); + + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + } + } + } + return AjaxResult.success("文件上传成功"); + + } + + /** + * 生成随机文件名 + * + * @param originalFilename + * @return + */ + private String generateUniqueFileName(String originalFilename) { + String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); + String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); + //生成年月日加 毫秒值的 文件名称 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String date = dateFormat.format(new Date()); + return filename + "_" + date + System.currentTimeMillis() + extension; + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceDetailsController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceDetailsController.java new file mode 100644 index 0000000..7861d12 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceDetailsController.java @@ -0,0 +1,115 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwLetterOfAdviceDetails; +import com.ruoyi.project.management.domain.PwLetterOfAdviceProduct; +import com.ruoyi.project.management.service.IPwLetterOfAdviceDetailsService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceProductService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品发货通知单详情Controller + * + * @author zhukangchao + * @date 2022-03-01 + */ +@RestController +@RequestMapping("/management/pwLetterOfAdviceDetails") +public class PwLetterOfAdviceDetailsController extends BaseController +{ + @Autowired + private IPwLetterOfAdviceDetailsService pwLetterOfAdviceDetailsService; + //发运单列表信息 + @Autowired + private IPwLetterOfAdviceProductService pwLetterOfAdviceProductService; + + /** + * 查询产品发货通知单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwLetterOfAdviceDetails:list')") + @GetMapping("/list") + public TableDataInfo list(PwLetterOfAdviceDetails pwLetterOfAdviceDetails) + { + startPage(); + List list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsList(pwLetterOfAdviceDetails); + return getDataTable(list); + } + + /** + * 导出产品发货通知单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwLetterOfAdviceDetails:export')") + @Log(title = "产品发货通知单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwLetterOfAdviceDetails pwLetterOfAdviceDetails) + { + List list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsList(pwLetterOfAdviceDetails); + ExcelUtil util = new ExcelUtil(PwLetterOfAdviceDetails.class); + return util.exportExcel(list, "pwLetterOfAdviceDetails"); + } + + /** + * 获取产品发货通知单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwLetterOfAdviceDetails:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsById(id)); + } + + /** + * 新增产品发货通知单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwLetterOfAdviceDetails:add')") + @Log(title = "产品发货通知单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwLetterOfAdviceDetails pwLetterOfAdviceDetails) + { + return toAjax(pwLetterOfAdviceDetailsService.insertPwLetterOfAdviceDetails(pwLetterOfAdviceDetails)); + } + + /** + * 修改产品发货通知单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwLetterOfAdviceDetails:edit')") + @Log(title = "产品发货通知单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwLetterOfAdviceDetails pwLetterOfAdviceDetails) + { + return toAjax(pwLetterOfAdviceDetailsService.updatePwLetterOfAdviceDetails(pwLetterOfAdviceDetails)); + } + + /** + * 删除产品发货通知单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwLetterOfAdviceDetails:remove')") + @Log(title = "产品发货通知单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long long1 : ids) { + //删除之前把发运单列表中的已发数量恢复 + PwLetterOfAdviceDetails letterOfAdviceDetails = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsById(long1); + //根据执行单code和产品型号查询 + PwLetterOfAdviceProduct letterOfAdviceProduct = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductByCodeAndFigureNumber(letterOfAdviceDetails.getProductionBillCode(), letterOfAdviceDetails.getProductType()); + letterOfAdviceProduct.setSentNumber(letterOfAdviceProduct.getSentNumber()-letterOfAdviceDetails.getApplyNumber()); + pwLetterOfAdviceProductService.updatePwLetterOfAdviceProduct(letterOfAdviceProduct); + } + return toAjax(pwLetterOfAdviceDetailsService.deletePwLetterOfAdviceDetailsByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceProductController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceProductController.java new file mode 100644 index 0000000..e0ddc9f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwLetterOfAdviceProductController.java @@ -0,0 +1,334 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; + +import com.ruoyi.common.utils.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwLetterOfAdvice; +import com.ruoyi.project.management.domain.PwLetterOfAdviceDetails; +import com.ruoyi.project.management.domain.PwLetterOfAdviceProduct; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.domain.PwProductionOrder; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwContractService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceDetailsService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceProductService; +import com.ruoyi.project.management.service.IPwLetterOfAdviceService; +import com.ruoyi.project.management.service.IPwProductionBillProductService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.project.management.service.IPwProductionOrderService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品发货通知单关联Controller + * + * @author zhukangchao + * @date 2020-07-21 + */ +@RestController +@RequestMapping("/management/letterOfAdviceProduct") +public class PwLetterOfAdviceProductController extends BaseController +{ + @Autowired + private IPwLetterOfAdviceProductService pwLetterOfAdviceProductService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + @Autowired + private IPwLetterOfAdviceService pwLetterOfAdviceService; + //合同信息 + @Autowired + private IPwContractService pwContractService; + //发运单详情信息 + @Autowired + private IPwLetterOfAdviceDetailsService pwLetterOfAdviceDetailsService; + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //生产订单信息 + @Autowired + private IPwProductionOrderService pwProductionOrderService; + + + /** + * 查询产品发货通知单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdviceProduct:list')") + @GetMapping("/list") + public TableDataInfo list(PwLetterOfAdviceProduct pwLetterOfAdviceProduct){ + List list = new ArrayList(); + //查询发运单id不为null的数据 +// startPage(); + List lists = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductList(pwLetterOfAdviceProduct); + for (PwLetterOfAdviceProduct pwLetterOfAdviceProduct2 : lists) { + if(pwLetterOfAdviceProduct2.getSentNumber() list = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductList(pwLetterOfAdviceProduct); + ExcelUtil util = new ExcelUtil(PwLetterOfAdviceProduct.class); + return util.exportExcel(list, "letterOfAdviceProduct"); + } + + /** + * 获取产品发货通知单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdviceProduct:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductById(id)); + } + + /** + * 新增产品发货通知单关联 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdviceProduct:add')") + @Log(title = "产品发货通知单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwLetterOfAdviceProduct pwLetterOfAdviceProduct) + { + return toAjax(pwLetterOfAdviceProductService.insertPwLetterOfAdviceProduct(pwLetterOfAdviceProduct)); + } + + /** + * 修改产品发货通知单关联 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdviceProduct:edit')") + @Log(title = "产品发货通知单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwLetterOfAdviceProduct pwLetterOfAdviceProduct){ + //根据执行单code查询合同code + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(pwLetterOfAdviceProduct.getProductionBillCode()); + //获取合同code + String contractCode = productionBill.getContractCode(); + //根据合同code查询发运单信息 + PwLetterOfAdvice letterOfAdvice = pwLetterOfAdviceService.selectPwLetterOfAdviceByCode(contractCode); + int i = 0; + if(null!=letterOfAdvice){ + pwLetterOfAdviceProduct.setLetterOfAdviceId(letterOfAdvice.getId()); + i = pwLetterOfAdviceProductService.updatePwLetterOfAdviceProduct(pwLetterOfAdviceProduct); + }else{ + //创建新的发运单 + letterOfAdvice = new PwLetterOfAdvice(); + //合同code + letterOfAdvice.setContractCode(contractCode); + //根据合同code查询合同信息 + PwContract pwContract = pwContractService.selectByContractCode(contractCode); + //买方名称 + letterOfAdvice.setPurchaserUnitName(pwContract.getPurchaser()); + //运费支付方 + letterOfAdvice.setFreightPayer(pwContract.getFreightPayer()); + //收货人 + letterOfAdvice.setConsignee(pwContract.getConsignee()); + //收货地址 + letterOfAdvice.setShippingAddress(pwContract.getDeliveryPoints()); + //收货人电话 + letterOfAdvice.setPurchaserUnitPhone(pwContract.getPurchaserPhone()); + //财务审核(初始值为0,未审核) + letterOfAdvice.setFinancialAudit(0); + //领导审核(初始值为0,未审核) + letterOfAdvice.setRatify(0); + //运单状态(初始值为0,未申请) + letterOfAdvice.setStatus(0); + //删除标记 + letterOfAdvice.setDelFlag(0); + i = pwLetterOfAdviceService.insertPwLetterOfAdvice(letterOfAdvice); + } + return toAjax(i); + } + + /** + * 申请发货 + */ + @RequestMapping("/shipmentss") + public AjaxResult shipmentss(@RequestBody PwLetterOfAdviceProduct pwLetterOfAdviceProduct){ + //判断发运数量是否为null或者0 + if(null==pwLetterOfAdviceProduct.getApplyNumber()||"".equals(pwLetterOfAdviceProduct.getApplyNumber())||pwLetterOfAdviceProduct.getApplyNumber()==0){ + return AjaxResult.error("请填写发运数量"); + } + //根据执行单号和型号查询已发运数量 + List list = null; + //有物料名称的查询条件需要按名称,类型和发运单号查询 ,无名称直接发运单号和类型查询 + if(StringUtils.isEmpty(pwLetterOfAdviceProduct.getSparedOne())){ + list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsByCodeAndTypeName(pwLetterOfAdviceProduct.getProductionBillCode(),pwLetterOfAdviceProduct.getProductType()); + }else{ + PwLetterOfAdviceDetails pwLetterOfAdviceDetails = new PwLetterOfAdviceDetails(); + pwLetterOfAdviceDetails.setProductionBillCode(pwLetterOfAdviceProduct.getProductionBillCode()); + pwLetterOfAdviceDetails.setSparedOne(pwLetterOfAdviceProduct.getSparedOne()); + pwLetterOfAdviceDetails.setProductType(pwLetterOfAdviceProduct.getProductType()); + list = pwLetterOfAdviceDetailsService.selectPwLetterOfAdviceDetailsList(pwLetterOfAdviceDetails); + } + Long s = 0L; + for (PwLetterOfAdviceDetails pwLetterOfAdviceDetails : list) { + s += pwLetterOfAdviceDetails.getSentNumber(); + } + if(pwLetterOfAdviceProduct.getApplyNumber()+s>pwLetterOfAdviceProduct.getNumber()){ + return AjaxResult.error("申请数量不可大于应发数量"); + } + //合同编号 + String contractCode = ""; + //根据执行单code查询合同code + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(pwLetterOfAdviceProduct.getProductionBillCode()); + if(null==productionBill){ + //根据生产订单信息查询合同号 + PwProductionOrder productionOrder = pwProductionOrderService.selectPwProductionOrderByCode(pwLetterOfAdviceProduct.getProductionBillCode()); + contractCode = productionOrder.getSparedOne(); + }else{ + //根据合同code查询合同信息 + PwContract pwContract = pwContractService.selectByContractCode(productionBill.getContractCode()); + if(null==pwContract){ + //根据生产订单信息查询合同号 + PwProductionOrder productionOrder = pwProductionOrderService.selectPwProductionOrderByCode(productionBill.getContractCode()); + contractCode = productionOrder.getSparedOne(); + }else{ + contractCode = productionBill.getContractCode(); + } + } + //根据合同code查询发运单信息 + PwLetterOfAdvice letterOfAdvice = pwLetterOfAdviceService.selectPwLetterOfAdviceByCode(contractCode); + int i = 0; + //如果发运单不为null,说明此单据之前发过货 + if(null!=letterOfAdvice){ + //申请状态 +// letterOfAdvice.setStatus(0); +// //财务审核状态 +// letterOfAdvice.setFinancialAudit(0); +// //财务审核时间 +// letterOfAdvice.setFinancialAuditTime(null); +// //领导审核状态 +// letterOfAdvice.setRatify(0); +// //领导审核时间 +// letterOfAdvice.setRatifyTime(null); +// pwLetterOfAdviceService.updatePwLetterOfAdvice(letterOfAdvice); + }else{ + //创建新的发运单 + letterOfAdvice = new PwLetterOfAdvice(); + //合同code + letterOfAdvice.setContractCode(contractCode); + //根据合同code查询合同信息 + PwContract pwContract = pwContractService.selectByContractCode(contractCode); + //买方名称 + letterOfAdvice.setPurchaserUnitName(pwContract.getPurchaser()); + //运费支付方 + letterOfAdvice.setFreightPayer(pwContract.getFreightPayer()); + //收货人 + letterOfAdvice.setConsignee(pwContract.getConsignee()); + //收货地址 + letterOfAdvice.setShippingAddress(pwContract.getDeliveryPoints()); + //收货人电话 + letterOfAdvice.setPurchaserUnitPhone(pwContract.getPurchaserPhone()); + //财务审核(初始值为0,未审核) + letterOfAdvice.setFinancialAudit(0); + //领导审核(初始值为0,未审核) + letterOfAdvice.setRatify(0); + //运单状态(初始值为0,未申请) + letterOfAdvice.setStatus(0); + //删除标记 + letterOfAdvice.setDelFlag(0); + i = pwLetterOfAdviceService.insertPwLetterOfAdvice(letterOfAdvice); + + } + //添加发运单详情 + PwLetterOfAdviceDetails pwLetterOfAdviceDetails= new PwLetterOfAdviceDetails(); + //发运单id + pwLetterOfAdviceDetails.setLetterOfAdviceId(letterOfAdvice.getId()); + //关联单据code + pwLetterOfAdviceDetails.setProductionBillCode(pwLetterOfAdviceProduct.getProductionBillCode()); + //产品型号 + pwLetterOfAdviceDetails.setProductType(pwLetterOfAdviceProduct.getProductType()); + //应发数量 + pwLetterOfAdviceDetails.setNumber(pwLetterOfAdviceProduct.getNumber()); + //设备编号 + pwLetterOfAdviceDetails.setEquipmentNumber(pwLetterOfAdviceProduct.getEquipmentNumber()); + //物料名称 + pwLetterOfAdviceDetails.setSparedOne(pwLetterOfAdviceProduct.getSparedOne()); + //实发数量 + pwLetterOfAdviceDetails.setSentNumber(pwLetterOfAdviceProduct.getApplyNumber()); + //申请数量 + pwLetterOfAdviceDetails.setApplyNumber(pwLetterOfAdviceProduct.getApplyNumber()); + //删除标记 + pwLetterOfAdviceDetails.setDelFlag(0); + i = pwLetterOfAdviceDetailsService.insertPwLetterOfAdviceDetails(pwLetterOfAdviceDetails); + + //把关联信息表的已发数量修改为申请数量(已发数量+本次申请数量) + if(null==pwLetterOfAdviceProduct.getSentNumber()){ + pwLetterOfAdviceProduct.setSentNumber(0L); + } + pwLetterOfAdviceProduct.setSentNumber(pwLetterOfAdviceProduct.getSentNumber()+pwLetterOfAdviceProduct.getApplyNumber()); + pwLetterOfAdviceProduct.setApplyNumber(0L); + pwLetterOfAdviceProductService.updatePwLetterOfAdviceProduct(pwLetterOfAdviceProduct); + return toAjax(i); + } + + /** + * 删除产品发货通知单关联 + */ + @PreAuthorize("@ss.hasPermi('management:letterOfAdviceProduct:remove')") + @Log(title = "产品发货通知单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwLetterOfAdviceProductService.deletePwLetterOfAdviceProductByIds(ids)); + } + + /** + * 转为库存商品 + */ + @RequestMapping("/transitions/{ids}") + public AjaxResult transitions(@PathVariable Long[] ids){ + for (Long long1 : ids) { + PwLetterOfAdviceProduct pwLetterOfAdviceProduct = pwLetterOfAdviceProductService.selectPwLetterOfAdviceProductById(long1); + //根据执行单code查询合同code + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(pwLetterOfAdviceProduct.getProductionBillCode()); + //判断当前令号下的所有总装型号是否都已经入库完成 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByProductionCodeALL(productionBill.getCode()); + int i = 0; + for (PwBomNumberTwo pwBomNumberTwo : list) { + if(null!=pwBomNumberTwo.getSparedFive()&&100==pwBomNumberTwo.getSparedFive()){ + if(!"已入库".equals(pwBomNumberTwo.getInventoryStatus())||null==pwBomNumberTwo.getInventoryStatus()){ + i = 1; + break; + } + } + } + if(i==0){ + //直接修改执行单完成状态即可 + productionBill.setStatus("已完成"); + pwProductionBillService.updatePwProductionBill(productionBill); + } + } + return toAjax(pwLetterOfAdviceProductService.deletePwLetterOfAdviceProductByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwMakeDocumentsController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwMakeDocumentsController.java new file mode 100644 index 0000000..aa93ae2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwMakeDocumentsController.java @@ -0,0 +1,1305 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.ruoyi.common.utils.StringUtils; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.security.access.prepost.PreAuthorize; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PreliminaryInventoryInfo; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocuments; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwModulePart; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.domain.SysConfigIni; +import com.ruoyi.project.management.mapper.PwMakeDocumentsDetailMapper; +import com.ruoyi.project.management.mapper.PwMakeDocumentsMapper; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsService; +import com.ruoyi.project.management.service.IPwModulePartService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.project.management.service.IPwPurchaseContractMaterialService; +import com.ruoyi.project.management.service.IPwPurchaseContractService; +import com.ruoyi.project.management.service.ISysConfigIniService; +import com.ruoyi.project.management.utils.DeleteFile; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.management.utils.FileToZip; +import com.ruoyi.project.management.utils.PDFDocHelper; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 库存制作单Controller + * + * @author zhukangchao + * @date 2020-11-11 + */ +@RestController +@RequestMapping("/management/makeDocuments") +public class PwMakeDocumentsController extends BaseController +{ + @Value("${ruoyi.yzPdfUrl}") + private String yzPdfUrl; + @Value("${ruoyi.pdfUrl}") + private String pdfUrl; + + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + //用户标识信息 + @Autowired + private TokenService tokenService; + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //采购单详情信息 + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //原材料采购单信息 + @Autowired + private IPwBuyingRequisitionService pwBuyingRequisitionService; + @Autowired + private IPwBuyingRequisitionMaterialService pwBuyingRequisitionMaterialService; + + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + @Autowired + private PwMakeDocumentsDetailMapper pwMakeDocumentsDetailMapper; + @Autowired + private PwMakeDocumentsMapper pwMakeDocumentsMapper; + @Autowired + private ISysDeptService deptService; + //图纸信息 + @Autowired + private ISysConfigIniService sysConfigIniService; + //入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //出库单信息 + @Autowired + private IImStockRequisitionMaterialService imStockRequisitionMaterialService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //零部件配置信息 + @Autowired + private IPwModulePartService pwModulePartService; + //质检信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + + /** + * 查询库存制作单列表 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocuments:list')") + @GetMapping("/list") + public TableDataInfo list(PwMakeDocuments pwMakeDocuments){ + startPage(); + List list = pwMakeDocumentsService.selectPwMakeDocumentsList(pwMakeDocuments); + return getDataTable(list); + } + + /** + * 打印企标单 + */ + @RequestMapping("/printMakeDocuments/{ids}") + public AjaxResult printMakeDocuments(@PathVariable Long[] ids){ + Map map = new HashedMap(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //获取当前用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //用户昵称 + String nickName = user.getNickName(); + List list = new ArrayList(); + for (Long id : ids) { + PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsById(id); + makeDocuments.setUserName(nickName); + makeDocuments.setPrepareDate(sdf.format(new Date())); + //根据令号查询当前令号下有哪些企标件 + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndDeleteXu(makeDocuments.getCode()); + makeDocuments.setPwMakeDocumentsDetail(list2); + list.add(makeDocuments); + } + map.put("list", list); + return AjaxResult.success("success",map); + } + + /** + * 下载生产图纸,并写入数据 + */ + @RequestMapping("/downloads/{ids}") + public AjaxResult downloads(@PathVariable Long[] ids){ + String makeDocumentsCode = ""; + //拼接需要传的图号 + String figureNumber = ""; + //拼接需要传的数量 + String quantity = ""; + //令号 + String code = ""; + //完成时间 + String date = ""; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + //返回令号集合 + List list5 = new ArrayList(); + for (Long id : ids) { + //根据id查询企标单信息(获取型号图纸类型) + PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsById(id); + //根据企标单令号查询企标单详情信息 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCode(makeDocuments.getCode()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + //根据id查询当前数据 +// PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); + //获取令号 + makeDocumentsCode = pwMakeDocumentsDetail.getMakeDocumentsCode(); + //获取图纸型号 + code = pwMakeDocumentsDetail.getMakeDocumentsCode(); + if(pwMakeDocumentsDetail.getName().contains("(M)")){ + //获取当前数据的图号 + figureNumber += pwMakeDocumentsDetail.getFigureNumber().substring(0,pwMakeDocumentsDetail.getFigureNumber().lastIndexOf("-"))+","; + }else{ + //获取当前数据的图号 + figureNumber += pwMakeDocumentsDetail.getFigureNumber()+","; + } + if(null!=pwMakeDocumentsDetail.getCompletionDate()&&!"".equals(pwMakeDocumentsDetail.getCompletionDate())){ + //完成时间 + date += sdf.format(pwMakeDocumentsDetail.getCompletionDate())+","; + }else{ + date += ""+","; + } + //获取数量 + quantity += pwMakeDocumentsDetail.getQuantity().toString()+","; + } + + //先查询pdf路径下有没有这张图 + String files = yzPdfUrl+code; + DeleteFile.delFolder(files); + //根据令号查询图纸型号 +// PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(code); + //根据图纸型号查询图纸路径 + SysConfigIni configIni = sysConfigIniService.selectSysConfigIniByFileType(makeDocuments.getSparedOne()); + String fileUrl = configIni.getFileUrl(); + + String s = "{\"url\":\""+fileUrl+"\", \"ids\":\""+figureNumber+"\", \"product_id\":\""+makeDocumentsCode+"\", \"number\":\""+quantity+"\", \"date\":\""+date+"\"}"; + + String sendPost = HttpUtils.sendPost("http://localhost:8900/product/product_export_drawing", s); + // json串转对象 + JSONObject rcm = JSONObject.parseObject(sendPost); + + //创建zip压缩文件夹,把没有库存的图复制到此文件夹下等待压缩 + File filess = new File(yzPdfUrl+code+"/zip"); + if (!filess.exists()) { + filess.mkdir(); + } + //如果result等于0,说明图纸生成完毕 + if("0".equals(rcm.get("code").toString())){ + //去服务器的文件夹下打包所有的pdf,然后下载 + File file = new File(yzPdfUrl + code + "/" + code + ".zip"); + if (file.exists()) { + file.delete(); + } + FileInputStream fileInputStream = null; + FileOutputStream fileOutputStream = null; + //把图纸添加上图纸章和工序 +// for (Long long1 : ids) { + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + + //把所有工序拼接成字符串 + String cailiao = ""; + String gongxu = "工序:"; + String xuMiaoShu = "序描述:"; + //根据id查询物料信息 +// PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(long1); + // 根据当前物料的id查询其所有工序子集 + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + //把所有工序拼接成字符串 + for (PwMakeDocumentsDetail makeDocumentsDetail2 : list2) { + if(makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1).equals("1")){ + if(null==makeDocumentsDetail2.getMaterialsName()){ + makeDocumentsDetail2.setMaterialsName(""); + } + if(null==makeDocumentsDetail2.getMaterialsSpecification()){ + makeDocumentsDetail2.setMaterialsSpecification("");; + } + if(null==makeDocumentsDetail2.getMeasure()){ + makeDocumentsDetail2.setMeasure("");; + } + if(null==makeDocumentsDetail2.getWorkblank()){ + makeDocumentsDetail2.setWorkblank(0L);; + } + if(null==makeDocumentsDetail2.getFinished()){ + makeDocumentsDetail2.setFinished(0L);; + } + cailiao += "材料名称:"+makeDocumentsDetail2.getMaterialsName()+" "+"图号:"+makeDocumentsDetail2.getMaterialsSpecification()+" "+"下料尺寸:"+makeDocumentsDetail2.getMeasure()+" "+"毛坯数量:"+makeDocumentsDetail2.getWorkblank()+" "+"成品数量:"+makeDocumentsDetail2.getFinished(); + if(null!=makeDocumentsDetail2.getXuDescribe()&&!"".equals(makeDocumentsDetail2.getXuDescribe())){ + xuMiaoShu += makeDocumentsDetail2.getXuDescribe(); + } + } + if(null!=makeDocumentsDetail2.getCompletionDate()){ + gongxu += makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1)+"、"+makeDocumentsDetail2.getName().substring(makeDocumentsDetail2.getName().lastIndexOf("-")+1,makeDocumentsDetail2.getName().indexOf("(M)"))+"-"+sdf.format(makeDocumentsDetail2.getCompletionDate())+" "; + }else{ + gongxu += makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1)+"、"+makeDocumentsDetail2.getName().substring(makeDocumentsDetail2.getName().lastIndexOf("-")+1,makeDocumentsDetail2.getName().indexOf("(M)"))+"-"+" "; + } + } + String s2 = pwMakeDocumentsDetail.getFigureNumber()+".pdf"; + s2 = s2.replace("/", "--"); + //获取当前图号的所属型号 + //获取pdf所在路径 + File f = new File(yzPdfUrl + code); + if (!f.exists()) { + System.out.println(yzPdfUrl + code + " not exists"); + return AjaxResult.error("路径不存在"); + } + + //获取所有的pdf文件 + File fa[] = f.listFiles(); + PDFDocHelper pd = new PDFDocHelper(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + String na = name.substring(name.indexOf("-")+1); + //如果名称相同则把文件重新放入到一个新的文件夹,等待压缩 +// if(s.equals(na)||na.contains("--2-1")||na.contains("--2-2")||na.contains("--3-1")||na.contains("--3-2")||na.contains("--3-3")||na.contains("XCL.1")||na.contains("XCL.2")){ + if(s2.equals(na)){ + try { + //获取要复制的文件 + File oldfile = new File(yzPdfUrl + code+"/" + name); + //文件输入流,用于读取要复制的文件 + fileInputStream = new FileInputStream(oldfile); + //要生成的新文件(指定路径如果没有则创建) + File newfile = new File(yzPdfUrl + code+"/new/" + name); + //获取父目录 + File fileParent = newfile.getParentFile(); + if(fileParent.exists()){ + fileParent.delete(); + } + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfile.exists()){ + newfile.delete(); + } + //判断文件是否存在 + if (!newfile.exists()) { + //创建文件 + newfile.createNewFile(); + }else{ + continue; + } +// PdfReader reader = new PdfReader(pdfUrl + code + "/" + name); +// // 获取pdf的宽和高 +// Rectangle pageSize = reader.getPageSize(1); +// float height = pageSize.getHeight(); +// float width = pageSize.getWidth(); + //把当前zip路径下所有的图片添加上文字水印 + List> reviews = new ArrayList<>(); + Map review = new HashMap<>(); + Map rev = new HashMap<>(); + Map xu = new HashMap<>(); + // 获取文件名(图号),根据图号查询表中数量 + review.put("result", cailiao); + rev.put("result", gongxu); + xu.put("result", xuMiaoShu); + review.put("type", "1"); + rev.put("type", "1"); + xu.put("type", "1"); + reviews.add(review); + reviews.add(rev); + reviews.add(xu); + float[] pawX = {20, 20, 20}; + float[] pawY = {817, 30, 800}; + //把当前zip路径下的所有图片添加上图纸章水印 + try { + pd.imageWatermark(yzPdfUrl + code+"/" + name, yzPdfUrl + code +"/new/" + name, "D:/java/tuzhizhang.png", reviews, pawX, pawY); + } catch (Exception e) { + e.printStackTrace(); + } + } catch (Exception e) { + // TODO: handle exception + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + +// } + } + File filea = new File(yzPdfUrl + code + "/zip/"+ code + ".zip"); + if (filea.exists()) { + filea.delete(); + } + + //把当前文件夹下所有的pdf复制到另一个可供bom表查看图纸的文件夹中 + File filesBom = new File(yzPdfUrl+code+"/bom"); + if (!filesBom.exists()) { + filesBom.mkdir(); + } + //获取pdf所在路径 + File f = new File(yzPdfUrl+code); + if (!f.exists()) { + System.out.println(yzPdfUrl+code + " not exists"); + return AjaxResult.error("路径不存在"); + } + //获取所有的pdf文件 + File fa[] = f.listFiles(); + PDFDocHelper pd = new PDFDocHelper(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + + //把所有文件复制到bom文件夹中 + //文件输入流,用于读取要复制的文件 + try { + //获取要复制的文件 + File oldfileBom = new File(yzPdfUrl + code + "/zip/" + name); + fileInputStream = new FileInputStream(oldfileBom); + //要生成的新文件(指定路径如果没有则创建) + File newfileBom = new File(yzPdfUrl+code+"/bom/" + name.substring(name.indexOf("-")+1)); + //获取父目录 + File fileParent = newfileBom.getParentFile(); + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfileBom.exists()){ + newfileBom.delete(); + } + //判断文件是否存在 + if (!newfileBom.exists()) { + //创建文件 + newfileBom.createNewFile(); + } + fileOutputStream = new FileOutputStream (newfileBom); + byte[] buffer= new byte[1024]; + int len; + //将文件流信息读取文件缓存区,如果读取结果不为-1就代表文件没有读取完毕,反之已经读取完毕 + while ((len=fileInputStream.read(buffer))!=-1) { + fileOutputStream.write(buffer, 0, len); + fileOutputStream.flush(); + } + fileInputStream.close(); + fileOutputStream.close(); + } catch (Exception e1) { + e1.printStackTrace(); + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + // 把当前文件夹下所有的文件打包,把路径保存到数据库 + boolean flag = FileToZip.fileToZip(yzPdfUrl + code + "/zip", yzPdfUrl + code + "/zip", code); + if (flag) { + list5.add(code); +// return AjaxResult.success(code); + } else { + return AjaxResult.error(); + } + } + } + + return AjaxResult.success(list5); + } + + /** + * 导出库存制作单列表 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocuments:export')") + @Log(title = "库存制作单", businessType = BusinessType.EXPORT) + @GetMapping("/export/{ids}") + public AjaxResult export(@PathVariable Long[] ids){ + List list = new ArrayList(); + for (Long id : ids) { + PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsById(id); + //根据令号查询当前令号下有哪些企标件 + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndDeleteXu(makeDocuments.getCode()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list2) { + //查询当前的库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + pwMakeDocumentsDetail.setInventoryDetailNumber(inventoryDetail.getQuantity()); + }else{ + return AjaxResult.error("未查询到:"+pwMakeDocumentsDetail.getName()+"的库存信息!"); + } + + list.add(pwMakeDocumentsDetail); + //未完成数量 + Long p = 0L; + //查询工序 + int i = 1; + List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list3) { + //查询质检信息 + List list6 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail2.getMakeDocumentsCode(), pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + //交检数量 + Long receivableQuantity = 0L; + //待检数量 + Long daijian = 0L; + //已检验数量 + Long jianyan = 0L; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list6) { + receivableQuantity += pwCompletionNoticeProduct.getReceivableQuantity().longValue(); + jianyan += pwCompletionNoticeProduct.getQuantity().longValue(); + daijian += pwCompletionNoticeProduct.getActualQuantity().longValue(); + } + + //查询入库数量 + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail2.getMakeDocumentsCode(), pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + //申请入库数量 + Long ruku = 0L; + //已入库数量 + Long number = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + ruku += imProductReceiptMaterial.getReceivableQuantity().longValue(); + number += imProductReceiptMaterial.getReceived().longValue(); + } + + //查询领料信息 + //计算在本序的数量(第一序为本批数量-已入库数量,后序为已领料数量-已入库数量) + if(i==1){ + //第一序 + + //查询已领料数量 + List list5 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail2.getMakeDocumentsCode(), pwMakeDocumentsDetail2.getMaterialsName(),pwMakeDocumentsDetail2.getMaterialsSpecification()); + //申请领料数量 + Long shenqingfaliao = 0L; + //已发数量 + Long lingliaoNumber = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list5) { + shenqingfaliao += imStockRequisitionMaterial.getSalaryQuantity(); + lingliaoNumber += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //查询申请领料的数量(申请领料数量) + pwMakeDocumentsDetail2.setShenQingLingLiaoNumber(shenqingfaliao); + //已发料的数量(已出库的数量) + pwMakeDocumentsDetail2.setYiFaLiaoNumber(lingliaoNumber); + //判断是否需领料 + if(null != pwMakeDocumentsDetail2.getMaterialId()){ + //说明需领料((发料数量/下料尺寸) - 交检合格数量 - 待检数量) + pwMakeDocumentsDetail2.setBenXuNumber((lingliaoNumber/Long.valueOf(pwMakeDocumentsDetail2.getMeasure()))-jianyan - daijian); + }else{ + //无需领料(投产数量 - 交检合格数量 - 待检数量) + pwMakeDocumentsDetail2.setBenXuNumber(pwMakeDocumentsDetail2.getQuantity() - jianyan - daijian); + } + }else{ + String substring = pwMakeDocumentsDetail2.getFigureNumber().substring(pwMakeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1); + String figureNumber = pwMakeDocumentsDetail2.getFigureNumber().substring(0,pwMakeDocumentsDetail2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //查询已领料数量 + List list5 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwMakeDocumentsDetail2.getMakeDocumentsCode(), figureNumber); + //申请领料数量 + Long shenqingfaliao = 0L; + //已发数量 + Long lingliaoNumber = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list5) { + shenqingfaliao += imStockRequisitionMaterial.getSalaryQuantity(); + lingliaoNumber += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //查询申请领料的数量(申请领料数量) + pwMakeDocumentsDetail2.setShenQingLingLiaoNumber(shenqingfaliao); + //已发料的数量(已出库的数量) + pwMakeDocumentsDetail2.setYiFaLiaoNumber(lingliaoNumber); + //本序 + pwMakeDocumentsDetail2.setBenXuNumber(lingliaoNumber - jianyan - daijian); + } + + //未完成数量(投产数量-已入库数量) + p = pwMakeDocumentsDetail2.getQuantity() - number; + pwMakeDocumentsDetail2.setWeiWanChengNumber(pwMakeDocumentsDetail2.getQuantity() - number); + //申请交检的数量(本批数量 - 合格数量) + pwMakeDocumentsDetail2.setShenQingJiaoJianNumber(receivableQuantity); + //已检验的数量(已检验数量) + pwMakeDocumentsDetail2.setYiJianYanNumber(jianyan); + //待检验数量(申请检验数量-已检验数量) + pwMakeDocumentsDetail2.setWeiZhiJianNumber(daijian); + //已入库数量(库房确认收的数量) + pwMakeDocumentsDetail2.setWanChengNumber(number); + //待入库数量(已检验数量-已入库数量) + pwMakeDocumentsDetail2.setWeiRuKuNumber(jianyan - number); + + //查询当前的库存数量 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + pwMakeDocumentsDetail2.setInventoryDetailNumber(inventoryDetail2.getQuantity()); + + list.add(pwMakeDocumentsDetail2); + i++; + } + + //把未完成数量添加到成品零件上 + pwMakeDocumentsDetail.setWeiWanChengNumber(p); + } + } + ExcelUtil util = new ExcelUtil(PwMakeDocumentsDetail.class); + return util.exportExcel(list, "makeDocuments"); + } + + /** + * 上传bom(派工) + */ + @RequestMapping("/uploadDispatchings") + @ResponseBody + public AjaxResult uploadDispatchings(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/ruoyi/Dispatchings/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + for (int i = 1; i < result.size(); i++) { + //根据令号和名称和图号查询 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(result.get(i).get(0).toString(), result.get(i).get(1).toString(), result.get(i).get(2).toString()); + if(null!=makeDocumentsDetail){ + if(result.size()>5){ + if(null!=result.get(i).get(7).toString()&&!"".equals(result.get(i).get(7).toString())){ + //完成时间 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(result.get(i).get(7).toString().contains("/")){ + String replaceAll = result.get(i).get(7).toString().replaceAll("/", "-"); + Date date = sdf.parse(replaceAll); + makeDocumentsDetail.setCompletionDate(date); + }else{ + Date date = sdf.parse(result.get(i).get(7).toString()); + makeDocumentsDetail.setCompletionDate(date); + } + } + + if(null!=result.get(i).get(5).toString()&&!"".equals(result.get(i).get(5).toString())){ + //派工部门 + //判断完成时间和是否入库是否有数据,如果没有数据,则返回失败 + if(null!=result.get(i).get(6).toString()&&!"".equals(result.get(i).get(6).toString())&&null!=result.get(i).get(7).toString()&&!"".equals(result.get(i).get(7).toString())){ + //查询派工部门是否标准 + String replaceAll = result.get(i).get(5).toString().replaceAll("(", "("); + String replaceAll2 = replaceAll.replaceAll(")", ")"); + SysDept dept = new SysDept(); + dept.setDeptName(replaceAll2.trim()); + List list = deptService.selectDeptLists(dept); + if(list.size()>0){ + makeDocumentsDetail.setDepartmentName(replaceAll2.trim()); + }else{ + return AjaxResult.error("未查询到此部门"); + } + }else{ + return AjaxResult.error("请完善时间和是否入库列"); + } + } + + if(null!=result.get(i).get(6).toString()&&!"".equals(result.get(i).get(6).toString())){ + //是否入库 + //判断是否是"是"或者"否" + String trim = result.get(i).get(6).toString().trim(); + if(!"是".equals(trim)&&!"否".equals(trim)){ + return AjaxResult.error("请正确填写是否入库(是或否)"); + } + makeDocumentsDetail.setGodownEntry(trim); + } + + if(null!=result.get(i).get(12).toString()&&!"".equals(result.get(i).get(12).toString())){ + //序描述 + makeDocumentsDetail.setXuDescribe(result.get(i).get(12).toString()); + } + } + } + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + /** + * 获取库存制作单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocuments: ')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwMakeDocumentsService.selectPwMakeDocumentsById(id)); + } + + /** + * 新增库存制作单 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocuments:add')") + @Log(title = "库存制作单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwMakeDocuments pwMakeDocuments){ + String sparedOne = pwMakeDocuments.getSparedOne(); + if(null!=sparedOne&&!"".equals(sparedOne)){ + pwMakeDocuments.setSparedOne(sparedOne.substring(3)); + }else{ + return AjaxResult.error("请选择图纸型号"); + } + //企标单编号 +// if(null==pwMakeDocuments.getCode()||"".equals(pwMakeDocuments.getCode())){ +// return AjaxResult.error("请填写企标单号"); +// } + return toAjax(pwMakeDocumentsService.insertPwMakeDocuments(pwMakeDocuments)); + } + + /** + * 修改库存制作单 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocuments:edit')") + @Log(title = "库存制作单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwMakeDocuments pwMakeDocuments){ +// String sparedOne = pwMakeDocuments.getSparedOne(); +// pwMakeDocuments.setSparedOne(sparedOne.substring(3)); + + return toAjax(pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments)); + } + + /** + * 删除库存制作单 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocuments:remove')") + @Log(title = "库存制作单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsById(id); + PwMakeDocumentsDetail pwMakeDocumentsDetail = new PwMakeDocumentsDetail(); + pwMakeDocumentsDetail.setMakeDocumentsCode(makeDocuments.getCode()); + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailList(pwMakeDocumentsDetail); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list) { + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail2.getId()); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + /*if(inventoryDetail.getPreliminaryInventory()>=makeDocumentsDetail.getQuantity()){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-makeDocumentsDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(0L); + }*/ + //减去原材料的预定数量 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + //说明添加了原材料 + if(inventoryDetail2.getLockNumber()>=makeDocumentsDetail.getReceiveNumber()){ + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()-makeDocumentsDetail.getReceiveNumber()); + }else{ + inventoryDetail2.setLockNumber(0L); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + pwMakeDocumentsDetailService.deletePwMakeDocumentsDetailById(pwMakeDocumentsDetail2.getId()); + } + } + return toAjax(pwMakeDocumentsService.deletePwMakeDocumentsByIds(ids)); + } + + /** + * 审批库存制作单 + */ + @RequestMapping("/editPass") + public AjaxResult editPass(Long id){ + PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsById(id); + makeDocuments.setPass(1); + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + makeDocuments.setApprover(user.getNickName()); + int i = pwMakeDocumentsService.updatePwMakeDocuments(makeDocuments); + if (i < 1) { + return AjaxResult.error(); + } + return AjaxResult.success(); + } + + /** + * 查询库存制作单列表(根据库存表的在途数量) + */ +// @PreAuthorize("@ss.hasPermi('management:makeDocuments:list')") + @RequestMapping("/listMakeDocumentsZaiTuByInventoryDetailId/{inventoryDetailId}") + public TableDataInfo listMakeDocumentsZaiTuByInventoryDetailId(@PathVariable Long inventoryDetailId){ + //根据库存表的id查询库存表信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(inventoryDetailId); + if(null!=inventoryDetail){ + List list = new ArrayList(); + //先查寻企标单的在途 + //根据物料名称和图号查询预制单详情中的物料信息(只查询未入库状态和入库中状态的,然后根据企标号去重) + List lists = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByNameAndFigureNumberList(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : lists) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + preliminaryInventoryInfo.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //名称 + preliminaryInventoryInfo.setName(pwMakeDocumentsDetail.getName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwMakeDocumentsDetail.getQuantity()); + //已入库数量 + //查询当前物料的最后一道序的入库情况 + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + //计录数量 + Long p = 0L; + if(list2.size()>0){ + List list3 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), list2.get(list2.size()-1).getName(), list2.get(list2.size()-1).getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { + p += imProductReceiptMaterial.getReceived().longValue(); + } + } + preliminaryInventoryInfo.setUsableQuantity(p); + //在途数量 + preliminaryInventoryInfo.setPreliminaryInventory(pwMakeDocumentsDetail.getQuantity()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + list.add(preliminaryInventoryInfo); + } + } + + //查询执行单的在途 TODO +// List list5 = pwProductionBillService.selectPwProductionBillByStatus("未完成"); +// for (PwProductionBill pwProductionBill : list5) { +// +// } + List list5 = pwBomNumberTwoService.selectPwBomNumberTwoByNameAndFigureNumber(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo : list5) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + preliminaryInventoryInfo.setCode(pwBomNumberTwo.getProductionCode()); + //名称 + preliminaryInventoryInfo.setName(pwBomNumberTwo.getName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwBomNumberTwo.getMaterialType()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwBomNumberTwo.getSumNumber()); + //已入库数量 + //查询当前物料的最后一道序的入库情况 + List list4 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + //计录数量 + Long p = 0L; + if(list4.size()>0){ + List list3 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list4.get(list4.size()-1).getName(), list4.get(list4.size()-1).getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { + p += imProductReceiptMaterial.getReceived().longValue(); + } + } + preliminaryInventoryInfo.setUsableQuantity(p); + //在途数量 + preliminaryInventoryInfo.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + //查询当前执行单是否已经完成 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(pwBomNumberTwo.getProductionCode()); + if(null!=productionBill&&"未完成".equals(productionBill.getStatus())){ + //有库存,或者安全库存标记的则不再展示 + if(!"有库存".equals(pwBomNumberTwo.getSparedTwo())&&!"安全库存".equals(pwBomNumberTwo.getSparedTwo())){ + list.add(preliminaryInventoryInfo); + } + } + } + } + + //查询标准件采购单的在途 + List list2 = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByNameAndFigureNumber(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial : list2) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号根据合同id查询 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(pwPurchaseContractMaterial.getPurchaseContractId()); + if(null!=purchaseContract){ + //根据采购单id查询 + preliminaryInventoryInfo.setCode(purchaseContract.getContractCode()); + } + //名称 + preliminaryInventoryInfo.setName(pwPurchaseContractMaterial.getMaterialName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwPurchaseContractMaterial.getFigureNumber()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwPurchaseContractMaterial.getMaterials()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwPurchaseContractMaterial.getAmount()); + //已入库数量 + //计录数量 + Long p = 0L; + if(null!=purchaseContract){ + //根据合同code查询入库单,根据领料单id和名称和图号查询入库单详情信息 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByContractCode(purchaseContract.getContractCode()); + if(null!=productReceipt){ + List list3 =imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber(productReceipt.getId(),pwPurchaseContractMaterial.getMaterialName(), pwPurchaseContractMaterial.getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { + p += imProductReceiptMaterial.getReceived().longValue(); + } + } + } + preliminaryInventoryInfo.setUsableQuantity(p); + //在途数量 + preliminaryInventoryInfo.setPreliminaryInventory(pwPurchaseContractMaterial.getAmount()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + list.add(preliminaryInventoryInfo); + } + //备注 + preliminaryInventoryInfo.setRemarks(pwPurchaseContractMaterial.getCode()); + } + + //查询原材料采购单的在途 + List list3 = pwBuyingRequisitionMaterialService.selectPwBuyingRequisitionMaterialByNameAndSpecification(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + for (PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial : list3) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + //根据原材料采购单id查询合同code + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionService.selectPwBuyingRequisitionById(pwBuyingRequisitionMaterial.getBuyingRequisitionId()); + if(null!=buyingRequisition){ + preliminaryInventoryInfo.setCode(buyingRequisition.getCode()); + } + //名称 + preliminaryInventoryInfo.setName(pwBuyingRequisitionMaterial.getMaterialName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwBuyingRequisitionMaterial.getFigureNumber()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwBuyingRequisitionMaterial.getMaterials()); + if("米".equals(pwBuyingRequisitionMaterial.getUnitOfMeasurementName())){ + //本批数量(米*1000) + preliminaryInventoryInfo.setQuantity((long)(pwBuyingRequisitionMaterial.getNumber()*1000)); + }else if("平方米".equals(pwBuyingRequisitionMaterial.getUnitOfMeasurementName())){ + //本批数量 + preliminaryInventoryInfo.setQuantity((long)(pwBuyingRequisitionMaterial.getNumber()*1000000)); + }else{ + //本批数量 + preliminaryInventoryInfo.setQuantity(pwBuyingRequisitionMaterial.getNumber().longValue()); + } + //已入库数量 + //计录数量 + Long p = 0L; + if(null!=buyingRequisition){ + //根据合同code查询入库单,根据领料单id和名称和图号查询入库单详情信息 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByContractCode(buyingRequisition.getCode()); + if(null!=productReceipt){ + List list4 =imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber(productReceipt.getId(),pwBuyingRequisitionMaterial.getMaterialName(), pwBuyingRequisitionMaterial.getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + p += imProductReceiptMaterial.getReceived().longValue(); + } + } + } + preliminaryInventoryInfo.setUsableQuantity(p); + //在途数量 + preliminaryInventoryInfo.setPreliminaryInventory(preliminaryInventoryInfo.getQuantity()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + list.add(preliminaryInventoryInfo); + } + //备注 + preliminaryInventoryInfo.setRemarks(buyingRequisition.getPurpose()); + } + + return getDataTable(list); + }else{ + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + startPage(); + List list = pwMakeDocumentsService.selectPwMakeDocumentsList(pwMakeDocuments); + return getDataTable(list); + } + } + + /** + * 预定数量详情信息 + * @param inventoryDetailId + * @return + */ + @RequestMapping("/listMakeDocumentsYuDingByInventoryDetailId/{inventoryDetailId}") + public TableDataInfo listMakeDocumentsYuDingByInventoryDetailId(@PathVariable Long inventoryDetailId){ + //根据库存表的id查询库存表信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(inventoryDetailId); + if(null!=inventoryDetail){ + List list = new ArrayList(); + + //根据物料名称和图号查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + if("毛坯".equals(material.getMaterialTypeName())||"原材料".equals(material.getMaterialTypeName())){ + if(null != material){ + //查询原材料信息 + List lists = pwBomNumberTwoService.selectPwBomNumberTwoByMaterialId(material.getId()); + for (PwBomNumberTwo pwBomNumberTwo : lists) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + preliminaryInventoryInfo.setCode(pwBomNumberTwo.getProductionCode()); + //名称 + preliminaryInventoryInfo.setName(pwBomNumberTwo.getMaterialsName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwBomNumberTwo.getSpecification()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwBomNumberTwo.getMaterialType()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwBomNumberTwo.getReceiveNumber()); + //已出库数量 + List list2 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + //计录数量 + Long p = 0L; + //根据合同code查询入库单,根据领料单id和名称和图号查询入库单详情信息 + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + p += imStockRequisitionMaterial.getAlreadyQuantity(); + } + preliminaryInventoryInfo.setUsableQuantity(p); + //预定数量 + preliminaryInventoryInfo.setPreliminaryInventory(pwBomNumberTwo.getReceiveNumber()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + list.add(preliminaryInventoryInfo); + } + } + + } + }else{ + //查询执行单的预定 + List list5 = pwBomNumberTwoService.selectPwBomNumberTwoByNameAndFigureNumber(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + for (PwBomNumberTwo pwBomNumberTwo : list5) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + preliminaryInventoryInfo.setCode(pwBomNumberTwo.getProductionCode()); + //名称 + preliminaryInventoryInfo.setName(pwBomNumberTwo.getName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwBomNumberTwo.getMaterialType()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwBomNumberTwo.getSumNumber()); + //已出库数量 + List list2 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + //计录数量 + Long p = 0L; + //根据合同code查询入库单,根据领料单id和名称和图号查询入库单详情信息 + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + p += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //计录数量 + preliminaryInventoryInfo.setUsableQuantity(p); + //预定数量 + preliminaryInventoryInfo.setPreliminaryInventory(pwBomNumberTwo.getSumNumber()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + //查询当前执行单是否已经完成 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(pwBomNumberTwo.getProductionCode()); + if(null!=productionBill&&"未完成".equals(productionBill.getStatus())){ + list.add(preliminaryInventoryInfo); + } + } + } + } + + //查询企标单的预定(企标单会预定毛坯和原材料和组件下边带的零件) + PwModulePart modulePart = new PwModulePart(); + if(null != material){ + //查询当前零件是否出现在零部件配置表中,且零件名称,和当前物料名称相同 + modulePart = pwModulePartService.selectPwModulePartById(material.getId()); + } + if("毛坯".equals(material.getMaterialTypeName())||"原材料".equals(material.getMaterialTypeName())){ + if(null != material){ + //查询原材料信息 + List lists = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByMaterialId(material.getId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : lists) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + preliminaryInventoryInfo.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //名称 + preliminaryInventoryInfo.setName(pwMakeDocumentsDetail.getMaterialsName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwMakeDocumentsDetail.getSpecification()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwMakeDocumentsDetail.getReceiveNumber()); + //已出库数量 + List list2 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getSpecification()); + //计录数量 + Long p = 0L; + //根据合同code查询入库单,根据领料单id和名称和图号查询入库单详情信息 + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + p += imStockRequisitionMaterial.getAlreadyQuantity(); + } + preliminaryInventoryInfo.setUsableQuantity(p); + //预定数量 + preliminaryInventoryInfo.setPreliminaryInventory(pwMakeDocumentsDetail.getReceiveNumber()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + list.add(preliminaryInventoryInfo); + } + } + } + }else if(null!=modulePart){ + //说明配置了零部件信息 + //根据物料名称和图号查询预制单详情中的物料信息(只查询未入库状态和入库中状态的,然后根据企标号去重) + List lists = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByNameAndFigureNumberList(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : lists) { + PreliminaryInventoryInfo preliminaryInventoryInfo = new PreliminaryInventoryInfo(); + //令号 + preliminaryInventoryInfo.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //名称 + preliminaryInventoryInfo.setName(pwMakeDocumentsDetail.getName()); + //图号 + preliminaryInventoryInfo.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //材料 + preliminaryInventoryInfo.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + preliminaryInventoryInfo.setQuantity(pwMakeDocumentsDetail.getQuantity()); + //已出库数量 + List list2 = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + //计录数量 + Long p = 0L; + //根据合同code查询入库单,根据领料单id和名称和图号查询入库单详情信息 + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + p += imStockRequisitionMaterial.getAlreadyQuantity(); + } + preliminaryInventoryInfo.setUsableQuantity(p); + //预定数量 + preliminaryInventoryInfo.setPreliminaryInventory(pwMakeDocumentsDetail.getQuantity()-preliminaryInventoryInfo.getUsableQuantity()); + //完成的不在展示 + if(preliminaryInventoryInfo.getPreliminaryInventory()>0){ + list.add(preliminaryInventoryInfo); + } + } + }else{ + //其他的不做处理 + + } + return getDataTable(list); + }else{ + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + startPage(); + List list = pwMakeDocumentsService.selectPwMakeDocumentsList(pwMakeDocuments); + return getDataTable(list); + } + } + + /** + * 手动生产企标单 + */ + @RequestMapping("/shoudong") + public AjaxResult shoudong(){ + //获取所有设置了安全库存的物料信息 + List list = imMaterialService.selectByMinimumAndHighest(); + for (ImMaterial imMaterial : list) { + if(imMaterial.getFigureNumber().contains("80A")||imMaterial.getFigureNumber().contains("100A")||imMaterial.getFigureNumber().contains("40R")){ + //根据物料名称和图号查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + if(imMaterial.getMinimum() -(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber())<=0){ + + }else{ + //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + //名称 + pdd.setName(imMaterial.getMaterialName()); + //图号 + pdd.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pdd.setMaterialType(imMaterial.getMaterials()); + //数量(最高库存数量-(库存数量+在途数量)) + pdd.setQuantity(imMaterial.getHighest()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd); + //更新在途数量 + inventoryDetail.setPreliminaryInventory(pdd.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + } + //查询预制单详情表没有预制单号的数据 + List list3 = pwMakeDocumentsDetailMapper.selectByMakeDocumentsCodeIsNull(); + //创建存储图纸类型的集合 + List li = new ArrayList(); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list3) { + //判断集合是否存在当前图号的标识 + int p = 0; + //遍历其图号 + String figureNumber = pwMakeDocumentsDetail.getFigureNumber(); + //截取图号第一个点之前的字符,用于区分图纸类型 + String str1=figureNumber.substring(0, figureNumber.indexOf(".")); + for (String string : li) { + if(string.contains(str1)){ + p = 1; + } + } + if(p==0){ + //p = 0时说明集合中没有此型号 + if(str1.contains("/")||str1.contains("-")){ + + }else{ + li.add(str1); + } + } + } + //查看map的长度,长度为几,则创建几个预制单 + for (int j = 0; j < li.size(); j++) { + //创建预制单,然后把单据的code添加到相关的物料上 + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsMapper.selectList(); + //获取最后一条记录的code的,分解其code + String code = documents.getCode(); + String substring = code.substring(code.length()-6,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + String str = String.format("%03d", valueOf); + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + String substring2 = ss.substring(2); + //code + pwMakeDocuments.setCode("QB-XCL-"+str+"-"+substring2); + //单据名称 + pwMakeDocuments.setName(li.get(j)+"预制清单"); + //日期 + pwMakeDocuments.setDate(new Date()); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //判断图纸类型是否是XCL开头 + if("XCL".equals(li.get(j))){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(li.get(j)); + } + pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + //把code添加到预制单明细表包函当前图纸型号的物料上 + //查询预制单明细表(物料图号包函当前图号且code为null的数据) + List list4 = pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByFigureNumberAndCode(li.get(j)); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list4) { + pwMakeDocumentsDetail.setMakeDocumentsCode(pwMakeDocuments.getCode()); + pwMakeDocumentsDetailMapper.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + } + return AjaxResult.success(); + } + + /** + * 隐藏库存制作单 + */ + @DeleteMapping("updateHids/{ids}") + public AjaxResult hid(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + PwMakeDocuments pwMakeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsById(id); + if(pwMakeDocuments.getHid()==1){ + pwMakeDocuments.setHid(0); + }else{ + pwMakeDocuments.setHid(1); + } + i = pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments); + } + return toAjax(i); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwMakeDocumentsDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwMakeDocumentsDetailController.java new file mode 100644 index 0000000..9fc37b1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwMakeDocumentsDetailController.java @@ -0,0 +1,4418 @@ +package com.ruoyi.project.management.controller; + +import java.awt.image.BufferedImage; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; + +import com.ruoyi.common.utils.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.rendering.PDFRenderer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.AllInfo; +import com.ruoyi.project.management.domain.CwNewPayroll; +import com.ruoyi.project.management.domain.DataInfo; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterialTwo; +import com.ruoyi.project.management.domain.ProductInfoNew; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwCompletionNotice; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwFuturesOrders; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetail; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetailTwo; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocuments; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwMaterialProcess; +import com.ruoyi.project.management.domain.PwModulePart; +import com.ruoyi.project.management.domain.PwOutsourceContractDetail; +import com.ruoyi.project.management.domain.PwProductionBillNew; +import com.ruoyi.project.management.domain.Subparts; +import com.ruoyi.project.management.domain.SysConfigIni; +import com.ruoyi.project.management.mapper.ImMaterialMapper; +import com.ruoyi.project.management.mapper.PwInventoryDetailMapper; +import com.ruoyi.project.management.mapper.PwMakeDocumentsDetailMapper; +import com.ruoyi.project.management.mapper.PwMakeDocumentsMapper; +import com.ruoyi.project.management.service.ICwNewPayrollService; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPcRigidChainService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailService; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailTwoService; +import com.ruoyi.project.management.service.IPwFuturesOrdersService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsService; +import com.ruoyi.project.management.service.IPwMaterialProcessService; +import com.ruoyi.project.management.service.IPwModulePartService; +import com.ruoyi.project.management.service.IPwOutsourceContractDetailService; +import com.ruoyi.project.management.service.IPwProcessService; +import com.ruoyi.project.management.service.ISysConfigIniService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.management.utils.FileToZip; +import com.ruoyi.project.management.utils.PDFDocHelper; +import com.ruoyi.project.system.domain.SysUser; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.extra.qrcode.QrCodeUtil; +import cn.hutool.extra.qrcode.QrConfig; + +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 库存制作单明细Controller + * + * @author zhukangchao + * @date 2020-11-11 + */ +@RestController +@RequestMapping("/management/makeDocumentsDetail") +public class PwMakeDocumentsDetailController extends BaseController +{ + @Value("${ruoyi.yzPdfUrl}") + private String yzPdfUrl; + @Value("${ruoyi.pdfUrl}") + private String pdfUrl; + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + //销齿链产品信息 + @Autowired + private IPcRigidChainService pcRigidChainService; + //图纸信息 + @Autowired + private ISysConfigIniService sysConfigIniService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //用户信息 + @Autowired + private TokenService tokenService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //质检通知单信息 + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //工序信息 + @Autowired + private IPwProcessService pwProcessService; + @Autowired + private ImMaterialMapper imMaterialMapper; + @Autowired + private PwInventoryDetailMapper pwInventoryDetailMapper; + //预制单明细 + @Autowired + private PwMakeDocumentsDetailMapper pwMakeDocumentsDetailMapper; + //预制单信息 + @Autowired + private PwMakeDocumentsMapper pwMakeDocumentsMapper; + //物料工序信息 + @Autowired + private IPwMaterialProcessService pwMaterialProcessService; + + //预采购单 + @Autowired + private IPwFuturesOrdersService pwFuturesOrdersService; + //预采购单明细 + @Autowired + private IPwFuturesOrdersDetailService pwFuturesOrdersDetailService; + //预采购单明细详情信息 + @Autowired + private IPwFuturesOrdersDetailTwoService pwFuturesOrdersDetailTwoService; + //零部件关联信息表 + @Autowired + private IPwModulePartService pwModulePartService; + //外协合同详情信息 + @Autowired + private IPwOutsourceContractDetailService pwOutsourceContractDetailService; + + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + //工资信息 + @Autowired + private ICwNewPayrollService cwNewPayrollService; + + /** + * 查询库存制作单明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocumentsDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwMakeDocumentsDetail pwMakeDocumentsDetail){ + //获取用户信息 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //用户昵称 + String nickName = user.getNickName(); + List list = new ArrayList(); + //判断用户昵称如果为,机加车间,铆焊工段,铆装车间时,只查询当前派工的数据 + List list2 = new ArrayList(); + if(user.getDept().getDeptName().equals("机一工段")||user.getDept().getDeptName().equals("机二工段")||user.getDept().getDeptName().equals("机三工段")||user.getDept().getDeptName().equals("外协部")||user.getDept().getDeptName().equals("采购部")){ + if(user.getDept().getDeptName().equals("外协部")){ + pwMakeDocumentsDetail.setDepartmentName("外协部"); + }else if(user.getDept().getDeptName().equals("采购部")){ + pwMakeDocumentsDetail.setDepartmentName("采购部"); + }else if(user.getDept().getDeptName().equals("机一工段")){ + pwMakeDocumentsDetail.setDepartmentName("机一工段"); + }else if(user.getDept().getDeptName().equals("机二工段")){ + pwMakeDocumentsDetail.setDepartmentName("机二工段"); + }else if(user.getDept().getDeptName().equals("机三工段")){ + pwMakeDocumentsDetail.setDepartmentName("机三工段"); + } + if(null==pwMakeDocumentsDetail.getMakeDocumentsCode()||"".equals(pwMakeDocumentsDetail.getMakeDocumentsCode())){ + //查询所有未完成的数据 + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailListAll(pwMakeDocumentsDetail); + }else{ + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailList(pwMakeDocumentsDetail); + } + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list2) { + list.add(pwMakeDocumentsDetail2); + List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail2.getMakeDocumentsCode(), pwMakeDocumentsDetail2.getId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail3 : list3) { + list.add(pwMakeDocumentsDetail3); + } + } + return getDataTable(list); + }else{ + //判断派工部门是否有参数,如果则查询所有的单号的当前派工部门 + if(null!=pwMakeDocumentsDetail.getDepartmentName()){ + if(null==pwMakeDocumentsDetail.getMakeDocumentsCode()||"".equals(pwMakeDocumentsDetail.getMakeDocumentsCode())){ + //查询所有未完成的数据 + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailListAll(pwMakeDocumentsDetail); + }else{ + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailList(pwMakeDocumentsDetail); + } + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list2) { + list.add(pwMakeDocumentsDetail2); + List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail2.getMakeDocumentsCode(), pwMakeDocumentsDetail2.getId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail3 : list3) { + list.add(pwMakeDocumentsDetail3); + } + } + return getDataTable(list); + }else{ + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailLists(pwMakeDocumentsDetail); + } + } + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list2) { + List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail2.getMakeDocumentsCode(), pwMakeDocumentsDetail2.getId()); + pwMakeDocumentsDetail2.setChildren(list3); + } + return getDataTable(list2); + } + + /** + * 导出库存制作单明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocumentsDetail:export')") + @Log(title = "库存制作单明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwMakeDocumentsDetail pwMakeDocumentsDetail){ + + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailList(pwMakeDocumentsDetail); + ExcelUtil util = new ExcelUtil(PwMakeDocumentsDetail.class); + return util.exportExcel(list, "makeDocumentsDetail"); + } + + /** + * 获取库存制作单明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocumentsDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id){ + long time = new Date().getTime(); + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); + //根据令号和图号和名称查询质检单详情 + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + int i = 0; +// //计算修改入库的剩余数量 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list) { + if(0==pwCompletionNoticeProduct.getActualQuantity()){ + i += pwCompletionNoticeProduct.getQuantity()+pwCompletionNoticeProduct.getConcessionQuantity(); + }else{ + i += pwCompletionNoticeProduct.getActualQuantity(); + } + } + if(makeDocumentsDetail.getQuantity()-i<0){ + makeDocumentsDetail.setNumber(0L); + }else{ + makeDocumentsDetail.setNumber(makeDocumentsDetail.getQuantity()-i); + } + //查询当前物料的单价和供应商 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + if(null!=imMaterial){ + //供应商名称 + makeDocumentsDetail.setPreferentialOriginName(imMaterial.getPreferentialOriginName()); + //含税单价 + makeDocumentsDetail.setUnitPrice(imMaterial.getUnitPrice().doubleValue()); + } + long time2 = new Date().getTime(); + System.out.println(time2-time); + return AjaxResult.success(makeDocumentsDetail); + } + + /** + * 添加工序 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocumentsDetail:add')") + @Log(title = "库存制作单明细", businessType = BusinessType.INSERT) + @RepeatSubmit + @PostMapping + public AjaxResult add(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + + if(null != pwMakeDocumentsDetail.getMaterialId()&&!"".equals(pwMakeDocumentsDetail.getMaterialId())){ + //查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialById(pwMakeDocumentsDetail.getMaterialId()); + if(null != material){ + + //判断如果选择的是毛坯,则长度不能大于1,且必须为1 + if("毛坯".equals(material.getMaterialTypeName())){ + if(1!=Long.valueOf(pwMakeDocumentsDetail.getLen())){ + return AjaxResult.error("所选材料为毛坯时,长度必须为1"); + } + if(null!=pwMakeDocumentsDetail.getWid()){ + return AjaxResult.error("所选材料为毛坯时,宽度无需填写"); + } + } + + pwMakeDocumentsDetail.setMaterialsName(material.getMaterialName()); + //图号 + pwMakeDocumentsDetail.setMaterialsSpecification(material.getFigureNumber()); + //判断是否填写了毛坯数量 + if(null==pwMakeDocumentsDetail.getWorkblank()||0==pwMakeDocumentsDetail.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + //判断是否是长和宽都不为null + if(null!=pwMakeDocumentsDetail.getWid()&&pwMakeDocumentsDetail.getWid()!=0){ + if(null==pwMakeDocumentsDetail.getLen()){ + return AjaxResult.error("请输入长度"); + } + //说明是板材,下料尺寸改为长*宽 + pwMakeDocumentsDetail.setSpecification(pwMakeDocumentsDetail.getLen()+"*"+pwMakeDocumentsDetail.getWid()+""); + //说明是板材,下料尺寸改为长*宽 + pwMakeDocumentsDetail.setMeasure(Long.valueOf(pwMakeDocumentsDetail.getLen())*pwMakeDocumentsDetail.getWid()+""); + + //计算板的重量 公式:长宽高X密度(7.85g/立方厘米) + double weight = 0.0; + if(null==material.getThickness()||0==material.getThickness()){ + return AjaxResult.error("请完善所选材料的厚度!"); + } + weight = ((pwMakeDocumentsDetail.getLen()*pwMakeDocumentsDetail.getWid()*material.getThickness()*7.85)/1000000)*pwMakeDocumentsDetail.getWorkblank(); + pwMakeDocumentsDetail.setWeight(weight); + }else{ + //说明是线材,下料尺寸改为长 + pwMakeDocumentsDetail.setMeasure(pwMakeDocumentsDetail.getLen()+""); + + pwMakeDocumentsDetail.setSpecification(pwMakeDocumentsDetail.getLen()+""); + } + + //成品数量为本批数量 + pwMakeDocumentsDetail.setFinished(pwMakeDocumentsDetail.getQuantity()); + + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //计算领料数量 + pwMakeDocumentsDetail.setReceiveNumber(pwMakeDocumentsDetail.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail.getMeasure())+(3*pwMakeDocumentsDetail.getWorkblank())); + }else{ + //计算领料数量 + pwMakeDocumentsDetail.setReceiveNumber(pwMakeDocumentsDetail.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail.getMeasure())); + } + +// //第二套材料 +// if(null!=pwMakeDocumentsDetail.getMaterialIdTwo()){ +// ImMaterial immaterialTwo = imMaterialService.selectImMaterialById(pwMakeDocumentsDetail.getMaterialIdTwo()); +// if(null != immaterialTwo){ +// //原材料名称 +// pwMakeDocumentsDetail.setMaterialsNameTwo(immaterialTwo.getMaterialName()); +// //原材料图号 +// pwMakeDocumentsDetail.setMaterialsSpecificationTwo(immaterialTwo.getFigureNumber()); +// //判断是否是长和宽都不为null +// if(null!=pwMakeDocumentsDetail.getWidTwo()&&pwMakeDocumentsDetail.getWidTwo()!=0){ +// if(null==pwMakeDocumentsDetail.getLenTwo()){ +// return AjaxResult.error("请输入长度"); +// } +// //规格合并成 长*宽 +// pwMakeDocumentsDetail.setSpecificationTwo(pwMakeDocumentsDetail.getLenTwo()+"*"+pwMakeDocumentsDetail.getWidTwo()+""); +// //说明是板材,下料尺寸改为长*宽 +// pwMakeDocumentsDetail.setMeasureTwo(Long.valueOf(pwMakeDocumentsDetail.getLenTwo())*pwMakeDocumentsDetail.getWidTwo()+""); +// }else{ +// pwMakeDocumentsDetail.setMeasureTwo(pwMakeDocumentsDetail.getLenTwo()+""); +// pwMakeDocumentsDetail.setSpecificationTwo(pwMakeDocumentsDetail.getMeasureTwo()); +// } +// } +// } + +// //查询库存信息 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); +// if(null!=inventoryDetail){ +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<0){ +// pwMakeDocumentsDetail.setUsableQuantity(0L); +// }else{ +// pwMakeDocumentsDetail.setUsableQuantity(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()); +// } +// } + } + } + + //获取父级图号 + String parentLevelFigureNumber = pwMakeDocumentsDetail.getParentLevelFigureNumber(); + //获取父级名称 + String parentLevelName = pwMakeDocumentsDetail.getParentLevelName(); + //获取执行单令号 + String makeDocumentsCode = pwMakeDocumentsDetail.getMakeDocumentsCode(); + //根据执行单令号和上级图号和上级名称查找上级信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumber(makeDocumentsCode,parentLevelName,parentLevelFigureNumber); + //根据上级id和令号查询 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsCode,makeDocumentsDetail.getId()); + + //获取工序名称集合 + String[] processNames = pwMakeDocumentsDetail.getProcessNames(); + if(null==processNames||processNames.length==0){ + return AjaxResult.error("请选择工序"); + } + int ii = 0; + for (int i = 0; i < processNames.length; i++) { + if(list.size()==0&&i == 0){ + pwMakeDocumentsDetail.setFigureNumber(pwMakeDocumentsDetail.getParentLevelFigureNumber()+"-1"); + }else{ + int sia = list.size()+i+1; + pwMakeDocumentsDetail.setFigureNumber(pwMakeDocumentsDetail.getParentLevelFigureNumber()+"-"+sia); + } + //只保留工序为1时的材料名称 + if(i>0){ + pwMakeDocumentsDetail.setMaterialsName(null); + pwMakeDocumentsDetail.setMaterialsSpecification(null); + pwMakeDocumentsDetail.setMeasure(null); + pwMakeDocumentsDetail.setWorkblank(null); + pwMakeDocumentsDetail.setFinished(null); + } + pwMakeDocumentsDetail.setName(pwMakeDocumentsDetail.getParentLevelName()+"-"+processNames[i]+"(M)"); + //工序名称 + pwMakeDocumentsDetail.setProcessName(processNames[i]); + //根据工序名称查询 +// PwProcess pwProcess = pwProcessService.selectPwProcessByName(pwMakeDocumentsDetail.getProcessName()); +// pwMakeDocumentsDetail.setGodownEntry(pwProcess.getGodownEntry()); + //入库状态(默认初始状态为未入库) + pwMakeDocumentsDetail.setInventoryStatus("未入库"); + //把上级id赋值给当前需要添加的工序 + pwMakeDocumentsDetail.setSuperiorId(makeDocumentsDetail.getId()); + //把物料信息保存到物料表中 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + if(null!=material){ + //先根据名称和图号查询库存信息表中有没有此数据 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 + if(material.getMinimum()!=0&&material.getHighest()!=0){ + //判断库存数量+在途数量-锁定数量,是否小于等于最低安全库存数量 +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=material.getMinimum()){ +// pwMakeDocumentsDetail.setQuantity(material.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); +// }else{ +// pwMakeDocumentsDetail.setQuantity(0L); +// } + +// + //计算安全库存是否触发 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<=material.getMinimum()){ + //生成企标单 + //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + //名称 + pdd.setName(material.getMaterialName()); + //图号 + pdd.setFigureNumber(material.getFigureNumber()); + //材料 + pdd.setMaterialType(material.getMaterials()); + //数量(最高库存数量-(库存数量+在途数量-本批数量)) + pdd.setQuantity(material.getHighest()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd); + //更新在途数量 + inventoryDetail.setPreliminaryInventory(pdd.getQuantity()); +// pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + //更新可用数量 + if(inventoryDetail.getQuantity()>=inventoryDetail.getLockNumber()){ + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + } + //锁定库存数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwMakeDocumentsDetail.getQuantity()); + //如果有安全库存数量,则直接锁定数量,然后标记库存数量为本批制作数量,然后计算是否触发最低安全库存,如果触发,则添加一条新的企标单详情,生成一个新的企标单 + pwMakeDocumentsDetail.setUsableQuantity(pwMakeDocumentsDetail.getQuantity()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //如果填写了原材料,则更新原材料的锁定数量 + if(null!=pwMakeDocumentsDetail.getReceiveNumber()&&pwMakeDocumentsDetail.getReceiveNumber()>0){ + //查询原材料库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + }else{ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //预存数量(添加工序时不在预存其在途数量,而是在领料是再添加在途数量) +// pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail.getQuantity()); + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + }else{ + //添加物料信息 + ImMaterial imMaterial = new ImMaterial(); + //物料名称 + imMaterial.setMaterialName(pwMakeDocumentsDetail.getName()); + //物料图号 + imMaterial.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + imMaterial.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial); + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //预存数量(添加工序时不在预存其在途数量,而是在领料是再添加在途数量) +// pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail.getQuantity()); + //锁定数量 + pwInventoryDetail.setLockNumber(pwMakeDocumentsDetail.getQuantity()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + + //如果填写了原材料,则更新原材料的锁定数量 + if(null!=pwMakeDocumentsDetail.getReceiveNumber()&&pwMakeDocumentsDetail.getReceiveNumber()>0){ + //查询原材料库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + ii = pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + //自动生成企标单 +// addMakeDocuments(); + return toAjax(ii); + } + + /** + * 修改(车间排产) + */ + @RequestMapping("/updateShopScheduling") + public AjaxResult updateShopScheduling(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + + if(null==pwMakeDocumentsDetail.getXuTime()||"".equals(pwMakeDocumentsDetail.getXuTime())){ + return AjaxResult.error("请输入序工时"); + } + return toAjax(pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail)); + } + + /** + * 企标查询物料状态信息 + * + */ + @GetMapping("/listPwBomNumberTwoAllQB") + public TableDataInfo listPwBomNumberTwoAllQB(PwMakeDocumentsDetail pwMakeDocumentsDetail){ + List list = new ArrayList(); + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + List list3 = new ArrayList(); + if(null != makeDocumentsDetail){ + list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + } + //查询当前物料的质检,入库,出库等状态 + for (PwMakeDocumentsDetail makeDocumentsDetail3 : list3) { + //查询领料数据 + //判断当前物料是否是第一道序的物料 + String substring = makeDocumentsDetail3.getFigureNumber().substring(makeDocumentsDetail3.getFigureNumber().lastIndexOf("-")+1); + List list5 = new ArrayList(); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1 == Integer.valueOf(substring)){ + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), makeDocumentsDetail3.getMaterialsName(), makeDocumentsDetail3.getMaterialsSpecification()); + }else{ + String figureNumber = makeDocumentsDetail3.getFigureNumber().substring(0,makeDocumentsDetail3.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), figureNumber); + } + //申请领料数量 + Long shenqingchuku = 0L; + Long chuku = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list5) { + shenqingchuku += imStockRequisitionMaterial.getApplyForQuantity(); + chuku += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //申请领料数量 + makeDocumentsDetail3.setLen(shenqingchuku); + makeDocumentsDetail3.setLingliaoNumber(chuku); + if(1 == Integer.valueOf(substring)&&(null==makeDocumentsDetail3.getMaterialsName()||"".equals(makeDocumentsDetail3.getMaterialsName()))){ + makeDocumentsDetail3.setInventoryStatus("无需领料"); + }else{ + if(chuku == 0){ + //未领料 + makeDocumentsDetail3.setInventoryStatus("未领料"); + }else{ + //已领料 + makeDocumentsDetail3.setInventoryStatus("已领料"); + } + } + + //查询质检数据 + List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), makeDocumentsDetail3.getName(), makeDocumentsDetail3.getFigureNumber()); + //交检数量 + Long jiaojian = 0L; + //已检数量 + Long jianyan = 0L; + //累加其数量 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list2) { + jiaojian += pwCompletionNoticeProduct.getReceivableQuantity().longValue(); + jianyan += pwCompletionNoticeProduct.getQuantity().longValue(); + } + makeDocumentsDetail3.setWid(jiaojian); + makeDocumentsDetail3.setWorkblankTwo(jianyan); + //查询入库数据 + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), makeDocumentsDetail3.getName(), makeDocumentsDetail3.getFigureNumber()); + //申请入库数量 + Long shenqingruku = 0L; + Long ruku = 0L; + //累加其数量 + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + shenqingruku += imProductReceiptMaterial.getReceivableQuantity().longValue(); + ruku += imProductReceiptMaterial.getReceived().longValue(); + } + makeDocumentsDetail3.setLenTwo(shenqingruku); + makeDocumentsDetail3.setNumber(ruku); + //状态 + if(makeDocumentsDetail3.getQuantity().equals(jianyan)){ + makeDocumentsDetail3.setInventoryStatus("已检验"); + } + if(makeDocumentsDetail3.getQuantity().equals(ruku)){ + makeDocumentsDetail3.setInventoryStatus("已入库"); + } + + //查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail3.getName(), makeDocumentsDetail3.getFigureNumber()); + makeDocumentsDetail3.setWorkblank(inventoryDetail.getQuantity()); + } + if(null!=makeDocumentsDetail){ + makeDocumentsDetail.setChildren(list3); + } + list.add(makeDocumentsDetail); + return getDataTable(list); + } + + /** + * 修改库存制作单明细 + */ + @RepeatSubmit + @PreAuthorize("@ss.hasPermi('management:makeDocumentsDetail:edit')") + @Log(title = "库存制作单明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + //根据id查询(修改之前的原数据) + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + //判断原数据与现在修改的数据的名称、图号、材料、数量是都一致,如果不一致,则需要修改物料表,和库存信息表 + if(!pwMakeDocumentsDetail.getName().equals(makeDocumentsDetail.getName())||!pwMakeDocumentsDetail.getFigureNumber().equals(makeDocumentsDetail.getFigureNumber())||!pwMakeDocumentsDetail.getQuantity().equals(makeDocumentsDetail.getQuantity())){ + //修改物料表(根据名称和图号查询物料信息) + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + //名称 + imMaterial.setMaterialName(pwMakeDocumentsDetail.getName()); + //图号 + imMaterial.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //材料 + imMaterial.setMaterials(pwMakeDocumentsDetail.getMaterialType()); + + imMaterialService.updateImMaterial(imMaterial); + //修改库存表(根据名称和图号查询库存信息) + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + //名称 + inventoryDetail.setName(pwMakeDocumentsDetail.getName()); + //图号 + inventoryDetail.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //材料 + inventoryDetail.setMaterials(pwMakeDocumentsDetail.getMaterialType()); + //修改数量(在途数量-原企标单数量+现企标单数量) + /*if(inventoryDetail.getPreliminaryInventory()-makeDocumentsDetail.getQuantity()+pwMakeDocumentsDetail.getQuantity()<0){ + inventoryDetail.setPreliminaryInventory(0L); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-makeDocumentsDetail.getQuantity()+pwMakeDocumentsDetail.getQuantity()); + }*/ + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //根据当前物料的id查询其所有子集 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list) { + //修改其数量 + pwMakeDocumentsDetail2.setQuantity(pwMakeDocumentsDetail.getQuantity()); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail2); + //根据名称和图号查询库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + /*if(inventoryDetail2.getPreliminaryInventory()-makeDocumentsDetail.getQuantity()+pwMakeDocumentsDetail2.getQuantity()<0){ + inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()-makeDocumentsDetail.getQuantity()+pwMakeDocumentsDetail2.getQuantity()); + }else{ + inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()-makeDocumentsDetail.getQuantity()+pwMakeDocumentsDetail2.getQuantity()); + }*/ + //更新当前物料下子集的数量及库存中当前物料的子集数量 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + }else{ + //判断是否修改了原材料信息,如果修改了原材料信息,则判断是否已经领料,如果已经领料则不允许修改,需要退库或者撤销申请领料 + if((null!=pwMakeDocumentsDetail.getMaterialId()&&null!=makeDocumentsDetail.getMaterialId()&&!pwMakeDocumentsDetail.getMaterialId().equals(makeDocumentsDetail.getMaterialId())) + ||(null!=pwMakeDocumentsDetail.getLen()&&null!=makeDocumentsDetail.getLen()&&!pwMakeDocumentsDetail.getLen().equals(makeDocumentsDetail.getLen())) + ||(null!=pwMakeDocumentsDetail.getWid()&&null!=makeDocumentsDetail.getWid()&&!pwMakeDocumentsDetail.getWid().equals(makeDocumentsDetail.getWid())) + ||(null!=pwMakeDocumentsDetail.getWorkblank()&&null!=makeDocumentsDetail.getWorkblank()&&!pwMakeDocumentsDetail.getWorkblank().equals(makeDocumentsDetail.getWorkblank()))){ + //说明修改了原材料 + //查询领料单中是否已经申请领料 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialBySparedThree(pwMakeDocumentsDetail.getMakeDocumentsCode(),pwMakeDocumentsDetail.getId()); + if(list.size()>0){ + return AjaxResult.error("已申请领料,不可修改"); + } + + } + + if(null==pwMakeDocumentsDetail.getMaterialId()){ + //说明是去掉材料了 + + //查询领料单中是否已经申请领料 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialBySparedThree(pwMakeDocumentsDetail.getMakeDocumentsCode(),pwMakeDocumentsDetail.getId()); + if(list.size()>0){ + return AjaxResult.error("已申请领料,不可修改"); + } + + //查询是否生成了原材料采购单,如果生成了,则不允许修改为null + PwFuturesOrdersDetail pwFuturesOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null!=pwFuturesOrdersDetail&&"已生成".equals(pwFuturesOrdersDetail.getStatus())){ + //说明生成了原材料采购单,则需要撤销撤销原材料采购单 + return AjaxResult.error("已生成原材料采购单,请先撤销原材料采购单"); + }else{ + //删除预采购单,删除预采购单明细 + if(null!=pwFuturesOrdersDetail){ + pwFuturesOrdersDetailTwoService.deletePwFuturesOrdersDetailTwoByOrdersDetailId(pwFuturesOrdersDetail.getId()); + pwFuturesOrdersDetailService.deletePwFuturesOrdersDetailById(pwFuturesOrdersDetail.getId()); + } + //物料id置为null + pwMakeDocumentsDetail.setMaterialId(null); + pwMakeDocumentsDetail.setMaterialsName(null); + pwMakeDocumentsDetail.setMaterialsSpecification(null); + pwMakeDocumentsDetail.setLen(null); + pwMakeDocumentsDetail.setWid(null); + pwMakeDocumentsDetail.setWorkblank(null); + pwMakeDocumentsDetail.setFinished(null); + pwMakeDocumentsDetail.setMeasure(null); + pwMakeDocumentsDetail.setSpecification(null); + pwMakeDocumentsDetail.setReceiveNumber(null); + } + + } + + //获取当前物料的图号和名称,查询其下是否有子集工序,如果有子集工序,则不能直接派工,需要派工子集工序的物料 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + if(list.size()>0){ + return AjaxResult.error("带有工序的物料不可直接派工"); + } + } + if(null!=pwMakeDocumentsDetail.getMaterialId()){ + //查询选择的原材料 + ImMaterial material = imMaterialService.selectImMaterialById(pwMakeDocumentsDetail.getMaterialId()); + if(null != material){ + + //判断如果选择的是毛坯,则长度不能大于1,且必须为1 + if("毛坯".equals(material.getMaterialTypeName())){ + if(1!=Long.valueOf(pwMakeDocumentsDetail.getLen())){ + return AjaxResult.error("所选材料为毛坯时,长度必须为1"); + } + if(null!=pwMakeDocumentsDetail.getWid()){ + return AjaxResult.error("所选材料为毛坯时,宽度无需填写"); + } + } + + //原材料名称 + pwMakeDocumentsDetail.setMaterialsName(material.getMaterialName()); + //原材料图号 + pwMakeDocumentsDetail.setMaterialsSpecification(material.getFigureNumber()); + //判断是否填写了毛坯数量 + if(null==pwMakeDocumentsDetail.getWorkblank()||0==pwMakeDocumentsDetail.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + //判断是否是长和宽都不为null + if(null!=pwMakeDocumentsDetail.getWid()&&pwMakeDocumentsDetail.getWid()!=0){ + if(null==pwMakeDocumentsDetail.getLen()){ + return AjaxResult.error("请输入长度"); + } + //规格合并成 长*宽 + pwMakeDocumentsDetail.setSpecification(pwMakeDocumentsDetail.getLen()+"*"+pwMakeDocumentsDetail.getWid()+""); + //说明是板材,下料尺寸改为长*宽 + pwMakeDocumentsDetail.setMeasure(Long.valueOf(pwMakeDocumentsDetail.getLen())*pwMakeDocumentsDetail.getWid()+""); + + //计算板的重量 公式:长宽高X密度(7.85g/立方厘米) + double weight = 0.0; + if(null==material.getThickness()||0==material.getThickness()){ + return AjaxResult.error("请完善所选材料的厚度!"); + } + weight = ((pwMakeDocumentsDetail.getLen()*pwMakeDocumentsDetail.getWid()*material.getThickness()*7.85)/1000000)*pwMakeDocumentsDetail.getWorkblank(); + pwMakeDocumentsDetail.setWeight(weight); + }else{ + pwMakeDocumentsDetail.setMeasure(pwMakeDocumentsDetail.getLen()+""); + pwMakeDocumentsDetail.setSpecification(pwMakeDocumentsDetail.getLen()+""); + } + + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //计算领料数量 + pwMakeDocumentsDetail.setReceiveNumber(pwMakeDocumentsDetail.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail.getMeasure())+(3*pwMakeDocumentsDetail.getWorkblank())); + }else{ + //计算领料数量 + pwMakeDocumentsDetail.setReceiveNumber(pwMakeDocumentsDetail.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail.getMeasure())); + } + //修改预定数量 + //查询之前的原材料信息 + if(null!=makeDocumentsDetail.getMaterialId()){ + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null!=inventoryDetail){ + //减掉修改之前的预定数量 + if(null==makeDocumentsDetail.getReceiveNumber()){ + makeDocumentsDetail.setReceiveNumber(0L); + } + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-makeDocumentsDetail.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + //查询修改之后的原材料信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(),pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null!=inventoryDetail){ + if(null==pwMakeDocumentsDetail.getReceiveNumber()){ + pwMakeDocumentsDetail.setReceiveNumber(0L); + } + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwMakeDocumentsDetail.getReceiveNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + + //查询库存信息 + PwInventoryDetail inventoryDetails = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(null!=inventoryDetails){ + pwMakeDocumentsDetail.setUsableQuantity(inventoryDetails.getQuantity()-inventoryDetails.getLockNumber()); + } + + //如果材料不为毛坯且没有设置安全库存,则修改 + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //查询预采购表,如果预采购表不为空,则把预采购表也修改了 + PwFuturesOrders futuresOrders = pwFuturesOrdersService.selectPwFuturesOrdersByCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + if(null != futuresOrders){ + //把合并之前的信息增加到详情中 + PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo = new PwFuturesOrdersDetailTwo(); + //说明已经生成预采购单 + //根据名称和图号查询预购单明细中是否有了此物料,如果有则不再新增,则在原有的基础上添加总数量 + PwFuturesOrdersDetail futuresOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(futuresOrders.getCode(),material.getMaterialName(),material.getFigureNumber()); + if(null != futuresOrdersDetail){ + //总尺寸相加 + if(null==makeDocumentsDetail.getMeasure()){ + makeDocumentsDetail.setMeasure("0"); + } + if(null==makeDocumentsDetail.getWorkblank()){ + makeDocumentsDetail.setWorkblank(0L); + } + if(null==pwMakeDocumentsDetail.getMeasure()){ + pwMakeDocumentsDetail.setMeasure("0"); + } + if(null==pwMakeDocumentsDetail.getWorkblank()){ + pwMakeDocumentsDetail.setWorkblank(0L); + } + futuresOrdersDetail.setNumber(futuresOrdersDetail.getNumber()-(Double.valueOf(makeDocumentsDetail.getMeasure())*makeDocumentsDetail.getWorkblank()+(3*pwMakeDocumentsDetail.getWorkblank()))+(Double.valueOf(pwMakeDocumentsDetail.getMeasure())*pwMakeDocumentsDetail.getWorkblank())+(3*pwMakeDocumentsDetail.getWorkblank())); + if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000); + }else if(null!=futuresOrdersDetail.getUnit()&&futuresOrdersDetail.getUnit().equals("平方毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000000); + }else{ + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()); + } + //总重量重新计算 + futuresOrdersDetail.setReferenceNumber(futuresOrdersDetail.getQuantity() * material.getPieceWeight()); + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(futuresOrdersDetail.getId()); + pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(futuresOrdersDetail); + + //库存数量 +// PwInventoryDetail inventoryDetaila = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(),material.getFigureNumber()); +// //判断物料单位 +// if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ +// //库存数量+在途数量-锁定数量 +// futuresOrdersDetail.setInventoryQuantity((inventoryDetaila.getQuantity()+inventoryDetaila.getPreliminaryInventory())/1000); +// }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ +// //库存数量+在途数量-锁定数量 +// futuresOrdersDetail.setInventoryQuantity((inventoryDetaila.getQuantity()+inventoryDetaila.getPreliminaryInventory())/1000000); +// }else{ +// //库存数量+在途数量-锁定数量 +// futuresOrdersDetail.setInventoryQuantity(inventoryDetaila.getQuantity()+inventoryDetaila.getPreliminaryInventory()); +// } + //锁定库存数量 +// inventoryDetaila.setLockNumber(inventoryDetaila.getLockNumber()+futuresOrdersDetail.getNumber().longValue()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetaila); + + //修改预采购单明细的明细信息(根据物料id) + PwFuturesOrdersDetailTwo futuresOrdersDetailTwo = pwFuturesOrdersDetailTwoService.selectPwFuturesOrdersDetailTwoByMatenaisIdAndNameAndFigureNumber(pwMakeDocumentsDetail.getId(),pwMakeDocumentsDetail.getMaterialsName(),pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null != futuresOrdersDetailTwo){ + //物料id + futuresOrdersDetailTwo.setMatenaisId(pwMakeDocumentsDetail.getId()); + //名称 + futuresOrdersDetailTwo.setName(pwMakeDocumentsDetail.getMaterialsName()); + //图号 + futuresOrdersDetailTwo.setFigureNumber(pwMakeDocumentsDetail.getMaterialsSpecification()); + //材料 + futuresOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + futuresOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + futuresOrdersDetailTwo.setSparedOne(pwMakeDocumentsDetail.getSpecification()); + //毛坯数量 + futuresOrdersDetailTwo.setWorkblank(pwMakeDocumentsDetail.getWorkblank().doubleValue()); + //总数量(计算)下料尺寸*毛坯数量 + futuresOrdersDetailTwo.setNumber(Double.valueOf(pwMakeDocumentsDetail.getMeasure())*pwMakeDocumentsDetail.getWorkblank().doubleValue()+(3*pwMakeDocumentsDetail.getWorkblank().doubleValue())); + //计量单位(物料属性) + futuresOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + futuresOrdersDetailTwo.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + futuresOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + futuresOrdersDetailTwo.setQuantity(futuresOrdersDetailTwo.getNumber()); + //采用原单位 + futuresOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + futuresOrdersDetailTwo.setReferenceNumber(futuresOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + pwFuturesOrdersDetailTwoService.updatePwFuturesOrdersDetailTwo(futuresOrdersDetailTwo); + } + }else{ + //新增预采购单明细 + PwFuturesOrdersDetail pwFuturesOrdersDetail = new PwFuturesOrdersDetail(); + //令号 + pwFuturesOrdersDetail.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //预购单id + pwFuturesOrdersDetail.setOrdersId(futuresOrders.getId()); + //名称 + pwFuturesOrdersDetail.setName(pwMakeDocumentsDetail.getMaterialsName()); + //图号 + pwFuturesOrdersDetail.setFigureNumber(pwMakeDocumentsDetail.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetail.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetail.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetail.setMeasure(Long.valueOf(pwMakeDocumentsDetail.getMeasure())); + //毛坯数量 + pwFuturesOrdersDetail.setWorkblank(pwMakeDocumentsDetail.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetail.setNumber(Double.valueOf(pwMakeDocumentsDetail.getMeasure())*pwMakeDocumentsDetail.getWorkblank().doubleValue()+(3*pwMakeDocumentsDetail.getWorkblank().doubleValue())); + //计量单位(物料属性) + pwFuturesOrdersDetail.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(Double.valueOf(pwMakeDocumentsDetail.getMeasure())*pwMakeDocumentsDetail.getWorkblank().doubleValue()+(3*pwMakeDocumentsDetail.getWorkblank())); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetail.setReferenceNumber(pwFuturesOrdersDetail.getQuantity() * material.getPieceWeight()); + + //库存数量 + //根据原材料物料名称和图号查询库存 + PwInventoryDetail inventoryDetaila = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + //库存数量 + pwFuturesOrdersDetail.setInventoryQuantity(inventoryDetaila.getQuantity()); + //在途数量 + pwFuturesOrdersDetail.setPreliminaryInventory(inventoryDetaila.getPreliminaryInventory()); + //锁定数量 + pwFuturesOrdersDetail.setLockNumber(inventoryDetaila.getLockNumber()-pwFuturesOrdersDetail.getNumber().longValue()); + + pwFuturesOrdersDetailService.insertPwFuturesOrdersDetail(pwFuturesOrdersDetail); + + //令号 + pwFuturesOrdersDetailTwo.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(pwFuturesOrdersDetail.getId()); + //名称 + pwFuturesOrdersDetailTwo.setName(pwMakeDocumentsDetail.getMaterialsName()); + //图号 + pwFuturesOrdersDetailTwo.setFigureNumber(pwMakeDocumentsDetail.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetailTwo.setSparedOne(pwMakeDocumentsDetail.getSpecification()); + //毛坯数量 + pwFuturesOrdersDetailTwo.setWorkblank(pwMakeDocumentsDetail.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetailTwo.setNumber(Double.valueOf(pwMakeDocumentsDetail.getMeasure())*pwMakeDocumentsDetail.getWorkblank().doubleValue()+(3*pwMakeDocumentsDetail.getWorkblank())); + //计量单位(物料属性) + pwFuturesOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + pwFuturesOrdersDetailTwo.setUnitTwo("米"); + }else if(null!=material.getUnitOfMeasurementName()&&material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetailTwo.setReferenceNumber(pwFuturesOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + + pwFuturesOrdersDetailTwoService.insertPwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo); + //锁定库存数量 +// inventoryDetaila.setLockNumber(inventoryDetaila.getLockNumber()+pwFuturesOrdersDetail.getNumber().longValue()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetaila); + } + } + } + } + } +// //根据id获取预制清单信息 +// PwMakeDocumentsDetail documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); +// //根据名称和图号获取库存信息 +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(documentsDetail.getName(),documentsDetail.getFigureNumber()); +// //更新在途数量(在途数量-原预制数量+新预制数量) +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-documentsDetail.getQuantity()+pwMakeDocumentsDetail.getQuantity()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + +// if(null!=pwMakeDocumentsDetail.getDepartmentName()&&!"".equals(pwMakeDocumentsDetail.getDepartmentName())){ +// //如果派工部门不为null时,判断完成时间是否为null +// if(null==pwMakeDocumentsDetail.getCompletionDate()||"".equals(pwMakeDocumentsDetail.getCompletionDate())){ +// return AjaxResult.error("请选择完成时间"); +// } +// } + return toAjax(pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail)); + } + + + /** + * 修改派工 + */ + /** + * 修改库存制作单明细 + */ + @RepeatSubmit + @PreAuthorize("@ss.hasPermi('management:makeDocumentsDetail:edit')") + @Log(title = "库存制作单明细", businessType = BusinessType.UPDATE) + @RequestMapping("/updateMakeDocumentsDetailpaigong") + public AjaxResult updateMakeDocumentsDetailpaigong(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + return toAjax(pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail)); + } + + + /** + * 打印流转单功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据 + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + if(ids.length==0){ + return AjaxResult.error("请选择物料"); + } + List list = new ArrayList(); + QrConfig config = new QrConfig(); + // 设置边距,既二维码和背景之间的边距 + config.setWidth(300); + config.setHeight(300); + config.setErrorCorrection(ErrorCorrectionLevel.M); + //遍历ids + for (Long id : ids) { + Long i = 1L; + + List list3 = new ArrayList(); + + //根据id获取物料信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); + + List list2 = new ArrayList(); + //查询其所有子集,显示到工件流转单中 + PwMakeDocumentsDetail documentsDetail = new PwMakeDocumentsDetail(); + //如果是序,则查询其父级 + if(null!=makeDocumentsDetail.getSuperiorId()){ + documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(documentsDetail.getMakeDocumentsCode(), documentsDetail.getId()); + + //查询当前物料的已入库数量 + Long yiru = 0L; + if(list2.size()>0){ + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(documentsDetail.getMakeDocumentsCode(), list2.get(list2.size()-1).getName(), list2.get(list2.size()-1).getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + yiru += imProductReceiptMaterial.getReceived().longValue(); + } + } + documentsDetail.setLenTwo(yiru); + }else{ + //根据id查询其所有子集 + list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + + //查询当前物料的已入库数量 + Long yiru = 0L; + if(list2.size()>0){ + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list2.get(list2.size()-1).getName(), list2.get(list2.size()-1).getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + yiru += imProductReceiptMaterial.getReceived().longValue(); + } + } + makeDocumentsDetail.setLenTwo(yiru); + } + + //判断是否是部件,如果为部件,则查询其子集 + if("组件".equals(makeDocumentsDetail.getMaterialType())||"部件".equals(makeDocumentsDetail.getMaterialType())){ + if(null!=makeDocumentsDetail.getSuperiorId()){ + //查询其所有子集,显示到工件流转单中 + documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + //查询零部件关联表 + PwModulePart pwModulePart = new PwModulePart(); + pwModulePart.setMaterialName(documentsDetail.getName()); + pwModulePart.setFigureNumber(documentsDetail.getFigureNumber()); + list3 = pwModulePartService.selectPwModulePartList(pwModulePart); + }else{ + //查询零部件关联表 + PwModulePart pwModulePart = new PwModulePart(); + pwModulePart.setMaterialName(makeDocumentsDetail.getName()); + pwModulePart.setFigureNumber(makeDocumentsDetail.getFigureNumber()); + list3 = pwModulePartService.selectPwModulePartList(pwModulePart); + } + + } + + //是否入库 + String ss = ""; + for (PwMakeDocumentsDetail makeDocumentsDetail2 : list2) { + makeDocumentsDetail2.setNum(i+""); + + File file = new File("D:/java/qrcode/QB"+makeDocumentsDetail2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(file.exists()){ + file.delete(); + } + // 生成申请质检的二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeQB?id="+makeDocumentsDetail2.getId(), config, FileUtil.file("D:/java/qrcode/QB"+makeDocumentsDetail2.getId()+".jpg")); + makeDocumentsDetail2.setQrCodeUrl("http://localhost:8088/qrcode/QB"+makeDocumentsDetail2.getId()+".jpg"); + + File fileTwo = new File("D:/java/qrcodeTwo/QB"+makeDocumentsDetail2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileTwo.exists()){ + fileTwo.delete(); + } + //生成确认质检的二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeTwo?code="+makeDocumentsDetail2.getMakeDocumentsCode()+"&figureNumber="+makeDocumentsDetail2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeTwo/QB"+makeDocumentsDetail2.getId()+".jpg")); + makeDocumentsDetail2.setQrCodeUrlTwo("http://localhost:8088/qrcodeTwo/QB"+makeDocumentsDetail2.getId()+".jpg"); + + //判断是否入库,如果不入库,则不再生成入库的二维码 + if("是".equals(makeDocumentsDetail2.getGodownEntry())){ + File fileThree = new File("D:/java/qrcodeThree/QB"+makeDocumentsDetail2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileThree.exists()){ + fileThree.delete(); + } + //生成确认入库的二维码,指定url对应的二维码到文件,宽和高都是300像素 +// QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeThree?code="+makeDocumentsDetail2.getMakeDocumentsCode()+"&name="+makeDocumentsDetail2.getName()+"&figureNumber="+makeDocumentsDetail2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeThree/QB"+makeDocumentsDetail2.getId()+".jpg")); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeThree?code="+makeDocumentsDetail2.getMakeDocumentsCode()+"&figureNumber="+makeDocumentsDetail2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeThree/QB"+makeDocumentsDetail2.getId()+".jpg")); + makeDocumentsDetail2.setQrCodeUrlThree("http://localhost:8088/qrcodeThree/QB"+makeDocumentsDetail2.getId()+".jpg"); + } + + //判断是否填写了原材料,如果没有填写原材料,则不再生成领料的二维码和出库的二维码 + if(i==1&&null==makeDocumentsDetail2.getMaterialId()&&!"组件".equals(makeDocumentsDetail2.getMaterialType())&&!"部件".equals(makeDocumentsDetail.getMaterialType())){ + + }else{ + File fileFour = new File("D:/java/qrcodeFour/QB"+makeDocumentsDetail2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFour.exists()){ + fileFour.delete(); + } + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFourQB?id="+makeDocumentsDetail2.getId(), config, FileUtil.file("D:/java/qrcodeFour/QB"+makeDocumentsDetail2.getId()+".jpg")); + makeDocumentsDetail2.setQrCodeUrlFour("http://localhost:8088/qrcodeFour/QB"+makeDocumentsDetail2.getId()+".jpg"); + } + + if(i==1&&null==makeDocumentsDetail2.getMaterialId()){ + //判断是否是组件,如果为组件,则生成领料 + if("组件".equals(makeDocumentsDetail2.getMaterialType())||"部件".equals(makeDocumentsDetail.getMaterialType())){ + //说明是组件,则需要生成出库的二维码 + File fileFive = new File("D:/java/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFive.exists()){ + fileFive.delete(); + } + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+makeDocumentsDetail2.getMakeDocumentsCode(), config, FileUtil.file("D:/java/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg")); + makeDocumentsDetail2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg"); + } + }else{ + if("是".equals(ss)||"".equals(ss)){ + File fileFive = new File("D:/java/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg"); + //第一序生成的出库领料码,为原材料的名称 + if(fileFive.exists()){ + fileFive.delete(); + } + if(i==1){ + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 +// QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+makeDocumentsDetail2.getMakeDocumentsCode()+"&name="+makeDocumentsDetail2.getMaterialsName()+"&figureNumber="+makeDocumentsDetail2.getMaterialsSpecification(), config, FileUtil.file("D:/java/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg")); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+makeDocumentsDetail2.getMakeDocumentsCode()+"&figureNumber="+makeDocumentsDetail2.getMaterialsSpecification(), config, FileUtil.file("D:/java/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg")); + makeDocumentsDetail2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg"); + }else{ + //生成领料申请二维码,指定url对应的二维码到文件,宽和高都是300像素 + //获取上一道序的名称和图号 + String substring = makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1); + String figureNumber = makeDocumentsDetail2.getFigureNumber().substring(0,makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //根据令号和图号查询上一道序的物料信息 + PwMakeDocumentsDetail documentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsDetail2.getMakeDocumentsCode(), figureNumber); +// QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+makeDocumentsDetail2.getMakeDocumentsCode()+"&name="+documentsDetail2.getName()+"&figureNumber="+documentsDetail2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg")); + QrCodeUtil.generate("http://localhost:8090/production/pwQrcodeFive?code="+makeDocumentsDetail2.getMakeDocumentsCode()+"&figureNumber="+documentsDetail2.getFigureNumber(), config, FileUtil.file("D:/java/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg")); + makeDocumentsDetail2.setQrCodeUrlFive("http://localhost:8088/qrcodeFive/QB"+makeDocumentsDetail2.getId()+".jpg"); + } + } + } + ss = makeDocumentsDetail2.getGodownEntry(); + i++; + } + + //返回pdf图片地址 + File file = new File("D:/evoEngine/static/pdf/yzpdf/"+makeDocumentsDetail.getMakeDocumentsCode()+"/bom/"+makeDocumentsDetail.getFigureNumber().replaceAll("/","--")+".pdf"); + if(null!=file){ + try { + PDDocument doc = PDDocument.load(file); + PDFRenderer renderer = new PDFRenderer(doc); + int pageCount = doc.getNumberOfPages(); + for(int r=0;r godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list); + return AjaxResult.success("success",godownMessage); + } + + + /** + * 毛坯物料申请领料 + */ + @RepeatSubmit + @RequestMapping("getWorkblanks") + public AjaxResult getWorkblanks(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //申请领料时判断当前序派工给谁了,如果不是管理员账号和本派工部门的权限,则不允许申请 + if(!"admin".equals(user.getUserName())&&!"chenshitian".equals(user.getUserName())&&!pwMakeDocumentsDetail.getDepartmentName().equals(user.getDept().getDeptName())){ + return AjaxResult.error("当前账号无权限"); + } + + //名称 + String name = pwMakeDocumentsDetail.getName(); + //图号 + String figureNumber2 = pwMakeDocumentsDetail.getFigureNumber(); + //根据id查看bom表 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + //获取执行单号 + String code = makeDocumentsDetail.getMakeDocumentsCode(); + //根据执行单号获取企标单信息 + PwMakeDocuments pwMakeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(code); + //判断当前物料是否是第一道序的物料 + String substring = makeDocumentsDetail.getFigureNumber().substring(makeDocumentsDetail.getFigureNumber().lastIndexOf("-")+1); + + //判断当前物料是否是第一道序的物料 + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1 list = imProductReceiptMaterialService.selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(documentsDetail.getMakeDocumentsCode(), documentsDetail.getName(), documentsDetail.getFigureNumber()); + Long ruku = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + ruku += imProductReceiptMaterial.getReceived().longValue(); + } + //查询发料的数量 + List list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(documentsDetail.getMakeDocumentsCode(), documentsDetail.getName(), documentsDetail.getFigureNumber()); + Long chuku = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + chuku += imStockRequisitionMaterial.getAlreadyQuantity(); + } + if(list.size()<1){ + //说明没有入库 + return AjaxResult.error("上序未入库,不允许领料"); + }else{ + if(rukuinventoryDetail.getQuantity()){ + return AjaxResult.error("领料数量不可以大于库存数量,当前库存数量为:"+inventoryDetail.getQuantity()+" 件"); + } + if(null==pwMakeDocumentsDetail.getLingliaoNumber()||0==pwMakeDocumentsDetail.getLingliaoNumber()){ + return AjaxResult.error("请输入申请数量"); + } + if(pwMakeDocumentsDetail.getLingliaoNumber()>pwMakeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申领数量不可大于本批数量"); + } + + } + + if(1==Integer.valueOf(substring)){ + //跟据序的id查询父级物料 + PwMakeDocumentsDetail documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getSuperiorId()); + if(null!=documentsDetail&&null==pwMakeDocumentsDetail.getMaterialId()&&("部件".equals(documentsDetail.getMaterialType())||"组件".equals(documentsDetail.getMaterialType()))){ + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(documentsDetail.getName(), documentsDetail.getFigureNumber()); + //查询零部件关联表 + List list = pwModulePartService.selectPwModulePartByMaterialId(imMaterial.getId()); + int i = 0; + if(list.size()<1){ + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //根据code查询领料单的申领数量 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(code); + if(null!=stockRequisition){ + //判断领料状态是否是1 + if(null!=pwMakeDocumentsDetail.getSparedFour()&&pwMakeDocumentsDetail.getSparedFour()==1){ + //return AjaxResult.error("已申请,无需重复申请"); + }else{ + if(null==pwMakeDocumentsDetail.getSparedThree()){ + pwMakeDocumentsDetail.setSparedThree(0L); + } + /*if(pwMakeDocumentsDetail.getLingliaoNumber()+pwMakeDocumentsDetail.getSparedThree()>pwMakeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申请数量不可大于本批数量,已申请数量为:"+pwMakeDocumentsDetail.getSparedThree()+",剩余可申领数量为:"+(pwMakeDocumentsDetail.getQuantity()-pwMakeDocumentsDetail.getSparedThree())); + }*/ + //说明有零件可以领 + for (PwModulePart pwModulePart : list) { + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + + //判断领用的原材料信息是否充足 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()>inventoryDetail.getQuantity()){ + return AjaxResult.error("领料数量不可以大于库存数量,"+material.getMaterialName()+"的当前库存数量为:"+inventoryDetail.getQuantity()); + } + + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(code); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwModulePart.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwModulePart.getSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(code); + imStockRequisitionMaterial.setSparedThree(pwMakeDocumentsDetail.getId()); + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + } + //判断领料数量是否已等于本批数量 + if(pwMakeDocumentsDetail.getLingliaoNumber()+pwMakeDocumentsDetail.getSparedThree()>=pwMakeDocumentsDetail.getQuantity()){ + //修改领料状态为1 + pwMakeDocumentsDetail.setSparedFour(1L); + }else{ + pwMakeDocumentsDetail.setSparedThree(pwMakeDocumentsDetail.getSparedThree()+pwMakeDocumentsDetail.getLingliaoNumber()); + } + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(code); + //项目名称 + imStockRequisition.setProjectName(pwMakeDocuments.getName()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + if(null==pwMakeDocumentsDetail.getSparedThree()){ + pwMakeDocumentsDetail.setSparedThree(0L); + } + /*if(pwMakeDocumentsDetail.getLingliaoNumber()+pwMakeDocumentsDetail.getSparedThree()>pwMakeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申请数量不可大于本批数量,已申请数量为:"+pwMakeDocumentsDetail.getSparedThree()+",剩余可申领数量为:"+(pwMakeDocumentsDetail.getQuantity()-pwMakeDocumentsDetail.getSparedThree())); + }*/ + for (PwModulePart pwModulePart : list) { + + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(code); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + + //判断领用的原材料信息是否充足 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()>inventoryDetail.getQuantity()){ + return AjaxResult.error("领料数量不可以大于库存数量,"+material.getMaterialName()+"的当前库存数量为:"+inventoryDetail.getQuantity()); + } + + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwModulePart.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwModulePart.getSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwMakeDocumentsDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(code); + imStockRequisitionMaterial.setSparedThree(pwMakeDocumentsDetail.getId()); + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + //判断领料数量是否已等于本批数量 + if(pwMakeDocumentsDetail.getLingliaoNumber()+pwMakeDocumentsDetail.getSparedThree()>=pwMakeDocumentsDetail.getQuantity()){ + //修改领料状态为1 + pwMakeDocumentsDetail.setSparedFour(1L); + }else{ + pwMakeDocumentsDetail.setSparedThree(pwMakeDocumentsDetail.getSparedThree()+pwMakeDocumentsDetail.getLingliaoNumber()); + } + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + } + return toAjax(i); + }else{ + //如果为第一道序,则查询原材料,领原材料的数量为下料尺寸*毛坯数量 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + makeDocumentsDetail.setName(makeDocumentsDetail.getMaterialsName()); + makeDocumentsDetail.setFigureNumber(makeDocumentsDetail.getMaterialsSpecification()); + //修改为领料数量*下料尺寸 + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //计算领料数量 + makeDocumentsDetail.setLingliaoNumber(pwMakeDocumentsDetail.getLingliaoNumber()*Long.valueOf(pwMakeDocumentsDetail.getMeasure())+(3*pwMakeDocumentsDetail.getLingliaoNumber())); + }else{ + //计算领料数量 + makeDocumentsDetail.setLingliaoNumber(pwMakeDocumentsDetail.getLingliaoNumber()*Long.valueOf(pwMakeDocumentsDetail.getMeasure())); + } + //判断领用的原材料信息是否充足 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(makeDocumentsDetail.getLingliaoNumber()>inventoryDetail.getQuantity()){ + return AjaxResult.error("领料数量不可以大于库存数量,当前库存数量为:"+inventoryDetail.getQuantity()); + } + + } + } + }else{ + if(0==pwMakeDocumentsDetail.getLingliaoNumber()||null==pwMakeDocumentsDetail.getLingliaoNumber()){ + return AjaxResult.error("请输入申请数量"); + } + /*if(pwMakeDocumentsDetail.getLingliaoNumber()>pwMakeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }*/ + String figureNumber = makeDocumentsDetail.getFigureNumber().substring(0,makeDocumentsDetail.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + makeDocumentsDetail.setFigureNumber(figureNumber); + } + + //根据code查询领料单的申领数量 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(code); + int i = 0; + //申请数量 + Long shenqingNumber = 0L; + if(null!=stockRequisition){ + Long s = 0L; + //如果为第一序,则查询时需要带上名称 + if(1==Integer.valueOf(substring)){ + //根据图号和code查询 +// List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { +// s += imStockRequisitionMaterial.getApplyForQuantity(); +// } + }else{ + //根据图号和code查询 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),makeDocumentsDetail.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + } + + if(1==Integer.valueOf(substring)){ + //判断领料状态是否是1 + if(null!=makeDocumentsDetail.getSparedFour()&&makeDocumentsDetail.getSparedFour()==1){ + //return AjaxResult.error("无需重复申请"); + }else{ + //如果为第一道序,则需要查询原材料信息 + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //判断领料数量是否满足了毛坯数量*下料尺寸 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), material.getMaterialName(), material.getFigureNumber()); + + for (ImStockRequisitionMaterial imStockRequisitionMaterial2 : list) { + shenqingNumber += imStockRequisitionMaterial2.getSalaryQuantity(); + } + /*if(shenqingNumber+pwMakeDocumentsDetail.getLingliaoNumber()>makeDocumentsDetail.getWorkblank()*Long.valueOf(makeDocumentsDetail.getMeasure())){ + return AjaxResult.error("累计申请数量超出!"); + }*/ + + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(material.getMaterialName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(material.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(makeDocumentsDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(makeDocumentsDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(makeDocumentsDetail.getLingliaoNumber()); + + //计量单位 + imStockRequisitionMaterial.setUnit(material.getUnitOfMeasurementName()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwMakeDocumentsDetail.getMakeDocumentsCode()); + imStockRequisitionMaterial.setSparedThree(pwMakeDocumentsDetail.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + /*if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail.getLingliaoNumber()); + }*/ + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + if(shenqingNumber+pwMakeDocumentsDetail.getLingliaoNumber()==makeDocumentsDetail.getWorkblank()*Long.valueOf(makeDocumentsDetail.getMeasure())){ + //修改领料状态 + pwMakeDocumentsDetail.setSparedFour(1L); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + } + }else{ + //判断数量是否已经超了本批数量 + if(s+pwMakeDocumentsDetail.getLingliaoNumber()>makeDocumentsDetail.getQuantity()){ + //return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + // TODO 判断上序是否入库,如果不入库,则直接出库 + //查找当前物料的上一道序的物料 + PwMakeDocumentsDetail makeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getFigureNumber()); + + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(makeDocumentsDetail2.getMakeDocumentsCode()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(makeDocumentsDetail2.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(makeDocumentsDetail2.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(makeDocumentsDetail2.getMaterialType()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwMakeDocumentsDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwMakeDocumentsDetail.getLingliaoNumber()); + + //查找当前物料的上一道序的物料 + if(makeDocumentsDetail2.getGodownEntry().equals("否")){ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(pwMakeDocumentsDetail.getLingliaoNumber()); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(0L); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("已出库"); + //出库时间 + imStockRequisitionMaterial.setOutboundDate(new Date()); + //出库人 + imStockRequisitionMaterial.setSendingPeopleName("虚拟出库"); + //减少库存 + //根据图号和名称查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imStockRequisitionMaterial.getMaterialName(), imStockRequisitionMaterial.getFigureNumber()); + //减少库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-pwMakeDocumentsDetail.getLingliaoNumber()); + if(inventoryDetail.getLockNumber()-pwMakeDocumentsDetail.getLingliaoNumber()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + //减少预定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwMakeDocumentsDetail.getLingliaoNumber()); + } + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(0L); + + }else{ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwMakeDocumentsDetail.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + } + + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwMakeDocumentsDetail.getMakeDocumentsCode()); + imStockRequisitionMaterial.setSparedThree(pwMakeDocumentsDetail.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + /*if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail.getLingliaoNumber()); + }*/ + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + if(!makeDocumentsDetail2.getGodownEntry().equals("否")){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + } + }else{ + + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //项目名称 + imStockRequisition.setProjectName(pwMakeDocuments.getName()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //申领数量 +// imStockRequisition.setSparedThree(pwBomNumberTwo.getShuliang()); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //查找当前物料的上一道序的物料 + PwMakeDocumentsDetail makeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getFigureNumber()); + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //判断领料数量是否满足了毛坯数量*下料尺寸 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), material.getMaterialName(), material.getFigureNumber()); + + for (ImStockRequisitionMaterial imStockRequisitionMaterial2 : list) { + shenqingNumber += imStockRequisitionMaterial2.getSalaryQuantity(); + } + /*if(shenqingNumber+pwMakeDocumentsDetail.getLingliaoNumber()>makeDocumentsDetail.getWorkblank()*Long.valueOf(makeDocumentsDetail.getMeasure())){ + return AjaxResult.error("累计申请数量超出!"); + }*/ + + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwMakeDocumentsDetail.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwMakeDocumentsDetail.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(makeDocumentsDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(makeDocumentsDetail.getLingliaoNumber()); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(makeDocumentsDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(makeDocumentsDetail.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + } + }else{ + // TODO 判断上一序是否入库,如果不入库,则直接出库 + //物料名称 + imStockRequisitionMaterial.setMaterialName(makeDocumentsDetail2.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(makeDocumentsDetail2.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(makeDocumentsDetail2.getMaterialType()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwMakeDocumentsDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwMakeDocumentsDetail.getLingliaoNumber()); + //判断上序是否入库 + if("否".equals(makeDocumentsDetail2.getGodownEntry())){ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(pwMakeDocumentsDetail.getLingliaoNumber()); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(makeDocumentsDetail.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("已出库"); + //出库时间 + imStockRequisitionMaterial.setOutboundDate(new Date()); + //出库人 + imStockRequisitionMaterial.setSendingPeopleName("虚拟出库"); + //减少库存 + //根据图号和名称查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imStockRequisitionMaterial.getMaterialName(), imStockRequisitionMaterial.getFigureNumber()); + //减少库存数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-pwMakeDocumentsDetail.getLingliaoNumber()); + if(inventoryDetail.getLockNumber()-pwMakeDocumentsDetail.getLingliaoNumber()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + //减少预定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwMakeDocumentsDetail.getLingliaoNumber()); + } + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(0L); + + }else{ + //重新计算可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + } + //修改库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwMakeDocumentsDetail.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + } + } + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwMakeDocumentsDetail.getMakeDocumentsCode()); + imStockRequisitionMaterial.setSparedThree(pwMakeDocumentsDetail.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(name, figureNumber2); + if(null!=inventoryDetail){ + /*if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail.getLingliaoNumber()); + }*/ + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + if(null==makeDocumentsDetail.getMeasure()){ + if(shenqingNumber+pwMakeDocumentsDetail.getLingliaoNumber()==pwMakeDocumentsDetail.getQuantity()){ + //修改领料状态 + pwMakeDocumentsDetail.setSparedFour(1L); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + }else{ + if(shenqingNumber+pwMakeDocumentsDetail.getLingliaoNumber()==makeDocumentsDetail.getWorkblank()*Long.valueOf(makeDocumentsDetail.getMeasure())){ + //修改领料状态 + pwMakeDocumentsDetail.setSparedFour(1L); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + } + + if(1==Integer.valueOf(substring)){ + if(!"否".equals(makeDocumentsDetail.getGodownEntry())){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + }else{ + if(!"否".equals(makeDocumentsDetail2.getGodownEntry())){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + } + return toAjax(i); + } + + /** + * 撤销申请质检按钮 + */ + @DeleteMapping("/revocationBoms/{ids}") + public AjaxResult revocationBoms(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwMakeDocumentsDetail detail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); + //根据物料名称和图号和令号查找此物料最近一次申请的质检信息 + int a = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(detail.getMakeDocumentsCode(), detail.getName(), detail.getFigureNumber()); + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById((long)a); + //根据物料名称和图号和令号查询入库单详情信息,距离当前时间最近的一条数据 + int b = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(detail.getMakeDocumentsCode(), detail.getName(), detail.getFigureNumber()); + ImProductReceiptMaterial receiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById((long)b); + //判断当前数据是否已经确认入库,如果确认入库则需要退库 + if(receiptMaterial.getInventoryStatus().equals("已入库")){ + //已经确认入库的则不允许撤销 + return AjaxResult.error("已经确认入库的物料不允许撤销"); + } + //删除当前数据 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(receiptMaterial.getId()); + pwCompletionNoticeProductService.deletePwCompletionNoticeProductById(completionNoticeProduct.getId()); + + //修改点件表的物料入库状态 + detail.setInventoryStatus("未入库"); + i = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(detail); + } + return toAjax(i); + } + + /** + * 撤销申请领料按钮 + */ + @DeleteMapping("/revocationLingliaos/{ids}") + public AjaxResult revocationLingliaos(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); + //图号 + String figureNumber = makeDocumentsDetail.getFigureNumber(); + //判断当前物料是否已经出库 + //判断是第几道序,如果是第一道序,则根据原材料名称和图号和令号查询,如果不是第一道序,则根据令号和图号查询 + //判断当前物料是否是第一道序的物料 + String substring = makeDocumentsDetail.getFigureNumber().substring(makeDocumentsDetail.getFigureNumber().lastIndexOf("-")+1); + List list = new ArrayList(); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1==Integer.valueOf(substring)){ + if("部件".equals(makeDocumentsDetail.getMaterialType())||"组件".equals(makeDocumentsDetail.getMaterialType())){ + //说明是部件或者是成品则查询零件的领用信息 + //查询父级的信息 + PwMakeDocumentsDetail documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + //查询当前部件下的零件 + List list2 = pwModulePartService.selectPwModulePartByMaterialNameAndFigureNumber(documentsDetail.getName(),documentsDetail.getFigureNumber()); + //是否可以删除标记 + int e = 0; + for (PwModulePart pwModulePart : list2) { + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(makeDocumentsDetail.getMakeDocumentsCode(), pwModulePart.getName(), pwModulePart.getSpecification(), makeDocumentsDetail.getId()); + if(list3.size()<1){ + return AjaxResult.error("已全部撤销领料条目"); + } + if(!"未出库".equals(list3.get(list3.size()-1).getGetStatus())){ + //说明已经出库,则不允许删除 + e = 1; + } + } + if(e == 1){ + return AjaxResult.error("已出库的物料不允许撤销申请领料!"); + }else{ + //删除 + for (PwModulePart pwModulePart : list2) { + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(makeDocumentsDetail.getMakeDocumentsCode(), pwModulePart.getName(), pwModulePart.getSpecification(), makeDocumentsDetail.getId()); + i = iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(list3.get(list3.size()-1).getId()); + } + return AjaxResult.success(i); + } + + }else{ + //如果是零件,则查询原材料领用信息 + list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + } + }else{ + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber.substring(0,figureNumber.lastIndexOf("-"))+"-"+s; + list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), figureNumber); + } + + if(list.size()>0){ + ImStockRequisitionMaterial imStockRequisitionMaterial = list.get(list.size()-1); + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + if(null!=makeDocumentsDetail.getSparedThree()){ + if(makeDocumentsDetail.getSparedThree()-imStockRequisitionMaterial.getSalaryQuantity()<0){ + //修改已领数量 + makeDocumentsDetail.setSparedThree(0L); + }else{ + //修改已领数量 + makeDocumentsDetail.setSparedThree(makeDocumentsDetail.getSparedThree()-imStockRequisitionMaterial.getSalaryQuantity()); + } + } + //修改领料状态 + makeDocumentsDetail.setSparedFour(0L); + i = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + }else{ + return AjaxResult.error("已入库的不允许撤销"); + } + } + } + if(i==0){ + return AjaxResult.error("已全部撤销领料条目"); + } + return toAjax(i); + } + + /** + * 生成库存制作清单 + */ + @RequestMapping("createInventory") + public AjaxResult createInventory(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + if(null==pwMakeDocumentsDetail.getMakeDocumentsCode()||"".equals(pwMakeDocumentsDetail.getMakeDocumentsCode().trim())){ + return AjaxResult.error("请输入令号"); + } + if(null==pwMakeDocumentsDetail.getBillsName()||"".equals(pwMakeDocumentsDetail.getBillsName().trim())){ + return AjaxResult.error("请输入名称"); + } + /*if(null==pwMakeDocumentsDetail.getSparedOne()||"".equals(pwMakeDocumentsDetail.getSparedOne().trim())){ + return AjaxResult.error("请输入名称"); + }*/ + //创建库存制作清单信息 + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + pwMakeDocuments.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + pwMakeDocuments.setName(pwMakeDocumentsDetail.getBillsName()); + pwMakeDocuments.setSparedOne(pwMakeDocumentsDetail.getSparedOne().substring(3)); + int j = pwMakeDocumentsService.insertPwMakeDocuments(pwMakeDocuments); + int i = 0; + if(j>0){ + Long[] ids = pwMakeDocumentsDetail.getIds(); + for (Long long1 : ids) { + //根据id查询库存信息 + PwInventoryDetail detail = pwInventoryDetailService.selectPwInventoryDetailById(long1); + //把库存信息添加到预制单明细中 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + pdd.setMakeDocumentsCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //名称 + pdd.setName(detail.getName()); + //图号 + pdd.setFigureNumber(detail.getFigureNumber()); + //材料 + pdd.setMaterialType(detail.getMaterials()); + //预制数量 + pdd.setQuantity(detail.getHighest()-detail.getAvailableNumber()-detail.getPreliminaryInventory()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd); + //修改库存的在途数量 + detail.setPreliminaryInventory(detail.getPreliminaryInventory()+detail.getHighest()-detail.getAvailableNumber()-detail.getPreliminaryInventory()); + pwInventoryDetailService.updatePwInventoryDetail(detail); + } + }else{ + return AjaxResult.error("生成清单失败"); + } + return AjaxResult.success(i); + } + + /** + * 删除库存制作单明细 + */ + @PreAuthorize("@ss.hasPermi('management:makeDocumentsDetail:remove')") + @Log(title = "库存制作单明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + int i = 0; + //释放在途数量 + for (Long id : ids) { + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); + if(null!=makeDocumentsDetail){ + //判断其物料下是否有子集工序,如果有子集工序,则删除全部子集工序 + if(!makeDocumentsDetail.getName().contains("(M)")){ + //说明是物料成品(需要删除其子集所有工序) + //查询其所有子集工序 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + //减少其在途数量(判断其是否有已经入库的数量,如果有,则不允许删除) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + if(list2.size() > 0){ + //说明有已经入库的 + return AjaxResult.error("已经入库的物料不允许删除"); + }else{ + //减少其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + if(inventoryDetail.getPreliminaryInventory()>=pwMakeDocumentsDetail.getQuantity()){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-pwMakeDocumentsDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(0L); + } + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //删除其子集信息 + i = pwMakeDocumentsDetailService.deletePwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + } + } + //减少其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + if(inventoryDetail.getPreliminaryInventory()>=makeDocumentsDetail.getQuantity()){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-makeDocumentsDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(0L); + } + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //删除物料本身 + i = pwMakeDocumentsDetailService.deletePwMakeDocumentsDetailById(id); + }else{ + //如果为子集工序,则需要删除当前物料的所有工序(根据当前物料的上级id查询所有工序) + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getSuperiorId()); + + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + //判断当前物料是否已经领料 + String substring = pwMakeDocumentsDetail.getFigureNumber().substring(pwMakeDocumentsDetail.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + String figureNumber = pwMakeDocumentsDetail.getFigureNumber().substring(0,pwMakeDocumentsDetail.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + if(s==0){ + //说明是第一道序,则查询原材料信息 + List listOne = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(listOne.size()>0){ + return AjaxResult.error("已经领料的工序不能直接删除"); + } + }else{ + //删除之前,跟据code和名称和图号查询是否已经领料 + List listTwo = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), figureNumber); + if(listTwo.size()>0){ + return AjaxResult.error("已经领料的工序不能直接删除"); + } + } + } + + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + if(null != pwMakeDocumentsDetail.getMaterialsName()&&!"".equals(pwMakeDocumentsDetail.getMaterialsName())&& null != pwMakeDocumentsDetail.getMaterialsSpecification()&&!"".equals(pwMakeDocumentsDetail.getMaterialsSpecification())){ + //减少其锁定数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null!=pwMakeDocumentsDetail.getMeasure()&&null!=pwMakeDocumentsDetail.getWorkblank()){ + if(inventoryDetail.getLockNumber()-(Double.valueOf(pwMakeDocumentsDetail.getMeasure()).longValue()*pwMakeDocumentsDetail.getWorkblank())<0){ + inventoryDetail.setLockNumber(0L); + }else{ + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-(Double.valueOf(pwMakeDocumentsDetail.getMeasure()).longValue()*pwMakeDocumentsDetail.getWorkblank())); + } + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + //减少其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + if(inventoryDetail.getPreliminaryInventory()>=pwMakeDocumentsDetail.getQuantity()){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-pwMakeDocumentsDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(0L); + } + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //删除其子集信息 + i = pwMakeDocumentsDetailService.deletePwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + } + } + }else{ + continue; + } + } + return toAjax(i); + } + + + /** + * 生成原材料明细单 + */ + @RequestMapping("generateProcurements/{ids}") + public AjaxResult generateProcurements(@PathVariable Long[] ids){ + PwMakeDocumentsDetail detail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(ids[0]); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据令号查询是否之前生成果预采购单,如果生成果,则不允许再生成 + PwFuturesOrders futuresOrders = pwFuturesOrdersService.selectPwFuturesOrdersByCode(detail.getMakeDocumentsCode()); + //如果填写了原材料,则计算原材料的数量 + if(null!=futuresOrders){ + return AjaxResult.error("不允许重复生成预采购单"); + } + + //判断材料是否是毛坯或者设置了安全库存的物料 + //查询所有填写了材料的数据 + int s = 0; + List list4 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndMaterialIdIsNotNull(detail.getMakeDocumentsCode()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list4) { + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + s = 1; + } + } + int i = 0; + if(s == 1){ + //生成新的预采购单 + PwFuturesOrders pwFuturesOrders = new PwFuturesOrders(); + //令号 + pwFuturesOrders.setCode(detail.getMakeDocumentsCode()); + //申请人 + pwFuturesOrders.setUser(user.getNickName()); + //申请时间 + pwFuturesOrders.setTime(new Date()); + //状态(初始状态为未审核) + pwFuturesOrders.setStatus("未审核"); + i = pwFuturesOrdersService.insertPwFuturesOrders(pwFuturesOrders); + + //获取令号,根据令号查询所有的物料的原材料明细 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(detail.getMakeDocumentsCode(),null); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + //获取每颗料的第一序的物料 + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + PwMakeDocumentsDetail detail2 = new PwMakeDocumentsDetail(); + if(list2.size()>0){ + //默认为下标为0的为第一序 + detail2 = list2.get(0); + }else{ + continue; + } + + //获取下料尺寸和毛坯数量(下料尺寸*毛坯数量为需要出库的) + if(null!=detail2.getMaterialsName()&&null!=detail2.getMaterialsSpecification()){ + //根据名称和图号查询预购单明细中是否有了此物料,如果有则不再新增,则在原有的基础上添加总数量 + //根据名称和图号查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(detail2.getMaterialsName(), detail2.getMaterialsSpecification()); + + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //把合并之前的信息增加到详情中 + PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo = new PwFuturesOrdersDetailTwo(); + //根据名称和图号查询预购单明细中是否有了此物料,如果有则不再新增,则在原有的基础上添加总数量 + PwFuturesOrdersDetail futuresOrdersDetail = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(detail2.getMakeDocumentsCode(),detail2.getMaterialsName(),detail2.getMaterialsSpecification()); + if(null != futuresOrdersDetail){ + //总尺寸相加 增加料损 + futuresOrdersDetail.setNumber(futuresOrdersDetail.getNumber()+(Double.valueOf(detail2.getMeasure())*detail2.getWorkblank())+(3*detail2.getWorkblank())); + if(futuresOrdersDetail.getUnit().equals("毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000); + }else if(futuresOrdersDetail.getUnit().equals("平方毫米")){ + //总采购数量转换 + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()/1000000); + }else{ + futuresOrdersDetail.setQuantity(futuresOrdersDetail.getNumber()); + } + //总重量重新计算 + futuresOrdersDetail.setReferenceNumber(futuresOrdersDetail.getQuantity() * material.getPieceWeight()); + + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(futuresOrdersDetail.getId()); + + pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(futuresOrdersDetail); + }else{ + //新增预采购单明细 + PwFuturesOrdersDetail pwFuturesOrdersDetail = new PwFuturesOrdersDetail(); + //令号 + pwFuturesOrdersDetail.setCode(detail.getMakeDocumentsCode()); + //预购单id + pwFuturesOrdersDetail.setOrdersId(pwFuturesOrders.getId()); + //名称 + pwFuturesOrdersDetail.setName(detail2.getMaterialsName()); + //图号 + pwFuturesOrdersDetail.setFigureNumber(detail2.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetail.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetail.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetail.setMeasure(Long.valueOf(detail2.getMeasure())); + //毛坯数量 + pwFuturesOrdersDetail.setWorkblank(detail2.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetail.setNumber(Double.valueOf(detail2.getMeasure())*detail2.getWorkblank().doubleValue()+(3*detail2.getWorkblank().doubleValue())); + //计量单位(物料属性) + pwFuturesOrdersDetail.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("米"); + }else if(material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(pwFuturesOrdersDetail.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetail.setQuantity(Double.valueOf(detail2.getMeasure())*detail2.getWorkblank().doubleValue()+(3*detail2.getWorkblank().doubleValue())); + //采用原单位 + pwFuturesOrdersDetail.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetail.setReferenceNumber(pwFuturesOrdersDetail.getQuantity() * material.getPieceWeight()); + + //库存数量 + //根据原材料物料名称和图号查询库存 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(detail2.getMaterialsName(), detail2.getMaterialsSpecification()); + //库存数量 + pwFuturesOrdersDetail.setInventoryQuantity(inventoryDetail.getQuantity()); + //在途数量 + pwFuturesOrdersDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + //锁定数量(锁定数量-本次项目用的数量) + pwFuturesOrdersDetail.setLockNumber(inventoryDetail.getLockNumber()-pwFuturesOrdersDetail.getNumber().longValue()); + + pwFuturesOrdersDetailService.insertPwFuturesOrdersDetail(pwFuturesOrdersDetail); + + //预购单id + pwFuturesOrdersDetailTwo.setOrdersDetailId(pwFuturesOrdersDetail.getId()); + //锁定库存数量 +// inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwFuturesOrdersDetail.getNumber().longValue()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + //令号 + pwFuturesOrdersDetailTwo.setCode(detail2.getMakeDocumentsCode()); + //物料id + pwFuturesOrdersDetailTwo.setMatenaisId(detail2.getId()); + //名称 + pwFuturesOrdersDetailTwo.setName(detail2.getMaterialsName()); + //图号 + pwFuturesOrdersDetailTwo.setFigureNumber(detail2.getMaterialsSpecification()); + //材料 + pwFuturesOrdersDetailTwo.setMaterials(material.getMaterials()); + //单重 + pwFuturesOrdersDetailTwo.setPieceWeight(material.getPieceWeight()); + //下料尺寸 + pwFuturesOrdersDetailTwo.setSparedOne(detail2.getSpecification()); + //毛坯数量 + pwFuturesOrdersDetailTwo.setWorkblank(detail2.getWorkblank().doubleValue()); + + //总数量(计算)下料尺寸*毛坯数量 + pwFuturesOrdersDetailTwo.setNumber(Double.valueOf(detail2.getMeasure())*detail2.getWorkblank().doubleValue()+(3*detail2.getWorkblank().doubleValue())); + //计量单位(物料属性) + pwFuturesOrdersDetailTwo.setUnit(material.getUnitOfMeasurementName()); + + //如果基本单位为毫米,则转换成米,如果为根,则使用原单位 + if(material.getUnitOfMeasurementName().equals("毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000); + //采用换算后的单位 + pwFuturesOrdersDetailTwo.setUnitTwo("米"); + }else if(material.getUnitOfMeasurementName().equals("平方毫米")){ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()/1000000); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo("平方米"); + }else{ + //采购数量(计算) + pwFuturesOrdersDetailTwo.setQuantity(pwFuturesOrdersDetailTwo.getNumber()); + //采用原单位 + pwFuturesOrdersDetailTwo.setUnitTwo(material.getUnitOfMeasurementName()); + } + + //参考重量 + pwFuturesOrdersDetailTwo.setReferenceNumber(pwFuturesOrdersDetailTwo.getQuantity() * material.getPieceWeight()); + + pwFuturesOrdersDetailTwoService.insertPwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo); + } + } + } + }else{ + return AjaxResult.error("此项目中的原材料,无需生成预采购单"); + } + return toAjax(i); + } + + /** + * 下载生产图纸,并写入数据 + */ +// @RequestMapping("uploadPDF/{ids}") +// public AjaxResult uploadPDF(@PathVariable Long[] ids){ +// String makeDocumentsCode = ""; +// //拼接需要传的图号 +// String figureNumber = ""; +// //拼接需要传的数量 +// String quantity = ""; +// //令号 +// String code = ""; +// //完成时间 +// String date = ""; +// SimpleDateFormat sdf= new SimpleDateFormat("MM月dd日"); +// for (Long id : ids) { +// //根据id查询当前数据 +// PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); +// //获取令号 +// makeDocumentsCode = makeDocumentsDetail.getMakeDocumentsCode(); +// //获取图纸型号 +// code = makeDocumentsDetail.getMakeDocumentsCode(); +// if(makeDocumentsDetail.getName().contains("(M)")){ +// //获取当前数据的图号 +// figureNumber += makeDocumentsDetail.getFigureNumber().substring(0,makeDocumentsDetail.getFigureNumber().lastIndexOf("-"))+","; +// }else{ +// //获取当前数据的图号 +// figureNumber += makeDocumentsDetail.getFigureNumber()+","; +// } +// if(null!=makeDocumentsDetail.getCompletionDate()&&!"".equals(makeDocumentsDetail.getCompletionDate())){ +// //完成时间 +// date += sdf.format(makeDocumentsDetail.getCompletionDate())+","; +// }else{ +// date += ""+","; +// } +// //获取数量 +// quantity += makeDocumentsDetail.getQuantity().toString()+","; +// } +// //先查询pdf路径下有没有这张图 +// String files = yzPdfUrl+code; +// DeleteFile.delFolder(files); +// //根据令号查询图纸型号 +// PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(code); +// //根据图纸型号查询图纸路径 +// SysConfigIni configIni = sysConfigIniService.selectSysConfigIniByFileType(makeDocuments.getSparedOne()); +// String fileUrl = configIni.getFileUrl(); +// +// String s = "{\"url\":\""+fileUrl+"\", \"ids\":\""+figureNumber+"\", \"product_id\":\""+makeDocumentsCode+"\", \"number\":\""+quantity+"\", \"date\":\""+date+"\"}"; +// +// String sendPost = HttpUtils.sendPost("http://localhost:8900/product/product_export_drawing", s); +// // json串转对象 +// JSONObject rcm = JSONObject.parseObject(sendPost); +// +// //创建zip压缩文件夹,把没有库存的图复制到此文件夹下等待压缩 +// File filess = new File(yzPdfUrl+code+"/zip"); +// if (!filess.exists()) { +// filess.mkdir(); +// } +// //如果result等于0,说明图纸生成完毕 +// if("0".equals(rcm.get("code").toString())){ +// //去服务器的文件夹下打包所有的pdf,然后下载 +// File file = new File(yzPdfUrl + code + "/" + code + ".zip"); +// if (file.exists()) { +// file.delete(); +// } +// FileInputStream fileInputStream = null; +// FileOutputStream fileOutputStream = null; +// //把图纸添加上图纸章和工序 +// for (Long long1 : ids) { +// //把所有工序拼接成字符串 +// String cailiao = ""; +// String gongxu = "工序:"; +// String xuMiaoShu = "序描述:"; +// //根据id查询物料信息 +// PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(long1); +// // 根据当前物料的id查询其所有工序子集 +// List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); +// //把所有工序拼接成字符串 +// for (PwMakeDocumentsDetail makeDocumentsDetail2 : list2) { +// if(makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1).equals("1")){ +// if(null==makeDocumentsDetail2.getMaterialsName()){ +// makeDocumentsDetail2.setMaterialsName(""); +// } +// if(null==makeDocumentsDetail2.getMaterialsSpecification()){ +// makeDocumentsDetail2.setMaterialsSpecification("");; +// } +// if(null==makeDocumentsDetail2.getMeasure()){ +// makeDocumentsDetail2.setMeasure("");; +// } +// if(null==makeDocumentsDetail2.getWorkblank()){ +// makeDocumentsDetail2.setWorkblank(0L);; +// } +// if(null==makeDocumentsDetail2.getFinished()){ +// makeDocumentsDetail2.setFinished(0L);; +// } +// cailiao += "材料名称:"+makeDocumentsDetail2.getMaterialsName()+" "+"图号:"+makeDocumentsDetail2.getMaterialsSpecification()+" "+"下料尺寸:"+makeDocumentsDetail2.getMeasure()+" "+"毛坯数量:"+makeDocumentsDetail2.getWorkblank()+" "+"成品数量:"+makeDocumentsDetail2.getFinished(); +// if(null!=makeDocumentsDetail2.getXuDescribe()&&!"".equals(makeDocumentsDetail2.getXuDescribe())){ +// xuMiaoShu += makeDocumentsDetail2.getXuDescribe(); +// } +// } +// if(null!=makeDocumentsDetail2.getCompletionDate()){ +// gongxu += makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1)+"、"+makeDocumentsDetail2.getName().substring(makeDocumentsDetail2.getName().lastIndexOf("-")+1,makeDocumentsDetail2.getName().indexOf("(M)"))+"-"+sdf.format(makeDocumentsDetail2.getCompletionDate())+" "; +// }else{ +// gongxu += makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1)+"、"+makeDocumentsDetail2.getName().substring(makeDocumentsDetail2.getName().lastIndexOf("-")+1,makeDocumentsDetail2.getName().indexOf("(M)"))+"-"+" "; +// } +// } +// String s2 = makeDocumentsDetail.getFigureNumber()+".pdf"; +// s2 = s2.replace("/", "--"); +// //获取当前图号的所属型号 +// //获取pdf所在路径 +// File f = new File(yzPdfUrl + code); +// if (!f.exists()) { +// System.out.println(yzPdfUrl + code + " not exists"); +// return AjaxResult.error("路径不存在"); +// } +// +// //获取所有的pdf文件 +// File fa[] = f.listFiles(); +// PDFDocHelper pd = new PDFDocHelper(); +// for (int i = 0; i < fa.length; i++) { +// File fs = fa[i]; +// String name = fs.getName(); +// String na = name.substring(name.indexOf("-")+1); +// //如果名称相同则把文件重新放入到一个新的文件夹,等待压缩 +//// if(s.equals(na)||na.contains("--2-1")||na.contains("--2-2")||na.contains("--3-1")||na.contains("--3-2")||na.contains("--3-3")||na.contains("XCL.1")||na.contains("XCL.2")){ +// if(s2.equals(na)){ +// try { +// //获取要复制的文件 +// File oldfile = new File(yzPdfUrl + code+"/" + name); +// //文件输入流,用于读取要复制的文件 +// fileInputStream = new FileInputStream(oldfile); +// //要生成的新文件(指定路径如果没有则创建) +// File newfile = new File(yzPdfUrl + code+"/new/" + name); +// //获取父目录 +// File fileParent = newfile.getParentFile(); +// if(fileParent.exists()){ +// fileParent.delete(); +// } +// //判断是否存在 +// if (!fileParent.exists()) { +// // 创建父目录文件夹 +// fileParent.mkdirs(); +// } +// if(newfile.exists()){ +// newfile.delete(); +// } +// //判断文件是否存在 +// if (!newfile.exists()) { +// //创建文件 +// newfile.createNewFile(); +// }else{ +// continue; +// } +//// PdfReader reader = new PdfReader(pdfUrl + code + "/" + name); +//// // 获取pdf的宽和高 +//// Rectangle pageSize = reader.getPageSize(1); +//// float height = pageSize.getHeight(); +//// float width = pageSize.getWidth(); +// //把当前zip路径下所有的图片添加上文字水印 +// List> reviews = new ArrayList<>(); +// Map review = new HashMap<>(); +// Map rev = new HashMap<>(); +// Map xu = new HashMap<>(); +// // 获取文件名(图号),根据图号查询表中数量 +// review.put("result", cailiao); +// rev.put("result", gongxu); +// xu.put("result", xuMiaoShu); +// review.put("type", "1"); +// rev.put("type", "1"); +// xu.put("type", "1"); +// reviews.add(review); +// reviews.add(rev); +// reviews.add(xu); +// float[] pawX = {20, 20, 20}; +// float[] pawY = {817, 30, 800}; +// //把当前zip路径下的所有图片添加上图纸章水印 +// try { +// pd.imageWatermark(yzPdfUrl + code+"/" + name, yzPdfUrl + code +"/new/" + name, "D:/java/tuzhizhang.png", reviews, pawX, pawY,"1"); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } catch (Exception e) { +// // TODO: handle exception +// }finally { +// try { +// if(null!=fileInputStream){ +// fileInputStream.close(); +// } +// if(null!=fileOutputStream){ +// fileOutputStream.close(); +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } +// } +// } +// +// } +// File filea = new File(yzPdfUrl + code + "/zip/"+ code + ".zip"); +// if (filea.exists()) { +// filea.delete(); +// } +// +// //把当前文件夹下所有的pdf复制到另一个可供bom表查看图纸的文件夹中 +// File filesBom = new File(yzPdfUrl+code+"/bom"); +// if (!filesBom.exists()) { +// filesBom.mkdir(); +// } +// //获取pdf所在路径 +// File f = new File(yzPdfUrl+code); +// if (!f.exists()) { +// System.out.println(yzPdfUrl+code + " not exists"); +// return AjaxResult.error("路径不存在"); +// } +// //获取所有的pdf文件 +// File fa[] = f.listFiles(); +// PDFDocHelper pd = new PDFDocHelper(); +// for (int i = 0; i < fa.length; i++) { +// File fs = fa[i]; +// String name = fs.getName(); +// +// //把所有文件复制到bom文件夹中 +// //文件输入流,用于读取要复制的文件 +// try { +// //获取要复制的文件 +// File oldfileBom = new File(yzPdfUrl + code + "/zip/" + name); +// fileInputStream = new FileInputStream(oldfileBom); +// //要生成的新文件(指定路径如果没有则创建) +// File newfileBom = new File(yzPdfUrl+code+"/bom/" + name.substring(name.indexOf("-")+1)); +// //获取父目录 +// File fileParent = newfileBom.getParentFile(); +// //判断是否存在 +// if (!fileParent.exists()) { +// // 创建父目录文件夹 +// fileParent.mkdirs(); +// } +// if(newfileBom.exists()){ +// newfileBom.delete(); +// } +// //判断文件是否存在 +// if (!newfileBom.exists()) { +// //创建文件 +// newfileBom.createNewFile(); +// } +// fileOutputStream = new FileOutputStream (newfileBom); +// byte[] buffer= new byte[1024]; +// int len; +// //将文件流信息读取文件缓存区,如果读取结果不为-1就代表文件没有读取完毕,反之已经读取完毕 +// while ((len=fileInputStream.read(buffer))!=-1) { +// fileOutputStream.write(buffer, 0, len); +// fileOutputStream.flush(); +// } +// fileInputStream.close(); +// fileOutputStream.close(); +// } catch (Exception e1) { +// e1.printStackTrace(); +// }finally { +// try { +// if(null!=fileInputStream){ +// fileInputStream.close(); +// } +// if(null!=fileOutputStream){ +// fileOutputStream.close(); +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } +// } +// +// +// // 把当前文件夹下所有的文件打包,把路径保存到数据库 +// boolean flag = FileToZip.fileToZip(yzPdfUrl + code + "/zip", yzPdfUrl + code + "/zip", code); +// if (flag) { +// return AjaxResult.success(code); +// } else { +// return AjaxResult.error(); +// } +// } +// return AjaxResult.success(); +// } + + + /** + * 下载生产图纸,并写入数据(新程序出图) + */ + @RequestMapping("uploadPDF/{ids}") + public AjaxResult uploadPDF(@PathVariable Long[] ids){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String code = ""; + //调用出图程序 + //请求参数 + PwProductionBillNew json = new PwProductionBillNew(); + //获取当前令号 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(ids[0]); + code = makeDocumentsDetail.getMakeDocumentsCode(); + if(null!=makeDocumentsDetail.getSuperiorId()&&!"".equals(makeDocumentsDetail.getSuperiorId())){ + //查询父级 + PwMakeDocumentsDetail makeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + //令号 + json.setProducitonorder(makeDocumentsDetail2.getMakeDocumentsCode()); + }else{ + //令号 + json.setProducitonorder(makeDocumentsDetail.getMakeDocumentsCode()); + } + //图纸输出路径 + json.setDestpath("D:\\evoEngine\\static\\pdf\\yzpdf"); + //发图时间 + json.setReleasedate(sdf.format(new Date())); + //完成时间(当前单据的完成时间) +// json.setCompletedate(completedate); + //产品型号集合 + List productList = new ArrayList(); + ProductInfoNew productInfoNew = new ProductInfoNew(); + Subparts subparts = new Subparts(); + List list = new ArrayList(); + + //根据令号查询当前单据的图纸类型,查询图纸地址 + PwMakeDocuments makeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(code); + //图纸地址 + SysConfigIni configIni = sysConfigIniService.selectSysConfigIniByFileType(makeDocuments.getSparedOne()); + if(null!=configIni&&null!=configIni.getFileUrl()){ + productInfoNew.setSourcefile(configIni.getFileUrl()); + }else{ + //未查询到图纸 + return AjaxResult.error("未查询到图纸"); + } + //dwg图纸文件名称,设置为令号,因为此dwg文件中可能包函多个物料 + productInfoNew.setAssembledrawing(code); + //数量(此数量不用)这个数量必须存在且等于0 + productInfoNew.setNumber("0"); + + for (Long id : ids) { + subparts = new Subparts(); + PwMakeDocumentsDetail makeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(id); + if(null!=makeDocumentsDetail2.getSuperiorId()&&!"".equals(makeDocumentsDetail2.getSuperiorId())){ + makeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail2.getSuperiorId()); + } + subparts.setPartname(makeDocumentsDetail2.getFigureNumber()); + subparts.setNumber(makeDocumentsDetail2.getQuantity()+""); + list.add(subparts); + } + DataInfo datainfo = new DataInfo(); + productInfoNew.setVars(datainfo); + productInfoNew.setSubparts(list); + productList.add(productInfoNew); + json.setProduct(productList); + String jsonString = JSONObject.toJSONString(json); + //请求bom表(直接添加到bom1表中) + int k = addMakeDocumentBomNew(jsonString,code,ids); + if(k==200){ + return AjaxResult.success(code); + }else{ + return AjaxResult.error(); + } + } + + public int addMakeDocumentBomNew(String json, String code,Long[] ids) { + SimpleDateFormat sdf= new SimpleDateFormat("MM月dd日"); + // 获取生产总图 + HttpUtils.sendPost("http://localhost:9000/generatedrawingscompatible", json); + System.out.println("请求参数:-----"+json); + String sendGet = ""; + + String result = ""; + + for (int i = 0; i < 10000; i++) { + try { + Thread.sleep(3000); + //调用进度接口 + sendGet = HttpUtils.sendGet("http://localhost:9000/getstate","UTF-8"); + // json串转对象 + JSONObject rcm = JSONObject.parseObject(sendGet); + result = rcm.get("processstate").toString(); + + if("1".equals(result)){ + //正在处理图纸,生成原始表 + AllInfo.statusCode = 1; + continue; + }else if("2".equals(result)){ + //正在出明细表 + continue; + }else if("3".equals(result)){ + //正在出pdf + AllInfo.statusCode = 2; + continue; + }else if("4".equals(result)){ + //pdf生产完成了 + AllInfo.statusCode = 4; + break; + }else if("5".equals(result)){ + //报错了 + break; + }else if("0".equals(result)){ + //空闲状态 + break; + }else{ + break; + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + if("1".equals(result)){ + //正在处理 + return 1000; + }else if("2".equals(result)){ + //正在处理 + return 1000; + }else if("3".equals(result)){ + //正在处理 + return 1000; + }else if("4".equals(result)){ + //完成了(把图纸打上图纸章和工序及材料信息) + //创建zip压缩文件夹,把没有库存的图复制到此文件夹下等待压缩 + File filess = new File(yzPdfUrl+code+"/zip"); + if (!filess.exists()) { + filess.mkdir(); + } + //去服务器的文件夹下打包所有的pdf,然后下载 + File file = new File(yzPdfUrl + code + "/" + code + ".zip"); + if (file.exists()) { + file.delete(); + } + + FileInputStream fileInputStream = null; + FileOutputStream fileOutputStream = null; + //把图纸添加上图纸章和工序 + for (Long long1 : ids) { + //把所有工序拼接成字符串 + String cailiao = ""; + String gongxu = "工序:"; + String xuMiaoShu = "序描述:"; + //根据id查询物料信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(long1); + // 根据当前物料的id查询其所有工序子集 + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + //把所有工序拼接成字符串 + for (PwMakeDocumentsDetail makeDocumentsDetail2 : list2) { + if(makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1).equals("1")){ + if(null==makeDocumentsDetail2.getMaterialsName()){ + makeDocumentsDetail2.setMaterialsName(""); + } + if(null==makeDocumentsDetail2.getMaterialsSpecification()){ + makeDocumentsDetail2.setMaterialsSpecification("");; + } + if(null==makeDocumentsDetail2.getMeasure()){ + makeDocumentsDetail2.setMeasure("");; + } + if(null==makeDocumentsDetail2.getWorkblank()){ + makeDocumentsDetail2.setWorkblank(0L);; + } + if(null==makeDocumentsDetail2.getFinished()){ + makeDocumentsDetail2.setFinished(0L);; + } + cailiao += "材料名称:"+makeDocumentsDetail2.getMaterialsName()+" "+"图号:"+makeDocumentsDetail2.getMaterialsSpecification()+" "+"下料尺寸:"+makeDocumentsDetail2.getMeasure()+" "+"毛坯数量:"+makeDocumentsDetail2.getWorkblank()+" "+"成品数量:"+makeDocumentsDetail2.getFinished(); + if(null!=makeDocumentsDetail2.getXuDescribe()&&!"".equals(makeDocumentsDetail2.getXuDescribe())){ + xuMiaoShu += makeDocumentsDetail2.getXuDescribe(); + } + } + if(null!=makeDocumentsDetail2.getCompletionDate()){ + gongxu += makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1)+"、"+makeDocumentsDetail2.getName().substring(makeDocumentsDetail2.getName().lastIndexOf("-")+1,makeDocumentsDetail2.getName().indexOf("(M)"))+"-"+sdf.format(makeDocumentsDetail2.getCompletionDate())+" "; + }else{ + gongxu += makeDocumentsDetail2.getFigureNumber().substring(makeDocumentsDetail2.getFigureNumber().lastIndexOf("-")+1)+"、"+makeDocumentsDetail2.getName().substring(makeDocumentsDetail2.getName().lastIndexOf("-")+1,makeDocumentsDetail2.getName().indexOf("(M)"))+"-"+" "; + } + } + String s2 = makeDocumentsDetail.getFigureNumber()+".pdf"; + s2 = s2.replace("/", "--"); + //获取当前图号的所属型号 + //获取pdf所在路径 + File f = new File(yzPdfUrl + code+"/"+code+"-PDF"); + if (!f.exists()) { + System.out.println(yzPdfUrl + code + " not exists"); + return 404; + } + + //获取所有的pdf文件 + File fa[] = f.listFiles(); + PDFDocHelper pd = new PDFDocHelper(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + String na = name.substring(name.indexOf("-")+1); + //如果名称相同则把文件重新放入到一个新的文件夹,等待压缩 +// if(s.equals(na)||na.contains("--2-1")||na.contains("--2-2")||na.contains("--3-1")||na.contains("--3-2")||na.contains("--3-3")||na.contains("XCL.1")||na.contains("XCL.2")){ + if(s2.equals(na)){ + try { + //获取要复制的文件 + File oldfile = new File(yzPdfUrl + code+"/"+code+"-PDF/" + name); + //文件输入流,用于读取要复制的文件 + fileInputStream = new FileInputStream(oldfile); + //要生成的新文件(指定路径如果没有则创建) + File newfile = new File(yzPdfUrl + code+"/new/" + name); + //获取父目录 + File fileParent = newfile.getParentFile(); + if(fileParent.exists()){ + fileParent.delete(); + } + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfile.exists()){ + newfile.delete(); + } + //判断文件是否存在 + if (!newfile.exists()) { + //创建文件 + newfile.createNewFile(); + }else{ + continue; + } +// PdfReader reader = new PdfReader(pdfUrl + code + "/" + name); +// // 获取pdf的宽和高 +// Rectangle pageSize = reader.getPageSize(1); +// float height = pageSize.getHeight(); +// float width = pageSize.getWidth(); + //把当前zip路径下所有的图片添加上文字水印 + List> reviews = new ArrayList<>(); + Map review = new HashMap<>(); + Map rev = new HashMap<>(); + Map xu = new HashMap<>(); + // 获取文件名(图号),根据图号查询表中数量 + review.put("result", cailiao); + rev.put("result", gongxu); + xu.put("result", xuMiaoShu); + review.put("type", "1"); + rev.put("type", "1"); + xu.put("type", "1"); + reviews.add(review); + reviews.add(rev); + reviews.add(xu); + float[] pawX = {20, 20, 20}; + float[] pawY = {817, 30, 800}; + //把当前zip路径下的所有图片添加上图纸章水印 + try { + pd.imageWatermark(yzPdfUrl + code+"/"+ code+"-PDF/" + name, yzPdfUrl + code +"/new/" + name, "D:/java/tuzhizhang.png", reviews, pawX, pawY); + } catch (Exception e) { + e.printStackTrace(); + } + } catch (Exception e) { + // TODO: handle exception + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + } + File filea = new File(yzPdfUrl + code + "/zip/"+ code + ".zip"); + if (filea.exists()) { + filea.delete(); + } + + //把当前文件夹下所有的pdf复制到另一个可供bom表查看图纸的文件夹中 + File filesBom = new File(yzPdfUrl+code+"/bom"); + if (!filesBom.exists()) { + filesBom.mkdir(); + } + //获取pdf所在路径 + File f = new File(yzPdfUrl+code+"/"+code+"-PDF"); + if (!f.exists()) { + System.out.println(yzPdfUrl+code + " not exists"); + return 404; + } + //获取所有的pdf文件 + File fa[] = f.listFiles(); + PDFDocHelper pd = new PDFDocHelper(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + + //把所有文件复制到bom文件夹中 + //文件输入流,用于读取要复制的文件 + try { + //获取要复制的文件 + File oldfileBom = new File(yzPdfUrl + code + "/zip/" + name); + fileInputStream = new FileInputStream(oldfileBom); + //要生成的新文件(指定路径如果没有则创建) + File newfileBom = new File(yzPdfUrl+code+"/bom/" + name.substring(name.indexOf("-")+1)); + //获取父目录 + File fileParent = newfileBom.getParentFile(); + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfileBom.exists()){ + newfileBom.delete(); + } + //判断文件是否存在 + if (!newfileBom.exists()) { + //创建文件 + newfileBom.createNewFile(); + } + fileOutputStream = new FileOutputStream (newfileBom); + byte[] buffer= new byte[1024]; + int len; + //将文件流信息读取文件缓存区,如果读取结果不为-1就代表文件没有读取完毕,反之已经读取完毕 + while ((len=fileInputStream.read(buffer))!=-1) { + fileOutputStream.write(buffer, 0, len); + fileOutputStream.flush(); + } + fileInputStream.close(); + fileOutputStream.close(); + } catch (Exception e1) { + e1.printStackTrace(); + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + // 把当前文件夹下所有的文件打包,把路径保存到数据库 + boolean flag = FileToZip.fileToZip(yzPdfUrl + code + "/zip", yzPdfUrl + code + "/zip", code); + if (flag) { + return 200; + } else { + return 404; + } + + }else if("5".equals(result)){ + //报错了 + return 5000; + }else if("0".equals(result)){ + //空闲状态 + return 6000; + }else{ + return 7000; + } + } + + /** + * 导入清单 + */ + @RequestMapping("/uploadExcel") + @ResponseBody + public AjaxResult uploadLableNumber(@RequestParam("makeDocumentsCode") String makeDocumentsCode,@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/ruoyi/qingdanExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + for (int i = 1; i < result.size(); i++) { + PwMakeDocumentsDetail pwMakeDocumentsDetail = new PwMakeDocumentsDetail(); + //预制单号 + pwMakeDocumentsDetail.setMakeDocumentsCode(makeDocumentsCode); + //物料名称 + pwMakeDocumentsDetail.setName(result.get(i).get(1).toString()); + //物料图号 + pwMakeDocumentsDetail.setFigureNumber(result.get(i).get(0).toString()); + //材料 +// pwMakeDocumentsDetail.setMaterialType(result.get(i).get(2).toString()); + //数量 + pwMakeDocumentsDetail.setQuantity(Double.valueOf(result.get(i).get(3).toString()).longValue()); + + //把物料同时添加到库存表中(判断库存表是否存在此物料,如果存在则直接修改其在途数量) + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(result.get(i).get(1).toString(), result.get(i).get(0).toString()); + if(null==inventoryDetail){ + return AjaxResult.error("物料信息不存在,请先添加物料信息"); + }else{ + Long l = inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail.getQuantity(); + inventoryDetail.setPreliminaryInventory(l); + } + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + /** + * 申请质检 + */ + @RepeatSubmit + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + if(null==pwMakeDocumentsDetail.getNumber()||"".equals(pwMakeDocumentsDetail.getNumber())||pwMakeDocumentsDetail.getNumber()==0){ + return AjaxResult.error("请输入申请入库数量"); + } + if(pwMakeDocumentsDetail.getQuantity() list = pwModulePartService.selectPwModulePartByMaterialNameAndFigureNumber(detail.getName(), detail.getFigureNumber()); + //查询子集的出库数量是否大于等于已入库和正要入库的数量 + //查询已入库数量 +// pwBomNumberTwo + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + int yiru = 0; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + yiru += imProductReceiptMaterial.getActualQuantity(); + } + //查询领料数量 + for (PwModulePart pwModulePart : list) { + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwModulePart.getName(), pwModulePart.getSpecification()); + int yichu =0; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list3) { + yichu += imStockRequisitionMaterial.getAlreadyQuantity(); + } + + if(yichu < ((yiru + pwMakeDocumentsDetail.getNumber())*pwModulePart.getNumber())){ + return AjaxResult.error("未领料或领料数量不足,不允许申请入库"); + } + } + } + } + + //判断其物料是否已经领料(未领料或者领料数量小于入库数量的不允许入库)判断是否是第一道序,如果为第一道序,则需要根据原材料去查询领料信息,否则需要根据上一道序的物料去查询领料信息 + //判断领料的是第几道工序 + //判断当前物料是否是第一道序的物料 + String substring = pwMakeDocumentsDetail.getFigureNumber().substring(pwMakeDocumentsDetail.getFigureNumber().lastIndexOf("-")+1); + if(1==Integer.valueOf(substring)){ + + //此处需要确定项目之后打开注释(因为现在第一道序还没原材料,所以不能限制第一道序也必须领料) + + //说明是第一道工序 + //判断当前序是否添加了原材料。如果添加了原材料则判断是否已经领料,如果未领料,则不允许申请质检 + if(null!=pwMakeDocumentsDetail.getMaterialsName()&&!"".equals(pwMakeDocumentsDetail.getMaterialsName())){ + //说明填写了原材料信息 + //根据物料的单据code和名称和图号查询领料信息 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(list.size()==0){ + //原材料无需判断领料数量 + return AjaxResult.error("未申请领料的不允许入库"); + } + } + + }else{ + String figureNumber = pwMakeDocumentsDetail.getFigureNumber().substring(0,pwMakeDocumentsDetail.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //查询上序是否需要入库,如果上序不需要入库,则当前序不再控制必须领料后才可入库 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), figureNumber); +// if(pwMakeDocumentsDetail2.getGodownEntry().equals("是")){ + //说明不是第一道工序 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(), figureNumber); + if(list.size()>0){ + Long i = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + i += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断数量是否大于等于入库数量 + //查询当前需入库物料的已入库数量(包函已申请的数量) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(),pwMakeDocumentsDetail.getName(), pwMakeDocumentsDetail.getFigureNumber()); + //已申请入库的数量 + Long p = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + p += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(i list4 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list4.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list4 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe = 0.0; + Long shichang = 0L; + for (CwNewPayroll cwNewPayroll2 : list4) { + zonghe += cwNewPayroll2.getSalary().doubleValue(); + shichang += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double maohandanjia = zonghe/shichang/60;*/ + + //机一工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("机一工段"); + cwNewPayroll.setAffiliationMonth(format); + List list5 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list5.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list5 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe2 = 0.0; + Long shichang2 = 0L; + for (CwNewPayroll cwNewPayroll2 : list5) { + zonghe2 += cwNewPayroll2.getSalary().doubleValue(); + shichang2 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double jiyidanjia = zonghe2/shichang2/60; + + //机二工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("机二工段"); + cwNewPayroll.setAffiliationMonth(format); + List list6 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list6.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list6 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe3 = 0.0; + Long shichang3 = 0L; + for (CwNewPayroll cwNewPayroll2 : list6) { + zonghe3 += cwNewPayroll2.getSalary().doubleValue(); + shichang3 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double jierdanjia = zonghe3/shichang3/60; + + //机三工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("机三工段"); + cwNewPayroll.setAffiliationMonth(format); + List list7 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list7.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list7 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe4 = 0.0; + Long shichang4 = 0L; + for (CwNewPayroll cwNewPayroll2 : list7) { + zonghe4 += cwNewPayroll2.getSalary().doubleValue(); + shichang4 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double jisandanjia = zonghe4/shichang4/60; + + //装配车间 + /*cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("装配车间"); + cwNewPayroll.setAffiliationMonth(format); + List list8 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list8.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list8 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe5 = 0.0; + Long shichang5 = 0L; + for (CwNewPayroll cwNewPayroll2 : list8) { + zonghe5 += cwNewPayroll2.getSalary().doubleValue(); + shichang5 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double zhuangpeidanjia = zonghe5/shichang5/60; + + //企标工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list9 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list9.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list9 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe6 = 0.0; + Long shichang6 = 0L; + for (CwNewPayroll cwNewPayroll2 : list9) { + zonghe6 += cwNewPayroll2.getSalary().doubleValue(); + shichang6 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double qibiaogongduandanjia = zonghe6/shichang6/60; + + //销齿链组 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list10 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list10.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list10 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe7 = 0.0; + Long shichang7 = 0L; + for (CwNewPayroll cwNewPayroll2 : list10) { + zonghe7 += cwNewPayroll2.getSalary().doubleValue(); + shichang7 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double xiaochilianzudanjia = zonghe7/shichang7/60; + + //非标设备组 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list11 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list11.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list11 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe8 = 0.0; + Long shichang8 = 0L; + for (CwNewPayroll cwNewPayroll2 : list11) { + zonghe8 += cwNewPayroll2.getSalary().doubleValue(); + shichang8 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double feibiaoshebeizudanjia = zonghe8/shichang8/60; + + //综合工段 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setDepartmentName("企标工段"); + cwNewPayroll.setAffiliationMonth(format); + List list12 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + if(list12.size()<1){ + //说明上个月的工资还没有计算出来,则需要获取上上个月的工资 + cwNewPayroll.setAffiliationMonth(format2); + list12 = cwNewPayrollService.selectCwNewPayrollList(cwNewPayroll); + } + //计算应发工资总和 + Double zonghe9 = 0.0; + Long shichang9 = 0L; + for (CwNewPayroll cwNewPayroll2 : list12) { + zonghe9 += cwNewPayroll2.getSalary().doubleValue(); + shichang9 += cwNewPayroll2.getRealAttendanceNumber().longValue(); + } + //应发工资总和/总出勤小时/60,得出每分钟的单价 + Double zonghegongduandanjia = zonghe9/shichang9/60;*/ + + //根据id查看企标单号 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + String makeDocumentsCode = makeDocumentsDetail.getMakeDocumentsCode(); + //根据执行单号获取企标单信息 + PwMakeDocuments pwMakeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(makeDocumentsCode); + //根据企标号查询此企标号时候已经添加到入库申请表了,如果添加到了则不再添加,反之则直接添加 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(makeDocumentsCode); + if(null!=productReceipt){ + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(makeDocumentsDetail.getMakeDocumentsCode()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //名称 + im.setMaterialName(makeDocumentsDetail.getName()); + //图号 + im.setSpecification(makeDocumentsDetail.getFigureNumber()); + //材料 + im.setMaterialType(makeDocumentsDetail.getMaterialType()); + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialList(im); + int s = 0; + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list) { + s += imProductReceiptMaterial2.getActualQuantity(); + } + //如果不等于null 则直接把物料添加到待入库详情表中 + //添加入库单详情 + //根据id查询需要入库的物料详情 + if(null!=makeDocumentsDetail.getInventoryStatus()&&!"".equals(makeDocumentsDetail.getInventoryStatus())&&!"未入库".equals(makeDocumentsDetail.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwMakeDocumentsDetail.getNumber()>makeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申请数量不可大于本批数量"); + }else{ + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + if("是".equals(makeDocumentsDetail.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(makeDocumentsDetail.getName()); + //图号 + imProductReceiptMaterial.setSpecification(makeDocumentsDetail.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(makeDocumentsDetail.getMaterialType()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //单价 + if(null==pwMakeDocumentsDetail.getXuTime()){ + pwMakeDocumentsDetail.setXuTime(0.0); + } + BigDecimal cailiaofei = new BigDecimal("0.0"); + if(1==Integer.valueOf(substring)){ + //查询原材料信息,单价为材料费加工时费 + //如果序中带材料,则把材料添加上 + if(null!=pwMakeDocumentsDetail.getMaterialId()&&!"".equals(pwMakeDocumentsDetail.getMaterialId())){ + //计算材料总价 + //查询材料库存信息 + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null!=inventoryDetail3){ + if("毫米".equals(inventoryDetail3.getUnit())){ + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000.0"),6,BigDecimal.ROUND_UP))); + }else if("平方毫米".equals(inventoryDetail3.getUnit())){ + //单价*(下料尺寸/1000000) + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000000.0"),7,BigDecimal.ROUND_UP))); + }else{ + cailiaofei = inventoryDetail3.getUnivalence(); + } + } + } + } + /*if("铆焊工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(maohandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else */if("机一工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jiyidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机二工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jierdanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机三工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jisandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }/*else if("装配车间".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zhuangpeidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("企标工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(qibiaogongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("销齿链组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(xiaochilianzudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("非标设备组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(feibiaoshebeizudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("综合工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zonghegongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }*/else{ + imProductReceiptMaterial.setUnivalence(pwMakeDocumentsDetail.getUnitPrice()+cailiaofei.doubleValue()); + } + //总价 + imProductReceiptMaterial.setTotalPrices(pwMakeDocumentsDetail.getNumber() * pwMakeDocumentsDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwMakeDocumentsDetail.getPreferentialOriginName()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwMakeDocumentsDetail.getNumber() == pwMakeDocumentsDetail.getQuantity()){ + //修改预制单详情的入库状态,改为已申请 + makeDocumentsDetail.setInventoryStatus("已申请"); + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + }else{ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(makeDocumentsDetail.getName()); + //图号 + imProductReceiptMaterial.setSpecification(makeDocumentsDetail.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(makeDocumentsDetail.getMaterialType()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //单价 + if(null==pwMakeDocumentsDetail.getXuTime()){ + pwMakeDocumentsDetail.setXuTime(0.0); + } + BigDecimal cailiaofei = new BigDecimal("0.0"); + if(1==Integer.valueOf(substring)){ + //查询原材料信息,单价为材料费加工时费 + //如果序中带材料,则把材料添加上 + if(null!=pwMakeDocumentsDetail.getMaterialId()&&!"".equals(pwMakeDocumentsDetail.getMaterialId())){ + //计算材料总价 + //查询材料库存信息 + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null!=inventoryDetail3){ + if("毫米".equals(inventoryDetail3.getUnit())){ + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000.0"),6,BigDecimal.ROUND_UP))); + }else if("平方毫米".equals(inventoryDetail3.getUnit())){ + //单价*(下料尺寸/1000000) + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000000.0"),7,BigDecimal.ROUND_UP))); + }else{ + cailiaofei = inventoryDetail3.getUnivalence(); + } + } + } + } + /*if("铆焊工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(maohandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else */if("机一工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jiyidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机二工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jierdanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机三工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jisandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }/*else if("装配车间".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zhuangpeidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("企标工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(qibiaogongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("销齿链组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(xiaochilianzudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("非标设备组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(feibiaoshebeizudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("综合工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zonghegongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }*/ + //总价 + imProductReceiptMaterial.setTotalPrices(pwMakeDocumentsDetail.getNumber() * pwMakeDocumentsDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwMakeDocumentsDetail.getPreferentialOriginName()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwMakeDocumentsDetail.getNumber() == pwMakeDocumentsDetail.getQuantity()){ + //修改预制单详情的入库状态,改为已申请 + makeDocumentsDetail.setInventoryStatus("已申请"); + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(makeDocumentsDetail.getMakeDocumentsCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(makeDocumentsDetail.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(makeDocumentsDetail.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(makeDocumentsDetail.getMaterialType()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(pwMakeDocumentsDetail.getPreferentialOriginName()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwMakeDocumentsDetail.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(makeDocumentsCode); + //项目名称 + imProductReceipt.setProjectName(pwMakeDocuments.getName()); + //关联令号 + imProductReceipt.setCode(makeDocumentsCode); +// //申请人(获取当前操作者账号) +// imProductReceipt.setProposer(user.getNickName()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("添加入库单失败"); + } + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(makeDocumentsCode); + //保存项目名称 + pwCompletionNotice.setProjectName(pwMakeDocuments.getName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwMakeDocumentsDetail detail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + if(null!=detail.getInventoryStatus()&&!"".equals(detail.getInventoryStatus())&&!"未入库".equals(makeDocumentsDetail.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + if("是".equals(makeDocumentsDetail.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(detail.getName()); + //图号 + imProductReceiptMaterial.setSpecification(detail.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(detail.getMaterialType()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //单价 + if(null==pwMakeDocumentsDetail.getXuTime()){ + pwMakeDocumentsDetail.setXuTime(0.0); + } + BigDecimal cailiaofei = new BigDecimal("0.0"); + if(1==Integer.valueOf(substring)){ + //查询原材料信息,单价为材料费加工时费 + //如果序中带材料,则把材料添加上 + if(null!=pwMakeDocumentsDetail.getMaterialId()&&!"".equals(pwMakeDocumentsDetail.getMaterialId())){ + //计算材料总价 + //查询材料库存信息 + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null!=inventoryDetail3){ + if("毫米".equals(inventoryDetail3.getUnit())){ + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000.0"),6,BigDecimal.ROUND_UP))); + }else if("平方毫米".equals(inventoryDetail3.getUnit())){ + //单价*(下料尺寸/1000000) + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000000.0"),7,BigDecimal.ROUND_UP))); + }else{ + cailiaofei = inventoryDetail3.getUnivalence(); + } + } + } + } + /*if("铆焊工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(maohandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else */if("机一工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jiyidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机二工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jierdanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机三工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jisandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }/*else if("装配车间".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zhuangpeidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("企标工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(qibiaogongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("销齿链组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(xiaochilianzudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("非标设备组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(feibiaoshebeizudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("综合工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zonghegongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }*/ + + //总价 + imProductReceiptMaterial.setTotalPrices(pwMakeDocumentsDetail.getNumber() * pwMakeDocumentsDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwMakeDocumentsDetail.getPreferentialOriginName()); + int w = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(w<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwMakeDocumentsDetail.getNumber()==pwMakeDocumentsDetail.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + detail.setInventoryStatus("已申请"); + //修改预制单详情的入库状态,改为已申请 + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(detail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + }else{ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(detail.getName()); + //图号 + imProductReceiptMaterial.setSpecification(detail.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(detail.getMaterialType()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //单价 + if(null==pwMakeDocumentsDetail.getXuTime()){ + pwMakeDocumentsDetail.setXuTime(0.0); + } + BigDecimal cailiaofei = new BigDecimal("0.0"); + if(1==Integer.valueOf(substring)){ + //查询原材料信息,单价为材料费加工时费 + //如果序中带材料,则把材料添加上 + if(null!=pwMakeDocumentsDetail.getMaterialId()&&!"".equals(pwMakeDocumentsDetail.getMaterialId())){ + //计算材料总价 + //查询材料库存信息 + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail.getMaterialsName(), pwMakeDocumentsDetail.getMaterialsSpecification()); + if(null!=inventoryDetail3){ + if("毫米".equals(inventoryDetail3.getUnit())){ + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000.0"),6,BigDecimal.ROUND_UP))); + }else if("平方毫米".equals(inventoryDetail3.getUnit())){ + //单价*(下料尺寸/1000000) + cailiaofei = inventoryDetail3.getUnitUnivalence().multiply((new BigDecimal(pwMakeDocumentsDetail.getMeasure()).divide(new BigDecimal("1000000.0"),7,BigDecimal.ROUND_UP))); + }else{ + cailiaofei = inventoryDetail3.getUnivalence(); + } + } + } + } + /*if("铆焊工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(maohandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else */if("机一工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jiyidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机二工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jierdanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("机三工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(jisandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }/*else if("装配车间".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zhuangpeidanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("企标工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(qibiaogongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("销齿链组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(xiaochilianzudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("非标设备组".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(feibiaoshebeizudanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }else if("综合工段".equals(pwMakeDocumentsDetail.getDepartmentName())){ + imProductReceiptMaterial.setUnivalence(zonghegongduandanjia*pwMakeDocumentsDetail.getXuTime()+cailiaofei.doubleValue()); + }*/ + + //总价 + imProductReceiptMaterial.setTotalPrices(pwMakeDocumentsDetail.getNumber() * pwMakeDocumentsDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwMakeDocumentsDetail.getPreferentialOriginName()); + int w = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(w<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwMakeDocumentsDetail.getNumber()==pwMakeDocumentsDetail.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + detail.setInventoryStatus("已申请"); + //修改预制单详情的入库状态,改为已申请 + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(detail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(detail.getMakeDocumentsCode()); + if(null==completionNotice){ + //创建质检单 + + } + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(detail.getMakeDocumentsCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(detail.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(detail.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(detail.getMaterialType()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwMakeDocumentsDetail.getNumber().doubleValue()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(pwMakeDocumentsDetail.getPreferentialOriginName()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwMakeDocumentsDetail.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待入库",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + } + return toAjax(200); + } + + /** + * 生成外协合同功能 + */ + @RequestMapping("/addPwOutsourceContracts") + public AjaxResult addPwOutsourceContracts(@RequestBody PwMakeDocumentsDetail pwMakeDocumentsDetail){ + if(pwMakeDocumentsDetail.getLingliaoNumber()<=0){ + return AjaxResult.error("请输入数量"); + } + //查询当前令号和名称和图号下的生成的外协合同明细的数量,如果相加数量等于本批数量时,则把外协合同标记修改为 是 + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail.getMakeDocumentsCode(),pwMakeDocumentsDetail.getName(),pwMakeDocumentsDetail.getFigureNumber()); + Long a = 0L; + for (PwOutsourceContractDetail pwOutsourceContractDetail2 : list) { + a += pwOutsourceContractDetail2.getQuantity(); + } + if(pwMakeDocumentsDetail.getQuantity() list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + Long a = 0L; + for (PwOutsourceContractDetail pwOutsourceContractDetail2 : list) { + a += pwOutsourceContractDetail2.getQuantity(); + } + if(makeDocumentsDetail.getQuantity() list3 = pwMakeDocumentsDetailMapper.selectByMakeDocumentsCodeIsNull(); + //创建存储图纸类型的集合 + List li = new ArrayList(); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list3) { + //判断集合是否存在当前图号的标识 + int p = 0; + //遍历其图号 + String figureNumber = pwMakeDocumentsDetail.getFigureNumber(); + //判断图号中是否包函点 + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + String str1=figureNumber.substring(0, figureNumber.indexOf(".")); + for (String string : li) { + if(string.contains(str1)){ + p = 1; + } + } + if(p==0){ + //p = 0时说明集合中没有此型号 + li.add(str1); + } + } + } + //查看map的长度,长度为几,则创建几个预制单 + for (int j = 0; j < li.size(); j++) { + //创建预制单,然后把单据的code添加到相关的物料上 + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsMapper.selectList(); + //获取最后一条记录的code的,分解其code + String code = documents.getCode(); + String substring = code.substring(code.length()-6,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + String str = String.format("%03d", valueOf); + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + String substring2 = ss.substring(2); + //code + pwMakeDocuments.setCode("QB-XCL-"+str+"-"+substring2); + //单据名称 + pwMakeDocuments.setName(li.get(j)+"预制清单"); + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(li.get(j))){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(li.get(j)); + } + pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + //把code添加到预制单明细表包函当前图纸型号的物料上 + //查询预制单明细表(物料图号包函当前图号且code为null的数据) + List list4 = pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByFigureNumberAndCode(li.get(j)); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list4) { + pwMakeDocumentsDetail.setMakeDocumentsCode(pwMakeDocuments.getCode()); + pwMakeDocumentsDetailMapper.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + //自动添加工序 + //查询当前令号下所有的物料(不包含标准件和数量为0的数据,遍历此集合查询物料工序表,如果查询到则添加到bomtwo中) + List list5 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pwMakeDocumentsDetail.getName(),pwMakeDocumentsDetail.getFigureNumber()); + if(list5.size()>0){ + for (int js = 0; js < list5.size(); js++) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()+"-"+(js+1)); + //物料名称 + pwMakeDocumentsDetail2.setName(pwMakeDocumentsDetail.getName()+"-"+list5.get(js).getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pwMakeDocumentsDetail.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pwMakeDocumentsDetail.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pwMakeDocumentsDetail.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //工序名称 + pwMakeDocumentsDetail2.setProcessName(list5.get(js).getProcess()); + //派工部门 + if(null!=list5.get(js).getDispatchingDept()&&!"".equals(list5.get(js).getDispatchingDept())){ + pwMakeDocumentsDetail2.setDepartmentName(list5.get(js).getDispatchingDept()); + } + //把物料信息保存到物料表中 + ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null!=material){ + //先根据名称和图号查询库存信息表中有没有此数据 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null!=inventoryDetail){ + //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 + if(material.getMinimum()!=0&&material.getHighest()!=0){ + //判断库存数量+在途数量-锁定数量,是否小于等于最低安全库存数量 + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=material.getMinimum()){ + pwMakeDocumentsDetail2.setQuantity(material.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); + }else{ + pwMakeDocumentsDetail2.setQuantity(0L); + } + } + //预存数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwMakeDocumentsDetail2.getQuantity()); + pwMakeDocumentsDetail2.setUsableQuantity(inventoryDetail.getQuantity()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + }else{ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //预存数量 + pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); + pwInventoryDetail.setDelFlag(0); + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + }else{ + //添加物料信息 + ImMaterial imMaterial = new ImMaterial(); + //物料名称 + imMaterial.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + imMaterial.setDelFlag(0); + + imMaterialMapper.insertImMaterial(imMaterial); + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //预存数量 + pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); + //锁定数量 +// pwInventoryDetail.setLockNumber(pwMakeDocumentsDetail2.getQuantity()); + pwInventoryDetail.setLockNumber(0L); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + } + } + } + } + } + + /** + * 查询合同详情的入库信息 + */ + @DeleteMapping("/listInfo/{ids}") + public TableDataInfo listInfo(@PathVariable Long[] ids){ + List list = new ArrayList(); + if(ids.length<1){ + return getDataTable(list); + } + PwMakeDocumentsDetail pwMakeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(ids[0]); + if(null!=pwMakeDocumentsDetail.getSuperiorId()){ + pwMakeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getSuperiorId()); + } + + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMakeDocumentsDetail.getId()); + List list3 = new ArrayList(); + if(null != makeDocumentsDetail){ + list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + } + //查询当前物料的质检,入库,出库等状态 + for (PwMakeDocumentsDetail makeDocumentsDetail3 : list3) { + //查询领料数据 + //判断当前物料是否是第一道序的物料 + String substring = makeDocumentsDetail3.getFigureNumber().substring(makeDocumentsDetail3.getFigureNumber().lastIndexOf("-")+1); + List list5 = new ArrayList(); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1 == Integer.valueOf(substring)){ + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), makeDocumentsDetail3.getMaterialsName(), makeDocumentsDetail3.getMaterialsSpecification()); + }else{ + String figureNumber = makeDocumentsDetail3.getFigureNumber().substring(0,makeDocumentsDetail3.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), figureNumber); + } + //申请领料数量 + Long shenqingchuku = 0L; + Long chuku = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list5) { + shenqingchuku += imStockRequisitionMaterial.getApplyForQuantity(); + chuku += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //申请领料数量 + makeDocumentsDetail3.setLen(shenqingchuku); + makeDocumentsDetail3.setLingliaoNumber(chuku); + if(1 == Integer.valueOf(substring)&&(null==makeDocumentsDetail3.getMaterialsName()||"".equals(makeDocumentsDetail3.getMaterialsName()))){ + makeDocumentsDetail3.setInventoryStatus("无需领料"); + }else{ + if(chuku == 0){ + //未领料 + makeDocumentsDetail3.setInventoryStatus("未领料"); + }else{ + //已领料 + makeDocumentsDetail3.setInventoryStatus("已领料"); + } + } + + //查询质检数据 + List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), makeDocumentsDetail3.getName(), makeDocumentsDetail3.getFigureNumber()); + //交检数量 + Long jiaojian = 0L; + //已检数量 + Long jianyan = 0L; + //累加其数量 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list2) { + jiaojian += pwCompletionNoticeProduct.getReceivableQuantity().longValue(); + jianyan += pwCompletionNoticeProduct.getQuantity().longValue(); + } + makeDocumentsDetail3.setWid(jiaojian); + makeDocumentsDetail3.setWorkblankTwo(jianyan); + //查询入库数据 + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail3.getMakeDocumentsCode(), makeDocumentsDetail3.getName(), makeDocumentsDetail3.getFigureNumber()); + //申请入库数量 + Long shenqingruku = 0L; + Long ruku = 0L; + //累加其数量 + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + shenqingruku += imProductReceiptMaterial.getReceivableQuantity().longValue(); + ruku += imProductReceiptMaterial.getReceived().longValue(); + } + makeDocumentsDetail3.setLenTwo(shenqingruku); + makeDocumentsDetail3.setNumber(ruku); + //状态 + if(makeDocumentsDetail3.getQuantity().equals(jianyan)){ + makeDocumentsDetail3.setInventoryStatus("已检验"); + } + if(makeDocumentsDetail3.getQuantity().equals(ruku)){ + makeDocumentsDetail3.setInventoryStatus("已入库"); + } + + //查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail3.getName(), makeDocumentsDetail3.getFigureNumber()); + makeDocumentsDetail3.setWorkblank(inventoryDetail.getQuantity()); + } + if(null!=makeDocumentsDetail){ + makeDocumentsDetail.setChildren(list3); + } + list.add(makeDocumentsDetail); + return getDataTable(list); + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialBorrowInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialBorrowInfoController.java new file mode 100644 index 0000000..2808877 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialBorrowInfoController.java @@ -0,0 +1,374 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMaterialBorrowInfo; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMaterialBorrowInfoService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 借用信息Controller + * + * @author zhukangchao + * @date 2023-11-24 + */ +@RestController +@RequestMapping("/management/pwMaterialBorrowInfo") +public class PwMaterialBorrowInfoController extends BaseController +{ + @Autowired + private IPwMaterialBorrowInfoService pwMaterialBorrowInfoService; + //bom信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //用户信息 + @Autowired + private TokenService tokenService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + + /** + * 查询借用信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialBorrowInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwMaterialBorrowInfo pwMaterialBorrowInfo){ + startPage(); + List list = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoList(pwMaterialBorrowInfo); + for (PwMaterialBorrowInfo pwMaterialBorrowInfo2 : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMaterialBorrowInfo2.getName(), pwMaterialBorrowInfo2.getFigureNumber()); + if(null==inventoryDetail){ + pwMaterialBorrowInfo2.setQuantity(0L); + }else{ + pwMaterialBorrowInfo2.setQuantity(inventoryDetail.getQuantity()); + } + } + return getDataTable(list); + } + + /** + * 导出借用信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialBorrowInfo:export')") + @Log(title = "借用信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwMaterialBorrowInfo pwMaterialBorrowInfo) + { + List list = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoList(pwMaterialBorrowInfo); + ExcelUtil util = new ExcelUtil(PwMaterialBorrowInfo.class); + return util.exportExcel(list, "pwMaterialBorrowInfo"); + } + + /** + * 获取借用信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialBorrowInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoById(id)); + } + + /** + * 新增借用信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialBorrowInfo:add')") + @Log(title = "借用信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwMaterialBorrowInfo pwMaterialBorrowInfo){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据库存id查询 + //根据物料id查询当前物料的名称和图号 +// PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwMaterialBorrowInfo.getMateialId()); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(pwMaterialBorrowInfo.getMateialId()); + if(null!=inventoryDetail){ + pwMaterialBorrowInfo.setName(inventoryDetail.getName()); + pwMaterialBorrowInfo.setFigureNumber(inventoryDetail.getFigureNumber()); + }else{ + return AjaxResult.error("未查询到此物料"); + } + //判断借用数量是否小于等于本批数量 + if(pwMaterialBorrowInfo.getNumber()>inventoryDetail.getQuantity()){ + return AjaxResult.error("借用数量不可大于库存数量!库存数量为:"+inventoryDetail.getQuantity()); + } + //借用单编号 + pwMaterialBorrowInfo.setSparedTwo("JT-"+sdf.format(new Date())); + //审批状态(默认为未审批) + pwMaterialBorrowInfo.setStatus("未审批"); + //借用人 + pwMaterialBorrowInfo.setSparedOne(user.getNickName()); + return toAjax(pwMaterialBorrowInfoService.insertPwMaterialBorrowInfo(pwMaterialBorrowInfo)); + } + + /** + * 修改借用信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialBorrowInfo:edit')") + @Log(title = "借用信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwMaterialBorrowInfo pwMaterialBorrowInfo){ + //判断当前状态是否还可修改,未审批,已审批,未申请状态时可以修改 + if("已申请".equals(pwMaterialBorrowInfo.getStatus())||"已出库".equals(pwMaterialBorrowInfo.getStatus())||"已归还".equals(pwMaterialBorrowInfo.getStatus())){ + return AjaxResult.error("当前借条为不可修改的状态"); + } + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //根据物料id查询当前物料的名称和图号 +// PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwMaterialBorrowInfo.getMateialId()); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(pwMaterialBorrowInfo.getMateialId()); + if(null!=inventoryDetail){ + pwMaterialBorrowInfo.setName(inventoryDetail.getName()); + pwMaterialBorrowInfo.setFigureNumber(inventoryDetail.getFigureNumber()); + }else{ + return AjaxResult.error("未查询到此物料"); + } + //判断借用数量是否小于等于本批数量 + if(pwMaterialBorrowInfo.getNumber()>inventoryDetail.getQuantity()){ + return AjaxResult.error("借用数量不可大于库存数量!库存数量为:"+inventoryDetail.getQuantity()); + } + //重置审批状态 + pwMaterialBorrowInfo.setStatus("未审批"); + //借用人(重置借用人) + pwMaterialBorrowInfo.setSparedOne(user.getNickName()); + return toAjax(pwMaterialBorrowInfoService.updatePwMaterialBorrowInfo(pwMaterialBorrowInfo)); + } + + /** + * 删除借用信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialBorrowInfo:remove')") + @Log(title = "借用信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //删除时判断状态 + for (Long id : ids) { + PwMaterialBorrowInfo materialBorrowInfo = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoById(id); + if("已申请".equals(materialBorrowInfo.getStatus())||"已出库".equals(materialBorrowInfo.getStatus())||"已归还".equals(materialBorrowInfo.getStatus())){ + return AjaxResult.error("当前状态下的借条不允许删除"); + } + } + return toAjax(pwMaterialBorrowInfoService.deletePwMaterialBorrowInfoByIds(ids)); + } + + //查询库存信息 + @GetMapping("/getBomLists") + public AjaxResult getBomLists(){ +// List list = new ArrayList(); +// list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeByG(pwMaterialBorrowInfo.getCode()); + List list = new ArrayList(); + //查询标准件库,零部件库 + list = pwInventoryDetailService.selectPwInventoryDetailByWareHouserName(); + return AjaxResult.success(list); + } + + /** + * 审核按钮 + */ + @RequestMapping("/audits/{ids}") + public AjaxResult audits(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwMaterialBorrowInfo materialBorrowInfo = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoById(id); + if("未审批".equals(materialBorrowInfo.getStatus())){ + materialBorrowInfo.setStatus("已审批"); + //记录审批人 + materialBorrowInfo.setApprover(user.getNickName()); + //审批时间 + materialBorrowInfo.setApproverTime(new Date()); + }else{ + materialBorrowInfo.setStatus("未审批"); + + //取消审批人 + materialBorrowInfo.setApprover(null); + //取消审批时间 + materialBorrowInfo.setApproverTime(null); + } + i = pwMaterialBorrowInfoService.updatePwMaterialBorrowInfo(materialBorrowInfo); + } + return toAjax(i); + } + + /** + * 申请借用 + */ + @RequestMapping("/deliverys/{ids}") + public AjaxResult deliverys(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwMaterialBorrowInfo materialBorrowInfo = pwMaterialBorrowInfoService.selectPwMaterialBorrowInfoById(id); + //判断当前状态是否允许出库 + if(!"已审批".equals(materialBorrowInfo.getStatus())){ + return AjaxResult.error("当前借条的状态不允许申请借用"); + } + //判断库存数量够不够 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(materialBorrowInfo.getName(), materialBorrowInfo.getFigureNumber()); + if(inventoryDetail.getQuantity() list = pwMaterialMaterialsService.selectPwMaterialMaterialsList(pwMaterialMaterials); + return getDataTable(list); + } + + /** + * 导出物料原材料列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialMaterials:export')") + @Log(title = "物料原材料", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwMaterialMaterials pwMaterialMaterials) + { + List list = pwMaterialMaterialsService.selectPwMaterialMaterialsList(pwMaterialMaterials); + ExcelUtil util = new ExcelUtil(PwMaterialMaterials.class); + return util.exportExcel(list, "pwMaterialMaterials"); + } + + /** + * 获取物料原材料详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialMaterials:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwMaterialMaterialsService.selectPwMaterialMaterialsById(id)); + } + + /** + * 新增物料原材料 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialMaterials:add')") + @Log(title = "物料原材料", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwMaterialMaterials pwMaterialMaterials){ + //判断执行单令号是否为null + if(null==pwMaterialMaterials.getCode()){ + return AjaxResult.error("请选择令号"); + } + + //判断物料id是否为null + if(null==pwMaterialMaterials.getMaterialId()){ + return AjaxResult.error("请选择物料"); + } + + //判断材料id是否为null + if(null==pwMaterialMaterials.getMaterialsId()){ + return AjaxResult.error("请选择原材料"); + } + + //本批数量 + Long quantity = 0L; + //判断是企标单还是执行单 + if(pwMaterialMaterials.getCode().contains("QB")){ + //说明是企标单,根据id查询企标单的物料信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(pwMaterialMaterials.getMaterialId()); + if(null!=makeDocumentsDetail){ + //物料名称 + pwMaterialMaterials.setMaterialName(makeDocumentsDetail.getName()); + //物料图号 + pwMaterialMaterials.setMaterialFigureNumber(makeDocumentsDetail.getFigureNumber()); + + quantity = makeDocumentsDetail.getQuantity(); + + }else{ + return AjaxResult.error("bom表中未查询到此物料"); + } + }else{ + //说明是执行单,根据id查询执行单的物料信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(pwMaterialMaterials.getMaterialId()); + if(null!=bomNumberTwo){ + //物料名称 + pwMaterialMaterials.setMaterialName(bomNumberTwo.getName()); + //物料图号 + pwMaterialMaterials.setMaterialFigureNumber(bomNumberTwo.getFigureNumber()); + + quantity = bomNumberTwo.getSumNumber(); + + }else{ + return AjaxResult.error("bom表中未查询到此物料"); + } + } + + //根据原材料id查询原材料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwMaterialMaterials.getMaterialsId()); + if(null!=imMaterial){ + //原材料名称 + pwMaterialMaterials.setMaterialsName(imMaterial.getMaterialName()); + //原材料图号 + pwMaterialMaterials.setMaterialsFigureNumber(imMaterial.getFigureNumber()); + //原材料单位 + pwMaterialMaterials.setMaterialsUnit(imMaterial.getUnitOfMeasurementName()); + }else{ + return AjaxResult.error("未查询原材料信息"); + } + + //判断材料的属性是原材料还是毛坯(原材料需要计算剩余尺寸,毛坯无需计算,毛坯材料的数量为填写的毛坯数量) + if(imMaterial.getMaterialTypeName().equals("毛坯")){ + //说明不用计算出料数量及剩余尺寸 + //长度为1 + pwMaterialMaterials.setLen("1"); + //下料规格为长度 + pwMaterialMaterials.setSpecification(pwMaterialMaterials.getLen()); + //判断毛坯数量是否填写(必填)毛坯数量为实际领料数量 + if(null==pwMaterialMaterials.getWorkblank()||0==pwMaterialMaterials.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + //成品数量为本批数量 + pwMaterialMaterials.setFinished(quantity); + + //领料数量(毛坯材料的领料数量为填写的毛坯数量) + pwMaterialMaterials.setQuantity(pwMaterialMaterials.getWorkblank()); + //剩余尺寸(默认为0) + pwMaterialMaterials.setRemainderLen(0L); + //剩余数量(默认为0) + pwMaterialMaterials.setRemainderNumber(0L); + //是否是残料(默认为否) + pwMaterialMaterials.setDefectiveMaterial("否"); + //剩余尺寸2(默认为0) + pwMaterialMaterials.setRemainderLenTwo(0L); + //剩余数量2(默认为0) + pwMaterialMaterials.setRemainderNumberTwo(0L); + //是否是残料2(默认为否) + pwMaterialMaterials.setDefectiveMaterialTwo("否"); + + }else if(null != pwMaterialMaterials.getWid()&&!pwMaterialMaterials.getWid().equals("0")&&!pwMaterialMaterials.getWid().trim().equals("")){ + //如果宽度不为null,说明是板材,板材的计算方法为Kg(自动计算毛坯数量,毛坯数量为出库数量,单位为Kg) + //长度 + if(null==pwMaterialMaterials.getLen()||"".equals(pwMaterialMaterials.getLen())){ + return AjaxResult.error("请输入长度"); + } + //下料规格为长度*宽度 + pwMaterialMaterials.setSpecification(pwMaterialMaterials.getLen()+"*"+pwMaterialMaterials.getWid()); + //毛坯数量(自动计算,长*宽*成品数量=总平方数,总平方数*单重=毛坯数量(Kg)) + //计算单件面积 + Double mianji = Double.valueOf(pwMaterialMaterials.getLen())*Double.valueOf(pwMaterialMaterials.getWid()); + //判断成品数量是否为null或者0 + if(null==pwMaterialMaterials.getFinished()||pwMaterialMaterials.getFinished().equals(0)){ + return AjaxResult.error("请输入成品数量"); + } + + //计算总面积 + Double zongmianji = mianji * pwMaterialMaterials.getFinished(); + //判断单重是否为null或者0 + if(null==imMaterial.getPieceWeight()||0==imMaterial.getPieceWeight()){ + return AjaxResult.error("无法计算,请核实材料的单重"); + } + Double workBlank = zongmianji * imMaterial.getPieceWeight(); + //毛坯数量(实际领料数量,总平方数*单重(一平方的重量)) + pwMaterialMaterials.setWorkblank(workBlank.longValue()); + + //剩余尺寸(板材剩余的为重量)(总重量-毛坯重量) + pwMaterialMaterials.setRemainderLen(0L); + //剩余数量 + pwMaterialMaterials.setRemainderNumber(0L); + + //判断是否是残料(总重量-毛坯重量<=残料重量) +// if(>imMaterial.getDefectiveMaterialMeasure()){ +// //是否是残料 +// pwMaterialMaterials.setDefectiveMaterial("否"); +// }else{ +// //是否是残料 +// pwMaterialMaterials.setDefectiveMaterial("是"); +// } + //剩余尺寸2 + pwMaterialMaterials.setRemainderLenTwo(0L); + //剩余数量2 + pwMaterialMaterials.setRemainderNumberTwo(0L); + //是否是残料2 + pwMaterialMaterials.setDefectiveMaterialTwo("否"); + + }else{ + //如果为线材,则计算 + //长度 + if(null==pwMaterialMaterials.getLen()||"".equals(pwMaterialMaterials.getLen())){ + return AjaxResult.error("请输入长度"); + } + //下料规格为长度 + pwMaterialMaterials.setSpecification(pwMaterialMaterials.getLen()); + + //判断毛坯数量是否填写(必填) + if(null==pwMaterialMaterials.getWorkblank()||0==pwMaterialMaterials.getWorkblank()){ + return AjaxResult.error("请填写毛坯数量"); + } + //判断成品数量是否填写(必填) + if(null==pwMaterialMaterials.getFinished()||0==pwMaterialMaterials.getFinished()){ + return AjaxResult.error("请填写成品数量"); + } + //判断原材料的长度是否是有效数据 + if(null==imMaterial.getLen()||imMaterial.getLen().equals(0)){ + return AjaxResult.error("材料的长度无效,请核实"); + } + + //判断毛坯数量*单根长度是否>=单件长度*成品数量,如果>=则说明可以出料,如果小于,则提示领料数量不满足于本次成品下料 + //计算成品的总长度(单件长度*成品数量) + Double sumNumber = Double.valueOf(pwMaterialMaterials.getLen())*pwMaterialMaterials.getFinished(); + //计算出料的总长度(毛坯数量*单根长度) + Double zong = Double.valueOf(pwMaterialMaterials.getWorkblank())*imMaterial.getLen(); + if(zong list = pwMaterialParamsService.selectPwMaterialParamsList(pwMaterialParams); + return getDataTable(list); + } + + /** + * 导出物料参数列表 + */ + @PreAuthorize("@ss.hasPermi('management:materialParams:export')") + @Log(title = "物料参数", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwMaterialParams pwMaterialParams) + { + List list = pwMaterialParamsService.selectPwMaterialParamsList(pwMaterialParams); + ExcelUtil util = new ExcelUtil(PwMaterialParams.class); + return util.exportExcel(list, "params"); + } + + /** + * 获取物料参数详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:materialParams:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwMaterialParamsService.selectPwMaterialParamsById(id)); + } + + /** + * 新增物料参数 + */ + @PreAuthorize("@ss.hasPermi('management:materialParams:add')") + @Log(title = "物料参数", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwMaterialParams pwMaterialParams) + { + return toAjax(pwMaterialParamsService.insertPwMaterialParams(pwMaterialParams)); + } + + /** + * 修改物料参数 + */ + @PreAuthorize("@ss.hasPermi('management:materialParams:edit')") + @Log(title = "物料参数", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwMaterialParams pwMaterialParams) + { + return toAjax(pwMaterialParamsService.updatePwMaterialParams(pwMaterialParams)); + } + + /** + * 删除物料参数 + */ + @PreAuthorize("@ss.hasPermi('management:materialParams:remove')") + @Log(title = "物料参数", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwMaterialParamsService.deletePwMaterialParamsByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialPriceController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialPriceController.java new file mode 100644 index 0000000..fe96e6f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialPriceController.java @@ -0,0 +1,121 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwMaterialPrice; +import com.ruoyi.project.management.service.IPwMaterialPriceService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料价格校验Controller + * + * @author zhukangchao + * @date 2023-06-23 + */ +@RestController +@RequestMapping("/management/pwMaterialPrice") +public class PwMaterialPriceController extends BaseController +{ + @Autowired + private IPwMaterialPriceService pwMaterialPriceService; + + /** + * 查询物料价格校验列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialPrice:list')") + @GetMapping("/list") + public TableDataInfo list(PwMaterialPrice pwMaterialPrice) + { + startPage(); + List list = pwMaterialPriceService.selectPwMaterialPriceList(pwMaterialPrice); + return getDataTable(list); + } + + /** + * 导出物料价格校验列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialPrice:export')") + @Log(title = "物料价格校验", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwMaterialPrice pwMaterialPrice) + { + List list = pwMaterialPriceService.selectPwMaterialPriceList(pwMaterialPrice); + ExcelUtil util = new ExcelUtil(PwMaterialPrice.class); + return util.exportExcel(list, "pwMaterialPrice"); + } + + /** + * 获取物料价格校验详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialPrice:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwMaterialPriceService.selectPwMaterialPriceById(id)); + } + + /** + * 新增物料价格校验 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialPrice:add')") + @Log(title = "物料价格校验", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwMaterialPrice pwMaterialPrice){ + //新增之前判断是否存在此物料了 + PwMaterialPrice materialPrice = new PwMaterialPrice(); + materialPrice.setName(pwMaterialPrice.getName()); + materialPrice.setFigureNumber(pwMaterialPrice.getFigureNumber()); + List list = pwMaterialPriceService.selectPwMaterialPriceList(pwMaterialPrice); + if(list.size()>0){ + return AjaxResult.error("此物料已存在,请勿重复添加"); + } + + return toAjax(pwMaterialPriceService.insertPwMaterialPrice(pwMaterialPrice)); + } + + /** + * 修改物料价格校验 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialPrice:edit')") + @Log(title = "物料价格校验", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwMaterialPrice pwMaterialPrice){ + //修改之前判断是否存在 + PwMaterialPrice materialPrice = pwMaterialPriceService.selectPwMaterialPriceById(pwMaterialPrice.getId()); + //根据新名称和图号查询 + PwMaterialPrice materialPrice2 = pwMaterialPriceService.selectPwMaterialPriceByNameAndFigureNumber(pwMaterialPrice.getName(),pwMaterialPrice.getFigureNumber()); + if(null != materialPrice2){ + if(!materialPrice.getId().equals(materialPrice2.getId())){ + //说明物料已经存在 + return AjaxResult.error("此物料已存在,请核实后再做修改"); + } + } + + return toAjax(pwMaterialPriceService.updatePwMaterialPrice(pwMaterialPrice)); + } + + /** + * 删除物料价格校验 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialPrice:remove')") + @Log(title = "物料价格校验", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwMaterialPriceService.deletePwMaterialPriceByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialProcessController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialProcessController.java new file mode 100644 index 0000000..e669c4e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwMaterialProcessController.java @@ -0,0 +1,292 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.PwMaterialProcess; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IPwMaterialProcessService; +import com.ruoyi.project.management.utils.ExcelUs; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料工序信息Controller + * + * @author zhukangchao + * @date 2021-12-04 + */ +@RestController +@RequestMapping("/management/pwMaterialProcess") +public class PwMaterialProcessController extends BaseController +{ + @Autowired + private IPwMaterialProcessService pwMaterialProcessService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + + /** + * 查询物料工序信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialProcess:list')") + @GetMapping("/list") + public TableDataInfo list(PwMaterialProcess pwMaterialProcess) + { + startPage(); + List list = pwMaterialProcessService.selectPwMaterialProcessList(pwMaterialProcess); + return getDataTable(list); + } + + /** + * 导出物料工序信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialProcess:export')") + @Log(title = "物料工序信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwMaterialProcess pwMaterialProcess) + { + List list = pwMaterialProcessService.selectPwMaterialProcessList(pwMaterialProcess); + ExcelUtil util = new ExcelUtil(PwMaterialProcess.class); + return util.exportExcel(list, "pwMaterialProcess"); + } + + /** + * 获取物料工序信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialProcess:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwMaterialProcessService.selectPwMaterialProcessById(id)); + } + + /** + * 新增物料工序信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialProcess:add')") + @Log(title = "物料工序信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwMaterialProcess pwMaterialProcess){ + if(null==pwMaterialProcess.getName()||"".equals(pwMaterialProcess.getName())){ + return AjaxResult.error("请输入物料名称"); + } + if(null==pwMaterialProcess.getFigureNumber()||"".equals(pwMaterialProcess.getFigureNumber())){ + return AjaxResult.error("请输入物料图号"); + } + if(null==pwMaterialProcess.getSerialNumber()||"".equals(pwMaterialProcess.getSerialNumber())){ + return AjaxResult.error("请输入工序序号"); + } + if(null==pwMaterialProcess.getStorage()||"".equals(pwMaterialProcess.getStorage())){ + return AjaxResult.error("请选择此工序是否入库"); + } + //根据物料名称和图号查询当前物料是否已经添加当前工序 + List list = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pwMaterialProcess.getName(), pwMaterialProcess.getFigureNumber()); + if(list.size()>=pwMaterialProcess.getSerialNumber()){ + return AjaxResult.error("此物料已存在当前序号"); + } + if(null==pwMaterialProcess.getWorkblank()||"".equals(pwMaterialProcess.getWorkblank())){ + pwMaterialProcess.setWorkblank(0L); + } + //序工时 + if(null==pwMaterialProcess.getSerialTime()||"".equals(pwMaterialProcess.getSerialTime())){ + pwMaterialProcess.setSerialTime(0.0); + } + + if(null != pwMaterialProcess.getMaterialsId()){ + //查询原材料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwMaterialProcess.getMaterialsId()); + if(null!=imMaterial){ + pwMaterialProcess.setMaterialsName(imMaterial.getMaterialName()); + pwMaterialProcess.setMaterialsSpecification(imMaterial.getFigureNumber()); + } + } + + return toAjax(pwMaterialProcessService.insertPwMaterialProcess(pwMaterialProcess)); + } + + /** + * 修改物料工序信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialProcess:edit')") + @Log(title = "物料工序信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwMaterialProcess pwMaterialProcess){ + if(null==pwMaterialProcess.getName()||"".equals(pwMaterialProcess.getName())){ + return AjaxResult.error("请输入物料名称"); + } + if(null==pwMaterialProcess.getFigureNumber()||"".equals(pwMaterialProcess.getFigureNumber())){ + return AjaxResult.error("请输入物料图号"); + } + if(null==pwMaterialProcess.getSerialNumber()||"".equals(pwMaterialProcess.getSerialNumber())){ + return AjaxResult.error("请输入工序序号"); + } + if(null==pwMaterialProcess.getStorage()||"".equals(pwMaterialProcess.getStorage())){ + return AjaxResult.error("请选择此工序是否入库"); + } + if(null==pwMaterialProcess.getWorkblank()||"".equals(pwMaterialProcess.getWorkblank())){ + pwMaterialProcess.setWorkblank(0L); + } + //序工时 + if(null==pwMaterialProcess.getSerialTime()||"".equals(pwMaterialProcess.getSerialTime())){ + pwMaterialProcess.setSerialTime(0.0); + } + if(null != pwMaterialProcess.getMaterialsId()){ + //查询原材料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwMaterialProcess.getMaterialsId()); + if(null!=imMaterial){ + pwMaterialProcess.setMaterialsName(imMaterial.getMaterialName()); + pwMaterialProcess.setMaterialsSpecification(imMaterial.getFigureNumber()); + } + } + return toAjax(pwMaterialProcessService.updatePwMaterialProcess(pwMaterialProcess)); + } + + /** + * 删除物料工序信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwMaterialProcess:remove')") + @Log(title = "物料工序信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwMaterialProcessService.deletePwMaterialProcessByIds(ids)); + } + + /** + * 上传文件 + */ + @RequestMapping("/uploadEndowmentInsuranceFile") + @ResponseBody + public AjaxResult uploadEndowmentInsuranceFile(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/lableExcel/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelUs.readExcel(files); + //先判断数据的正确性 + for (int i = 1; i < result.size(); i++) { + //名称 + String name = result.get(i).get(0).toString(); + //图号 + String figureNumber = result.get(i).get(1).toString(); + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(name, figureNumber); + if(null==imMaterial){ + return AjaxResult.error("未查询到:"+ name +"的物料信息"); + } + + if(null!=result.get(i).get(6).toString()&&!"".equals(result.get(i).get(6).toString())&&null!=result.get(i).get(7).toString()&&!"".equals(result.get(i).get(7).toString())){ + //查询材料id + ImMaterial imMaterial2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(result.get(i).get(6).toString(), result.get(i).get(7).toString()); + if(null==imMaterial2){ + return AjaxResult.error("未查询到:"+ result.get(i).get(6).toString() +"的物料信息"); + } + } + } + for (int i = 1; i < result.size(); i++) { + //创建对象 + PwMaterialProcess pwMaterialProcess = new PwMaterialProcess(); + //名称 + pwMaterialProcess.setName(result.get(i).get(0).toString()); + //图号 + pwMaterialProcess.setFigureNumber(result.get(i).get(1).toString()); + + //根据名称和图号查询物料信息 + + //序号 + pwMaterialProcess.setSerialNumber(Double.valueOf(result.get(i).get(2).toString()).longValue()); + //工序名称 + if(null==result.get(i).get(3).toString()||"".equals(result.get(i).get(3).toString())){ + break; + }else{ + pwMaterialProcess.setProcess(result.get(i).get(3).toString()); + } + //派工部门 + pwMaterialProcess.setDispatchingDept(result.get(i).get(4).toString()); + //是否入库 + pwMaterialProcess.setStorage(result.get(i).get(5).toString()); + //查询材料id + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(result.get(i).get(6).toString(), result.get(i).get(7).toString()); + if(null!=imMaterial){ + pwMaterialProcess.setMaterialsId(imMaterial.getId()); + } + if(null!=result.get(i).get(6).toString()&&!"".equals(result.get(i).get(6).toString())){ + //材料名称 + pwMaterialProcess.setMaterialsName(result.get(i).get(6).toString()); + } + if(null!=result.get(i).get(7).toString()&&!"".equals(result.get(i).get(7).toString())){ + //材料规格 + pwMaterialProcess.setMaterialsSpecification(result.get(i).get(7).toString()); + } + if(null!=result.get(i).get(8).toString()&&!"".equals(result.get(i).get(8).toString())){ + //下料长度 + pwMaterialProcess.setLen(Double.valueOf(result.get(i).get(8).toString())); + } + if(null!=result.get(i).get(9).toString()&&!"".equals(result.get(i).get(9).toString())){ + //下料宽度 + pwMaterialProcess.setWid(Double.valueOf(result.get(i).get(9).toString())); + } + //毛坯数量 + if(null==result.get(i).get(10).toString()||"".equals(result.get(i).get(10).toString())){ + pwMaterialProcess.setWorkblank(0L); + }else{ + pwMaterialProcess.setWorkblank(Double.valueOf(result.get(i).get(10).toString()).longValue()); + } + //序描述 + if(null!=result.get(i).get(11).toString()||!"".equals(result.get(i).get(11).toString())){ + pwMaterialProcess.setSparedOne(result.get(i).get(11).toString()); + } + //毛坯数量 + if(null==result.get(i).get(12).toString()||"".equals(result.get(i).get(12).toString())){ + pwMaterialProcess.setSerialTime(0.0); + }else{ + pwMaterialProcess.setSerialTime(Double.valueOf(result.get(i).get(12).toString())); + } + + pwMaterialProcessService.insertPwMaterialProcess(pwMaterialProcess); + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwModulePartController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwModulePartController.java new file mode 100644 index 0000000..c978250 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwModulePartController.java @@ -0,0 +1,139 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.PwModulePart; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IPwModulePartService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 零部件关联Controller + * + * @author zhukangchao + * @date 2022-11-28 + */ +@RestController +@RequestMapping("/management/pwModulePart") +public class PwModulePartController extends BaseController +{ + @Autowired + private IPwModulePartService pwModulePartService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + + /** + * 查询零部件关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwModulePart:list')") + @GetMapping("/list") + public TableDataInfo list(PwModulePart pwModulePart) + { + startPage(); + List list = pwModulePartService.selectPwModulePartList(pwModulePart); + return getDataTable(list); + } + + /** + * 导出零部件关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwModulePart:export')") + @Log(title = "零部件关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwModulePart pwModulePart) + { + List list = pwModulePartService.selectPwModulePartList(pwModulePart); + ExcelUtil util = new ExcelUtil(PwModulePart.class); + return util.exportExcel(list, "pwModulePart"); + } + + /** + * 获取零部件关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwModulePart:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwModulePartService.selectPwModulePartById(id)); + } + + /** + * 新增零部件关联 + */ + @PreAuthorize("@ss.hasPermi('management:pwModulePart:add')") + @Log(title = "零部件关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwModulePart pwModulePart){ + //判断是否填写了数量 + if(null==pwModulePart.getNumber()||pwModulePart.getNumber()<0){ + return AjaxResult.error("请填写单件数量"); + } + //根据部件id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwModulePart.getMaterialId()); + //部件名称 + pwModulePart.setMaterialName(imMaterial.getMaterialName()); + //部件图号 + pwModulePart.setFigureNumber(imMaterial.getFigureNumber()); + //跟据零件id查询物料 + ImMaterial imMaterialTwo = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + //零件名称 + pwModulePart.setName(imMaterialTwo.getMaterialName()); + //零件图号 + pwModulePart.setSpecification(imMaterialTwo.getFigureNumber()); + + return toAjax(pwModulePartService.insertPwModulePart(pwModulePart)); + } + + /** + * 修改零部件关联 + */ + @PreAuthorize("@ss.hasPermi('management:pwModulePart:edit')") + @Log(title = "零部件关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwModulePart pwModulePart){ + //修改的同时,把物料id也修改了 + //部件名称和图号 + String name = pwModulePart.getMaterialName(); + String figureNumber = pwModulePart.getFigureNumber(); + + //零件名称和图号 + String name2 = pwModulePart.getName(); + String specification = pwModulePart.getSpecification(); + + //根据名称和图号查询物料 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(name, figureNumber); + + ImMaterial imMaterial2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(name2, specification); + + pwModulePart.setMaterialId(imMaterial.getId()); + pwModulePart.setPartId(imMaterial2.getId()); + return toAjax(pwModulePartService.updatePwModulePart(pwModulePart)); + } + + /** + * 删除零部件关联 + */ + @PreAuthorize("@ss.hasPermi('management:pwModulePart:remove')") + @Log(title = "零部件关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwModulePartService.deletePwModulePartByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwOtherCorrespondentController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwOtherCorrespondentController.java new file mode 100644 index 0000000..a0dc987 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwOtherCorrespondentController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwOtherCorrespondent; +import com.ruoyi.project.management.service.IPwOtherCorrespondentService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 其它往来单位信息Controller + * + * @author zhukangchao + * @date 2023-12-04 + */ +@RestController +@RequestMapping("/management/pwOtherCorrespondent") +public class PwOtherCorrespondentController extends BaseController +{ + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + + /** + * 查询其它往来单位信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwOtherCorrespondent:list')") + @GetMapping("/list") + public TableDataInfo list(PwOtherCorrespondent pwOtherCorrespondent) + { + startPage(); + List list = pwOtherCorrespondentService.selectPwOtherCorrespondentList(pwOtherCorrespondent); + return getDataTable(list); + } + + /** + * 导出其它往来单位信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwOtherCorrespondent:export')") + @Log(title = "其它往来单位信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwOtherCorrespondent pwOtherCorrespondent) + { + List list = pwOtherCorrespondentService.selectPwOtherCorrespondentList(pwOtherCorrespondent); + ExcelUtil util = new ExcelUtil(PwOtherCorrespondent.class); + return util.exportExcel(list, "pwOtherCorrespondent"); + } + + /** + * 获取其它往来单位信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOtherCorrespondent:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwOtherCorrespondentService.selectPwOtherCorrespondentById(id)); + } + + /** + * 新增其它往来单位信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOtherCorrespondent:add')") + @Log(title = "其它往来单位信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwOtherCorrespondent pwOtherCorrespondent) + { + return toAjax(pwOtherCorrespondentService.insertPwOtherCorrespondent(pwOtherCorrespondent)); + } + + /** + * 修改其它往来单位信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOtherCorrespondent:edit')") + @Log(title = "其它往来单位信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwOtherCorrespondent pwOtherCorrespondent) + { + return toAjax(pwOtherCorrespondentService.updatePwOtherCorrespondent(pwOtherCorrespondent)); + } + + /** + * 删除其它往来单位信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOtherCorrespondent:remove')") + @Log(title = "其它往来单位信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwOtherCorrespondentService.deletePwOtherCorrespondentByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourceContractController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourceContractController.java new file mode 100644 index 0000000..3abe78c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourceContractController.java @@ -0,0 +1,608 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.io.*; +import java.util.*; + +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 外协合同信息Controller + * + * @author zhukangchao + * @date 2023-04-09 + */ +@RestController +@RequestMapping("/management/pwOutsourceContract") +public class PwOutsourceContractController extends BaseController +{ + @Autowired + private IPwOutsourceContractService pwOutsourceContractService; + //重置合同详情信息的合同id + @Autowired + private IPwOutsourceContractDetailService pwOutsourceContractDetailService; + //发票信息 + @Autowired + private IPwInvoiceInfoService pwInvoiceInfoService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //用户信息 + @Autowired + private TokenService tokenService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //物流费用信息 + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + /** + * 查询外协合同信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContract:list')") + @GetMapping("/list") + public TableDataInfo list(PwOutsourceContract pwOutsourceContract){ + //获取当前登录用户 + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(null!=pwOutsourceContract.getInvoice()){ + //说明是从发票处查询的,应该查询所有的 + pwOutsourceContract.setContractStatus(null); + } + if("外协部".equals(user.getDept().getDeptName())||"采购部".equals(user.getDept().getDeptName())){ + pwOutsourceContract.setSparedOne(user.getNickName()); + } + startPage(); + List list = new ArrayList(); + if((null!=pwOutsourceContract.getMaterialName()&&!"".equals(pwOutsourceContract.getMaterialName()))||(null!=pwOutsourceContract.getCode()&&!"".equals(pwOutsourceContract.getCode()))){ + PwOutsourceContractDetail pwOutsourceContractDetail = new PwOutsourceContractDetail(); + pwOutsourceContractDetail.setCode(pwOutsourceContract.getCode()); + pwOutsourceContractDetail.setName(pwOutsourceContract.getMaterialName()); + List list2 = pwOutsourceContractDetailService.selectPwOutsourceContractDetailLists(pwOutsourceContractDetail); + for (PwOutsourceContractDetail pwOutsourceContractDetail2 : list2) { + //根据单据id查询请购单 + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(pwOutsourceContractDetail2.getOutsourceContractId()); + if(null!=outsourceContract){ + list.add(outsourceContract); + } + } + }else{ + list = pwOutsourceContractService.selectPwOutsourceContractList(pwOutsourceContract); + } + return getDataTable(list); + } + + /** + * 导出外协合同信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContract:export')") + @Log(title = "外协合同信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwOutsourceContract pwOutsourceContract) + { + List list = pwOutsourceContractService.selectPwOutsourceContractList(pwOutsourceContract); + ExcelUtil util = new ExcelUtil(PwOutsourceContract.class); + return util.exportExcel(list, "pwOutsourceContract"); + } + + /** + * 获取外协合同信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContract:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwOutsourceContractService.selectPwOutsourceContractById(id)); + } + + /** + * 新增外协合同信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContract:add')") + @Log(title = "外协合同信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwOutsourceContract pwOutsourceContract) + { + return toAjax(pwOutsourceContractService.insertPwOutsourceContract(pwOutsourceContract)); + } + + /** + * 修改外协合同信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContract:edit')") + @Log(title = "外协合同信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwOutsourceContract pwOutsourceContract){ + //判断当前合同是否生成了发票信息 + if("是".equals(pwOutsourceContract.getBillingInformation())){ + //说明已经开票,则不允许有任何修改与删除 + return AjaxResult.error("已经开票的合同不允许修改"); + } + return toAjax(pwOutsourceContractService.updatePwOutsourceContract(pwOutsourceContract)); + } + + /** + * 删除外协合同信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContract:remove')") + @Log(title = "外协合同信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(id); + //判断当前合同是否生成了发票信息 + if("是".equals(outsourceContract.getBillingInformation())){ + //说明已经开票,则不允许有任何修改与删除 + return AjaxResult.error("已经开票的合同不允许删除"); + }else{ + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByOutsourceContractId(id); + for (PwOutsourceContractDetail pwOutsourceContractDetail : list) { + pwOutsourceContractDetail.setOutsourceContractId(null); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + } + } + return toAjax(pwOutsourceContractService.deletePwOutsourceContractByIds(ids)); + } + + /** + * 开具发票功能 + */ + @RequestMapping("/issueAnInvoices/{ids}") + public AjaxResult remissueAnInvoicesove(@PathVariable Long[] ids){ + + int i = 0; + //判断是否是统一的供应商 + //供应商名称 + String preferentialOriginName = ""; + for (Long id : ids) { + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(id); + if(null==outsourceContract.getSupplier()||"".equals(outsourceContract.getSupplier())){ + return AjaxResult.error("请完善合同的供应商名称"); + } + if(null==outsourceContract.getTaxRate()){ + return AjaxResult.error("请完善合同的税率"); + } + if(0==outsourceContract.getTotalPricesSmall()||null==outsourceContract.getTotalPricesSmall()){ + return AjaxResult.error("请完善合同的价格"); + } + if(!"已完成".equals(outsourceContract.getContractStatus())){ + return AjaxResult.error("未完成的合同,不允许开具发票"); + } + if("是".equals(outsourceContract.getBillingInformation())){ + return AjaxResult.error("已经开具发票的合同不允许重复开票"); + } + if("".equals(preferentialOriginName)||null==preferentialOriginName){ + preferentialOriginName = outsourceContract.getSupplier(); + }else{ + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if(!preferentialOriginName.equals(outsourceContract.getSupplier())){ + return AjaxResult.error("不同供应商不可开具发票"); + } + } + } + + //生成发票信息 + PwInvoiceInfo pwInvoiceInfo = new PwInvoiceInfo(); + //发票的供应商名称 + pwInvoiceInfo.setSupplierName(preferentialOriginName); + //是否付款 + pwInvoiceInfo.setPayment("否"); + //合同来源 + pwInvoiceInfo.setSource("外协"); + i = pwInvoiceInfoService.insertPwInvoiceInfo(pwInvoiceInfo); + + //修改开具发票后的合同状态 + for (Long id : ids) { + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(id); + //是否开票 + outsourceContract.setBillingInformation("是"); + //发票id + outsourceContract.setInvoice(pwInvoiceInfo.getId()); + pwOutsourceContractService.updatePwOutsourceContract(outsourceContract); + } + return toAjax(i); + } + + //打印合同 + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids) { + if (ids.length>1){ + return AjaxResult.error("不同合同不允许合并打印"); + } + HashMap printMessageMap = new HashMap<>(); + //根据id获取合同信息 + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(ids[0]); + //获得产品列表 + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByOutsourceContractId(outsourceContract.getId()); + Long i = 1L; + for (PwOutsourceContractDetail pwOutsourceContractDetail : list) { + pwOutsourceContractDetail.setNum(i); + i++; + } + //如果备注为null则显示空 + if (outsourceContract.getRemarks()==null){ + outsourceContract.setRemarks(""); + } + //根据供应商名称查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierByName(outsourceContract.getSupplier()); + + //产品列表 + printMessageMap.put("outsourceContractDetailLlist", list); + printMessageMap.put("contractObj", outsourceContract); + printMessageMap.put("supplier", supplier); + return AjaxResult.success("success", printMessageMap); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody PwOutsourceContract pwOutsourceContract){ + //校验付款金额 + if(null==pwOutsourceContract.getPaymentAmount()||"".equals(pwOutsourceContract.getPaymentAmount())||0==pwOutsourceContract.getPaymentAmount()){ + return AjaxResult.error("请填写付款金额"); + } + //获取合同id + Long[] ids = pwOutsourceContract.getIds(); + //供应商名称 + String name = ""; + //合同总金额 + Double d = 0.0; + for (Long id : ids) { + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(id); + //校验当前选中的合同是否为同一个供应商 + if(!"".equals(name)){ + //校验name是否和供应商名称相同 + if(!name.equals(outsourceContract.getSupplier())){ + return AjaxResult.error("不同供应商不可合并付款"); + } + }else{ + name = outsourceContract.getSupplier(); + } + + //计算合同总金额 + d += outsourceContract.getTotalPricesSmall(); + } + + //校验付款金额是否大于合同总金额 + if(d0){ + //生成付款申请单及付款申请单明细 + for (Long id : ids) { + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(id); + + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + //付款单id + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + //付款单编号 + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + //关联合同编号 + cwOtherPaymentInfo.setCode(outsourceContract.getContractCode()); + //合同金额 + cwOtherPaymentInfo.setContractMoney(outsourceContract.getTotalPricesSmall()); + //付款金额(计算) 合同金额*(付款金额/总金额) + cwOtherPaymentInfo.setPaymentAmount(outsourceContract.getTotalPricesSmall()*(pwOutsourceContract.getPaymentAmount()/d)); + //付款比例(计算) 付款金额/合同金额 + cwOtherPaymentInfo.setProportion(cwOtherPaymentInfo.getPaymentAmount()/outsourceContract.getTotalPricesSmall()*100); + //合同类型 + cwOtherPaymentInfo.setSparedOne("委外加工合同"); + cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + } + return toAjax(i); + } + + /** + * 生成物流费用单 + */ + @RequestMapping("/addLogistics") + public AjaxResult addLogistics(@RequestBody PwOutsourceContract outsourceContract) { + //校验付款金额 + if (null == outsourceContract.getMoney() || "".equals(outsourceContract.getMoney()) || 0 == outsourceContract.getMoney()) { + return AjaxResult.error("请填写付款金额"); + } + //校验支付方式 + if(null==outsourceContract.getPayWay()||"".equals(outsourceContract.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==outsourceContract.getUnitName()||"".equals(outsourceContract.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //物料费用单 + CwLogisticsFeesInfo cwLogisticsFeesInfo = new CwLogisticsFeesInfo(); + + //编号 + cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); + //关联单据编号 所勾选的合同编号 + //获取合同id + Long[] ids = outsourceContract.getIds(); + //拼接合同编号 + String code = ""; + for (Long id : ids) { + PwOutsourceContract outsourceContract2 = pwOutsourceContractService.selectPwOutsourceContractById(id); + code += outsourceContract2.getContractCode()+","; + } + cwLogisticsFeesInfo.setRelevanceCode(code); + //单据类型 + cwLogisticsFeesInfo.setRelevanceType("委外加工合同"); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //小写金额 + cwLogisticsFeesInfo.setMoney(outsourceContract.getMoney()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(outsourceContract.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //事由 + cwLogisticsFeesInfo.setCause("采购运费"); + //支付方式 + cwLogisticsFeesInfo.setPayWay(outsourceContract.getPayWay()); + //单位名称 + cwLogisticsFeesInfo.setUnitName(outsourceContract.getUnitName()); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(outsourceContract.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(outsourceContract.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(outsourceContract.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); + return toAjax(i); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(id); + if(null!=outsourceContract.getLeadership()){ + outsourceContract.setLeadership(""); + }else{ + outsourceContract.setLeadership(user.getNickName()); + //审批时间 + outsourceContract.setLeadershipTime(new Date()); + } + if (outsourceContract.getSupplier() == null || outsourceContract.getSupplier().isEmpty()) { + AjaxResult.error("供应商信息不全,请补充完整"); + } + if (outsourceContract.getTaxRate() == null || outsourceContract.getTaxRate() == 0) { + AjaxResult.error("税率信息不全,请补充完整"); + } + if (outsourceContract.getTotalPricesSmall() == null || outsourceContract.getTotalPricesSmall() == 0.0) { + AjaxResult.error("总价不全,请补充完整"); + } + if (outsourceContract.getDeliveryType() == null || outsourceContract.getDeliveryType().isEmpty()) { + AjaxResult.error("交货方式不全,请补充完整"); + } + if (outsourceContract.getPayer() == null || outsourceContract.getPayer().isEmpty()) { + AjaxResult.error("货运费支付方不全,请补充完整"); + } + if (outsourceContract.getModeOfPayment() == null || outsourceContract.getModeOfPayment().isEmpty()) { + AjaxResult.error("货款支付方式不全, 请补充完整"); + } + i = pwOutsourceContractService.updatePwOutsourceContract(outsourceContract); + + } + return toAjax(i); + } + + /** + * 上传合同的PDF + * + * @param id + * @param filePath + * @return + */ + @RequestMapping("/uploadContractPDF") + @ResponseBody + public AjaxResult uploadContractPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { + System.out.println(id); + String originalFilename = filePath.getOriginalFilename(); + if (originalFilename != null) { + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传"); + } else { + //根据id 获取合同信息 + PwOutsourceContract pwOutsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(Long.valueOf(id)); + String newfilenname = generateUniqueFileName(originalFilename); + try (InputStream is = filePath.getInputStream(); + //在对应的文件夹下生成新的图片 + FileOutputStream fos = new FileOutputStream("D:/contract/" + newfilenname); + BufferedOutputStream bos = new BufferedOutputStream(fos)) { + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + //映射路径 + pwOutsourceContract.setContractPath(newfilenname); + //更新 + pwOutsourceContractService.updatePwOutsourceContract(pwOutsourceContract); + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + } + } + } + return AjaxResult.success("文件上传成功"); + + } + + /** + * 生成随机文件名 + * + * @param originalFilename + * @return + */ + private String generateUniqueFileName(String originalFilename) { + String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); + String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); + //生成年月日加 毫秒值的 文件名称 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String date = dateFormat.format(new Date()); + return filename + "_" + date + System.currentTimeMillis() + extension; + } +} + diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourceContractDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourceContractDetailController.java new file mode 100644 index 0000000..fb75270 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourceContractDetailController.java @@ -0,0 +1,4046 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterialTwo; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwBomNumber; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoLingliao; +import com.ruoyi.project.management.domain.PwCompletionNotice; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocuments; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwModulePart; +import com.ruoyi.project.management.domain.PwOutsourceContract; +import com.ruoyi.project.management.domain.PwOutsourceContractDetail; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.domain.PwUserEmail; +import com.ruoyi.project.management.mapper.PwInventoryDetailMapper; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwBomNumberService; +import com.ruoyi.project.management.service.IPwBomNumberTwoLingliaoService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsService; +import com.ruoyi.project.management.service.IPwModulePartService; +import com.ruoyi.project.management.service.IPwOutsourceContractDetailService; +import com.ruoyi.project.management.service.IPwOutsourceContractService; +import com.ruoyi.project.management.service.IPwProductionBillProductService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.project.management.service.IPwUserEmailService; +import com.ruoyi.project.management.utils.ExcelU; +import com.ruoyi.project.management.utils.FileToZip; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.management.utils.PDFDocHelper; +import com.ruoyi.project.management.utils.SendEmail; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 外协合同详情信息Controller + * + * @author zhukangchao + * @date 2023-04-09 + */ +@RestController +@RequestMapping("/management/pwOutsourceContractDetail") +public class PwOutsourceContractDetailController extends BaseController +{ + @Value("${ruoyi.yzPdfUrl}") + private String yzPdfUrl; + @Value("${ruoyi.dwgAndPdf}") + private String dwgAndPdf; + + @Autowired + private IPwOutsourceContractDetailService pwOutsourceContractDetailService; + //合同信息 + @Autowired + private IPwOutsourceContractService pwOutsourceContractService; + //用户邮箱信息 + @Autowired + private IPwUserEmailService pwUserEmailService; + //用户信息 + @Autowired + private TokenService tokenService; + //bom信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //质检通知单信息 + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //领料专用bom + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + + //bom信息 + @Autowired + private IPwBomNumberService pwBomNumberService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //企标单信息 + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + //零部件关联信息表 + @Autowired + private IPwModulePartService pwModulePartService; + + + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询外协合同详情信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContractDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwOutsourceContractDetail pwOutsourceContractDetail){ + startPage(); + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailList(pwOutsourceContractDetail); + + //自动修改合同状态 + if(null!=pwOutsourceContractDetail.getOutsourceContractId()){ + //根据id查询当前合同下所有的数据 + List list2 = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByOutsourceContractId(pwOutsourceContractDetail.getOutsourceContractId()); + //查询是否已全部完成 + int i = 0; + for (PwOutsourceContractDetail pwOutsourceContractDetail2 : list2) { + if(!"已完成".equals(pwOutsourceContractDetail2.getAccomplishStatus())){ + i = 1; + } + } + if(i == 0){ + //说明都已经完成,则修改合同状态 + PwOutsourceContract contract = pwOutsourceContractService.selectPwOutsourceContractById(pwOutsourceContractDetail.getOutsourceContractId()); + contract.setContractStatus("已完成"); + pwOutsourceContractService.updatePwOutsourceContract(contract); + } + } + return getDataTable(list); + } + + /** + * 导出外协合同详情信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContractDetail:export')") + @Log(title = "外协合同详情信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwOutsourceContractDetail pwOutsourceContractDetail) + { + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailList(pwOutsourceContractDetail); + ExcelUtil util = new ExcelUtil(PwOutsourceContractDetail.class); + return util.exportExcel(list, "pwOutsourceContractDetail"); + } + + /** + * 获取外协合同详情信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContractDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id)); + } + + /** + * 获取数量保存详细信息 + */ + @GetMapping(value = "/getPwBomNumberTwo/{id}") + public AjaxResult getPwBomNumberTwo(@PathVariable("id") Long id){ + //查询合同详情信息 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + + //根据令号和图号和名称查询质检单详情 + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + int i = 0; +// //计算修改入库的剩余数量 + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list) { + if(0==pwCompletionNoticeProduct.getActualQuantity()){ + i += pwCompletionNoticeProduct.getQuantity(); + }else{ + i += pwCompletionNoticeProduct.getActualQuantity(); + } + } + if(outsourceContractDetail.getQuantity()-i<0){ + outsourceContractDetail.setNumber(0L); + }else{ + outsourceContractDetail.setNumber(outsourceContractDetail.getQuantity()-i); + } + return AjaxResult.success(outsourceContractDetail); + } + + /** + * 打印单据功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据, + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdft= new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(ids.length==0){ + return AjaxResult.error("请选择物料"); + } + //返回获得到的入库单信息 + List list3 = new ArrayList(); + for (Long id : ids) { + //查询合同详情信息 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + //根据令号和合同id查询入库单信息 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndSparedFour(outsourceContractDetail.getCode(),outsourceContractDetail.getId()); + Long i = 1L; + for (ImProductReceiptMaterial productReceiptMaterial : list) { + productReceiptMaterial.setSerialNumber(i); + i++; +// list.add(productReceiptMaterial); + } + + //供应商名称 + String preferentialOriginName = ""; + //检验员 + String qualityInspector = ""; + //库管 + String kuguan = ""; + ImProductReceiptMaterial productReceiptMaterial = new ImProductReceiptMaterial(); + //遍历统计数量和金额 + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + if(null==preferentialOriginName||"".equals(preferentialOriginName)||"无".equals(preferentialOriginName)){ + if(null!=imProductReceiptMaterial.getPreferentialOriginName()){ + preferentialOriginName = imProductReceiptMaterial.getPreferentialOriginName(); + }else{ + preferentialOriginName = "无"; + } + }else{ + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if(!preferentialOriginName.equals(imProductReceiptMaterial.getPreferentialOriginName())){ + return AjaxResult.error("不同供应商不可合并打印"); + } + } + if(null!=imProductReceiptMaterial.getQualityInspector()){ + qualityInspector = imProductReceiptMaterial.getQualityInspector(); + }else{ + qualityInspector = "无"; + } + if(null!=imProductReceiptMaterial.getRecipient()){ + kuguan = imProductReceiptMaterial.getRecipient(); + }else{ + kuguan = "无"; + } + if(null==productReceiptMaterial.getActualQuantity()){ + productReceiptMaterial.setActualQuantity(0.0); + } + productReceiptMaterial.setActualQuantity(productReceiptMaterial.getActualQuantity()+imProductReceiptMaterial.getActualQuantity()); + if(null==productReceiptMaterial.getTotalPrices()){ + productReceiptMaterial.setTotalPrices(0.0); + } + DecimalFormat df = new DecimalFormat("#.00"); + productReceiptMaterial.setTotalPrices(Double.valueOf(df.format(productReceiptMaterial.getTotalPrices()+imProductReceiptMaterial.getTotalPrices()))); + } + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(productReceiptMaterial.getTotalPrices()+""); + productReceiptMaterial.setCode("合计金额:"); + productReceiptMaterial.setMaterialName(chinese); + list.add(productReceiptMaterial); + //返回获得到的入库单信息 + HashMap godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list); + //供应商 + godownMessage.put("preferentialOriginName",preferentialOriginName); + //检验员 + godownMessage.put("qualityInspector",qualityInspector); + //库管 + godownMessage.put("kuguan",kuguan); + //经办 + godownMessage.put("jingban",""); + //制单人员名称 + godownMessage.put("zhidan",user.getNickName()); + //制单日期 + godownMessage.put("zhidanDate",sdf.format(new Date())); + //编号 + godownMessage.put("number",sdft.format(new Date())); + //合计金额 + godownMessage.put("money",chinese); + //摘要 + godownMessage.put("zhaiyao"," "); + + list3.add(godownMessage); + } + + return AjaxResult.success("success",list3); + } + + /** + * 新增外协合同详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContractDetail:add')") + @Log(title = "外协合同详情信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwOutsourceContractDetail pwOutsourceContractDetail) + { + return toAjax(pwOutsourceContractDetailService.insertPwOutsourceContractDetail(pwOutsourceContractDetail)); + } + + /** + * 上传bom(派工) + */ + @RequestMapping("/uploadFiles") + @ResponseBody + public AjaxResult uploadDispatchings(@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/ruoyi/Dispatchings/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelU.readExcel(files); + for (int i = 1; i < result.size(); i++) { + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(Long.valueOf(result.get(i).get(0).toString())); + if(null!=outsourceContractDetail.getOutsourceContractId()){ + //如果已经生成的合同,则不再修改价格 + continue; + } + if(null!=outsourceContractDetail){ + outsourceContractDetail.setUnitPrice(Double.valueOf(result.get(i).get(8).toString())); + outsourceContractDetail.setTotalPrices(outsourceContractDetail.getQuantity()*outsourceContractDetail.getUnitPrice()); + outsourceContractDetail.setRemarks(result.get(i).get(10).toString()); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + } + } + }catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + + /** + * 修改外协合同详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContractDetail:edit')") + @Log(title = "外协合同详情信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwOutsourceContractDetail pwOutsourceContractDetail){ + if(pwOutsourceContractDetail.getUnitPrice()<=0){ + return AjaxResult.error("请输入正确的单价"); + } + //已经入库的不允许修改 + if(!"未完成".equals(pwOutsourceContractDetail.getAccomplishStatus())){ + return AjaxResult.error("已质检或已入库的数据不允许修改,如需修改,请撤销"); + } + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //用户昵称 + String nickName = user.getNickName(); + //修改之前查询原来的数据 + PwOutsourceContractDetail pwOutsourceContractDetail2 = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(pwOutsourceContractDetail.getId()); + //修改单价时,计算总价 + pwOutsourceContractDetail.setTotalPrices(pwOutsourceContractDetail.getUnitPrice() * pwOutsourceContractDetail.getQuantity()); + + //价格变动,给领导发送邮箱提醒 + //发送邮件通知领导 + //根据申请人名称查询 + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + //查询库管邮箱 + PwUserEmail userEmail2 = pwUserEmailService.selectPwUserEmailByName("外协价格审核"); + if(null != userEmail2){ + //拼接邮件内容 + content = "修改价格的物料:"+"\n
"+"令号:"+pwOutsourceContractDetail.getCode()+"\n
"+"物料名称:"+pwOutsourceContractDetail.getName()+ + "\n
"+"图号:"+pwOutsourceContractDetail.getFigureNumber()+"\n
"+"数量:"+pwOutsourceContractDetail.getQuantity()+ + "\n
"+"原单价:"+pwOutsourceContractDetail2.getUnitPrice()+"\n
"+"修改后单价:"+pwOutsourceContractDetail.getUnitPrice()+ + "\n
"+"原总价:"+pwOutsourceContractDetail2.getTotalPrices()+"\n
"+"修改后的总价:"+pwOutsourceContractDetail.getTotalPrices()+ + "\n
"+"修改人:"+nickName; + try { + send.sendEmail("外协修改价格通知",content,userEmail2.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + int i = pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + + //判断是否生成了合同,如果生成了合同,则需要把合同的总价也修改掉 + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(pwOutsourceContractDetail.getOutsourceContractId()); + if(null!=outsourceContract){ + //判断当前合同是否生成了发票信息 + if("是".equals(outsourceContract.getBillingInformation())){ + //说明已经开票,则不允许有任何修改与删除 + return AjaxResult.error("已经开票的合同不允许修改"); + } + //重新计算 + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByOutsourceContractId(outsourceContract.getId()); + Double s = 0.0; + for (PwOutsourceContractDetail pwOutsourceContractDetail3 : list) { + s += pwOutsourceContractDetail3.getTotalPrices(); + } + outsourceContract.setTotalPricesSmall(s); + //大写也修改掉 + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(outsourceContract.getTotalPricesSmall()+""); + outsourceContract.setTotalPricesBig(chinese); + pwOutsourceContractService.updatePwOutsourceContract(outsourceContract); + } + + return toAjax(i); + } + + /** + * 删除外协合同详情信息 TODO 删除之前,先计算合同总价,现在计算的总价,包函没有删除之前的价格 + */ + @PreAuthorize("@ss.hasPermi('management:pwOutsourceContractDetail:remove')") + @Log(title = "外协合同详情信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + int i = 0; + //删除时重新计算合同的总价 + for (Long id : ids) { + //根据id查询合同详情信息 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + //已经入库的不允许删除 + if(!"未完成".equals(outsourceContractDetail.getAccomplishStatus())&&null!=outsourceContractDetail.getAccomplishStatus()){ + return AjaxResult.error("已质检或已入库的数据不允许删除"); + } + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(outsourceContractDetail.getOutsourceContractId()); + //如果合同id不为null,则重置合同id,否则重置bom表标记 + if(null!=outsourceContract){ + //判断当前合同是否生成了发票信息 + if("是".equals(outsourceContract.getBillingInformation())){ + //说明已经开票,则不允许有任何修改与删除 + return AjaxResult.error("已经开票的合同不允许删除"); + } + //重新计算 + List list = pwOutsourceContractDetailService.selectPwOutsourceContractDetailByOutsourceContractId(outsourceContract.getId()); + Double s = 0.0; + for (PwOutsourceContractDetail pwOutsourceContractDetail3 : list) { + s += pwOutsourceContractDetail3.getTotalPrices(); + } + outsourceContract.setTotalPricesSmall(s-outsourceContractDetail.getTotalPrices()); + //大写也修改掉 + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(outsourceContract.getTotalPricesSmall()+""); + outsourceContract.setTotalPricesBig(chinese); + pwOutsourceContractService.updatePwOutsourceContract(outsourceContract); + + //重置合同id + outsourceContractDetail.setOutsourceContractId(null); + i = pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + + }else{ + if(outsourceContractDetail.getCode().contains("QB")){ + //说明是企标单 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + if(null!=makeDocumentsDetail&&"是".equals(makeDocumentsDetail.getOutsourceContratDetailId())){ + makeDocumentsDetail.setOutsourceContratDetailId("否"); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + } + }else{ + //判断bom表中的外协合同标记是否为是,如果为是,则需要修改为否 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + if(null!=pwBomNumberTwo&&"是".equals(pwBomNumberTwo.getOutsourceContratDetailId())){ + pwBomNumberTwo.setOutsourceContratDetailId("否"); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + } + i = pwOutsourceContractDetailService.deletePwOutsourceContractDetailById(id); + } + } + return toAjax(i); + } + + /** + * 查询合同详情的入库信息 + */ + @DeleteMapping("/listProductReceipt/{ids}") + public AjaxResult listProductReceipt(@PathVariable Long[] ids){ + List list = new ArrayList(); + for (Long id : ids) { + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + //根据令号和合同id查询入库单信息 + list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndSparedFour(outsourceContractDetail.getCode(),outsourceContractDetail.getId()); + //入库数量 + Long ruku = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + ruku += imProductReceiptMaterial.getReceived().longValue(); + } + //如果入库数量等于合同数量,则把合同改为已完成。完成数量改为合同数量 + if(ruku.equals(outsourceContractDetail.getQuantity())){ + if(!"已完成".equals(outsourceContractDetail.getAccomplishStatus())){ + outsourceContractDetail.setAccomplishStatus("已完成"); + outsourceContractDetail.setAccomplishQuantity(ruku); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + } + } + } + return AjaxResult.success(list); + } + + /** + * 生成外协合同 + */ + @RequestMapping("/addPwOutsourceContracts/{ids}") + public AjaxResult addPwOutsourceContracts(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //判断是否有了单价 + for (Long id : ids) { + + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + + //判断是否已经生成了合同 + if(null!=outsourceContractDetail.getOutsourceContractId()){ + return AjaxResult.error("请勿重复生成合同"); + } + + if(0==outsourceContractDetail.getUnitPrice()||null==outsourceContractDetail.getUnitPrice()||"".equals(outsourceContractDetail.getUnitPrice())){ + return AjaxResult.error("请完善单价信息"); + } + } + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); + //查询上一份合同的编号,自增1 + PwOutsourceContract pwOutsourceContract = new PwOutsourceContract(); + List list = pwOutsourceContractService.selectPwOutsourceContractList(pwOutsourceContract); + String str = ""; + if(list.size()==0){ + //创建外协合同 + //合同编号从0000001开始(999万封顶) + str = String.format("%07d", 1); + }else{ + String contractCode = list.get(0).getContractCode(); + Long valueOf = Long.valueOf(contractCode); + valueOf++; + str = String.format("%07d", valueOf); + } + //合同编号 + pwOutsourceContract.setContractCode(str); + //签订日期 + String string = sdf.format(new Date()); + try { + pwOutsourceContract.setSignDate(sdf.parse(string)); + } catch (ParseException e) { + e.printStackTrace(); + } + //完成状态(默认未完成) + pwOutsourceContract.setContractStatus("未完成"); + //扣款金额(默认为0,可以修改) + pwOutsourceContract.setWithhold(0.0); + //是否开票 默认为否 + pwOutsourceContract.setBillingInformation("否"); + //合同生成者 + pwOutsourceContract.setSparedOne(user.getNickName()); + //合同生成者的部门 + pwOutsourceContract.setSparedTwo(user.getDept().getDeptName()); + pwOutsourceContractService.insertPwOutsourceContract(pwOutsourceContract); + //记录金额 + Double d = 0.0; + for (Long id : ids) { + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + outsourceContractDetail.setOutsourceContractId(pwOutsourceContract.getId()); + //总价累计 + d += outsourceContractDetail.getTotalPrices(); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + } + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(pwOutsourceContract.getId()); + outsourceContract.setTotalPricesSmall(d); + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(outsourceContract.getTotalPricesSmall()+""); + outsourceContract.setTotalPricesBig(chinese); + int i = pwOutsourceContractService.updatePwOutsourceContract(outsourceContract); + return toAjax(i); + } + + /** + * 批量申请质检 + */ + @RequestMapping("/storageAlls/{ids}") + public AjaxResult storageAlls(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + for (Long id : ids) { + PwOutsourceContractDetail pwOutsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + //判断单价 + if("".equals(pwOutsourceContractDetail.getUnitPrice())||null==pwOutsourceContractDetail.getUnitPrice()||0==pwOutsourceContractDetail.getUnitPrice()){ + return AjaxResult.error("请完善单价信息"); + } + //判断是否完善了合同信息 + PwOutsourceContract outsourceContract = pwOutsourceContractService.selectPwOutsourceContractById(pwOutsourceContractDetail.getOutsourceContractId()); + if(null!=outsourceContract){ + //供应商信息 + if("".equals(outsourceContract.getSupplier())||null==outsourceContract.getSupplier()){ + return AjaxResult.error("请完善合同的供应商信息"); + } + //税率 + if("".equals(outsourceContract.getTaxRate())||null==outsourceContract.getSupplier()){ + return AjaxResult.error("请完善合同的税率信息"); + } + //交货方式 + if("".equals(outsourceContract.getDeliveryType())||null==outsourceContract.getDeliveryType()){ + return AjaxResult.error("请完善合同的交货方式信息"); + } + //运费支付方 + if("".equals(outsourceContract.getPayer())||null==outsourceContract.getPayer()){ + return AjaxResult.error("请完善合同的运费支付方信息"); + } + //交货地点 + if("".equals(outsourceContract.getDeliveryAddress())||null==outsourceContract.getDeliveryAddress()){ + return AjaxResult.error("请完善合同的交货地点信息"); + } + //货款支付方式 + if("".equals(outsourceContract.getModeOfPayment())||null==outsourceContract.getModeOfPayment()){ + return AjaxResult.error("请完善合同的货款支付方式信息"); + } + }else{ + return AjaxResult.error("未查询到合同信息"); + } + + if(pwOutsourceContractDetail.getCode().contains("QB")){ + //说明是企标单 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(pwOutsourceContractDetail.getCode(), pwOutsourceContractDetail.getName(), pwOutsourceContractDetail.getFigureNumber()); + //判断其物料是否已经领料(未领料或者领料数量小于入库数量的不允许入库)判断是否是第一道序,如果为第一道序,则需要根据原材料去查询领料信息,否则需要根据上一道序的物料去查询领料信息 + //判断领料的是第几道工序 + //判断当前物料是否是第一道序的物料 + String substring = makeDocumentsDetail.getFigureNumber().substring(makeDocumentsDetail.getFigureNumber().lastIndexOf("-")+1); + if(1==Integer.valueOf(substring)){ + //说明是第一道工序 + //判断当前序是否添加了原材料。如果添加了原材料则判断是否已经领料,如果未领料,则不允许申请质检 + if(null!=makeDocumentsDetail.getMaterialsName()&&!"".equals(makeDocumentsDetail.getMaterialsName())){ + //说明填写了原材料信息 + //根据物料的单据code和名称和图号查询领料信息 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(list.size()==0){ + //原材料无需判断领料数量 + return AjaxResult.error("未申请领料的不允许入库"); + } + } + }else{ + String figureNumber = makeDocumentsDetail.getFigureNumber().substring(0,makeDocumentsDetail.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //说明不是第一道工序 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), figureNumber); + if(list.size()>0){ + Long i = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + i += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断数量是否大于等于入库数量 + //查询当前需入库物料的已入库数量(包函已申请的数量) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + //已申请入库的数量 + Long p = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + p += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(i list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(cnp); + +// //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(documentsDetail2.getMakeDocumentsCode()); + int s = 0; + + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + s += pwCompletionNoticeProduct2.getActualQuantity()+pwCompletionNoticeProduct2.getConcessionQuantity()+pwCompletionNoticeProduct2.getQuantity(); + } + if(null!=documentsDetail2.getInventoryStatus()&&!"".equals(documentsDetail2.getInventoryStatus())&&!"未入库".equals(makeDocumentsDetail.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwOutsourceContractDetail.getQuantity()>makeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申请数量不可大于本批数量,已报检数量为:"+s+" 剩余可报检数量为:"+(pwOutsourceContractDetail.getQuantity()-s)); + }else{ + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //判断是否需要入库,如果需要则添加入库单,不需要则直接添加质检单 +// if("是".equals(documentsDetail2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(documentsDetail2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(documentsDetail2.getMaterialType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getQuantity()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwOutsourceContractDetail.getQuantity() == pwOutsourceContractDetail.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + documentsDetail2.setInventoryStatus("已申请"); + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(documentsDetail2); + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } +// } + //把添加入库单的id添加到质检单中 + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(documentsDetail2.getMakeDocumentsCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(documentsDetail2.getMakeDocumentsCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(documentsDetail2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(documentsDetail2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(documentsDetail2.getMaterialType()); + //单重 +// pwCompletionNoticeProduct.setPieceWeight(documentsDetail2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=documentsDetail2.getFigureNumber()&&!"009".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!"017".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!" ".equals(documentsDetail2.getFigureNumber().substring(0,2))){ + if(null!=documentsDetail2.getSuperiorId()){ + PwMakeDocumentsDetail makeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(documentsDetail2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+makeDocumentsDetail2.getMakeDocumentsCode()+"/bom/"+makeDocumentsDetail2.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+documentsDetail2.getMakeDocumentsCode()+"/bom/"+documentsDetail2.getFigureNumber().replaceAll("/", "--")+".pdf"); + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(makeDocumentsDetail.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单和质检通知单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(code); + //关联令号 + imProductReceipt.setCode(code); + //项目名称 + imProductReceipt.setProjectName(pwMakeDocuments.getName()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwMakeDocumentsDetail documentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getId()); + if(null!=documentsDetail2.getInventoryStatus()&&!"".equals(documentsDetail2.getInventoryStatus())&&!"未入库".equals(documentsDetail2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(code); + //项目名称 + pwCompletionNotice.setProjectName(pwMakeDocuments.getName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); +// if("是".equals(documentsDetail2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(documentsDetail2.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(documentsDetail2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(documentsDetail2.getMaterialType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getQuantity()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(makeDocumentsDetail.getQuantity()==makeDocumentsDetail.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + documentsDetail2.setInventoryStatus("已申请"); + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(documentsDetail2); + + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } +// } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(documentsDetail2.getMakeDocumentsCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(documentsDetail2.getMakeDocumentsCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(documentsDetail2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(documentsDetail2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(documentsDetail2.getMaterialType()); + //单重 +// pwCompletionNoticeProduct.setPieceWeight(documentsDetail2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=documentsDetail2.getFigureNumber()&&!"009".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!"017".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!" ".equals(documentsDetail2.getFigureNumber().substring(0,2))){ + if(null!=documentsDetail2.getSuperiorId()){ + PwMakeDocumentsDetail documentsDetail3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(documentsDetail2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+documentsDetail3.getMakeDocumentsCode()+"/bom/"+documentsDetail3.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+documentsDetail2.getMakeDocumentsCode()+"/bom/"+documentsDetail2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(makeDocumentsDetail.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + } + } + + }else{ + //说明是执行单 + //查询bom信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwOutsourceContractDetail.getCode(), pwOutsourceContractDetail.getName(), pwOutsourceContractDetail.getFigureNumber()); + + //判断其物料是否已经领料(未领料或者领料数量小于入库数量的不允许入库)判断是否是第一道序,如果为第一道序,则需要根据原材料去查询领料信息,否则需要根据上一道序的物料去查询领料信息 + //判断领料的是第几道工序 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + if(1==Integer.valueOf(substring)){ + //说明是第一道工序 + //判断当前序是否添加了原材料。如果添加了原材料则判断是否已经领料,如果未领料,则不允许申请质检 + if(null!=pwBomNumberTwo.getMaterialsName()&&!"".equals(pwBomNumberTwo.getMaterialsName())){ + //说明填写了原材料信息 + //根据物料的单据code和名称和图号查询领料信息 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(list.size()==0){ + //原材料无需判断领料数量 + return AjaxResult.error("未申请领料的不允许入库"); + } + } + }else{ + String figureNumber = pwBomNumberTwo.getFigureNumber().substring(0,pwBomNumberTwo.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //查询上序是否需要入库,如果上序不需要入库,则当前序不再控制必须领料后才可入库 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), figureNumber); +// if(bomNumberTwo.getGodownEntry().equals("是")){ + //说明不是第一道工序 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), figureNumber); + if(list.size()>0){ + Long i = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + i += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断数量是否大于等于入库数量 + //查询当前需入库物料的已入库数量(包函已申请的数量) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + //已申请入库的数量 + Long p = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + p += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(i list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(cnp); + +// //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(bomNumberTwo2.getProductionCode()); + int s = 0; + + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + s += pwCompletionNoticeProduct2.getActualQuantity()+pwCompletionNoticeProduct2.getConcessionQuantity()+pwCompletionNoticeProduct2.getQuantity(); + } + if(null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus())&&!"未入库".equals(pwBomNumberTwo.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwOutsourceContractDetail.getQuantity()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申请数量不可大于本批数量,已报检数量为:"+s+" 剩余可报检数量为:"+(pwOutsourceContractDetail.getQuantity()-s)); + }else{ + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //判断是否需要入库,如果需要则添加入库单,不需要则直接添加质检单 +// if("是".equals(bomNumberTwo2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getQuantity()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwOutsourceContractDetail.getQuantity() == pwOutsourceContractDetail.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } +// } + //把添加入库单的id添加到质检单中 + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwo2.getFigureNumber()&&!"009".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwo2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwo2.getSuperiorId()){ + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwo.getProductionCode()+"/bom/"+numberTwo.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwo2.getProductionCode()+"/bom/"+bomNumberTwo2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单和质检通知单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(code); + //关联令号 + imProductReceipt.setCode(code); + //项目名称 + imProductReceipt.setProjectName(pwProductionBill.getIllustrate()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + if(null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(code); + //根据生产令号查询项目名称 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + //保存项目名称 + pwCompletionNotice.setProjectName(productionBill.getProjectName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); +// if("是".equals(bomNumberTwo2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getQuantity()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwOutsourceContractDetail.getQuantity()==pwBomNumberTwo.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } +// } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwo2.getFigureNumber()&&!"009".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwo2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwo2.getSuperiorId()){ + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwo.getProductionCode()+"/bom/"+numberTwo.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwo2.getProductionCode()+"/bom/"+bomNumberTwo2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getQuantity().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + } + } + } + + } + return AjaxResult.success(); + } + + /** + * 申请质检 + */ + @RepeatSubmit + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwOutsourceContractDetail pwOutsourceContractDetail){ + if(null==pwOutsourceContractDetail.getNumber()||"".equals(pwOutsourceContractDetail.getNumber())||pwOutsourceContractDetail.getNumber()==0){ + return AjaxResult.error("请输入申请数量"); + } + if(pwOutsourceContractDetail.getQuantity() list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(list.size()==0){ + //原材料无需判断领料数量 + return AjaxResult.error("未申请领料的不允许入库"); + } + } + }else{ + String figureNumber = makeDocumentsDetail.getFigureNumber().substring(0,makeDocumentsDetail.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //查询上序是否需要入库,如果上序不需要入库,则当前序不再控制必须领料后才可入库 + PwMakeDocumentsDetail documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), figureNumber); + if("是".equals(documentsDetail.getGodownEntry())){ + //说明不是第一道工序 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), figureNumber); + if(list.size()>0){ + Long i = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + i += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断数量是否大于等于入库数量 + //查询当前需入库物料的已入库数量(包函已申请的数量) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + //已申请入库的数量 + Long p = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + p += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(i list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(cnp); + +// //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(documentsDetail2.getMakeDocumentsCode()); + int s = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + s += pwCompletionNoticeProduct2.getActualQuantity()+pwCompletionNoticeProduct2.getConcessionQuantity()+pwCompletionNoticeProduct2.getQuantity(); + } + if(null!=documentsDetail2.getInventoryStatus()&&!"".equals(documentsDetail2.getInventoryStatus())&&!"未入库".equals(makeDocumentsDetail.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwOutsourceContractDetail.getNumber()>pwOutsourceContractDetail.getQuantity()){ + return AjaxResult.error("申请数量不可大于合同数量,已报检数量为:"+s+" 剩余可报检数量为:"+(pwOutsourceContractDetail.getQuantity()-s)); + }else{ + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //判断是否需要入库,如果需要则添加入库单,不需要则直接添加质检单 + if("是".equals(documentsDetail2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(documentsDetail2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(documentsDetail2.getMaterialType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwOutsourceContractDetail.getNumber() == documentsDetail2.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + documentsDetail2.setInventoryStatus("已申请"); + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(documentsDetail2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(s+pwOutsourceContractDetail.getNumber() == pwOutsourceContractDetail.getQuantity()){ + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + }else{ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(documentsDetail2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(documentsDetail2.getMaterialType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getNumber() * pwOutsourceContractDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwOutsourceContractDetail.getNumber() == makeDocumentsDetail.getQuantity()){ + //修改预制单详情的入库状态,改为已申请 +// makeDocumentsDetail.setInventoryStatus("已申请"); +// int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + int k = pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + } + + //把添加入库单的id添加到质检单中 + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(documentsDetail2.getMakeDocumentsCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(documentsDetail2.getMakeDocumentsCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(documentsDetail2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(documentsDetail2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(documentsDetail2.getMaterialType()); + //供应商名称 + pwCompletionNoticeProduct.setPreferentialOriginName(outsourceContract.getSupplier()); + //单重 +// pwCompletionNoticeProduct.setPieceWeight(documentsDetail2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=documentsDetail2.getFigureNumber()&&!"009".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!"017".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!" ".equals(documentsDetail2.getFigureNumber().substring(0,2))){ + if(null!=documentsDetail2.getSuperiorId()){ + PwMakeDocumentsDetail makeDocumentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(documentsDetail2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+makeDocumentsDetail2.getMakeDocumentsCode()+"/bom/"+makeDocumentsDetail2.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+documentsDetail2.getMakeDocumentsCode()+"/bom/"+documentsDetail2.getFigureNumber().replaceAll("/", "--")+".pdf"); + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(makeDocumentsDetail.getGodownEntry()); + //外协合同详情id + pwCompletionNoticeProduct.setSparedFour(pwOutsourceContractDetail.getId()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单和质检通知单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(code); + //关联令号 + imProductReceipt.setCode(code); + //项目名称 + imProductReceipt.setProjectName(pwMakeDocuments.getName()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwMakeDocumentsDetail documentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getId()); + if(null!=documentsDetail2.getInventoryStatus()&&!"".equals(documentsDetail2.getInventoryStatus())&&!"未入库".equals(documentsDetail2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(code); + //项目名称 + pwCompletionNotice.setProjectName(pwMakeDocuments.getName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + if("是".equals(documentsDetail2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(documentsDetail2.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(documentsDetail2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(documentsDetail2.getMaterialType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwOutsourceContractDetail.getNumber()==makeDocumentsDetail.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + documentsDetail2.setInventoryStatus("已申请"); + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(documentsDetail2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(pwOutsourceContractDetail.getNumber()==pwOutsourceContractDetail.getQuantity()){ + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + }else{ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(documentsDetail2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(documentsDetail2.getMaterialType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getNumber() * pwOutsourceContractDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwOutsourceContractDetail.getNumber()==makeDocumentsDetail.getQuantity()){ + //修改bom单详情的入库状态,改为已申请 + documentsDetail2.setInventoryStatus("已申请"); + int k = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(documentsDetail2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(pwOutsourceContractDetail.getNumber()==pwOutsourceContractDetail.getQuantity()){ + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(documentsDetail2.getMakeDocumentsCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(documentsDetail2.getMakeDocumentsCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(documentsDetail2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(documentsDetail2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(documentsDetail2.getMaterialType()); + //供应商名称 + pwCompletionNoticeProduct.setPreferentialOriginName(outsourceContract.getSupplier()); + //单重 +// pwCompletionNoticeProduct.setPieceWeight(documentsDetail2.getPieceWeight()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=documentsDetail2.getFigureNumber()&&!"009".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!"017".equals(documentsDetail2.getFigureNumber().substring(0,3))&&!" ".equals(documentsDetail2.getFigureNumber().substring(0,2))){ + if(null!=documentsDetail2.getSuperiorId()){ + PwMakeDocumentsDetail documentsDetail3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(documentsDetail2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+documentsDetail3.getMakeDocumentsCode()+"/bom/"+documentsDetail3.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8908/yzpdf/"+documentsDetail2.getMakeDocumentsCode()+"/bom/"+documentsDetail2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(makeDocumentsDetail.getGodownEntry()); + //外协合同详情id + pwCompletionNoticeProduct.setSparedFour(pwOutsourceContractDetail.getId()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + } + } + + }else{ + //说明是执行单 + //查询bom信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwOutsourceContractDetail.getCode(), pwOutsourceContractDetail.getName(), pwOutsourceContractDetail.getFigureNumber()); + + //判断其物料是否已经领料(未领料或者领料数量小于入库数量的不允许入库)判断是否是第一道序,如果为第一道序,则需要根据原材料去查询领料信息,否则需要根据上一道序的物料去查询领料信息 + //判断领料的是第几道工序 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + if(1==Integer.valueOf(substring)){ + //说明是第一道工序 + //判断当前序是否添加了原材料。如果添加了原材料则判断是否已经领料,如果未领料,则不允许申请质检 + if(null!=pwBomNumberTwo.getMaterialsName()&&!"".equals(pwBomNumberTwo.getMaterialsName())){ + //说明填写了原材料信息 + //根据物料的单据code和名称和图号查询领料信息 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(list.size()==0){ + //原材料无需判断领料数量 + return AjaxResult.error("未申请领料的不允许入库"); + } + } + }else{ + String figureNumber = pwBomNumberTwo.getFigureNumber().substring(0,pwBomNumberTwo.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + //查询上序是否需要入库,如果上序不需要入库,则当前序不再控制必须领料后才可入库 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), figureNumber); + if("是".equals(bomNumberTwo.getGodownEntry())){ + //说明不是第一道工序 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), figureNumber); + if(list.size()>0){ + Long i = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + i += imStockRequisitionMaterial.getAlreadyQuantity(); + } + //判断数量是否大于等于入库数量 + //查询当前需入库物料的已入库数量(包函已申请的数量) + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + //已申请入库的数量 + Long p = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + p += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(i list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductList(cnp); + +// //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(bomNumberTwo2.getProductionCode()); + int s = 0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct2 : list) { + s += pwCompletionNoticeProduct2.getActualQuantity()+pwCompletionNoticeProduct2.getConcessionQuantity()+pwCompletionNoticeProduct2.getQuantity(); + } + if(null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwOutsourceContractDetail.getNumber()>bomNumberTwo2.getSumNumber()){ + return AjaxResult.error("申请数量不可大于本批数量,已报检数量为:"+s+" 剩余可报检数量为:"+(pwOutsourceContractDetail.getQuantity()-s)); + }else{ + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //判断是否需要入库,如果需要则添加入库单,不需要则直接添加质检单 + if("是".equals(bomNumberTwo2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //申请数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwOutsourceContractDetail.getNumber() == bomNumberTwo2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(s+pwOutsourceContractDetail.getNumber() == pwOutsourceContractDetail.getQuantity()){ + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + }else{ + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getNumber() * pwOutsourceContractDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwOutsourceContractDetail.getNumber() == bomNumberTwo2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(s+pwOutsourceContractDetail.getNumber() == pwOutsourceContractDetail.getQuantity()){ + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + } + + + //把添加入库单的id添加到质检单中 + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + //供应商名称 + pwCompletionNoticeProduct.setPreferentialOriginName(outsourceContract.getSupplier()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwo2.getFigureNumber()&&!"009".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwo2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwo2.getSuperiorId()){ + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwo.getProductionCode()+"/bom/"+numberTwo.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwo2.getProductionCode()+"/bom/"+bomNumberTwo2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + //外协合同详情id + pwCompletionNoticeProduct.setSparedFour(pwOutsourceContractDetail.getId()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单和质检通知单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(code); + //关联令号 + imProductReceipt.setCode(code); + //项目名称 + imProductReceipt.setProjectName(pwProductionBill.getIllustrate()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //添加入库单详情 + //根据id查询需要入库的物料详情 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(pwBomNumberTwo.getId()); + if(null!=bomNumberTwo2.getInventoryStatus()&&!"".equals(bomNumberTwo2.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(code); + //根据生产令号查询项目名称 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + //保存项目名称 + pwCompletionNotice.setProjectName(productionBill.getProjectName()); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(j<1){ + return AjaxResult.error("申请入库失败"); + } + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + if("是".equals(bomNumberTwo2.getGodownEntry())){ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getUnitPrice()*pwOutsourceContractDetail.getNumber()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwOutsourceContractDetail.getNumber() == bomNumberTwo2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(pwOutsourceContractDetail.getNumber() == pwOutsourceContractDetail.getQuantity()){ + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + }else{ + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(bomNumberTwo2.getName()); + //图号 + imProductReceiptMaterial.setSpecification(bomNumberTwo2.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(bomNumberTwo2.getType()); + if(null!=imMaterial){ + //收货仓库名称 + imProductReceiptMaterial.setWarehouseName(imMaterial.getWarehouseName()); + } + //供应商名称 + imProductReceiptMaterial.setPreferentialOriginName(outsourceContract.getSupplier()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwOutsourceContractDetail.getUnitPrice()); + + //未税单价 + //计算税率 + double d = outsourceContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwOutsourceContractDetail.getNumber() * pwOutsourceContractDetail.getUnitPrice()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + //虚拟入库标记 + imProductReceiptMaterial.setRecipient("虚拟入库"); + //外协合同详情id + imProductReceiptMaterial.setSparedFour(pwOutsourceContractDetail.getId()); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + if(pwOutsourceContractDetail.getNumber() == bomNumberTwo2.getSumNumber()){ + //修改bom单详情的入库状态,改为已申请 + bomNumberTwo2.setInventoryStatus("已申请"); + int k = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo2); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(pwOutsourceContractDetail.getNumber() == pwOutsourceContractDetail.getQuantity()){ + pwOutsourceContractDetail.setAccomplishStatus("已申请"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(bomNumberTwo2.getProductionCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(bomNumberTwo2.getProductionCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(bomNumberTwo2.getName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(bomNumberTwo2.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(bomNumberTwo2.getType()); + //单重 + pwCompletionNoticeProduct.setPieceWeight(bomNumberTwo2.getPieceWeight()); + //供应商名称 + pwCompletionNoticeProduct.setPreferentialOriginName(outsourceContract.getSupplier()); + + //判断是否是有图纸的物料 + //判断物料是否有上级,如果有上级,则把上级的图号和名称加入到图片地址中(上级代表序的上级,不代表零件的上级,零件的上级为部件) + if(null!=bomNumberTwo2.getFigureNumber()&&!"009".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!"017".equals(bomNumberTwo2.getFigureNumber().substring(0,3))&&!" ".equals(bomNumberTwo2.getFigureNumber().substring(0,2))){ + if(null!=bomNumberTwo2.getSuperiorId()){ + PwBomNumberTwo numberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo2.getSuperiorId()); + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+numberTwo.getProductionCode()+"/bom/"+numberTwo.getFigureNumber().replaceAll("/", "--")+".pdf"); + }else{ + //http://localhost:8903/product/'+scope.row.productionCode+'/bom/'+scope.row.figureNumber.replaceAll('/','--')+'.pdf + pwCompletionNoticeProduct.setPicture("http://localhost:8903/product/"+bomNumberTwo2.getProductionCode()+"/bom/"+bomNumberTwo2.getFigureNumber().replaceAll("/", "--")+".pdf"); + + } + } + + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwOutsourceContractDetail.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + //外协合同详情id + pwCompletionNoticeProduct.setSparedFour(pwOutsourceContractDetail.getId()); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待质检",pwCompletionNoticeProduct.getCode(),pwCompletionNoticeProduct.getProductName(),pwCompletionNoticeProduct.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + } + } + } + + return toAjax(200); + } + + /** + * 毛坯物料申请领料 + */ + @RequestMapping("/getWorkblanks") + public AjaxResult getWorkblanks(@RequestBody PwOutsourceContractDetail pwOutsourceContractDetail){ + //判断领料数量 + if(0==pwOutsourceContractDetail.getLingliaoNumber()||"".equals(pwOutsourceContractDetail.getLingliaoNumber())||null==pwOutsourceContractDetail.getLingliaoNumber()){ + return AjaxResult.error("请输入领料数量"); + } + if(pwOutsourceContractDetail.getQuantity() list2 = new ArrayList(); + if(1==Integer.valueOf(substring)){ + if("部件".equals(documentsDetail.getMaterialType())||"组件".equals(documentsDetail.getMaterialType())){ + //根据superior_id查询上级物料信息 + PwMakeDocumentsDetail documentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(documentsDetail.getSuperiorId()); + //如果需领物料为部件,则查询当前部件下所有的零件,领料数量*单台数量 + //查询当前部件下的零件 + list2 = pwModulePartService.selectPwModulePartByMaterialNameAndFigureNumber(documentsDetail2.getName(),documentsDetail2.getFigureNumber()); + }else{ + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(documentsDetail.getMaterialsName(), documentsDetail.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + documentsDetail.setName(documentsDetail.getMaterialsName()); + documentsDetail.setFigureNumber(documentsDetail.getMaterialsSpecification()); + + //获取当前物料的信息(如果物料的级别尺寸和残料尺寸大于0,则计算需要多少数量) + if(null!=material.getRankMeasure()&&material.getRankMeasure()>0&&null!=material.getDefectiveMaterialMeasure()&&material.getDefectiveMaterialMeasure()>0){ + //说明设置了级别尺寸和残料尺寸 + //总长度除以下料尺寸长度= 一支能出几件毛坯的数量(向下取整) + //毛坯数量除以一支出的毛坯数量 = 需要出料的数量(小数向上取整)如果为整数则该领料数量为当前数量,如果为小数,则向上取整 + }else{ + makeDocumentsDetail.setLingliaoNumber(documentsDetail.getWorkblank()*Long.valueOf(documentsDetail.getMeasure())); + } + } + } + }else{ + String figureNumber = makeDocumentsDetail.getFigureNumber().substring(0,makeDocumentsDetail.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + documentsDetail.setFigureNumber(figureNumber); + } + + if(list2.size()>0){ + //根据code查询领料单的申领数量 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(pwOutsourceContractDetail.getCode()); + if(null!=stockRequisition){ + //判断领料状态是否是1 + if(null!=makeDocumentsDetail.getSparedFour()&&makeDocumentsDetail.getSparedFour()==1){ + return AjaxResult.error("已申请,无需重复申请"); + }else{ + if(null==makeDocumentsDetail.getSparedThree()){ + makeDocumentsDetail.setSparedThree(0L); + } + if(pwOutsourceContractDetail.getLingliaoNumber()+makeDocumentsDetail.getSparedThree()>makeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申请数量不可大于本批数量,已申请数量为:"+makeDocumentsDetail.getSparedThree()+",剩余可申领数量为:"+(makeDocumentsDetail.getQuantity()-makeDocumentsDetail.getSparedThree())); + } + //说明有零件可以领 + for (PwModulePart pwModulePart : list2) { + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + + //判断领用的原材料信息是否充足 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()>inventoryDetail.getQuantity()){ + return AjaxResult.error("领料数量不可以大于库存数量,"+material.getMaterialName()+"的当前库存数量为:"+inventoryDetail.getQuantity()); + } + + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwOutsourceContractDetail.getCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwModulePart.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwModulePart.getSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwOutsourceContractDetail.getCode()); + imStockRequisitionMaterial.setSparedThree(makeDocumentsDetail.getId()); + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + } + //判断领料数量是否已等于本批数量 + if(pwOutsourceContractDetail.getLingliaoNumber()+makeDocumentsDetail.getSparedThree()==makeDocumentsDetail.getQuantity()){ + //修改领料状态为1 + makeDocumentsDetail.setSparedFour(1L); + }else{ + makeDocumentsDetail.setSparedThree(makeDocumentsDetail.getSparedThree()+pwOutsourceContractDetail.getLingliaoNumber()); + } + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + } + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //根据执行单号获取企标单信息 + PwMakeDocuments pwMakeDocuments = pwMakeDocumentsService.selectPwMakeDocumentsByCode(pwOutsourceContractDetail.getCode()); + //关联单据(执行单code) + imStockRequisition.setCode(pwOutsourceContractDetail.getCode()); + //项目名称 + imStockRequisition.setProjectName(pwMakeDocuments.getName()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + if(null==makeDocumentsDetail.getSparedThree()){ + makeDocumentsDetail.setSparedThree(0L); + } + if(pwOutsourceContractDetail.getLingliaoNumber()+makeDocumentsDetail.getSparedThree()>makeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申请数量不可大于本批数量,已申请数量为:"+makeDocumentsDetail.getSparedThree()+",剩余可申领数量为:"+(makeDocumentsDetail.getQuantity()-makeDocumentsDetail.getSparedThree())); + } + for (PwModulePart pwModulePart : list2) { + + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwOutsourceContractDetail.getCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + + //判断领用的原材料信息是否充足 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(material.getMaterialName(), material.getFigureNumber()); + if(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()>inventoryDetail.getQuantity()){ + return AjaxResult.error("领料数量不可以大于库存数量,"+material.getMaterialName()+"的当前库存数量为:"+inventoryDetail.getQuantity()); + } + + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwModulePart.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwModulePart.getSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()*pwModulePart.getNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwOutsourceContractDetail.getCode()); + imStockRequisitionMaterial.setSparedThree(makeDocumentsDetail.getId()); + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + //判断领料数量是否已等于本批数量 + if(pwOutsourceContractDetail.getLingliaoNumber()+makeDocumentsDetail.getSparedThree()==makeDocumentsDetail.getQuantity()){ + //修改领料状态为1 + makeDocumentsDetail.setSparedFour(1L); + }else{ + makeDocumentsDetail.setSparedThree(makeDocumentsDetail.getSparedThree()+makeDocumentsDetail.getLingliaoNumber()); + } + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + } + }else{ + //说明是零件领料 + //根据code查询领料单的申领数量 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(makeDocumentsDetail.getMakeDocumentsCode()); + if(null!=stockRequisition){ + Long s = 0L; + //如果为第一序,则查询时需要带上名称 + if(1==Integer.valueOf(substring)){ + //根据图号和code查询 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),makeDocumentsDetail.getMaterialsName(),makeDocumentsDetail.getMaterialsSpecification()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + }else{ + //根据图号和code查询 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(),documentsDetail.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + } + //分序判断 + if(1==Integer.valueOf(substring)){ + //判断数量是否已经超了本批数量 + //判断数量是否已经超了本批数量 + if(s+pwOutsourceContractDetail.getLingliaoNumber()>makeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申领数量不可大于本批数量"); + } + //判断领料状态是否是1 +// if(null!=makeDocumentsDetail.getSparedFour()&&makeDocumentsDetail.getSparedFour()==1){ +// return AjaxResult.error("已申请,无需重复申请"); +// } + else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(makeDocumentsDetail.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(makeDocumentsDetail.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwMakeDocumentsDetail documentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), documentsDetail.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(documentsDetail2.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(documentsDetail2.getMaterialType()); + //单重 +// imStockRequisitionMaterial.setPieceWeight(documentsDetail2.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(makeDocumentsDetail.getMakeDocumentsCode()); + imStockRequisitionMaterial.setSparedThree(makeDocumentsDetail.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + /*if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getLingliaoNumber()); + }*/ + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //修改领料状态为1 + makeDocumentsDetail.setSparedFour(1L); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + }else{ + //判断数量是否已经超了本批数量 + if(s+pwOutsourceContractDetail.getLingliaoNumber()>makeDocumentsDetail.getQuantity()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(makeDocumentsDetail.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(makeDocumentsDetail.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwMakeDocumentsDetail documentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), documentsDetail.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(documentsDetail2.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(documentsDetail2.getMaterialType()); + //单重 +// imStockRequisitionMaterial.setPieceWeight(documentsDetail2.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(makeDocumentsDetail.getMakeDocumentsCode()); + imStockRequisitionMaterial.setSparedThree(makeDocumentsDetail.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + } + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //项目名称 +// imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(makeDocumentsDetail.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //申领数量 +// imStockRequisition.setSparedThree(pwBomNumberTwo.getShuliang()); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(makeDocumentsDetail.getMakeDocumentsCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(makeDocumentsDetail.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(makeDocumentsDetail.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + } + //修改领料状态为1 + makeDocumentsDetail.setSparedFour(1L); + pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + }else{ + //查找当前物料的上一道序的物料 + PwMakeDocumentsDetail documentsDetail2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), documentsDetail.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(documentsDetail2.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(documentsDetail2.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(documentsDetail2.getMaterialType()); + //单重 +// imStockRequisitionMaterial.setPieceWeight(documentsDetail2.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + } + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(makeDocumentsDetail.getMakeDocumentsCode()); + imStockRequisitionMaterial.setSparedThree(makeDocumentsDetail.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + }else{ + //说明是执行单 + //查询bom信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwOutsourceContractDetail.getCode(), pwOutsourceContractDetail.getName(), pwOutsourceContractDetail.getFigureNumber()); + //判断上序是否需要入库,如果上序不需要入库,则当前序不需要领料 + //判断当前物料是否是第一道序的物料 + String substring = pwBomNumberTwo.getFigureNumber().substring(pwBomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1 list2 = new ArrayList(); + if(1==Integer.valueOf(substring)){ + if("部件".equals(bomNumberTwo.getType())||"组件".equals(bomNumberTwo.getType())){ + //根据superior_id查询上级物料信息 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo.getSuperiorId()); + //如果需领物料为部件,则查询当前部件下所有的零件,领料数量*单台数量 + list2 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(bomNumberTwo2.getFigureNumber(), bomNumberTwo2.getSparedOne(), code); + }else{ + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(bomNumberTwo.getMaterialsName(), bomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + bomNumberTwo.setName(bomNumberTwo.getMaterialsName()); + bomNumberTwo.setFigureNumber(bomNumberTwo.getMaterialsSpecification()); + + //获取当前物料的信息(如果物料的级别尺寸和残料尺寸大于0,则计算需要多少数量) + if(null!=material.getRankMeasure()&&material.getRankMeasure()>0&&null!=material.getDefectiveMaterialMeasure()&&material.getDefectiveMaterialMeasure()>0){ + //说明设置了级别尺寸和残料尺寸 + //总长度除以下料尺寸长度= 一支能出几件毛坯的数量(向下取整) + //毛坯数量除以一支出的毛坯数量 = 需要出料的数量(小数向上取整)如果为整数则该领料数量为当前数量,如果为小数,则向上取整 + }else{ + pwBomNumberTwo.setLingliaoNumber(bomNumberTwo.getWorkblank()*Long.valueOf(bomNumberTwo.getMeasure())); + } + } + } + }else{ + String figureNumber = pwBomNumberTwo.getFigureNumber().substring(0,pwBomNumberTwo.getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + bomNumberTwo.setFigureNumber(figureNumber); + } + + if(list2.size()>0){ + + for (PwBomNumber pwBomNumber : list2) { + //计算本次领料的数量 + Long number = pwBomNumber.getOneNumber()*pwOutsourceContractDetail.getLingliaoNumber(); + + //库存是否满足本次领料标记 TODO 返回库存数量不够的数据 + List list7 = new ArrayList(); + //判断数量是否充足 + int a = 0; + //先查询库存数量是否够本次领料的数量,如果不够,则不允许申请领 + //根据code和名称和图号查询 + int t = 0; + //根据物料名称和图号和令号查询bomTwo + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwBomNumber.getProductionCode(), pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + //根据当前物料id查询子集工序 + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumber.getProductionCode(), bomNumberTwo2.getId()); + /*if(list3.size()>0&&("装配车间".equals(list3.get(list3.size()-1).getDepartmentName())||"企标工段".equals(list3.get(list3.size()-1).getDepartmentName())||"销齿链组".equals(list3.get(list3.size()-1).getDepartmentName()))||"非标设备组".equals(list3.get(list3.size()-1).getDepartmentName())||"综合工段".equals(list3.get(list3.size()-1).getDepartmentName())){ + t = 1; + }*/ + if(t!=1&&(!"部件".equals(bomNumberTwo2.getType())&&!"是".equals(bomNumberTwo2.getTheoretical()))&& null != bomNumberTwo2.getName() && !bomNumberTwo2.getName().contains("木箱")){ + //根据物料名称和图号查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(bomNumberTwo2.getName(), bomNumberTwo2.getFigureNumber()); + if(inventoryDetail.getQuantity() list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumber.getName(),pwBomNumber.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + //判断数量是否已经超了本批数量 + if(s+number>pwOutsourceContractDetail.getQuantity()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumber.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumber.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumber.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumber.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(number); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(number); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(number); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + + }else{ + if(number>pwOutsourceContractDetail.getQuantity()){ + return AjaxResult.error("申领数量不可大于本批数量"); + } + //说明此单据之前没有领过料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwBomNumberTwo.getProductionCode()); + //项目名称 + imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(pwBomNumberTwo.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //申领数量 + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumber.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumber.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumber.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumber.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(number); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(number); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(number); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + }else{ + //说明是零件领料 + //根据code查询领料单的申领数量 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCodeAndTypeName(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getSparedOne()); + if(null!=stockRequisition){ + Long s = 0L; + //如果为第一序,则查询时需要带上名称 + if(1==Integer.valueOf(substring)){ + //根据图号和code查询 +// List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { +// s += imStockRequisitionMaterial.getApplyForQuantity(); +// } + }else{ + //根据图号和code查询 + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(),bomNumberTwo.getFigureNumber()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + s += imStockRequisitionMaterial.getApplyForQuantity(); + } + } + //分序判断 + if(1==Integer.valueOf(substring)){ + //判断数量是否已经超了本批数量 + //判断领料状态是否是1 + if(null!=pwBomNumberTwo.getSparedFour()&&pwBomNumberTwo.getSparedFour()==1){ + return AjaxResult.error("已申请,无需重复申请"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwo bomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), bomNumberTwo.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwos.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwos.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwos.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwos.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //修改领料状态为1 + pwBomNumberTwo.setSparedFour(1L); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + }else{ + //判断数量是否已经超了本批数量 + if(s+pwOutsourceContractDetail.getLingliaoNumber()>pwBomNumberTwo.getSumNumber()){ + return AjaxResult.error("申领数量不可大于本批数量"); + }else{ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwo bomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), bomNumberTwo.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwos.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwos.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwos.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwos.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + } + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + + } + } + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwBomNumberTwo.getProductionCode()); + //项目名称 + imStockRequisition.setProjectName(pwProductionBill.getProjectName()); + //产品型号 + imStockRequisition.setTypeName(pwBomNumberTwo.getSparedOne()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + //申领数量 +// imStockRequisition.setSparedThree(pwBomNumberTwo.getShuliang()); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwBomNumberTwo.getProductionCode()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + if(null!=outsourceContract){ + //领料供应商 + imStockRequisitionMaterial.setSparedOne(outsourceContract.getSupplier()); + }else{ + return AjaxResult.error("请完善合同信息"); + } + if(1==Integer.valueOf(substring)){ + //查询原材料信息 + //根据物料名称和物料图号查询物料 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getMaterialsName(), pwBomNumberTwo.getMaterialsSpecification()); + if(null == material){ + //说明没有添加原材料信息 + return AjaxResult.error("未查询到需要领用的物料信息"); + }else{ + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwo.getMaterialsName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwo.getMaterialsSpecification()); + //材料 + imStockRequisitionMaterial.setMaterials(material.getMaterials()); + //单重 + imStockRequisitionMaterial.setPieceWeight(material.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + } + //修改领料状态为1 + pwBomNumberTwo.setSparedFour(1L); + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + }else{ + //查找当前物料的上一道序的物料 + PwBomNumberTwo bomNumberTwos = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndFigureNumber(pwBomNumberTwo.getProductionCode(), bomNumberTwo.getFigureNumber()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(bomNumberTwos.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(bomNumberTwos.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(bomNumberTwos.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(bomNumberTwos.getPieceWeight()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwOutsourceContractDetail.getLingliaoNumber()); + } + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwOutsourceContractDetail.getLingliaoNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + //领料标识 + imStockRequisitionMaterial.setSparedTwo(pwBomNumberTwo.getProductionCode()); + imStockRequisitionMaterial.setSparedThree(pwBomNumberTwo.getId()); + + //申请领料成功后,增加其在途数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + if(1==Integer.valueOf(substring)){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getQuantity()); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwOutsourceContractDetail.getLingliaoNumber()); + } + }else{ + return AjaxResult.error("未查询到库存信息"); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("物料待出库",imStockRequisitionMaterial.getCode(),imStockRequisitionMaterial.getMaterialName(),imStockRequisitionMaterial.getFigureNumber(),user.getNickName(),"库管","审核出库","物料出库管理","/inventory/imStockRequisitionMaterial?id="+imStockRequisitionMaterial.getStockRequisitionId()); + } + } + } + + return toAjax(i); + } + + /** + * 撤销申请质检按钮 + */ + @DeleteMapping("/revocationBoms/{ids}") + public AjaxResult revocationBoms(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + + if(outsourceContractDetail.getCode().contains("QB")){ + //说明是企标单 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + + //根据物料名称和图号和令号查找此物料最近一次申请的质检信息 + int a = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + if(a==0){ + return AjaxResult.error("当前物料未申请质检,无需撤销"); + } + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById((long)a); + //判断是否已经质检,如果已经质检则需要查询入库信息,并退库,如果没有质检,则直接删除质检详情信息,然后把状态改为null + if(completionNoticeProduct.getCheckoutStatus().equals("已检验")||completionNoticeProduct.getCheckoutStatus().equals("正在检验")){ + return AjaxResult.error("已检验的物料不允许撤销"); + }else{ + //根据物料名称和图号和令号查询入库单详情信息,距离当前时间最近的一条数据 + //先查询是否有数据 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + if(list.size()>0){ + int b = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(), makeDocumentsDetail.getFigureNumber()); + ImProductReceiptMaterial receiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById((long)b); + //判断当前数据是否已经确认入库,如果确认入库则需要退库 + if(receiptMaterial.getInventoryStatus().equals("已入库")){ + //已经确认入库的则不允许撤销 + return AjaxResult.error("已经确认入库的物料不允许撤销"); + } + //删除当前数据 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(receiptMaterial.getId()); + } + } + pwCompletionNoticeProductService.deletePwCompletionNoticeProductById(completionNoticeProduct.getId()); + + //修改点件表的物料入库状态 + makeDocumentsDetail.setInventoryStatus(null); + //修改外协合同详情信息的状态 + outsourceContractDetail.setAccomplishStatus("未完成"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + i = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + }else{ + //说明是执行单 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + //根据物料名称和图号和令号查找此物料最近一次申请的质检信息 + int a = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + if(a==0){ + return AjaxResult.error("当前物料未申请质检,无需撤销"); + } + PwCompletionNoticeProduct completionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById((long)a); + //判断是否已经质检,如果已经质检则需要查询入库信息,并退库,如果没有质检,则直接删除质检详情信息,然后把状态改为null + if(completionNoticeProduct.getCheckoutStatus().equals("已检验")||completionNoticeProduct.getCheckoutStatus().equals("正在检验")){ + return AjaxResult.error("已检验的物料不允许撤销"); + }else{ + //根据物料名称和图号和令号查询入库单详情信息,距离当前时间最近的一条数据 + //先查询是否有数据 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + if(list.size()>0){ + int b = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(bomNumberTwo.getProductionCode(), bomNumberTwo.getName(), bomNumberTwo.getFigureNumber()); + ImProductReceiptMaterial receiptMaterial = imProductReceiptMaterialService.selectImProductReceiptMaterialById((long)b); + //判断当前数据是否已经确认入库,如果确认入库则需要退库 + if(receiptMaterial.getInventoryStatus().equals("已入库")){ + //已经确认入库的则不允许撤销 + return AjaxResult.error("已经确认入库的物料不允许撤销"); + } + //删除当前数据 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(receiptMaterial.getId()); + } + } + pwCompletionNoticeProductService.deletePwCompletionNoticeProductById(completionNoticeProduct.getId()); + + //修改点件表的物料入库状态 + bomNumberTwo.setInventoryStatus(null); + //修改外协合同详情信息的状态 + outsourceContractDetail.setAccomplishStatus("未完成"); + pwOutsourceContractDetailService.updatePwOutsourceContractDetail(outsourceContractDetail); + i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + } + + } + return toAjax(i); + } + + /** + * 撤销申请领料按钮 + */ + @DeleteMapping("/revocationLingliaos/{ids}") + public AjaxResult revocationLingliaos(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id获取物料信息 + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + if(outsourceContractDetail.getCode().contains("QB")){ + //根据id获取物料信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + //图号 + String figureNumber = makeDocumentsDetail.getFigureNumber(); + //判断当前物料是否已经出库 + //判断是第几道序,如果是第一道序,则根据原材料名称和图号和令号查询,如果不是第一道序,则根据令号和图号查询 + //判断当前物料是否是第一道序的物料 + String substring = makeDocumentsDetail.getFigureNumber().substring(makeDocumentsDetail.getFigureNumber().lastIndexOf("-")+1); + List list = new ArrayList(); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1==Integer.valueOf(substring)){ + if("部件".equals(makeDocumentsDetail.getMaterialType())||"组件".equals(makeDocumentsDetail.getMaterialType())){ + //说明是部件或者是成品则查询零件的领用信息 + //查询父级的信息 + PwMakeDocumentsDetail documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + //查询当前部件下的零件 + List list2 = pwModulePartService.selectPwModulePartByMaterialNameAndFigureNumber(documentsDetail.getName(),documentsDetail.getFigureNumber()); + //是否可以删除标记 + int e = 0; + for (PwModulePart pwModulePart : list2) { + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(makeDocumentsDetail.getMakeDocumentsCode(), pwModulePart.getName(), pwModulePart.getSpecification(), makeDocumentsDetail.getId()); + if(list3.size()<1){ + return AjaxResult.error("已全部撤销领料条目"); + } + if(!"未出库".equals(list3.get(list3.size()-1).getGetStatus())){ + //说明已经出库,则不允许删除 + e = 1; + } + } + if(e == 1){ + return AjaxResult.error("已出库的物料不允许撤销申请领料!"); + }else{ + //删除 + for (PwModulePart pwModulePart : list2) { + List list3 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(makeDocumentsDetail.getMakeDocumentsCode(), pwModulePart.getName(), pwModulePart.getSpecification(), makeDocumentsDetail.getId()); + i = iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(list3.get(list3.size()-1).getId()); + } + return AjaxResult.success(i); + } + + }else{ + //如果是零件,则查询原材料领用信息 + list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); + } + }else{ + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber.substring(0,figureNumber.lastIndexOf("-"))+"-"+s; + list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), figureNumber); + } + + if(list.size()>0){ + ImStockRequisitionMaterial imStockRequisitionMaterial = list.get(list.size()-1); + if("未出库".equals(imStockRequisitionMaterial.getGetStatus())){ + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + if(null!=makeDocumentsDetail.getSparedThree()){ + if(makeDocumentsDetail.getSparedThree()-imStockRequisitionMaterial.getSalaryQuantity()<0){ + //修改已领数量 + makeDocumentsDetail.setSparedThree(0L); + }else{ + //修改已领数量 + makeDocumentsDetail.setSparedThree(makeDocumentsDetail.getSparedThree()-imStockRequisitionMaterial.getSalaryQuantity()); + } + } + //修改领料状态 + makeDocumentsDetail.setSparedFour(0L); + i = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); + }else{ + return AjaxResult.error("已入库的不允许撤销"); + } + } + + +// +// //说明是企标单 +// PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); +// //图号 +// String figureNumber = makeDocumentsDetail.getFigureNumber(); +// //判断当前物料是否已经出库 +// //判断是第几道序,如果是第一道序,则根据原材料名称和图号和令号查询,如果不是第一道序,则根据令号和图号查询 +// //判断当前物料是否是第一道序的物料 +// String substring = makeDocumentsDetail.getFigureNumber().substring(makeDocumentsDetail.getFigureNumber().lastIndexOf("-")+1); +// //除第一道序之外的所有序都要获取其上一道序的信息 +// if(1==Integer.valueOf(substring)){ +// List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsName(), makeDocumentsDetail.getMaterialsSpecification()); +// int f = 0; +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { +// if(imStockRequisitionMaterial.getGetStatus().equals("已出库")){ +// f = 1; +// } +// } +// if(f == 1){ +// return AjaxResult.error("已出库的物料不允许撤销"); +// }else{ +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { +// //直接删除 +// iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); +// } +// if(null!=makeDocumentsDetail.getMaterialIdTwo()){ +// List list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsNameTwo(), makeDocumentsDetail.getMaterialsSpecificationTwo()); +// for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { +// //直接删除 +// iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); +// } +// } +// } +// //修改领料状态 +// makeDocumentsDetail.setSparedFour(0L); +// i = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); +// }else{ +// Integer s = Integer.valueOf(substring)-1; +// String figureNumbers = makeDocumentsDetail.getFigureNumber().substring(0,makeDocumentsDetail.getFigureNumber().lastIndexOf("-")); +// figureNumber = figureNumbers+"-"+s; +// List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), figureNumber); +// if(list.size()>0){ +// ImStockRequisitionMaterial imStockRequisitionMaterial = list.get(list.size()-1); +// if(imStockRequisitionMaterial.getGetStatus().equals("未出库")){ +// //直接删除 +// iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); +// //修改领料状态 +// makeDocumentsDetail.setSparedFour(0L); +// i = pwMakeDocumentsDetailService.updatePwMakeDocumentsDetail(makeDocumentsDetail); +// }else{ +// return AjaxResult.error("已入库的不允许撤销"); +// } +// } +// } + }else{ + //说明是执行单 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + //图号 + String figureNumber = bomNumberTwo.getFigureNumber(); + //判断当前物料是否已经出库 + //判断是第几道序,如果是第一道序,则根据原材料名称和图号和令号查询,如果不是第一道序,则根据令号和图号查询 + //判断当前物料是否是第一道序的物料 + String substring = bomNumberTwo.getFigureNumber().substring(bomNumberTwo.getFigureNumber().lastIndexOf("-")+1); + //除第一道序之外的所有序都要获取其上一道序的信息 + if(1==Integer.valueOf(substring)){ + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getMaterialsName(), bomNumberTwo.getMaterialsSpecification()); + int f = 0; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + if(imStockRequisitionMaterial.getGetStatus().equals("已出库")){ + f = 1; + } + } + if(f == 1){ + return AjaxResult.error("已出库的物料不允许撤销"); + }else{ + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list) { + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + } + if(null!=bomNumberTwo.getMaterialIdTwo()){ + List list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(bomNumberTwo.getProductionCode(), bomNumberTwo.getMaterialsNameTwo(), bomNumberTwo.getMaterialsSpecificationTwo()); + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list2) { + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + } + } + } + //修改领料状态 + bomNumberTwo.setSparedFour(0L); + i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + }else{ + Integer s = Integer.valueOf(substring)-1; + String figureNumbers = bomNumberTwo.getFigureNumber().substring(0,bomNumberTwo.getFigureNumber().lastIndexOf("-")); + figureNumber = figureNumbers+"-"+s; + List list = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(bomNumberTwo.getProductionCode(), figureNumber); + if(list.size()>0){ + ImStockRequisitionMaterial imStockRequisitionMaterial = list.get(list.size()-1); + if(imStockRequisitionMaterial.getGetStatus().equals("未出库")){ + //直接删除 + iImStockRequisitionMaterialService.deleteImStockRequisitionMaterialById(imStockRequisitionMaterial.getId()); + //修改领料状态 + bomNumberTwo.setSparedFour(0L); + i = pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + }else{ + return AjaxResult.error("已入库的不允许撤销"); + } + } + } + } + } + return toAjax(i); + } + + /** + * 下载压缩文件 + * 根据id查询物料信息,根据物料图号查询图纸,打包下载 + * + */ + @RequestMapping("/downloadPdfs/{ids}") + public AjaxResult downloadPdfs(@PathVariable Long[] ids) { + String code = ""; + for (Long id : ids) { + PwOutsourceContractDetail outsourceContractDetail = pwOutsourceContractDetailService.selectPwOutsourceContractDetailById(id); + if(outsourceContractDetail.getCode().contains("QB")){ + // 根据令号和图号和名称查信息bom信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + //查询父级 + PwMakeDocumentsDetail documentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(makeDocumentsDetail.getSuperiorId()); + code = outsourceContractDetail.getCode(); + + FileInputStream fileInputStream = null; + FileOutputStream fileOutputStream = null; + //获取图号,根据图号去服务器pdf文件夹下找对应的图纸 + String figureNumber = documentsDetail.getFigureNumber(); + String s = figureNumber+".pdf"; + s = s.replace("/", "--"); + //获取pdf所在路径 + File f = new File(yzPdfUrl+code+"/bom/"); + if (!f.exists()) { + System.out.println(yzPdfUrl+code+"/bom/" + " not exists"); + return AjaxResult.error("路径不存在"); + } + //获取所有的pdf文件 + File fa[] = f.listFiles(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + //去掉页码的文件名 + String na = name.substring(name.indexOf("-")+1); + //如果名称相同则把文件重新放入到一个新的文件夹,等待压缩 + if(s.equals(na)){ + try { + //获取要复制的文件 + File oldfile = new File(yzPdfUrl+code+"/bom/" + name); + //文件输入流,用于读取要复制的文件 + fileInputStream = new FileInputStream(oldfile); + //要生成的新文件(指定路径如果没有则创建) + File newfile = new File(yzPdfUrl+code+"/waixie/" + name); + //获取父目录 + File fileParent = newfile.getParentFile(); + if(fileParent.exists()){ + fileParent.delete(); + } + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfile.exists()){ + newfile.delete(); + } + //判断文件是否存在 + if (!newfile.exists()) { + //创建文件 + newfile.createNewFile(); + }else{ + continue; + } + } catch (Exception e) { + // TODO: handle exception + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + }else{ + // 根据令号和图号和名称查信息bom信息 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(outsourceContractDetail.getCode(), outsourceContractDetail.getName(), outsourceContractDetail.getFigureNumber()); + //查询父级 + PwBomNumberTwo bomNumberTwo2 = pwBomNumberTwoService.selectPwBomNumberTwoById(bomNumberTwo.getSuperiorId()); + code = outsourceContractDetail.getCode(); + + FileInputStream fileInputStream = null; + FileOutputStream fileOutputStream = null; + //获取图号,根据图号去服务器pdf文件夹下找对应的图纸 + String figureNumber = bomNumberTwo2.getFigureNumber(); + String s = figureNumber+".pdf"; + s = s.replace("/", "--"); + //获取当前图号的所属型号 + String replaceAll = bomNumberTwo2.getSparedOne().replaceAll("/","-"); + //获取pdf所在路径 + File f = new File(dwgAndPdf+code+"/bomThree/"); + if (!f.exists()) { + System.out.println(dwgAndPdf+code+"/bomThree/" + " not exists"); + return AjaxResult.error("路径不存在"); + } + + //获取所有的pdf文件 + File fa[] = f.listFiles(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + //去掉页码的文件名 + String na = name.substring(name.indexOf("-")+1); + //如果名称相同则把文件重新放入到一个新的文件夹,等待压缩 + if(s.equals(na)){ + try { + //获取要复制的文件 + File oldfile = new File(dwgAndPdf+code+"/bomThree/" + name); + //文件输入流,用于读取要复制的文件 + fileInputStream = new FileInputStream(oldfile); + //要生成的新文件(指定路径如果没有则创建) + File newfile = new File(dwgAndPdf+code+"/waixie/" + name); + //获取父目录 + File fileParent = newfile.getParentFile(); + if(fileParent.exists()){ + fileParent.delete(); + } + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfile.exists()){ + newfile.delete(); + } + //判断文件是否存在 + if (!newfile.exists()) { + //创建文件 + newfile.createNewFile(); + }else{ + continue; + } + } catch (Exception e) { + // TODO: handle exception + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + } + + } + if(code.contains("QB")){ + //创建zip压缩文件夹,把没有库存的图复制到此文件夹下等待压缩 + File files = new File(yzPdfUrl+code+"/waixie"); + if (!files.exists()) { + files.mkdir(); + } + + File file = new File(yzPdfUrl + code + "/waixie/"+ code + ".zip"); + if (file.exists()) { + file.delete(); + } + // 把当前文件夹下所有的文件打包,把路径保存到数据库 + boolean flag = FileToZip.fileToZip(yzPdfUrl + code + "/waixie", yzPdfUrl + code + "/waixie", code); + if (flag) { + return AjaxResult.success(code); + } else { + return AjaxResult.error(); + } + }else{ + //创建zip压缩文件夹,把没有库存的图复制到此文件夹下等待压缩 + File files = new File(dwgAndPdf+code+"/waixie"); + if (!files.exists()) { + files.mkdir(); + } + + File file = new File(dwgAndPdf + code + "/waixie/"+ code + ".zip"); + if (file.exists()) { + file.delete(); + } + // 把当前文件夹下所有的文件打包,把路径保存到数据库 + boolean flag = FileToZip.fileToZip(dwgAndPdf + code + "/waixie", dwgAndPdf + code + "/waixie", code); + if (flag) { + return AjaxResult.success(code); + } else { + return AjaxResult.error(); + } + } + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourcingContractController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourcingContractController.java new file mode 100644 index 0000000..3b8bd13 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourcingContractController.java @@ -0,0 +1,123 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwOutsourcingContract; +import com.ruoyi.project.management.service.IPwOutsourcingContractService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 外协合同Controller + * + * @author zhukangchao + * @date 2020-07-01 + */ +@RestController +@RequestMapping("/management/outsourcingContract") +public class PwOutsourcingContractController extends BaseController +{ + @Autowired + private IPwOutsourcingContractService pwOutsourcingContractService; + + /** + * 查询外协合同列表 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContract:list')") + @GetMapping("/list") + public TableDataInfo list(PwOutsourcingContract pwOutsourcingContract) + { + startPage(); + List list = pwOutsourcingContractService.selectPwOutsourcingContractList(pwOutsourcingContract); + return getDataTable(list); + } + + /** + * 导出外协合同列表 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContract:export')") + @Log(title = "外协合同", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwOutsourcingContract pwOutsourcingContract) + { + List list = pwOutsourcingContractService.selectPwOutsourcingContractList(pwOutsourcingContract); + ExcelUtil util = new ExcelUtil(PwOutsourcingContract.class); + return util.exportExcel(list, "outsourcingContract"); + } + + /** + * 获取外协合同详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContract:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwOutsourcingContractService.selectPwOutsourcingContractById(id)); + } + + /** + * 新增外协合同 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContract:add')") + @Log(title = "外协合同", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwOutsourcingContract pwOutsourcingContract){ + //合同编号自动生成 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm-ss"); + String string = sdf.format(new Date()); + pwOutsourcingContract.setContractCode("外协-"+string); + //合同状态初始为1--未完成状态 + pwOutsourcingContract.setContractStatus(1); + //删除标记(0:未删除) + pwOutsourcingContract.setDelFlag(0); + return toAjax(pwOutsourcingContractService.insertPwOutsourcingContract(pwOutsourcingContract)); + } + + /** + * 修改外协合同 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContract:edit')") + @Log(title = "外协合同", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwOutsourcingContract pwOutsourcingContract) + { + return toAjax(pwOutsourcingContractService.updatePwOutsourcingContract(pwOutsourcingContract)); + } + + /** + * 删除外协合同 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContract:remove')") + @Log(title = "外协合同", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwOutsourcingContractService.deletePwOutsourcingContractByIds(ids)); + } + + /** + * 查询未完成的外协合同列表 + */ + @GetMapping("/selectByContractStatus") + public TableDataInfo selectByContractStatus(PwOutsourcingContract pwOutsourcingContract){ + //未完成状态为1 + pwOutsourcingContract.setContractStatus(1); + List list = pwOutsourcingContractService.selectPwOutsourcingContractList(pwOutsourcingContract); + return getDataTable(list); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourcingContractMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourcingContractMaterialController.java new file mode 100644 index 0000000..6d334ce --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwOutsourcingContractMaterialController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwOutsourcingContractMaterial; +import com.ruoyi.project.management.service.IPwOutsourcingContractMaterialService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 零件和外协合同关联Controller + * + * @author zhukangchao + * @date 2020-07-01 + */ +@RestController +@RequestMapping("/management/outsourcingContractMaterial") +public class PwOutsourcingContractMaterialController extends BaseController +{ + @Autowired + private IPwOutsourcingContractMaterialService pwOutsourcingContractMaterialService; + + /** + * 查询零件和外协合同关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContractMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(PwOutsourcingContractMaterial pwOutsourcingContractMaterial) + { + startPage(); + List list = pwOutsourcingContractMaterialService.selectPwOutsourcingContractMaterialList(pwOutsourcingContractMaterial); + return getDataTable(list); + } + + /** + * 导出零件和外协合同关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContractMaterial:export')") + @Log(title = "零件和外协合同关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwOutsourcingContractMaterial pwOutsourcingContractMaterial) + { + List list = pwOutsourcingContractMaterialService.selectPwOutsourcingContractMaterialList(pwOutsourcingContractMaterial); + ExcelUtil util = new ExcelUtil(PwOutsourcingContractMaterial.class); + return util.exportExcel(list, "outsourcingContractMaterial"); + } + + /** + * 获取零件和外协合同关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContractMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwOutsourcingContractMaterialService.selectPwOutsourcingContractMaterialById(id)); + } + + /** + * 新增零件和外协合同关联 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContractMaterial:add')") + @Log(title = "零件和外协合同关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwOutsourcingContractMaterial pwOutsourcingContractMaterial) + { + return toAjax(pwOutsourcingContractMaterialService.insertPwOutsourcingContractMaterial(pwOutsourcingContractMaterial)); + } + + /** + * 修改零件和外协合同关联 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContractMaterial:edit')") + @Log(title = "零件和外协合同关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwOutsourcingContractMaterial pwOutsourcingContractMaterial) + { + return toAjax(pwOutsourcingContractMaterialService.updatePwOutsourcingContractMaterial(pwOutsourcingContractMaterial)); + } + + /** + * 删除零件和外协合同关联 + */ + @PreAuthorize("@ss.hasPermi('management:outsourcingContractMaterial:remove')") + @Log(title = "零件和外协合同关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwOutsourcingContractMaterialService.deletePwOutsourcingContractMaterialByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwPankuRecordController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwPankuRecordController.java new file mode 100644 index 0000000..f23a2cd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwPankuRecordController.java @@ -0,0 +1,139 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwPankuRecord; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwPankuRecordService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 盘库记录Controller + * + * @author zhukangchao + * @date 2020-08-27 + */ +@RestController +@RequestMapping("/management/pankuRecord") +public class PwPankuRecordController extends BaseController +{ + @Autowired + private IPwPankuRecordService pwPankuRecordService; + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + + /** + * 查询盘库记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:pankuRecord:list')") + @GetMapping("/list") + public TableDataInfo list(PwPankuRecord pwPankuRecord){ + if(null!=pwPankuRecord.getSparedFour()){ + if(pwPankuRecord.getSparedFour()>0){ + pwPankuRecord.setSparedFour(1L); + }else{ + pwPankuRecord.setSparedFour(2L); + } + } + startPage(); + List list = pwPankuRecordService.selectPwPankuRecordList(pwPankuRecord); + return getDataTable(list); + } + + /** + * 导出盘库记录列表 + */ + @PreAuthorize("@ss.hasPermi('management:pankuRecord:export')") + @Log(title = "盘库记录", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwPankuRecord pwPankuRecord) + { + List list = pwPankuRecordService.selectPwPankuRecordList(pwPankuRecord); + ExcelUtil util = new ExcelUtil(PwPankuRecord.class); + return util.exportExcel(list, "pankuRecord"); + } + + /** + * 获取盘库记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pankuRecord:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwPankuRecordService.selectPwPankuRecordById(id)); + } + + /** + * 新增盘库记录 + */ + @PreAuthorize("@ss.hasPermi('management:pankuRecord:add')") + @Log(title = "盘库记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwPankuRecord pwPankuRecord) + { + return toAjax(pwPankuRecordService.insertPwPankuRecord(pwPankuRecord)); + } + + /** + * 修改盘库记录 + */ + @PreAuthorize("@ss.hasPermi('management:pankuRecord:edit')") + @Log(title = "盘库记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwPankuRecord pwPankuRecord){ + return toAjax(pwPankuRecordService.updatePwPankuRecord(pwPankuRecord)); + } + + /** + * 删除盘库记录 + */ + @PreAuthorize("@ss.hasPermi('management:pankuRecord:remove')") + @Log(title = "盘库记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwPankuRecordService.deletePwPankuRecordByIds(ids)); + } + + /** + * 盘库按钮 + * 根据id查询当前库存信息,添加到盘库表,返回当前库存信息 + * 参数:库存信息id + */ + @RequestMapping("/collateInventory") + public AjaxResult collateInventory(Long id){ + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(id); + PwPankuRecord pwPankuRecord = new PwPankuRecord(); + pwPankuRecord.setSparedThree(inventoryDetail.getId()); + pwPankuRecord.setName(inventoryDetail.getName()); + pwPankuRecord.setTypeName(inventoryDetail.getTypeName()); + pwPankuRecord.setWarehouseName(inventoryDetail.getWarehouseName()); + pwPankuRecord.setUnit(inventoryDetail.getUnit()); + pwPankuRecord.setQuantity(inventoryDetail.getQuantity()); + return AjaxResult.success(pwPankuRecord); + } + + /** + * 添加盘库记录,修改库存数据 + */ + @RequestMapping("/addCollateInventory") + public AjaxResult addCollateInventory(PwPankuRecord pwPankuRecord){ + int i = pwPankuRecordService.addCollateInventory(pwPankuRecord); + return AjaxResult.success(i); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwPredictPurchaseController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwPredictPurchaseController.java new file mode 100644 index 0000000..aadddaa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwPredictPurchaseController.java @@ -0,0 +1,623 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.MoneyUtil; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 预采购单Controller + * + * @author zhukangchao + * @date 2023-02-02 + */ +@RestController +@RequestMapping("/management/predictPurchase") +public class PwPredictPurchaseController extends BaseController +{ + @Autowired + private IPwPredictPurchaseService pwPredictPurchaseService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //外购单预采购详情 + @Autowired + private IPwPredictPurchaseTwoService pwPredictPurchaseTwoService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + @Autowired + private IImSupplierService imSupplierService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //物流费用信息 + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + + /** + * 查询预采购单列表 + */ + @PreAuthorize("@ss.hasPermi('management:predictPurchase:list')") + @GetMapping("/list") + public TableDataInfo list(PwPredictPurchase pwPredictPurchase) + { + startPage(); + List list = pwPredictPurchaseService.selectPwPredictPurchaseList(pwPredictPurchase); + return getDataTable(list); + } + + /** + * 导出预采购单列表 + */ + @PreAuthorize("@ss.hasPermi('management:predictPurchase:export')") + @Log(title = "预采购单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwPredictPurchase pwPredictPurchase) + { + List list = pwPredictPurchaseService.selectPwPredictPurchaseList(pwPredictPurchase); + ExcelUtil util = new ExcelUtil(PwPredictPurchase.class); + return util.exportExcel(list, "purchase"); + } + + /** + * 获取预采购单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:predictPurchase:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwPredictPurchaseService.selectPwPredictPurchaseById(id)); + } + + /** + * 新增预采购单 + */ + @PreAuthorize("@ss.hasPermi('management:predictPurchase:add')") + @Log(title = "预采购单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwPredictPurchase pwPredictPurchase){ + //自动生成预采购单令号 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + // 获取当前登录用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + pwPredictPurchase.setCode("YG-"+sdf.format(new Date())); + pwPredictPurchase.setAuditor(user.getNickName()); + pwPredictPurchase.setDemandDate(new Date()); + pwPredictPurchase.setStatus("未审核"); + + pwPredictPurchase.setContractStatus((long)1); + pwPredictPurchase.setAppointTime(new Date()); + return toAjax(pwPredictPurchaseService.insertPwPredictPurchase(pwPredictPurchase)); + } + + /** + * 修改预采购单 + */ + @PreAuthorize("@ss.hasPermi('management:predictPurchase:edit')") + @Log(title = "预采购单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwPredictPurchase pwPredictPurchase) + { + return toAjax(pwPredictPurchaseService.updatePwPredictPurchase(pwPredictPurchase)); + } + + /** + * 删除预采购单 + */ + @PreAuthorize("@ss.hasPermi('management:predictPurchase:remove')") + @Log(title = "预采购单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + for (Long id : ids) { + PwPredictPurchase pwPredictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(id); + if(!"未审核".equals(pwPredictPurchase.getStatus())){ + return AjaxResult.error("已审核的采购单不允许删除"); + } + //根据id查询详情信息,删除所有的详情信息,恢复在途数量 + PwPredictPurchaseTwo pwPredictPurchaseTwo = new PwPredictPurchaseTwo(); + pwPredictPurchaseTwo.setPredictPurchaseId(id); + List list = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoList(pwPredictPurchaseTwo); + for (PwPredictPurchaseTwo pwPredictPurchaseTwo2 : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwPredictPurchaseTwo2.getMaterialName(), pwPredictPurchaseTwo2.getFigureNumber()); + if(null!=inventoryDetail){ + if(inventoryDetail.getPreliminaryInventory()-pwPredictPurchaseTwo2.getNumber()<0){ + inventoryDetail.setPreliminaryInventory(0L); + }else{ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-pwPredictPurchaseTwo2.getNumber()); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + } + return toAjax(pwPredictPurchaseService.deletePwPredictPurchaseByIds(ids)); + } + + /** + * 审核预采购单,审核之后给采购人员发通知和待办事项 + */ + @RequestMapping("/audits/{ids}") + public AjaxResult audits(@PathVariable Long[] ids){ + int i = 0; + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + for (Long id : ids) { + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(id); + if (predictPurchase.getSellerName() == null || predictPurchase.getSellerName().isEmpty()) { + AjaxResult.error("供应商信息不全,请补充完整"); + } + if (predictPurchase.getTaxRate() == 0) { + AjaxResult.error("税率信息不全,请补充完整"); + } + if (predictPurchase.getTotalPrices() == 0.0 || predictPurchase.getTotalPrices() == null) { + AjaxResult.error("总价不全,请补充完整"); + } + if (predictPurchase.getDeliveryType() == null || predictPurchase.getDeliveryType().isEmpty()) { + AjaxResult.error("交货方式不全,请补充完整"); + } + if (predictPurchase.getPayer() == null || predictPurchase.getPayer().isEmpty()) { + AjaxResult.error("运费支付方不全,请补充完整"); + } + if (predictPurchase.getModeOfPayment() == null || predictPurchase.getModeOfPayment().isEmpty()) { + return AjaxResult.error("货款支付方式不全,请补充完整"); + } + + if("未审核".equals(predictPurchase.getStatus())){ + predictPurchase.setStatus("已审核"); + predictPurchase.setProposer(user.getNickName()); + //给采购人员发送待办事项 + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("外购件待采购",predictPurchase.getCode(),"","",user.getNickName(),"采购","外购件预采购","外购件预采购单管理","/purchase/pwPredictPurchaseTwo?id="+predictPurchase.getId()); + + }else if("已审核".equals(predictPurchase.getStatus())){ + predictPurchase.setStatus("未审核"); + predictPurchase.setProposer(null); + } + i = pwPredictPurchaseService.updatePwPredictPurchase(predictPurchase); + if(i < 0){ + continue; + } + } + return toAjax(i); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(id); + if(null!=predictPurchase.getLeadership()){ + predictPurchase.setLeadership(""); + }else{ + predictPurchase.setLeadership(user.getNickName()); + //审批时间 + predictPurchase.setLeadershipTime(new Date()); + } + i = pwPredictPurchaseService.updatePwPredictPurchase(predictPurchase); + + } + return toAjax(i); + } + + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody PwPredictPurchase pwPredictPurchase){ + //校验付款金额 + if(null==pwPredictPurchase.getPaymentAmount()||"".equals(pwPredictPurchase.getPaymentAmount())||0==pwPredictPurchase.getPaymentAmount()){ + return AjaxResult.error("请填写付款金额"); + } + //获取合同id + Long[] ids = pwPredictPurchase.getIds(); + //供应商名称 + String name = ""; + //合同总金额 + Double d = 0.0; + for (Long id : ids) { + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(id); + //校验当前选中的合同是否为同一个供应商 + if(!"".equals(name)){ + //校验name是否和供应商名称相同 + if(!name.equals(predictPurchase.getSellerName())){ + return AjaxResult.error("不同供应商不可合并付款"); + } + }else{ + name = predictPurchase.getSellerName(); + } + + //计算合同总金额 + d += predictPurchase.getTotalPrices(); + } + + //校验付款金额是否大于合同总金额 + if(d0){ + //生成付款申请单及付款申请单明细 + for (Long id : ids) { + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(id); + + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + //付款单id + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + //付款单编号 + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + //关联合同编号 + cwOtherPaymentInfo.setCode(predictPurchase.getCode()); + //合同金额 + cwOtherPaymentInfo.setContractMoney(predictPurchase.getTotalPrices()); + //付款金额(计算) 合同金额*(付款金额/总金额) + cwOtherPaymentInfo.setPaymentAmount(predictPurchase.getTotalPrices()*(pwPredictPurchase.getPaymentAmount()/d)); + //付款比例(计算) 付款金额/合同金额 + cwOtherPaymentInfo.setProportion(cwOtherPaymentInfo.getPaymentAmount()/predictPurchase.getTotalPrices()*100); + //合同类型 + cwOtherPaymentInfo.setSparedOne("预采件采购合同"); + cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + } + return toAjax(i); + } + + /** + * 生成物流费用单 + */ + @RequestMapping("/addLogistics") + public AjaxResult addLogistics(@RequestBody PwPredictPurchase predictPurchase) { + //校验付款金额 + if (null == predictPurchase.getMoney() || "".equals(predictPurchase.getMoney()) || 0 == predictPurchase.getMoney()) { + return AjaxResult.error("请填写付款金额"); + } + //校验支付方式 + if(null==predictPurchase.getPayWay()||"".equals(predictPurchase.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==predictPurchase.getUnitName()||"".equals(predictPurchase.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //物料费用单 + CwLogisticsFeesInfo cwLogisticsFeesInfo = new CwLogisticsFeesInfo(); + + //编号 + cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); + //关联单据编号 所勾选的合同编号 + //获取合同id + Long[] ids = predictPurchase.getIds(); + //拼接合同编号 + String code = ""; + for (Long id : ids) { + PwPredictPurchase predictPurchase2 = pwPredictPurchaseService.selectPwPredictPurchaseById(id); + code += predictPurchase2.getCode()+","; + } + cwLogisticsFeesInfo.setRelevanceCode(code); + //单据类型 + cwLogisticsFeesInfo.setRelevanceType("预采件采购合同"); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //小写金额 + cwLogisticsFeesInfo.setMoney(predictPurchase.getMoney()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(predictPurchase.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //事由 + cwLogisticsFeesInfo.setCause("采购运费"); + //支付方式 + cwLogisticsFeesInfo.setPayWay(predictPurchase.getPayWay()); + //单位名称 + cwLogisticsFeesInfo.setUnitName(predictPurchase.getUnitName()); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(predictPurchase.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(predictPurchase.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(predictPurchase.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); + return toAjax(i); + } + + /** + * 打印合同 + * @param ids + * @return + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids) { + HashMap printMessageMap = new HashMap<>(); + //根据id获取合同信息 + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(ids[0]); + if(StringUtils.isEmpty(predictPurchase.getRemark())){ + predictPurchase.setRemark(""); + } + if(null == predictPurchase.getAppointTime()){ + predictPurchase.setAppointTime(new Date()); + predictPurchase.setContractStatus(1L); + pwPredictPurchaseService.updatePwPredictPurchase(predictPurchase); + } + //获得产品列表 + List list = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoByPredictPurchaseId(ids[0]); + int i = 1; + for (PwPredictPurchaseTwo pwPredictPurchaseTwo : list) { + pwPredictPurchaseTwo.setNum(i); + if(pwPredictPurchaseTwo.getNumber() != null && pwPredictPurchaseTwo.getUnivalence() != null){ + String zj = String.format("%.2f",pwPredictPurchaseTwo.getNumber() * pwPredictPurchaseTwo.getUnivalence()); + pwPredictPurchaseTwo.setTotalprice(Double.parseDouble(zj)); + } + i++; + } + //根据供应商名称查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierByName(predictPurchase.getSellerName()); + //产品列表 + printMessageMap.put("product", list); + printMessageMap.put("contract", predictPurchase); + printMessageMap.put("supplier", supplier); + return AjaxResult.success("success", printMessageMap); + } + + /** + * 上传合同的PDF + * + * @param id + * @param filePath + * @return + */ + @RequestMapping("/uploadContractPDF") + @ResponseBody + public AjaxResult uploadContractPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { + String originalFilename = filePath.getOriginalFilename(); + if (originalFilename != null) { + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传"); + } else { + PwPredictPurchase pwPredictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(Long.valueOf(id)); + //根据id 获取合同信息 + String newfilenname = generateUniqueFileName(originalFilename); + try (InputStream is = filePath.getInputStream(); + //在对应的文件夹下生成新的图片 + FileOutputStream fos = new FileOutputStream("D:/contract/" + newfilenname); + BufferedOutputStream bos = new BufferedOutputStream(fos)) { + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + //映射路径 + pwPredictPurchase.setContractPath(newfilenname); + //更新 + pwPredictPurchaseService.updatePwPredictPurchase(pwPredictPurchase); + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + } + } + } + return AjaxResult.success("文件上传成功"); + + } + + /** + * 生成随机文件名 + * + * @param originalFilename + * @return + */ + private String generateUniqueFileName(String originalFilename) { + String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); + String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); + //生成年月日加 毫秒值的 文件名称 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String date = dateFormat.format(new Date()); + return filename + "_" + date + System.currentTimeMillis() + extension; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwPredictPurchaseTwoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwPredictPurchaseTwoController.java new file mode 100644 index 0000000..5dd7516 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwPredictPurchaseTwoController.java @@ -0,0 +1,620 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.security.NoSuchAlgorithmException; +import java.util.Date; +import java.util.List; + +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwPredictPurchaseService; +import com.ruoyi.project.management.utils.MoneyUtil; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.service.IPwPredictPurchaseTwoService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 预采购单详情Controller + * + * @author zhukangchao + * @date 2023-02-02 + */ +@RestController +@RequestMapping("/management/PwPredictPurchaseTwo") +public class PwPredictPurchaseTwoController extends BaseController { + //外购单预采购详情 + @Autowired + private IPwPredictPurchaseTwoService pwPredictPurchaseTwoService; + //外购件预采购单 + @Autowired + private IPwPredictPurchaseService pwPredictPurchaseService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询预采购单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:PwPredictPurchaseTwo:list')") + @GetMapping("/list") + public TableDataInfo list(PwPredictPurchaseTwo pwPredictPurchaseTwo) { + startPage(); + List list = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoList(pwPredictPurchaseTwo); + return getDataTable(list); + } + + /** + * 导出预采购单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:PwPredictPurchaseTwo:export')") + @Log(title = "预采购单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwPredictPurchaseTwo pwPredictPurchaseTwo) { + List list = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoList(pwPredictPurchaseTwo); + ExcelUtil util = new ExcelUtil(PwPredictPurchaseTwo.class); + return util.exportExcel(list, "PwPredictPurchaseTwo"); + } + + /** + * 获取预采购单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:PwPredictPurchaseTwo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoById(id)); + } + + /** + * 新增预采购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:PwPredictPurchaseTwo:add')") + @Log(title = "预采购单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwPredictPurchaseTwo pwPredictPurchaseTwo) { + + int i = 0; + //判断物料名称是否为null + if (null == pwPredictPurchaseTwo.getMaterialName() || "".equals(pwPredictPurchaseTwo.getMaterialName())) { + return AjaxResult.error("请填写物料名称"); + } + //判断物料图号是否为null + if (null == pwPredictPurchaseTwo.getFigureNumber() || "".equals(pwPredictPurchaseTwo.getFigureNumber())) { + return AjaxResult.error("请填写物料图号"); + } + //判断单重是否为null + if (null == pwPredictPurchaseTwo.getPieceWeight() || "".equals(pwPredictPurchaseTwo.getPieceWeight())) { + pwPredictPurchaseTwo.setPieceWeight(0.0); + } + //判断单位是否为null + if (null == pwPredictPurchaseTwo.getUnitOfMeasurementName() || "".equals(pwPredictPurchaseTwo.getUnitOfMeasurementName())) { + return AjaxResult.error("请填写单位"); + } + //判断数量是否为null + if (null == pwPredictPurchaseTwo.getNumber() || "".equals(pwPredictPurchaseTwo.getNumber()) || "0".equals(pwPredictPurchaseTwo.getNumber())) { + return AjaxResult.error("请填写需采购数量"); + } + //查询物料表中是否已经存在此物料,如果存在,则不再添加,反之则添加(物料表和库存表数据同步),新增之后,库存表同时加上在途数量 + ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwPredictPurchaseTwo.getMaterialName(), pwPredictPurchaseTwo.getFigureNumber()); + if(null == imMaterial){ + //说明是新物料,添加物料信息和库存信息 + imMaterial = new ImMaterial(); + imMaterial.setMaterialName(pwPredictPurchaseTwo.getMaterialName()); + imMaterial.setFigureNumber(pwPredictPurchaseTwo.getFigureNumber()); + imMaterial.setMaterials(pwPredictPurchaseTwo.getMaterials()); + imMaterial.setPieceWeight(pwPredictPurchaseTwo.getPieceWeight()); + imMaterial.setUnitOfMeasurementName(pwPredictPurchaseTwo.getUnitOfMeasurementName()); + if(null!=pwPredictPurchaseTwo.getUnivalence()&&!"".equals(pwPredictPurchaseTwo.getUnivalence())){ + imMaterial.setUnivalence(new BigDecimal(pwPredictPurchaseTwo.getUnivalence())); + }else{ + imMaterial.setUnivalence(new BigDecimal("0")); + } + imMaterial.setPreferentialOriginName(pwPredictPurchaseTwo.getPreferentialOriginName()); + imMaterial.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial); + //添加库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwPredictPurchaseTwo.getMaterialName(), pwPredictPurchaseTwo.getFigureNumber()); + if(null == inventoryDetail){ + inventoryDetail = new PwInventoryDetail(); + inventoryDetail.setName(pwPredictPurchaseTwo.getMaterialName()); + inventoryDetail.setFigureNumber(pwPredictPurchaseTwo.getFigureNumber()); + inventoryDetail.setMaterials(pwPredictPurchaseTwo.getMaterials()); + inventoryDetail.setPieceWeight(pwPredictPurchaseTwo.getPieceWeight()); + inventoryDetail.setUnit(pwPredictPurchaseTwo.getUnitOfMeasurementName()); + if(null!=pwPredictPurchaseTwo.getUnivalence()&&!"".equals(pwPredictPurchaseTwo.getUnivalence())){ + inventoryDetail.setUnivalence(new BigDecimal(pwPredictPurchaseTwo.getUnivalence())); + }else{ + inventoryDetail.setUnivalence(new BigDecimal("0")); + } + //在途数量 + inventoryDetail.setPreliminaryInventory(pwPredictPurchaseTwo.getNumber()); + inventoryDetail.setDelFlag(0); + i = pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail); + }else{ + //修改在途数量 + inventoryDetail.setPreliminaryInventory(pwPredictPurchaseTwo.getNumber()); + i = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + }else{ + //添加库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwPredictPurchaseTwo.getMaterialName(), pwPredictPurchaseTwo.getFigureNumber()); + if(null == inventoryDetail){ + inventoryDetail = new PwInventoryDetail(); + inventoryDetail.setName(pwPredictPurchaseTwo.getMaterialName()); + inventoryDetail.setFigureNumber(pwPredictPurchaseTwo.getFigureNumber()); + inventoryDetail.setMaterials(pwPredictPurchaseTwo.getMaterials()); + inventoryDetail.setPieceWeight(pwPredictPurchaseTwo.getPieceWeight()); + inventoryDetail.setUnit(pwPredictPurchaseTwo.getUnitOfMeasurementName()); + if(null!=pwPredictPurchaseTwo.getUnivalence()&&!"".equals(pwPredictPurchaseTwo.getUnivalence())){ + inventoryDetail.setUnivalence(new BigDecimal(pwPredictPurchaseTwo.getUnivalence())); + }else{ + inventoryDetail.setUnivalence(new BigDecimal("0")); + } + //在途数量 + inventoryDetail.setPreliminaryInventory(pwPredictPurchaseTwo.getNumber()); + inventoryDetail.setDelFlag(0); + + i = pwInventoryDetailService.insertPwInventoryDetail(inventoryDetail); + }else{ + //修改在途数量 + inventoryDetail.setPreliminaryInventory(pwPredictPurchaseTwo.getNumber()); + i = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + } + //计算总价 + if(null!=pwPredictPurchaseTwo.getUnivalence()&&!"".equals(pwPredictPurchaseTwo.getUnivalence())){ + pwPredictPurchaseTwo.setTotalprice(pwPredictPurchaseTwo.getNumber()*pwPredictPurchaseTwo.getUnivalence()); + }else{ + pwPredictPurchaseTwo.setTotalprice(0.0); + } + //入库状态(初始为未入库) + pwPredictPurchaseTwo.setInventoryStatus("未入库"); + + int j = pwPredictPurchaseTwoService.insertPwPredictPurchaseTwo(pwPredictPurchaseTwo); + //计算预采购单的总价 + //查询当前预采购单信息 + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(pwPredictPurchaseTwo.getPredictPurchaseId()); + if(null==predictPurchase.getTotalPrices()||"".equals(predictPurchase.getTotalPrices())){ + predictPurchase.setTotalPrices(0.0); + } + predictPurchase.setTotalPrices(predictPurchase.getTotalPrices()+pwPredictPurchaseTwo.getTotalprice()); + predictPurchase.setBigTotalPrices( MoneyUtil.toChinese(predictPurchase.getTotalPrices().toString())); + pwPredictPurchaseService.updatePwPredictPurchase(predictPurchase); + return toAjax(j); + } + + /** + * 修改预采购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:PwPredictPurchaseTwo:edit')") + @Log(title = "预采购单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwPredictPurchaseTwo pwPredictPurchaseTwo) { + //判断当前物料是否已经入库 + if(!"未入库".equals(pwPredictPurchaseTwo.getInventoryStatus())){ + return AjaxResult.error("已入库的物料不允许变更数量"); + } + //判断物料名称是否为null + if (null == pwPredictPurchaseTwo.getMaterialName() || "".equals(pwPredictPurchaseTwo.getMaterialName())) { + return AjaxResult.error("请填写物料名称"); + } + //判断物料图号是否为null + if (null == pwPredictPurchaseTwo.getFigureNumber() || "".equals(pwPredictPurchaseTwo.getFigureNumber())) { + return AjaxResult.error("请填写物料图号"); + } + //判断单重是否为null + if (null == pwPredictPurchaseTwo.getPieceWeight() || "".equals(pwPredictPurchaseTwo.getPieceWeight())) { + pwPredictPurchaseTwo.setPieceWeight(0.0); + } + //判断单位是否为null + if (null == pwPredictPurchaseTwo.getUnitOfMeasurementName() || "".equals(pwPredictPurchaseTwo.getUnitOfMeasurementName())) { + return AjaxResult.error("请填写单位"); + } + //判断数量是否为null + if (null == pwPredictPurchaseTwo.getNumber() || "".equals(pwPredictPurchaseTwo.getNumber()) || "0".equals(pwPredictPurchaseTwo.getNumber())) { + return AjaxResult.error("请填写需采购数量"); + } + //修改之前,根据id查询旧的数据 + PwPredictPurchaseTwo pwPredictPurchaseTwo2 = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoById(pwPredictPurchaseTwo.getId()); + //查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwPredictPurchaseTwo.getMaterialName(), pwPredictPurchaseTwo.getFigureNumber()); + inventoryDetail.setPreliminaryInventory(pwPredictPurchaseTwo2.getNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //重新计算总价 + //计算总价 + if(null!=pwPredictPurchaseTwo.getUnivalence()&&!"".equals(pwPredictPurchaseTwo.getUnivalence())){ + pwPredictPurchaseTwo.setTotalprice(pwPredictPurchaseTwo.getNumber()*pwPredictPurchaseTwo.getUnivalence()); + }else{ + pwPredictPurchaseTwo.setTotalprice(0.0); + } + //查询当前预采购单信息 + + List list = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoList(pwPredictPurchaseTwo2); + Double zongjia = 0.0; + for (PwPredictPurchaseTwo pwPredictPurchaseTwo3 : list) { + zongjia += pwPredictPurchaseTwo3.getTotalprice(); + } + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(pwPredictPurchaseTwo.getPredictPurchaseId()); + predictPurchase.setTotalPrices(zongjia); + pwPredictPurchaseService.updatePwPredictPurchase(predictPurchase); + return toAjax(pwPredictPurchaseTwoService.updatePwPredictPurchaseTwo(pwPredictPurchaseTwo)); + } + + /** + * 删除预采购单详情 + */ + @PreAuthorize("@ss.hasPermi('management:PwPredictPurchaseTwo:remove')") + @Log(title = "预采购单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + int i = 0; + for (Long id : ids) { + //根据物料id查询单据id + PwPredictPurchaseTwo pwPredictPurchaseTwo = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoById(id); + if(!"未入库".equals(pwPredictPurchaseTwo.getInventoryStatus())){ + return AjaxResult.error("已入库的物料不允许删除"); + } + //更新库存明细信息 + PwInventoryDetail pwInventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwPredictPurchaseTwo.getMaterialName(), pwPredictPurchaseTwo.getFigureNumber()); + /*if(pwInventoryDetail.getPreliminaryInventory()-pwPredictPurchaseTwo.getNumber()<0){ + pwInventoryDetail.setPreliminaryInventory(0L); + }else{ + pwInventoryDetail.setPreliminaryInventory(pwInventoryDetail.getPreliminaryInventory()-pwPredictPurchaseTwo.getNumber()); + }*/ + pwInventoryDetailService.updatePwInventoryDetail(pwInventoryDetail); + //删除该预购单物料 + i = pwPredictPurchaseTwoService.deletePwPredictPurchaseTwoByIds(ids); + //传入预采购单详情的预购单id更新总价 + pwPredictPurchaseService.updatePwPredictPurchaseTotalPrices(pwPredictPurchaseTwo.getPredictPurchaseId()); + } + return toAjax(i); + } + + /** + * 外购件申请入库 + */ + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwPredictPurchaseTwo pwPredictPurchaseTwo){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + if(null==pwPredictPurchaseTwo.getQuantity()||"".equals(pwPredictPurchaseTwo.getQuantity())||pwPredictPurchaseTwo.getQuantity()<=0){ + return AjaxResult.error("请填写申请数量"); + } + //判断单价是否为null,单价为null不允许入库 + if(null==pwPredictPurchaseTwo.getUnivalence()||pwPredictPurchaseTwo.getUnivalence()==0){ + return AjaxResult.error("请填写单价"); + } + if(null==pwPredictPurchaseTwo.getPreferentialOriginName()||"".equals(pwPredictPurchaseTwo.getPreferentialOriginName())){ + return AjaxResult.error("请选择供应商"); + } + //根据预采购单id查询预采购单信息 + PwPredictPurchase predictPurchase = pwPredictPurchaseService.selectPwPredictPurchaseById(pwPredictPurchaseTwo.getPredictPurchaseId()); + //判断是否是已经审核的单据,如果未审核,则不允许入库 + if(!"已审核".equals(predictPurchase.getStatus())){ + return AjaxResult.error("未审核的单据不允许入库"); + } + //判读申请数量是否超出了采购数量 + //根据令号和名称和图号查询质检管理列表中的合格数量 + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(predictPurchase.getCode(), pwPredictPurchaseTwo.getMaterialName(), pwPredictPurchaseTwo.getFigureNumber()); + //i = 可入库数量 + Long r = 0L; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list) { + //可入库数量 = 总数量 - (已质检的合格数量+未质检的申请数量) + r += pwCompletionNoticeProduct.getQuantity().longValue() + pwCompletionNoticeProduct.getActualQuantity().longValue(); + } + if(pwPredictPurchaseTwo.getNumber() - r < pwPredictPurchaseTwo.getQuantity()){ + return AjaxResult.error("入库数量不可大于总数量"); + } + + //添加质检信息和入库信息 + //根据合同id查看此合同是否已经添加到待入库申请表了,如果添加到了则不再添加,反之则直接添加 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(predictPurchase.getCode()); + if(null!=productReceipt){ + //如果不等于null 则直接把物料添加到待入库详情表中 + //添加入库单详情 + if("已申请".equals(pwPredictPurchaseTwo.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //根据请购单号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(predictPurchase.getCode()); + //令号 + imProductReceiptMaterial.setCode(predictPurchase.getCode()); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwPredictPurchaseTwo.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwPredictPurchaseTwo.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwPredictPurchaseTwo.getMaterials()); + //单重 +// imProductReceiptMaterial.set + //单位 + imProductReceiptMaterial.setUnit(pwPredictPurchaseTwo.getUnitOfMeasurementName()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwPredictPurchaseTwo.getUnivalence()); + + //未税单价 + //计算税率 + double d = predictPurchase.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwPredictPurchaseTwo.getQuantity() * pwPredictPurchaseTwo.getUnivalence()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwPredictPurchaseTwo.getPreferentialOriginName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(predictPurchase.getCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(predictPurchase.getCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(pwPredictPurchaseTwo.getMaterialName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(pwPredictPurchaseTwo.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(pwPredictPurchaseTwo.getMaterials()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(pwPredictPurchaseTwo.getPreferentialOriginName()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("外购件待质检",predictPurchase.getCode(),pwPredictPurchaseTwo.getMaterialName(),pwPredictPurchaseTwo.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + }else{ + //如果等于null 则先添加待入库单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(predictPurchase.getCode()); + //项目令号 + imProductReceipt.setCode(predictPurchase.getPurpose()); + //项目名称 + imProductReceipt.setProjectName(predictPurchase.getName()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + //保存生产令号 + pwCompletionNotice.setProductionCode(predictPurchase.getCode()); + //保存项目名称 + pwCompletionNotice.setProjectName(predictPurchase.getPurpose()+"(外购件)"); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + + //添加入库单详情 + if("已申请".equals(pwPredictPurchaseTwo.getInventoryStatus())){ + return AjaxResult.error("无需重复申请"); + }else{ + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(predictPurchase.getCode()); + //令号 + imProductReceiptMaterial.setCode(predictPurchase.getCode()); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwPredictPurchaseTwo.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwPredictPurchaseTwo.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwPredictPurchaseTwo.getMaterials()); + //单位 + imProductReceiptMaterial.setUnit(pwPredictPurchaseTwo.getUnitOfMeasurementName()); + + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //单价 + imProductReceiptMaterial.setUnivalence(pwPredictPurchaseTwo.getUnivalence()); + + //未税单价 + //计算税率 + double d = predictPurchase.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(imProductReceiptMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //总价 + imProductReceiptMaterial.setTotalPrices(pwPredictPurchaseTwo.getQuantity() * pwPredictPurchaseTwo.getUnivalence()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(pwPredictPurchaseTwo.getPreferentialOriginName()); + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(predictPurchase.getCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(predictPurchase.getCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(pwPredictPurchaseTwo.getMaterialName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(pwPredictPurchaseTwo.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(pwPredictPurchaseTwo.getMaterials()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwPredictPurchaseTwo.getQuantity().doubleValue()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(pwPredictPurchaseTwo.getPreferentialOriginName()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("外购件待质检",predictPurchase.getCode(),pwPredictPurchaseTwo.getMaterialName(),pwPredictPurchaseTwo.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + } + + if(pwPredictPurchaseTwo.getNumber().equals(r + pwPredictPurchaseTwo.getQuantity())){ + //入库状态 + pwPredictPurchaseTwo.setInventoryStatus("已申请"); + }else{ + //入库状态 + pwPredictPurchaseTwo.setInventoryStatus("申请中"); + } + return AjaxResult.success(pwPredictPurchaseTwoService.updatePwPredictPurchaseTwo(pwPredictPurchaseTwo)); + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProcessController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProcessController.java new file mode 100644 index 0000000..4b85480 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProcessController.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwProcess; +import com.ruoyi.project.management.service.IPwProcessService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 工序Controller + * + * @author zhukangchao + * @date 2021-10-11 + */ +@RestController +@RequestMapping("/management/pwProcess") +public class PwProcessController extends BaseController +{ + @Autowired + private IPwProcessService pwProcessService; + + /** + * 查询工序列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProcess:list')") + @GetMapping("/list") + public TableDataInfo list(PwProcess pwProcess) + { + startPage(); + List list = pwProcessService.selectPwProcessList(pwProcess); + return getDataTable(list); + } + + /** + * 王炎程序用 + * + */ + @RequestMapping("/pwProcessList") + public TableDataInfo pwProcessList(){ + PwProcess pwProcess = new PwProcess(); + List list = pwProcessService.selectPwProcessList(pwProcess); + return getDataTable(list); + } + + /** + * 导出工序列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProcess:export')") + @Log(title = "工序", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProcess pwProcess) + { + List list = pwProcessService.selectPwProcessList(pwProcess); + ExcelUtil util = new ExcelUtil(PwProcess.class); + return util.exportExcel(list, "pwProcess"); + } + + /** + * 获取工序详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProcess:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProcessService.selectPwProcessById(id)); + } + + /** + * 新增工序 + */ + @PreAuthorize("@ss.hasPermi('management:pwProcess:add')") + @Log(title = "工序", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProcess pwProcess) + { + return toAjax(pwProcessService.insertPwProcess(pwProcess)); + } + + /** + * 修改工序 + */ + @PreAuthorize("@ss.hasPermi('management:pwProcess:edit')") + @Log(title = "工序", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProcess pwProcess) + { + return toAjax(pwProcessService.updatePwProcess(pwProcess)); + } + + /** + * 删除工序 + */ + @PreAuthorize("@ss.hasPermi('management:pwProcess:remove')") + @Log(title = "工序", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProcessService.deletePwProcessByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProcessOrDeptController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProcessOrDeptController.java new file mode 100644 index 0000000..1b0b9c0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProcessOrDeptController.java @@ -0,0 +1,116 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwProcessOrDept; +import com.ruoyi.project.management.service.IPwProcessOrDeptService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 工序部门Controller + * + * @author chenyongjiang + * @date 2024-05-23 + */ +@RestController +@RequestMapping("/management/deptOrProcess") +public class PwProcessOrDeptController extends BaseController +{ + @Autowired + private IPwProcessOrDeptService pwProcessOrDeptService; + + /** + * 查询工序部门列表 + */ + @PreAuthorize("@ss.hasPermi('management:deptOrProcess:list')") + @GetMapping("/list") + public TableDataInfo list(PwProcessOrDept pwProcessOrDept) + { + startPage(); + List list = pwProcessOrDeptService.selectPwProcessOrDeptList(pwProcessOrDept); + return getDataTable(list); + } + + /** + * 导出工序部门列表 + */ + @PreAuthorize("@ss.hasPermi('management:deptOrProcess:export')") + @Log(title = "工序部门", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProcessOrDept pwProcessOrDept) + { + List list = pwProcessOrDeptService.selectPwProcessOrDeptList(pwProcessOrDept); + ExcelUtil util = new ExcelUtil(PwProcessOrDept.class); + return util.exportExcel(list, "dept"); + } + + /** + * 获取工序部门详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:deptOrProcess:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProcessOrDeptService.selectPwProcessOrDeptById(id)); + } + + /** + * 新增工序部门 + */ + @PreAuthorize("@ss.hasPermi('management:deptOrProcess:add')") + @Log(title = "工序部门", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProcessOrDept pwProcessOrDept) + { + return toAjax(pwProcessOrDeptService.insertPwProcessOrDept(pwProcessOrDept)); + } + + /** + * 修改工序部门 + */ + @PreAuthorize("@ss.hasPermi('management:deptOrProcess:edit')") + @Log(title = "工序部门", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProcessOrDept pwProcessOrDept) + { + return toAjax(pwProcessOrDeptService.updatePwProcessOrDept(pwProcessOrDept)); + } + + /** + * 删除工序部门 + */ + @PreAuthorize("@ss.hasPermi('management:deptOrProcess:remove')") + @Log(title = "工序部门", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProcessOrDeptService.deletePwProcessOrDeptByIds(ids)); + } + + @GetMapping(value = "/dept/{processName}") + public PwProcessOrDept getDept(@PathVariable("processName") String processName) + { + return pwProcessOrDeptService.selectPwProcessOrDeptByProcessName(processName); + } + + @GetMapping("/listAll") + public List listAll() + { + List list = pwProcessOrDeptService.selectPwProcessOrDeptList(null); + return list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductBillBomController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductBillBomController.java new file mode 100644 index 0000000..33dd45b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductBillBomController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwProductBillBom; +import com.ruoyi.project.management.service.IPwProductBillBomService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 生产执行单bomController + * + * @author zhukangchao + * @date 2020-08-17 + */ +@RestController +@RequestMapping("/management/ProductBillBom") +public class PwProductBillBomController extends BaseController +{ + @Autowired + private IPwProductBillBomService pwProductBillBomService; + + /** + * 查询生产执行单bom列表 + */ + @PreAuthorize("@ss.hasPermi('management:ProductBillBom:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductBillBom pwProductBillBom) + { +// startPage(); + List list = pwProductBillBomService.selectPwProductBillBomList(pwProductBillBom); + return getDataTable(list); + } + + /** + * 导出生产执行单bom列表 + */ + @PreAuthorize("@ss.hasPermi('management:ProductBillBom:export')") + @Log(title = "生产执行单bom", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductBillBom pwProductBillBom) + { + List list = pwProductBillBomService.selectPwProductBillBomList(pwProductBillBom); + ExcelUtil util = new ExcelUtil(PwProductBillBom.class); + return util.exportExcel(list, "ProductBillBom"); + } + + /** + * 获取生产执行单bom详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:ProductBillBom:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductBillBomService.selectPwProductBillBomById(id)); + } + + /** + * 新增生产执行单bom + */ + @PreAuthorize("@ss.hasPermi('management:ProductBillBom:add')") + @Log(title = "生产执行单bom", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductBillBom pwProductBillBom) + { + return toAjax(pwProductBillBomService.insertPwProductBillBom(pwProductBillBom)); + } + + /** + * 修改生产执行单bom + */ + @PreAuthorize("@ss.hasPermi('management:ProductBillBom:edit')") + @Log(title = "生产执行单bom", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductBillBom pwProductBillBom) + { + return toAjax(pwProductBillBomService.updatePwProductBillBom(pwProductBillBom)); + } + + /** + * 删除生产执行单bom + */ + @PreAuthorize("@ss.hasPermi('management:ProductBillBom:remove')") + @Log(title = "生产执行单bom", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProductBillBomService.deletePwProductBillBomByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductController.java new file mode 100644 index 0000000..9f9ea6f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductController.java @@ -0,0 +1,134 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwProduct; +import com.ruoyi.project.management.service.IPwProductService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/product") +public class PwProductController extends BaseController +{ + @Autowired + private IPwProductService pwProductService; + + /** + * 查询产品列表 + */ + @PreAuthorize("@ss.hasPermi('management:product:list')") + @GetMapping("/list") + public TableDataInfo list(PwProduct pwProduct) + { + startPage(); + List list = pwProductService.selectPwProductList(pwProduct); + return getDataTable(list); + } + + /** + * 导出产品列表 + */ + @PreAuthorize("@ss.hasPermi('management:product:export')") + @Log(title = "产品", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProduct pwProduct) + { + List list = pwProductService.selectPwProductList(pwProduct); + ExcelUtil util = new ExcelUtil(PwProduct.class); + return util.exportExcel(list, "product"); + } + + /** + * 获取产品详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:product:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductService.selectPwProductById(id)); + } + + /** + * 新增产品 + */ + @PreAuthorize("@ss.hasPermi('management:product:add')") + @Log(title = "产品", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProduct pwProduct){ + //防止出现null指针异常 + if(null==pwProduct){ + return AjaxResult.error(600,"参数不能空,请传参"); + } + //产品名称为必填,校验非空 + if(null==pwProduct.getName()||"".equals(pwProduct.getName())){ + return AjaxResult.error(10, "请输入产品名称"); + } + PwProduct product = pwProductService.selectByName(pwProduct.getName()); + if(null!=product){ + return AjaxResult.error(11,"产品名称已存在"); + } + return toAjax(pwProductService.insertPwProduct(pwProduct)); + } + + /** + * 修改产品 + */ + @PreAuthorize("@ss.hasPermi('management:product:edit')") + @Log(title = "产品", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProduct pwProduct){ + //判断产品名称是否为null + if(null==pwProduct.getName()||"".equals(pwProduct.getName())){ + return AjaxResult.error(10, "请输入产品名称"); + } + PwProduct product = pwProductService.selectByName(pwProduct.getName()); + //判断产品名称是否存在 + if(null!=product){ + return AjaxResult.error(11,"产品名称已存在"); + } + return toAjax(pwProductService.updatePwProduct(pwProduct)); + } + + /** + * 删除产品(逻辑删除,底层sql为修改删除标记值) + */ + @PreAuthorize("@ss.hasPermi('management:product:remove')") + @Log(title = "产品", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + return toAjax(pwProductService.deletePwProductByIds(ids)); + } + + /** + * 根据产品名称查询 + */ + @RequestMapping("/selectByName") + public AjaxResult selectByName(String name){ + PwProduct product = pwProductService.selectByName(name); + //判断产品名称是否存在 + if(null!=product){ + return AjaxResult.error(11, "产品名称已存在"); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductDetailController.java new file mode 100644 index 0000000..81ad39f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductDetailController.java @@ -0,0 +1,90 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwProductDetail; +import com.ruoyi.project.management.service.IPwProductDetailService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 金蝶生产详情Controller + * + * @author chenyongjiang + * @date 2024-04-23 + */ +@RestController +@RequestMapping("/management/productDetail") +public class PwProductDetailController extends BaseController +{ + @Autowired + private IPwProductDetailService pwProductDetailService; + + /** + * 查询金蝶生产详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:productDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductDetail pwProductDetail) + { + startPage(); + List list = pwProductDetailService.selectPwProductDetailList(pwProductDetail); + return getDataTable(list); + } + + /** + * 获取金蝶生产详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:productDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductDetailService.selectPwProductDetailById(id)); + } + + /** + * 新增金蝶生产详情 + */ + @PreAuthorize("@ss.hasPermi('management:productDetail:add')") + @Log(title = "金蝶生产详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductDetail pwProductDetail) + { + return toAjax(pwProductDetailService.insertPwProductDetail(pwProductDetail)); + } + + /** + * 修改金蝶生产详情 + */ + @PreAuthorize("@ss.hasPermi('management:productDetail:edit')") + @Log(title = "金蝶生产详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductDetail pwProductDetail) + { + return toAjax(pwProductDetailService.updatePwProductDetail(pwProductDetail)); + } + + /** + * 删除金蝶生产详情 + */ + @PreAuthorize("@ss.hasPermi('management:productDetail:remove')") + @Log(title = "金蝶生产详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(pwProductDetailService.deletePwProductDetailById(id)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductQuotationController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductQuotationController.java new file mode 100644 index 0000000..4d4e2a1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductQuotationController.java @@ -0,0 +1,397 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PcRigidChain; +import com.ruoyi.project.management.domain.PcStrokeMeasurement; +import com.ruoyi.project.management.domain.PwDanceNotStandard; +import com.ruoyi.project.management.domain.PwProductQuotation; +import com.ruoyi.project.management.domain.PwQuotation; +import com.ruoyi.project.management.service.IPcRigidChainService; +import com.ruoyi.project.management.service.IPcStrokeMeasurementService; +import com.ruoyi.project.management.service.IPwDanceNotStandardService; +import com.ruoyi.project.management.service.IPwProductQuotationService; +import com.ruoyi.project.management.service.IPwQuotationService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品报价单关联Controller + * + * @author zhukangchao + * @date 2020-07-07 + */ +@RestController +@RequestMapping("/management/productQuotation") +public class PwProductQuotationController extends BaseController +{ + @Autowired + private IPwProductQuotationService pwProductQuotationService; + //用户标识信息 + @Autowired + private TokenService tokenService; + //型号信息 + @Autowired + private IPcRigidChainService pcRigidChainService; + //非标型号管理 + @Autowired + private IPwDanceNotStandardService pwDanceNotStandardService; + //报价单信息 + @Autowired + private IPwQuotationService pwQuotationService; + //行程检测 + @Autowired + private IPcStrokeMeasurementService pcStrokeMeasurementService; + + /** + * 查询产品报价单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productQuotation:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductQuotation pwProductQuotation) + { + startPage(); + List list = pwProductQuotationService.selectPwProductQuotationList(pwProductQuotation); + return getDataTable(list); + } + + /** + * 导出产品报价单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productQuotation:export')") + @Log(title = "产品报价单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductQuotation pwProductQuotation) + { + List list = pwProductQuotationService.selectPwProductQuotationList(pwProductQuotation); + ExcelUtil util = new ExcelUtil(PwProductQuotation.class); + return util.exportExcel(list, "productQuotation"); + } + + /** + * 获取产品报价单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:productQuotation:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductQuotationService.selectPwProductQuotationById(id)); + } + + /** + * 新增产品报价单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productQuotation:add')") + @Log(title = "产品报价单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductQuotation pwProductQuotation){ + //校验产品类型 + if(null==pwProductQuotation.getProductType()||"".equals(pwProductQuotation.getProductType())){ + return AjaxResult.error("请选择产品类型"); + } + //校验型号类型 + if(null==pwProductQuotation.getTypeName()||"".equals(pwProductQuotation.getTypeName())){ + return AjaxResult.error("请选择型号类型"); + } + //校验数量 + if(null==pwProductQuotation.getNumber()||"".equals(pwProductQuotation.getNumber())){ + return AjaxResult.error("请输入数量"); + } + //校验单价 + if(null==pwProductQuotation.getUnivalence()||"".equals(pwProductQuotation.getUnivalence())){ + return AjaxResult.error("请输入单价"); + } + if("销齿链".equals(pwProductQuotation.getProductType())){ + //根据型号名称查询型号 + PcRigidChain rigidChain = pcRigidChainService.selectPcRigidChainByTypeName(pwProductQuotation.getTypeName()); + if(null != rigidChain){ + pwProductQuotation.setProductName(rigidChain.getProductName()); + } + }else if("卷扬机".equals(pwProductQuotation.getProductType())){ + + }else if("大幕机".equals(pwProductQuotation.getProductType())){ + + }else if("防火隔离幕阻尼驱动".equals(pwProductQuotation.getProductType())){ + + }else if("行程检测装置".equals(pwProductQuotation.getProductType())){ + PcStrokeMeasurement strokeMeasurement = pcStrokeMeasurementService.selectPcStrokeMeasurementByTypeName(pwProductQuotation.getTypeName()); + if(null != strokeMeasurement){ + pwProductQuotation.setProductName(strokeMeasurement.getProductName()); + } + }else if("二级减速器".equals(pwProductQuotation.getProductType())){ + + }else if("电机AC".equals(pwProductQuotation.getProductType())){ + + }else if("F型减速机".equals(pwProductQuotation.getProductType())){ + + }else if("制动器".equals(pwProductQuotation.getProductType())){ + + }else if("万向联轴器".equals(pwProductQuotation.getProductType())){ + + }else if("齿形联轴器".equals(pwProductQuotation.getProductType())){ + + }else if("非标产品".equals(pwProductQuotation.getProductType())){ + //查询产品信息 + PwDanceNotStandard danceNotStandard = pwDanceNotStandardService.selectPwDanceNotStandardByType(pwProductQuotation.getTypeName()); + if(null != danceNotStandard){ + pwProductQuotation.setProductName(danceNotStandard.getName()); + } + } + if(null==pwProductQuotation.getFigureNumber()||"".equals(pwProductQuotation.getFigureNumber())){ + //把型号名称和产品名称添加到图号和物料名称中 + pwProductQuotation.setFigureNumber(pwProductQuotation.getTypeName()); + //物料名称 + pwProductQuotation.setMaterialName(pwProductQuotation.getProductName()); + } + //单位统一为台 + pwProductQuotation.setUnit("台"); + //计算总价 + pwProductQuotation.setTotal(pwProductQuotation.getNumber()*pwProductQuotation.getUnivalence().doubleValue()); + //删除标记 + pwProductQuotation.setDelFlag(0); + int i = pwProductQuotationService.insertPwProductQuotation(pwProductQuotation); + int j = 0; + if(i>0){ + //根据报价单id查询报价单,把总价合并到报价单总价上 + PwQuotation pwQuotation = pwQuotationService.selectPwQuotationById(pwProductQuotation.getQuotationId()); + //总价 + Double d = 0.0; + //根据报价单id查询当前报价单下有多少中产品 + PwProductQuotation pwPQ = new PwProductQuotation(); + pwPQ.setQuotationId(pwProductQuotation.getQuotationId()); + List list = pwProductQuotationService.selectPwProductQuotationList(pwPQ); + for (PwProductQuotation pwProductQuotation2 : list) { + d += pwProductQuotation2.getTotal(); + } + pwQuotation.setTotalPrices(d); + j = pwQuotationService.updatePwQuotation(pwQuotation); + } + return toAjax(j); + } + + /** + * 修改产品报价单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productQuotation:edit')") + @Log(title = "产品报价单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductQuotation pwProductQuotation){ + //校验产品类型 + if(null==pwProductQuotation.getProductType()||"".equals(pwProductQuotation.getProductType())){ + return AjaxResult.error("请选择产品类型"); + } + //校验型号类型 + if(null==pwProductQuotation.getTypeName()||"".equals(pwProductQuotation.getTypeName())){ + return AjaxResult.error("请选择型号类型"); + } + //校验数量 + if(null==pwProductQuotation.getNumber()||"".equals(pwProductQuotation.getNumber())){ + return AjaxResult.error("请输入数量"); + } + //校验单价 + if(null==pwProductQuotation.getUnivalence()||"".equals(pwProductQuotation.getUnivalence())){ + return AjaxResult.error("请输入单价"); + } + if("销齿链".equals(pwProductQuotation.getProductType())){ + //根据型号名称查询型号 + PcRigidChain rigidChain = pcRigidChainService.selectPcRigidChainByTypeName(pwProductQuotation.getTypeName()); + if(null != rigidChain){ + pwProductQuotation.setProductName(rigidChain.getProductName()); + } + }else if("卷扬机".equals(pwProductQuotation.getProductType())){ + + }else if("大幕机".equals(pwProductQuotation.getProductType())){ + + }else if("防火隔离幕阻尼驱动".equals(pwProductQuotation.getProductType())){ + + }else if("行程检测装置".equals(pwProductQuotation.getProductType())){ + PcStrokeMeasurement strokeMeasurement = pcStrokeMeasurementService.selectPcStrokeMeasurementByTypeName(pwProductQuotation.getTypeName()); + if(null != strokeMeasurement){ + pwProductQuotation.setProductName(strokeMeasurement.getProductName()); + } + }else if("二级减速器".equals(pwProductQuotation.getProductType())){ + + }else if("电机AC".equals(pwProductQuotation.getProductType())){ + + }else if("F型减速机".equals(pwProductQuotation.getProductType())){ + + }else if("制动器".equals(pwProductQuotation.getProductType())){ + + }else if("万向联轴器".equals(pwProductQuotation.getProductType())){ + + }else if("齿形联轴器".equals(pwProductQuotation.getProductType())){ + + }else if("非标产品".equals(pwProductQuotation.getProductType())){ + //查询产品信息 + PwDanceNotStandard danceNotStandard = pwDanceNotStandardService.selectPwDanceNotStandardByType(pwProductQuotation.getTypeName()); + if(null != danceNotStandard){ + pwProductQuotation.setProductName(danceNotStandard.getName()); + } + } + if(null==pwProductQuotation.getFigureNumber()||"".equals(pwProductQuotation.getFigureNumber())){ + //把型号名称和产品名称添加到图号和物料名称中 + pwProductQuotation.setFigureNumber(pwProductQuotation.getTypeName()); + //物料名称 + pwProductQuotation.setMaterialName(pwProductQuotation.getProductName()); + } + //单位统一为台 + pwProductQuotation.setUnit("台"); + //计算总价 + pwProductQuotation.setTotal(pwProductQuotation.getNumber()*pwProductQuotation.getUnivalence().doubleValue()); + //删除标记 + pwProductQuotation.setDelFlag(0); + int i = pwProductQuotationService.updatePwProductQuotation(pwProductQuotation); + int j = 0; + if(i>0){ + //根据报价单id查询报价单,把总价合并到报价单总价上 + PwQuotation pwQuotation = pwQuotationService.selectPwQuotationById(pwProductQuotation.getQuotationId()); + //总价 + Double d = 0.0; + //根据报价单id查询当前报价单下有多少中产品 + PwProductQuotation pwPQ = new PwProductQuotation(); + pwPQ.setQuotationId(pwProductQuotation.getQuotationId()); + List list = pwProductQuotationService.selectPwProductQuotationList(pwPQ); + for (PwProductQuotation pwProductQuotation2 : list) { + d += pwProductQuotation2.getTotal(); + } + pwQuotation.setTotalPrices(d); + j = pwQuotationService.updatePwQuotation(pwQuotation); + } + return toAjax(j); + } + + /** + * 删除产品报价单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productQuotation:remove')") + @Log(title = "产品报价单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //查询当前报价单 + PwProductQuotation pwProductQuotation = pwProductQuotationService.selectPwProductQuotationById(ids[0]); + int i = pwProductQuotationService.deletePwProductQuotationByIds(ids); + int j = 0; + if(i>0){ + //根据报价单id查询报价单,把总价合并到报价单总价上 + PwQuotation pwQuotation = pwQuotationService.selectPwQuotationById(pwProductQuotation.getQuotationId()); + //总价 + Double d = 0.0; + //根据报价单id查询当前报价单下有多少中产品 + PwProductQuotation pwPQ = new PwProductQuotation(); + pwPQ.setQuotationId(pwProductQuotation.getQuotationId()); + List list = pwProductQuotationService.selectPwProductQuotationList(pwPQ); + for (PwProductQuotation pwProductQuotation2 : list) { + d += pwProductQuotation2.getTotal(); + } + pwQuotation.setTotalPrices(d); + j = pwQuotationService.updatePwQuotation(pwQuotation); + } + return toAjax(j); + } + + /** + * 根据产品类型查询 + */ + @RequestMapping("/getproductClassifLists") + public TableDataInfo getproductClassifLists(PwProductQuotation pwProductQuotation){ + List list = new ArrayList(); + if("销齿链".equals(pwProductQuotation.getProductType())){ + //查询所有销齿链,按照型号分组 + list = pcRigidChainService.selectPcRigidChainByTypeList(); + }else{ + //根据各自的产品类型查询各自的产品列表 + if("卷扬机".equals(pwProductQuotation.getProductType())){ + + }else if("大幕机".equals(pwProductQuotation.getProductType())){ + + }else if("防火隔离幕阻尼驱动".equals(pwProductQuotation.getProductType())){ + + }else if("行程检测装置".equals(pwProductQuotation.getProductType())){ + PcStrokeMeasurement pcStrokeMeasurement = new PcStrokeMeasurement(); + List list2 = pcStrokeMeasurementService.selectPcStrokeMeasurementList(pcStrokeMeasurement); + PcRigidChain pcRigidChain = new PcRigidChain(); + for (PcStrokeMeasurement pcStrokeMeasurement2 : list2) { + pcRigidChain = new PcRigidChain(); + pcRigidChain.setTypeName(pcStrokeMeasurement2.getTypeName()); + pcRigidChain.setProductName(pcStrokeMeasurement2.getProductName()); + list.add(pcRigidChain); + } + }else if("二级减速器".equals(pwProductQuotation.getProductType())){ + + }else if("电机AC".equals(pwProductQuotation.getProductType())){ + + }else if("F型减速机".equals(pwProductQuotation.getProductType())){ + + }else if("制动器".equals(pwProductQuotation.getProductType())){ + + }else if("万向联轴器".equals(pwProductQuotation.getProductType())){ + + }else if("齿形联轴器".equals(pwProductQuotation.getProductType())){ + + }else if("非标产品".equals(pwProductQuotation.getProductType())){ + //查询所有非标产品型号 + PwDanceNotStandard pwDanceNotStandard = new PwDanceNotStandard(); + List list2 = pwDanceNotStandardService.selectPwDanceNotStandardList(pwDanceNotStandard); + PcRigidChain pcRigidChain = new PcRigidChain(); + for (PwDanceNotStandard pwDanceNotStandard2 : list2) { + pcRigidChain = new PcRigidChain(); + pcRigidChain.setTypeName(pwDanceNotStandard2.getTypeName()); + pcRigidChain.setProductName(pwDanceNotStandard2.getName()); + list.add(pcRigidChain); + } + }else{ + //暂时不做处理 + } + } + return getDataTable(list); + } + + /** + * 根据选择的类型查询型号 + * + */ + @RequestMapping("/getProductTypeLists") + public TableDataInfo getProductTypeLists(PwProductQuotation pwProductQuotation){ + List list = new ArrayList(); + if(null!=pwProductQuotation.getProductClassify()&&!"".equals(pwProductQuotation.getProductClassify())){ + //查询所有销齿链,按照型号分组 + list = pcRigidChainService.selectPcRigidChainByType(pwProductQuotation.getProductClassify()); + } + return getDataTable(list); + } + +// /** +// * 根据型号名称查询详细信息,把信息保存到产品与报价单关联表中 +// * 参数:型号全称,数量 +// */ +// @PreAuthorize("@ss.hasPermi('management:rigidChain:list')") +// @RequestMapping("/getPcRigidChainByTypeName") +// public TableDataInfo getPcRigidChainByTypeName(String typeName,Long quantity){ +// //获取当前登录用户信息,查询当前登录用户的vip等级 +// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); +// SysUser user = loginUser.getUser(); +// //获取用户vip的等级 +// double vipLevel = user.getVipLevel(); +// //根据型号全称查询型号信息 +// PcRigidChain pcRigidChain = pcRigidChainService.selectPcRigidChainByTypeName(typeName); +// //把型号信息保存到产品和报价单关联表中 +// PwProductQuotation pwProductQuotation = new PwProductQuotation(); +// +// return getDataTable(list); +// } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillController.java new file mode 100644 index 0000000..a991ae4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillController.java @@ -0,0 +1,2112 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import com.itextpdf.text.Rectangle; +import com.itextpdf.text.pdf.PdfReader; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import com.ruoyi.project.management.utils.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.poi.ExcelUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.interceptor.annotation.RepeatSubmit; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysDeptService; + +/** + * 生产执行单Controller + * + * @author zhukangchao + * @date 2020-07-21 + */ +@RestController +@RequestMapping("/management/productionBill") +public class PwProductionBillController extends BaseController { + + private static final Logger logger = LoggerFactory.getLogger(PwProductionBillController.class); + + @Value("${ruoyi.pdfUrl}") + private String pdfUrl; + @Value("${ruoyi.dwgAndPdf}") + private String dwgAndPdf; + @Value("${ruoyi.jdInterFaceUrl}") + private String jdInterFaceUrl; + + @Autowired + private IPwProductionBillService pwProductionBillService; + @Autowired + private IPcRigidChainService pcRigidChainService; + @Autowired + private IPwBomService pwBomService; + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + // 库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //bom信息 + @Autowired + private IPwBomNumberService pwBomNumberService; + //计算了数量的bom + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //预制单详细信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //用户信息 + @Autowired + private TokenService tokenService; + @Autowired + private ISysDeptService deptService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //保留工序信息 + @Autowired + private IPwBomNumberTwoGongxuService pwBomNumberTwoGongxuService; + @Autowired + private IPwMaterialParamsService pwMaterialParamsService; + + /** + * 查询生产执行单列表 + */ + @PreAuthorize("@ss.hasPermi('management:productionBill:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductionBill pwProductionBill) { + startPage(); + List list = pwProductionBillService.selectPwProductionBillList(pwProductionBill); + return getDataTable(list); + } + + @GetMapping("/lists") + public TableDataInfo lists(PwProductionBill pwProductionBill) { +// pwProductionBill.setStatus("未完成"); + startPage(); + List list = pwProductionBillService.selectPwProductionBillList(pwProductionBill); + return getDataTable(list); + } + + /** + * 导出生产执行单列表 + */ + @PreAuthorize("@ss.hasPermi('management:productionBill:export')") + @Log(title = "生产执行单", businessType = BusinessType.EXPORT) + @GetMapping("/export/{ids}") + public AjaxResult export(@PathVariable Long[] ids) { + LinkedList list = new LinkedList(); + for (Long id : ids) { + + //根据id查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(id); + + //根据执行单查询执行单详情 + List list2 = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(productionBill.getId()); + for (PwProductionBillProduct pwProductionBillProduct : list2) { + + //根据令号,型号查询bom表(不包含序的物料) + List list3 = pwBomNumberTwoService.selectBomTwoByCodeAndSparedOne(productionBill.getCode(),pwProductionBillProduct.getProductType()); + for (PwBomNumberTwo pwBomNumberTwo : list3) { + ProductBillBomTwo productBillBomTwo = new ProductBillBomTwo(); + //令号 + productBillBomTwo.setCode(productionBill.getCode()); + //产品名称 + productBillBomTwo.setProductName(pwProductionBillProduct.getProductName()); + //产品型号 + productBillBomTwo.setProductType(pwProductionBillProduct.getProductType()); + //数量 + productBillBomTwo.setQuantity(pwProductionBillProduct.getQuantity()); + + //图号 + productBillBomTwo.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //名称 + productBillBomTwo.setName(pwBomNumberTwo.getName()); + //单台数量 + productBillBomTwo.setOneNumber(pwBomNumberTwo.getOneNumber()); + //材料 + productBillBomTwo.setType(pwBomNumberTwo.getType()); + //单重 + productBillBomTwo.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //本批数量 + productBillBomTwo.setSumNumber(pwBomNumberTwo.getSumNumber()); + //备注 + productBillBomTwo.setRemarks(pwBomNumberTwo.getRemarks()); + //完成时间 + productBillBomTwo.setCompletionDate(pwBomNumberTwo.getCompletionDate()); + //是否有库存 + productBillBomTwo.setSparedTwo(pwBomNumberTwo.getSparedTwo()); + + //查询入库(当前物料最后一序的入库) + //根据物料查询序的信息 + List list4 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + //最后一序的code + if(list4.size()>0){ + String code = list4.get(list4.size()-1).getProductionCode(); + String name = list4.get(list4.size()-1).getName(); + String figureNumber = list4.get(list4.size()-1).getFigureNumber(); + //查询当前物料的最后一序 + List list8 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(code, name, figureNumber); + Long rukuNumber2 = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list8) { + rukuNumber2 += imProductReceiptMaterial.getReceived().longValue(); + } + productBillBomTwo.setRukuNumber(rukuNumber2); + } + + //查询出库(当前序的出库) + List list7 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + Long chukuNumber2 = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list7) { + chukuNumber2 += imStockRequisitionMaterial.getAlreadyQuantity(); + } + productBillBomTwo.setChukuNumber(chukuNumber2); + + list.add(productBillBomTwo); + + + for (PwBomNumberTwo pwBomNumberTwo2 : list4) { + + productBillBomTwo = new ProductBillBomTwo(); + + //令号 + productBillBomTwo.setCode(productionBill.getCode()); + //产品名称 + productBillBomTwo.setProductName(pwProductionBillProduct.getProductName()); + //产品型号 + productBillBomTwo.setProductType(pwProductionBillProduct.getProductType()); + //数量 + productBillBomTwo.setQuantity(pwProductionBillProduct.getQuantity()); + + //图号 + productBillBomTwo.setFigureNumber(pwBomNumberTwo2.getFigureNumber()); + //名称 + productBillBomTwo.setName(pwBomNumberTwo2.getName()); + //单台数量 + productBillBomTwo.setOneNumber(pwBomNumberTwo2.getOneNumber()); + //材料 + productBillBomTwo.setType(pwBomNumberTwo2.getType()); + //单重 + productBillBomTwo.setPieceWeight(pwBomNumberTwo2.getPieceWeight()); + //本批数量 + productBillBomTwo.setSumNumber(pwBomNumberTwo2.getSumNumber()); + //备注 + productBillBomTwo.setRemarks(pwBomNumberTwo2.getRemarks()); + //工序名称 + productBillBomTwo.setProcessName(pwBomNumberTwo2.getProcessName()); + //派工部门 + productBillBomTwo.setDepartmentName(pwBomNumberTwo2.getDepartmentName()); + //完成时间 + productBillBomTwo.setCompletionDate(pwBomNumberTwo2.getCompletionDate()); + //是否有库存 + productBillBomTwo.setSparedTwo(pwBomNumberTwo2.getSparedTwo()); + //材料采购日期 + productBillBomTwo.setMaterialsDate(pwBomNumberTwo2.getMaterialsDate()); + + //查询出库(当前序的出库) + List list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo2.getProductionCode(), pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + Long chukuNumber = 0L; + for (ImStockRequisitionMaterial imStockRequisitionMaterial : list5) { + chukuNumber += imStockRequisitionMaterial.getAlreadyQuantity(); + } + productBillBomTwo.setChukuNumber(chukuNumber); + + //查询入库(当前序的入库) + List list6 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo2.getProductionCode(), pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + Long rukuNumber = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list6) { + rukuNumber += imProductReceiptMaterial.getReceived().longValue(); + } + productBillBomTwo.setRukuNumber(rukuNumber); + + list.add(productBillBomTwo); + } + } + } + + } + + ExcelUtil util = new ExcelUtil(ProductBillBomTwo.class); + return util.exportExcel(list, "执行单统计"); + } + + /** + * 获取生产执行单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:productionBill:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwProductionBillService.selectPwProductionBillById(id)); + } + + /** + * 修改生产执行单 + */ + @PreAuthorize("@ss.hasPermi('management:productionBill:edit')") + @Log(title = "生产执行单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductionBill pwProductionBill) { + return toAjax(pwProductionBillService.updatePwProductionBill(pwProductionBill)); + } + + /** + * 删除生产执行单 + */ + @PreAuthorize("@ss.hasPermi('management:productionBill:remove')") + @Log(title = "生产执行单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(pwProductionBillService.deletePwProductionBillByIds(ids)); + } + + /** + * 根据生产令号获取当前令号下所有的型号 + * @param code + * @return + */ + @GetMapping("/getJourneyList") + public TableDataInfo getJourneyList(String code){ + //根据令号查询当前令号下所有的型号 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + PwProductionBillProduct pwProductionBillProduct = new PwProductionBillProduct(); + pwProductionBillProduct.setProductionBillId(productionBill.getId()); + List list = pwProductionBillProductService.selectPwProductionBillProductList(pwProductionBillProduct); + return getDataTable(list); + } + + /** + * 根据生产令号获取当前令号下所有的图号,标准件的不要 + * @param code + * @return + */ + @GetMapping("/getJourneyLists") + public TableDataInfo getJourneyLists(String code,String productType){ + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndProductType(code,productType); + return getDataTable(list); + } + + /** + * 下载Dwg图纸 + */ + @RequestMapping("/submitDwg") + public AjaxResult submitDwg(@RequestBody PwProductionBill pwProductionBill){ + if(null==pwProductionBill.getCode()||"".equals(pwProductionBill.getCode())){ + return AjaxResult.error("请选择生产令号"); + } + if(null==pwProductionBill.getSparedTwo()||"".equals(pwProductionBill.getSparedTwo())){ + return AjaxResult.error("请选择型号"); + } + //获取用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(pwProductionBill.getSparedTwo().contains("XCL")){ + //判断是否有权限下载 + if(user.getDeptId()!=213&&user.getDeptId()!=103){ + //说明不是工艺部 + return AjaxResult.error("当前账号无权限"); + } + } + String string = pwProductionBill.getSparedTwo().replaceAll("/", "-"); + String s = ""; + if("2".equals(pwProductionBill.getSign())){ + s = "http://localhost:8903/product/"+pwProductionBill.getCode()+"/"+string+".dwg"; + }else{ + s = "http://localhost:8903/product/"+pwProductionBill.getCode()+"/"+string+".stp"; + } + + return AjaxResult.success(s); + } + + /** + * 生成生产执行单 参数:执行单 + */ + @PreAuthorize("@ss.hasPermi('management:productionBill:add')") + @Log(title = "生产执行单", businessType = BusinessType.INSERT) + @RepeatSubmit + @RequestMapping("/createProductionBill") + public AjaxResult createProductionBill(@RequestBody PwProductionBill pwProductionBill) { + if(null==pwProductionBill.getSign()||"".equals(pwProductionBill.getSign())){ + return AjaxResult.error("请选择是否有图"); + } + //先查询是否有此令号了 + PwProductionBill bill = pwProductionBillService.selectPwProductionBillByProductionCode(pwProductionBill.getCode()); + if(null != bill){ + //说明有此图号了 + return AjaxResult.error("此令号已被使用"); + } + int i = 0; + try { + i = pwProductionBillService.insertPwProductionBill(pwProductionBill); + if (500 == i) { + return AjaxResult.error("程序出错,请重试"); + } + } catch (Exception e) { + e.printStackTrace(); + } + return toAjax(i); + } + + /** + * 生成生产执行单 参数:执行单 新程序出图 + */ + @PreAuthorize("@ss.hasPermi('management:productionBill:add')") + @Log(title = "生产执行单", businessType = BusinessType.INSERT) + @RepeatSubmit + @RequestMapping("/createProductionBillNew") + public AjaxResult createProductionBillNew(@RequestBody PwProductionBill pwProductionBill) { + if(null==pwProductionBill.getSign()||"".equals(pwProductionBill.getSign())){ + return AjaxResult.error("请选择图纸!!"); + } + //先查询是否有此令号了 + PwProductionBill bill = pwProductionBillService.selectPwProductionBillByProductionCode(pwProductionBill.getCode()); + if(null != bill){ + //说明有此图号了 + return AjaxResult.error("此令号已被使用"); + } + return pwProductionBillService.insertPwProductionBillNew(pwProductionBill); + } + + //前端循环查询状态码 + @RequestMapping("/selectStatusCode") + public AjaxResult selectStatusCode(){ + //获取当前状态码 + return AjaxResult.success(AllInfo.statusCode); + } + + /** + * 新增产品 + */ + @PreAuthorize("@ss.hasPermi('management:product:add')") + @Log(title = "产品", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductionBill pwProductionBill){ + + return toAjax(pwProductionBillService.insertPwProductionBillWF(pwProductionBill)); + } + + /** + * 生产总图回调接口 + */ + @RequestMapping("/updateWorkingDrawing") + public void updateWorkingDrawing(Long id, String sendGet) { + PwProductionBillProduct pwProductionBillProduct = pwProductionBillProductService + .selectPwProductionBillProductById(id); + // json串转对象 + JSONObject rcm = JSONObject.parseObject(sendGet); + JSONObject result = JSONObject.parseObject(rcm.get("result").toString()); + // 保存生产总图路径 + pwProductionBillProduct.setGeneralAssemblyDrawing(result.get("drawing").toString()); + // 保存零部件明细文件路径 + pwProductionBillProduct.setBomUrl(result.get("form").toString()); + pwProductionBillProductService.updatePwProductionBillProduct(pwProductionBillProduct); + } + + /** + * 审核生产执行单(修改其审核状态) TODO + */ + @RequestMapping("/editStatusId") + public AjaxResult editStatusId(Long id) { + // 根据生产执行单id查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(id); + String arr = ""; + if("-".equals(productionBill.getCode().substring(2,3))){ + arr += "F:/20"+productionBill.getCode().substring(3,5)+"/"; + }else{ + arr += "F:/20"+productionBill.getCode().substring(2,4)+"/"; + } + //删除目录和文件夹 + DeleteFile.deleteDirectory(arr+productionBill.getCode()+"/bomThree"); + //创建打包的文件夹,如果存在,先删除再创建 + File bomThree = new File(arr+productionBill.getCode()+"/bomThree"); + //创建文件夹 + if (!bomThree.exists()) { + bomThree.mkdir(); + } + //获取产品信息 + List pro_list = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(id); + //获取当前图号的所属型号 + String replaceAll = pro_list.get(0).getProductType().replaceAll("/","-") + "-PDF"; + File f = new File(arr+productionBill.getCode()+"/"+replaceAll); + if(!f.exists()){ + return AjaxResult.error("路径不存在"); + } + //获取所有的pdf文件 + PdfReader reader = null; + File fa[] = f.listFiles(); + PDFDocHelper pd = new PDFDocHelper(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + try { + pd.imageWatermark(arr+productionBill.getCode()+"/"+ replaceAll + "/" + name, arr+productionBill.getCode()+"/bomThree/"+name.substring(name.indexOf("-")+1), "D:/java/tuzhizhang.png"); + } catch (Exception e) { + e.printStackTrace(); + }finally { + if(reader != null){ + reader.close(); + } + } + } + // 修改执行单审核状态为已审核2 + productionBill.setStatusId((long) 2); + int i = pwProductionBillService.updatePwProductionBill(productionBill); + if (i < 1) { + return AjaxResult.error(); + } + return AjaxResult.success(); + } + + /*@RequestMapping("/uploadPDF") + public AjaxResult uploadPDF(Long id) { + SimpleDateFormat sdf= new SimpleDateFormat("MM月dd日"); + // 根据id查询令号 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(id); + String code = productionBill.getCode(); + + //创建bom表查看图纸的文件夹(去掉页码的pdf,可供于bom表直接点击查看图纸) + File filesBom = new File(dwgAndPdf+code+"/bom"); + if (!filesBom.exists()) { + filesBom.mkdir(); + } + + //创建zip压缩文件夹,把没有库存的图复制到此文件夹下等待压缩 + File files = new File(dwgAndPdf+code+"/zip"); + if (!files.exists()) { + files.mkdir(); + } + FileInputStream fileInputStream = null; + FileOutputStream fileOutputStream = null; + //根据令号查询当前令号下没有库存且不是标准件的图号 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCode(code); + //查询库存 + //List res_list = BaseDataTool.queryMaterialsForInstantLibrary(""); + for (PwBomNumberTwo pwBomNumberTwo : list) { + if(code.indexOf("QB") == -1){ + int flag = 0; + for(JDInvertoryVo jDInvertoryVo : res_list){ + if(pwBomNumberTwo.getFigureNumber().equals(jDInvertoryVo.getFnumber())){ + //判断库存数量大于本批数量 + String str = jDInvertoryVo.getBaseQty().substring(0,jDInvertoryVo.getBaseQty().indexOf(".")); + if(pwBomNumberTwo.getSumNumber() < Long.valueOf(str)){ + flag = 1; + } + } + } + if(flag == 1){ + continue; + } + } + //获取图号,根据图号去服务器pdf文件夹下找对应的图纸 + String figureNumber = pwBomNumberTwo.getFigureNumber(); + + String s = figureNumber+".pdf"; + s = s.replace("/", "--"); + //获取当前图号的所属型号 + String replaceAll = pwBomNumberTwo.getSparedOne().replaceAll("/","-"); + //获取pdf所在路径 + File f = new File(dwgAndPdf+code+"/"+replaceAll+"-pdf"); + if (!f.exists()) { + System.out.println(dwgAndPdf+code+"/"+replaceAll+"-pdf" + " not exists"); + return AjaxResult.error("路径不存在"); + } + PdfReader reader = null; + float height = 0.0f; + float width = 0.0f; + //获取所有的pdf文件 + File fa[] = f.listFiles(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + //去掉页码的文件名 + String na = name.substring(name.indexOf("-")+1); + //文件输入流,用于读取要复制的文件 + try { + //获取要复制的文件 + File oldfileBom = new File(dwgAndPdf+code+"/"+replaceAll+"-pdf/" + name); + fileInputStream = new FileInputStream(oldfileBom); + reader = new PdfReader(dwgAndPdf+code+"/"+replaceAll+"-pdf/" + name); + // 获取pdf的宽和高 + Rectangle pageSize = reader.getPageSize(1); + height = pageSize.getHeight(); + width = pageSize.getWidth(); + //要生成的新文件(指定路径如果没有则创建) + File newfileBom = new File(dwgAndPdf+code+"/bom/" + name.substring(name.indexOf("-")+1)); + //获取父目录 + File fileParent = newfileBom.getParentFile(); + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfileBom.exists()){ + newfileBom.delete(); + } + //判断文件是否存在 + if (!newfileBom.exists()) { + //创建文件 + newfileBom.createNewFile(); + } + fileOutputStream = new FileOutputStream (newfileBom); + byte[] buffer= new byte[1024]; + int len; + //将文件流信息读取文件缓存区,如果读取结果不为-1就代表文件没有读取完毕,反之已经读取完毕 + while ((len=fileInputStream.read(buffer))!=-1) { + fileOutputStream.write(buffer, 0, len); + fileOutputStream.flush(); + } + fileInputStream.close(); + fileOutputStream.close(); + } catch (Exception e1) { + e1.printStackTrace(); + return AjaxResult.error(); + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + //把名称中带有/2-1、/3-1、/4-1、/5-1、/6-1、的图纸,合并成一张pdf。用于浏览器查看 + if(na.contains("--2-1")){ + //如果包函此类型的字符串,则代表有多张图 + //截取标准图号 + String string = na.replaceAll("--2-1", ""); + String strings = string.replaceAll(".pdf", ""); + //标准图号 + System.out.println("标准图号:"+string); + //根据标准图号拼接 + List files2 = new ArrayList(); + File file = new File(dwgAndPdf+code+"/bom/"+strings+"--2-1.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--2-1.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--2-2.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--2-2.pdf")); + } + + try { + PDFDocHelper.mulFile2One(files2, dwgAndPdf+code+"/bom/"+string); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + }else if(na.contains("--3-1")){ + //如果包函此类型的字符串,则代表有多张图 + //截取标准图号 + String string = na.replaceAll("--3-1", ""); + String strings = string.replaceAll(".pdf", ""); + //标准图号 + System.out.println("标准图号:"+string); + //根据标准图号拼接 + List files2 = new ArrayList(); + File file = new File(dwgAndPdf+code+"/bom/"+strings+"--3-1.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--3-1.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--3-2.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--3-2.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--3-3.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--3-3.pdf")); + } + + try { + PDFDocHelper.mulFile2One(files2, dwgAndPdf+code+"/bom/"+string); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + }else if(na.contains("--4-1")){ + //如果包函此类型的字符串,则代表有多张图 + //截取标准图号 + String string = na.replaceAll("--4-1", ""); + String strings = string.replaceAll(".pdf", ""); + //标准图号 + System.out.println("标准图号:"+string); + //根据标准图号拼接 + List files2 = new ArrayList(); + File file = new File(dwgAndPdf+code+"/bom/"+strings+"--4-1.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--4-1.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--4-2.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--4-2.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--4-3.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--4-3.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--4-4.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--4-4.pdf")); + } + + try { + File f2 =PDFDocHelper.mulFile2One(files2, dwgAndPdf+code+"/bom/"+string); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + }else if(na.contains("--5-1")){ + //如果包函此类型的字符串,则代表有多张图 + //截取标准图号 + String string = na.replaceAll("--5-1", ""); + String strings = string.replaceAll(".pdf", ""); + //标准图号 + System.out.println("标准图号:"+string); + //根据标准图号拼接 + List files2 = new ArrayList(); + File file = new File(dwgAndPdf+code+"/bom/"+strings+"--5-1.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--5-1.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--5-2.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--5-2.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--5-3.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--5-3.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--5-4.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--5-4.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--5-5.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--5-5.pdf")); + } + + try { + PDFDocHelper.mulFile2One(files2, dwgAndPdf+code+"/bom/"+string); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + }else if(na.contains("--6-1")){ + //如果包函此类型的字符串,则代表有多张图 + //截取标准图号 + String string = na.replaceAll("--6-1", ""); + String strings = string.replaceAll(".pdf", ""); + //标准图号 + System.out.println("标准图号:"+string); + //根据标准图号拼接 + List files2 = new ArrayList(); + File file = new File(dwgAndPdf+code+"/bom/"+strings+"--6-1.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--6-1.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--6-2.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--6-2.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--6-3.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--6-3.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--6-4.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--6-4.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--6-5.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--6-5.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"--6-6.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"--6-6.pdf")); + } + + try { + PDFDocHelper.mulFile2One(files2, dwgAndPdf+code+"/bom/"+string); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + }else if(na.contains("XCL.1-1")){ + //如果包函此类型的字符串,则代表有多张图 + //截取标准图号 + String string = na.replaceAll("-1", ""); + String strings = string.replaceAll(".pdf", ""); + //标准图号 + System.out.println("标准图号:"+string); + //根据标准图号拼接 + List files2 = new ArrayList(); + File file = new File(dwgAndPdf+code+"/bom/"+strings+"-1.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-1.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-2.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-2.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-3.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-3.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-4.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-4.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-5.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-5.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-6.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-6.pdf")); + } + + try { + PDFDocHelper.mulFile2One(files2, dwgAndPdf+code+"/bom/"+string); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + }else if(na.contains("XCL.2-1")){ + //如果包函此类型的字符串,则代表有多张图 + //截取标准图号 + String string = na.replaceAll("-1", ""); + String strings = string.replaceAll(".pdf", ""); + //标准图号 + System.out.println("标准图号:"+string); + //根据标准图号拼接 + List files2 = new ArrayList(); + File file = new File(dwgAndPdf+code+"/bom/"+strings+"-1.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-1.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-2.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-2.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-3.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-3.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-4.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-4.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-5.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-5.pdf")); + } + file = new File(dwgAndPdf+code+"/bom/"+strings+"-6.pdf"); + if(file.exists()){ + files2.add(new File(dwgAndPdf+code+"/bom/"+strings+"-6.pdf")); + } + + try { + PDFDocHelper.mulFile2One(files2, dwgAndPdf+code+"/bom/"+string); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + //如果名称相同则把文件重新放入到一个新的文件夹,等待压缩 + if(s.equals(na)){ + try { + //获取要复制的文件 + File oldfile = new File(dwgAndPdf+code+"/"+replaceAll+"-pdf/" + name); + //文件输入流,用于读取要复制的文件 + fileInputStream = new FileInputStream(oldfile); + //要生成的新文件(指定路径如果没有则创建) + File newfile = new File(dwgAndPdf+code+"/new/" + name); + File zipfile = new File(dwgAndPdf+code+"/zip/" + name); + //获取父目录 + File fileParent = newfile.getParentFile(); + if(fileParent.exists()){ + fileParent.delete(); + } + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfile.exists()){ + newfile.delete(); + } + //判断文件是否存在 + if (!newfile.exists()) { + //创建文件 + newfile.createNewFile(); + }else{ + continue; + } + if(zipfile.exists()){ + zipfile.delete(); + } + fileOutputStream = new FileOutputStream (zipfile); + byte[] buffer= new byte[1024]; + int len; + //将文件流信息读取文件缓存区,如果读取结果不为-1就代表文件没有读取完毕,反之已经读取完毕 + while ((len=fileInputStream.read(buffer))!=-1) { + fileOutputStream.write(buffer, 0, len); + fileOutputStream.flush(); + } + } catch (Exception e) { + // TODO: handle exception + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + }else if( + na.contains("--2-1")||na.contains("--2-2") + ||na.contains("--3-1")||na.contains("--3-2")||na.contains("--3-3") + ||na.contains("--4-1")||na.contains("--4-2")||na.contains("--4-3")||na.contains("--4-4") + ||na.contains("--5-1")||na.contains("--5-2")||na.contains("--5-3")||na.contains("--5-4")||na.contains("--5-5") + ||na.contains("--6-1")||na.contains("--6-2")||na.contains("--6-3")||na.contains("--6-4")||na.contains("--6-5")||na.contains("--6-6") + ||na.contains("XCL.1-1")||na.contains("XCL.1-2")||na.contains("XCL.1-3")||na.contains("XCL.1-4")||na.contains("XCL.1-5") + ||na.contains("XCL.2-1")||na.contains("XCL.2-2")||na.contains("XCL.2-3")||na.contains("XCL.2-4")||na.contains("XCL.2-5") + ){ + try { + //获取要复制的文件 + File oldfile = new File(dwgAndPdf+code+"/"+replaceAll+"-pdf/" + name); + //文件输入流,用于读取要复制的文件 + fileInputStream = new FileInputStream(oldfile); + //要生成的新文件(指定路径如果没有则创建) + File newfile = new File(dwgAndPdf+code+"/new/" + name); + File zipfile = new File(dwgAndPdf+code+"/zip/" + name); + //获取父目录 + File fileParent = newfile.getParentFile(); + if(fileParent.exists()){ + fileParent.delete(); + } + //判断是否存在 + if (!fileParent.exists()) { + // 创建父目录文件夹 + fileParent.mkdirs(); + } + if(newfile.exists()){ + newfile.delete(); + } + //判断文件是否存在 + if (!newfile.exists()) { + //创建文件 + newfile.createNewFile(); + }else{ + continue; + } + fileOutputStream = new FileOutputStream (zipfile); + byte[] buffer= new byte[1024]; + int len; + //将文件流信息读取文件缓存区,如果读取结果不为-1就代表文件没有读取完毕,反之已经读取完毕 + while ((len=fileInputStream.read(buffer))!=-1) { + fileOutputStream.write(buffer, 0, len); + fileOutputStream.flush(); + } + } catch (Exception e) { + // TODO: handle exception + return AjaxResult.error(); + }finally { + try { + if(null!=fileInputStream){ + fileInputStream.close(); + } + if(null!=fileOutputStream){ + fileOutputStream.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + } + File file = new File(dwgAndPdf + code + "/zip/"+ code + ".zip"); + if (file.exists()) { + file.delete(); + } + // 把当前文件夹下所有的文件打包,把路径保存到数据库 + boolean flag = FileToZip.fileToZip(dwgAndPdf + code + "/zip", dwgAndPdf + code + "/zip", code); + if (flag) { + return AjaxResult.success(code); + } else { + return AjaxResult.error(); + } + }*/ + + /** + * 下载bom表 + */ + @RequestMapping("/exportBom/{ids}") + public AjaxResult downloadBOM(@PathVariable Long[] ids) { + // 创建excel文件 + ExcelUtils util = new ExcelUtils(PwBomNumberTwoVo.class); + List list = new ArrayList(); + //标准件表 + List list2 = new ArrayList(); + //外购件表 + List list3 = new ArrayList(); + //甲供件表 + List list4 = new ArrayList(); + //原始表 + List list5 = new ArrayList(); + //汇总表 + List list6 = new ArrayList(); + //自制件表 + List list7 = new ArrayList(); + //伊特自制表 + List list13 = new ArrayList(); + + //表头 + String title = ""; + String titles = ""; + String code = ""; + for (Long id : ids) { + // 根据执行单id查询当前执行单下所有的型号 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductById(id); + //查询当前的执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(productionBillProduct.getProductionBillId()); + //令号 + code = productionBill.getCode(); + PwBomNumberTwoVo two = new PwBomNumberTwoVo(); + two.setProductionCode(code); + two.setSparedOne(productionBillProduct.getProductType()); + //根据令号查询bom表(计算之后的) + list = pwBomNumberTwoService.selectPwBomNumberTwoListToBomVo(two); + //计算之前的 + PwBomNumber pwbom = new PwBomNumber(); + pwbom.setProductionCode(code); + pwbom.setTypeName(productionBillProduct.getProductType()); + List bomNumberList = pwBomNumberService.selectPwBomNumberList(pwbom); + for (PwBomNumber pwBomNumber : bomNumberList) { + if(null!=pwBomNumber.getSumNumber()){ + PwBomNumberTwoVo pwBomNumberTwoVo = new PwBomNumberTwoVo(); + //序号 + pwBomNumberTwoVo.setNum(pwBomNumber.getNum()); + //图号 + pwBomNumberTwoVo.setFigureNumber(pwBomNumber.getFigureNumber()); + //名称 + pwBomNumberTwoVo.setName(pwBomNumber.getName()); + //单台数量 + pwBomNumberTwoVo.setOneNumber(pwBomNumber.getOneNumber()); + //材料 + pwBomNumberTwoVo.setType(pwBomNumber.getType()); + //单重 + pwBomNumberTwoVo.setPieceWeight(pwBomNumber.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwoVo.setSumNumber(pwBomNumber.getOneNumber()*productionBillProduct.getQuantity()); + //是否有库存 + + //备注 + pwBomNumberTwoVo.setRemarks(pwBomNumber.getRemarks()); + + list6.add(pwBomNumberTwoVo); + }else{ + continue; + } + //查找下一级 + List list8 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber.getFigureNumber(), code,pwBomNumber.getNum()); + for (PwBomNumber pwBomNumber2 : list8) { + PwBomNumberTwoVo pwBomNumberTwoVo2 = new PwBomNumberTwoVo(); + //序号 + pwBomNumberTwoVo2.setNum(pwBomNumber2.getNum()); + //图号 + pwBomNumberTwoVo2.setFigureNumber(pwBomNumber2.getFigureNumber()); + //名称 + pwBomNumberTwoVo2.setName(pwBomNumber2.getName()); + //单台数量 + pwBomNumberTwoVo2.setOneNumber(pwBomNumber2.getOneNumber()); + //材料 + pwBomNumberTwoVo2.setType(pwBomNumber2.getType()); + //单重 + pwBomNumberTwoVo2.setPieceWeight(pwBomNumber2.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwoVo2.setSumNumber(pwBomNumber2.getOneNumber()*productionBillProduct.getQuantity()); + //是否有库存 + + //备注 + pwBomNumberTwoVo2.setRemarks(pwBomNumber2.getRemarks()); + list6.add(pwBomNumberTwoVo2); + //查找下一级 + List list9 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber2.getFigureNumber(), code,pwBomNumber2.getNum()); + for (PwBomNumber pwBomNumber3 : list9) { + PwBomNumberTwoVo pwBomNumberTwoVo3 = new PwBomNumberTwoVo(); + //序号 + pwBomNumberTwoVo3.setNum(pwBomNumber3.getNum()); + //图号 + pwBomNumberTwoVo3.setFigureNumber(pwBomNumber3.getFigureNumber()); + //名称 + pwBomNumberTwoVo3.setName(pwBomNumber3.getName()); + //单台数量 + pwBomNumberTwoVo3.setOneNumber(pwBomNumber3.getOneNumber()); + //材料 + pwBomNumberTwoVo3.setType(pwBomNumber3.getType()); + //单重 + pwBomNumberTwoVo3.setPieceWeight(pwBomNumber3.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwoVo3.setSumNumber(pwBomNumber3.getOneNumber()*productionBillProduct.getQuantity()); + //是否有库存 + + //备注 + pwBomNumberTwoVo3.setRemarks(pwBomNumber3.getRemarks()); + list6.add(pwBomNumberTwoVo3); + //查找下一级 + List list10 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber3.getFigureNumber(), code,pwBomNumber3.getNum()); + for (PwBomNumber pwBomNumber4 : list10) { + PwBomNumberTwoVo pwBomNumberTwoVo4 = new PwBomNumberTwoVo(); + //序号 + pwBomNumberTwoVo4.setNum(pwBomNumber4.getNum()); + //图号 + pwBomNumberTwoVo4.setFigureNumber(pwBomNumber4.getFigureNumber()); + //名称 + pwBomNumberTwoVo4.setName(pwBomNumber4.getName()); + //单台数量 + pwBomNumberTwoVo4.setOneNumber(pwBomNumber4.getOneNumber()); + //材料 + pwBomNumberTwoVo4.setType(pwBomNumber4.getType()); + //单重 + pwBomNumberTwoVo4.setPieceWeight(pwBomNumber4.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwoVo4.setSumNumber(pwBomNumber4.getOneNumber()*productionBillProduct.getQuantity()); + //是否有库存 + + //备注 + pwBomNumberTwoVo4.setRemarks(pwBomNumber4.getRemarks()); + list6.add(pwBomNumberTwoVo4); + //查找下一级 + List list11 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber4.getFigureNumber(), code,pwBomNumber4.getNum()); + for (PwBomNumber pwBomNumber5 : list11) { + PwBomNumberTwoVo pwBomNumberTwoVo5 = new PwBomNumberTwoVo(); + //序号 + pwBomNumberTwoVo5.setNum(pwBomNumber5.getNum()); + //图号 + pwBomNumberTwoVo5.setFigureNumber(pwBomNumber5.getFigureNumber()); + //名称 + pwBomNumberTwoVo5.setName(pwBomNumber5.getName()); + //单台数量 + pwBomNumberTwoVo5.setOneNumber(pwBomNumber5.getOneNumber()); + //材料 + pwBomNumberTwoVo5.setType(pwBomNumber5.getType()); + //单重 + pwBomNumberTwoVo5.setPieceWeight(pwBomNumber5.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwoVo5.setSumNumber(pwBomNumber5.getOneNumber()*productionBillProduct.getQuantity()); + //是否有库存 + + //备注 + pwBomNumberTwoVo5.setRemarks(pwBomNumber5.getRemarks()); + list6.add(pwBomNumberTwoVo5); + //查找下一级 + List list12 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber5.getFigureNumber(), code,pwBomNumber5.getNum()); + for (PwBomNumber pwBomNumber6 : list12) { + PwBomNumberTwoVo pwBomNumberTwoVo6 = new PwBomNumberTwoVo(); + //序号 + pwBomNumberTwoVo6.setNum(pwBomNumber6.getNum()); + //图号 + pwBomNumberTwoVo6.setFigureNumber(pwBomNumber6.getFigureNumber()); + //名称 + pwBomNumberTwoVo6.setName(pwBomNumber6.getName()); + //单台数量 + pwBomNumberTwoVo6.setOneNumber(pwBomNumber6.getOneNumber()); + //材料 + pwBomNumberTwoVo6.setType(pwBomNumber6.getType()); + //单重 + pwBomNumberTwoVo6.setPieceWeight(pwBomNumber6.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwoVo6.setSumNumber(pwBomNumber6.getOneNumber()*productionBillProduct.getQuantity()); + //是否有库存 + + //备注 + pwBomNumberTwoVo6.setRemarks(pwBomNumber6.getRemarks()); + list6.add(pwBomNumberTwoVo6); + } + } + } + } + } + } + + for (PwBomNumberTwoVo pwBomNumberTwoVo : list) { + list5.add(pwBomNumberTwoVo); + } + //拼接表头信息(令号+项目名+型号) + //项目名称 + String projectName = productionBill.getProjectName(); + //型号 + String productType2 = productionBillProduct.getProductType(); + String replaceAll = ""; + if(productType2.contains("L-")){ + replaceAll = productType2.replaceAll("L-", "L(R)-"); + } + if(productType2.contains("R-")){ + replaceAll = productType2.replaceAll("R-", "R(L)-"); + } + title = code+" "+projectName+" "+replaceAll; + titles = code+" "+projectName; + } + for (PwBomNumberTwoVo pwBomNumberTwoVo : list5) { + if(null!=pwBomNumberTwoVo.getRemarks()&&pwBomNumberTwoVo.getRemarks().contains("甲供件")){ + //甲供件 + if(null!=pwBomNumberTwoVo.getSumNumber()&&pwBomNumberTwoVo.getSumNumber()>0){ + list4.add(pwBomNumberTwoVo); + } + }else if(null!=pwBomNumberTwoVo.getRemarks()&&pwBomNumberTwoVo.getRemarks().contains("外购件")){ + //外购件 + if(null!=pwBomNumberTwoVo.getSumNumber()&&pwBomNumberTwoVo.getSumNumber()>0){ + list3.add(pwBomNumberTwoVo); + } + }else if(null!=pwBomNumberTwoVo.getRemarks()&&pwBomNumberTwoVo.getRemarks().contains("伊特")){ + //伊特自制 + if(null!=pwBomNumberTwoVo.getSumNumber()&&pwBomNumberTwoVo.getSumNumber()>0){ + list13.add(pwBomNumberTwoVo); + } + }else{ + if(pwBomNumberTwoVo.getFigureNumber().length() > 3) { + if ("009".equals(pwBomNumberTwoVo.getFigureNumber().substring(0, 3)) || "017".equals(pwBomNumberTwoVo.getFigureNumber().substring(0, 3)) || " ".equals(pwBomNumberTwoVo.getFigureNumber().substring(0, 2))) { + //标准件 + if (pwBomNumberTwoVo.getSumNumber() > 0) { + list2.add(pwBomNumberTwoVo); + } + continue; + } + }else{ + list7.add(pwBomNumberTwoVo); + //查询工序 + List list8 = pwBomNumberTwoService.selectPwBomNumberTwoVoByCodeAndSuperiorId(pwBomNumberTwoVo.getProductionCode(), pwBomNumberTwoVo.getId()); + for (PwBomNumberTwoVo pwBomNumberTwoVo2 : list8) { + list7.add(pwBomNumberTwoVo2); + } + continue; + } + //自制件 + if(null!=pwBomNumberTwoVo.getSumNumber()&&pwBomNumberTwoVo.getSumNumber()>0){ + list7.add(pwBomNumberTwoVo); + //查询工序 + List list8 = pwBomNumberTwoService.selectPwBomNumberTwoVoByCodeAndSuperiorId(pwBomNumberTwoVo.getProductionCode(), pwBomNumberTwoVo.getId()); + for (PwBomNumberTwoVo pwBomNumberTwoVo2 : list8) { + list7.add(pwBomNumberTwoVo2); + } + } + } + } + + return util.exportExcel(list6,list7,list2,list3,list4,list13,"汇总表","自制件","标准件","外购件","甲供件","伊特自制",title,titles,code); + } + + + /** + * 下载bom表 + */ + @RequestMapping("/exportBomWu/{ids}") + public AjaxResult downloadBOMWu(@PathVariable Long[] ids) { + // 创建excel文件 + ExcelUtils util = new ExcelUtils(PwBomNumberTwo.class); + List list = new ArrayList(); + //标准件表 + List list2 = new ArrayList(); + //外购件表 + List list3 = new ArrayList(); + //甲供件表 + List list4 = new ArrayList(); + //原始表 + List list5 = new ArrayList(); + //汇总表 + List list6 = new ArrayList(); + //自制件表 + List list7 = new ArrayList(); + //伊特自制表 + List list15 = new ArrayList(); + + //表头 + String title = ""; + String titles = ""; + String code = ""; + for (Long id : ids) { + // 根据执行单id查询当前执行单下所有的型号 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductById(id); + //查询当前的执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(productionBillProduct.getProductionBillId()); + //令号 + code = productionBill.getCode(); + PwBomNumberTwo two = new PwBomNumberTwo(); + two.setProductionCode(code); + two.setSparedOne(productionBillProduct.getProductType()); + //根据令号查询bom表(计算之后的) + list = pwBomNumberTwoService.selectPwBomNumberTwoListToBom(two); + //计算之前的 + PwBomNumber pwbom = new PwBomNumber(); + pwbom.setProductionCode(code); + pwbom.setTypeName(productionBillProduct.getProductType()); + List bomNumberList = pwBomNumberService.selectPwBomNumberList(pwbom); + //获取数据 + list6.addAll(currsionBomNumber(bomNumberList,code)); + + for (PwBomNumberTwo pwBomNumberTwo : list) { + list5.add(pwBomNumberTwo); + } + //拼接表头信息(令号+项目名+型号) + //项目名称 + String projectName = productionBill.getProjectName(); + //型号 + String productType2 = productionBillProduct.getProductType(); + String replaceAll = ""; + if(productType2.contains("L-")){ + replaceAll = productType2.replaceAll("L-", "L(R)-"); + } + if(productType2.contains("R-")){ + replaceAll = productType2.replaceAll("R-", "R(L)-"); + } + title = code+" "+projectName+" "+replaceAll; + titles = code+" "+projectName; + } + for (PwBomNumberTwo pwBomNumberTwo : list5) { + if(null!=pwBomNumberTwo.getRemarks()&&pwBomNumberTwo.getRemarks().contains("甲供件")){ + //甲供件 + if(null!=pwBomNumberTwo.getSumNumber()&&pwBomNumberTwo.getSumNumber()>0){ + list4.add(pwBomNumberTwo); + } + }else if(null!=pwBomNumberTwo.getRemarks()&&pwBomNumberTwo.getRemarks().contains("外购件")){ + //外购件 + if(null!=pwBomNumberTwo.getSumNumber()&&pwBomNumberTwo.getSumNumber()>0){ + list3.add(pwBomNumberTwo); + } + }else if(null!=pwBomNumberTwo.getRemarks()&&pwBomNumberTwo.getRemarks().contains("伊特")){ + //伊特自制 + if(null!=pwBomNumberTwo.getSumNumber()&&pwBomNumberTwo.getSumNumber()>0){ + list15.add(pwBomNumberTwo); + } + }else{ + if(pwBomNumberTwo.getFigureNumber().length() > 3){ + if("009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || "017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) ||" ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2))){ + //标准件 + if(null!=pwBomNumberTwo.getSumNumber()&&pwBomNumberTwo.getSumNumber()>0){ + list2.add(pwBomNumberTwo); + } + continue; + } + } + //自制件 + if(null!=pwBomNumberTwo.getSumNumber()&&pwBomNumberTwo.getSumNumber()>0){ + list7.add(pwBomNumberTwo); + } + } + } + + return util.exportExcel(list6,list7,list2,list3,list4,list15,"汇总表","自制件","标准件","外购件","甲供件","伊特自制",title,titles,code); + } + + /** + * 递归获取数据 + * @param bomNumberList + * @return + */ + private List currsionBomNumber(List bomNumberList,String code){ + List list6 = new ArrayList(); + PwBomNumberTwo pwBomNumberTwo = null; + for (PwBomNumber pwBomNumber : bomNumberList) { + if(pwBomNumber.getNum().indexOf(".") == -1){ + pwBomNumberTwo = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo.setNum(pwBomNumber.getNum()); + //图号 + pwBomNumberTwo.setFigureNumber(pwBomNumber.getFigureNumber()); + //名称 + pwBomNumberTwo.setName(pwBomNumber.getName()); + //单台数量 + pwBomNumberTwo.setOneNumber(pwBomNumber.getOneNumber()); + //材料 + pwBomNumberTwo.setType(pwBomNumber.getType()); + //单重 + pwBomNumberTwo.setPieceWeight(pwBomNumber.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo.setSumNumber(pwBomNumber.getSumNumber()); + //是否有库存 + + //备注 + pwBomNumberTwo.setRemarks(pwBomNumber.getRemarks()); + + list6.add(pwBomNumberTwo); + + //查找下一级 + List list8 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber.getFigureNumber(), code,pwBomNumber.getNum()); + for (PwBomNumber pwBomNumber2 : list8) { + PwBomNumberTwo pwBomNumberTwo2 = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo2.setNum(pwBomNumber2.getNum()); + //图号 + pwBomNumberTwo2.setFigureNumber(pwBomNumber2.getFigureNumber()); + //名称 + pwBomNumberTwo2.setName(pwBomNumber2.getName()); + //单台数量 + pwBomNumberTwo2.setOneNumber(pwBomNumber2.getOneNumber()); + //材料 + pwBomNumberTwo2.setType(pwBomNumber2.getType()); + //单重 + pwBomNumberTwo2.setPieceWeight(pwBomNumber2.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo2.setSumNumber(pwBomNumber2.getOneNumber()*pwBomNumber.getSumNumber()); + //是否有库存 + + //备注 + pwBomNumberTwo2.setRemarks(pwBomNumber2.getRemarks()); + list6.add(pwBomNumberTwo2); + //查找下一级 + List list9 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber2.getFigureNumber(), code,pwBomNumber2.getNum()); + for (PwBomNumber pwBomNumber3 : list9) { + PwBomNumberTwo pwBomNumberTwo3 = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo3.setNum(pwBomNumber3.getNum()); + //图号 + pwBomNumberTwo3.setFigureNumber(pwBomNumber3.getFigureNumber()); + //名称 + pwBomNumberTwo3.setName(pwBomNumber3.getName()); + //单台数量 + pwBomNumberTwo3.setOneNumber(pwBomNumber3.getOneNumber()); + //材料 + pwBomNumberTwo3.setType(pwBomNumber3.getType()); + //单重 + pwBomNumberTwo3.setPieceWeight(pwBomNumber3.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo3.setSumNumber(pwBomNumber3.getOneNumber()*pwBomNumberTwo2.getSumNumber()); + //是否有库存 + //备注 + pwBomNumberTwo3.setRemarks(pwBomNumber3.getRemarks()); + list6.add(pwBomNumberTwo3); + + //查找下一级 + List list10 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber3.getFigureNumber(), code,pwBomNumber3.getNum()); + for (PwBomNumber pwBomNumber4 : list10) { + PwBomNumberTwo pwBomNumberTwo4 = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo4.setNum(pwBomNumber4.getNum()); + //图号 + pwBomNumberTwo4.setFigureNumber(pwBomNumber4.getFigureNumber()); + //名称 + pwBomNumberTwo4.setName(pwBomNumber4.getName()); + //单台数量 + pwBomNumberTwo4.setOneNumber(pwBomNumber4.getOneNumber()); + //材料 + pwBomNumberTwo4.setType(pwBomNumber4.getType()); + //单重 + pwBomNumberTwo4.setPieceWeight(pwBomNumber4.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo4.setSumNumber(pwBomNumber4.getOneNumber() * pwBomNumberTwo3.getSumNumber()); + //是否有库存 + + //备注 + pwBomNumberTwo4.setRemarks(pwBomNumber4.getRemarks()); + list6.add(pwBomNumberTwo4); + + //查找下一级 + List list11 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber4.getFigureNumber(), code,pwBomNumber4.getNum()); + for (PwBomNumber pwBomNumber5 : list11) { + PwBomNumberTwo pwBomNumberTwo5 = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo5.setNum(pwBomNumber5.getNum()); + //图号 + pwBomNumberTwo5.setFigureNumber(pwBomNumber5.getFigureNumber()); + //名称 + pwBomNumberTwo5.setName(pwBomNumber5.getName()); + //单台数量 + pwBomNumberTwo5.setOneNumber(pwBomNumber5.getOneNumber()); + //材料 + pwBomNumberTwo5.setType(pwBomNumber5.getType()); + //单重 + pwBomNumberTwo5.setPieceWeight(pwBomNumber5.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo5.setSumNumber(pwBomNumber5.getOneNumber()*pwBomNumberTwo4.getSumNumber()); + //是否有库存 + + //备注 + pwBomNumberTwo5.setRemarks(pwBomNumber5.getRemarks()); + list6.add(pwBomNumberTwo5); + + //查找下一级 + List list12 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber5.getFigureNumber(), code,pwBomNumber5.getNum()); + for (PwBomNumber pwBomNumber6 : list12) { + PwBomNumberTwo pwBomNumberTwo6 = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo6.setNum(pwBomNumber6.getNum()); + //图号 + pwBomNumberTwo6.setFigureNumber(pwBomNumber6.getFigureNumber()); + //名称 + pwBomNumberTwo6.setName(pwBomNumber6.getName()); + //单台数量 + pwBomNumberTwo6.setOneNumber(pwBomNumber6.getOneNumber()); + //材料 + pwBomNumberTwo6.setType(pwBomNumber6.getType()); + //单重 + pwBomNumberTwo6.setPieceWeight(pwBomNumber6.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo6.setSumNumber(pwBomNumber6.getOneNumber() * pwBomNumberTwo5.getSumNumber()); + //是否有库存 + + //备注 + pwBomNumberTwo6.setRemarks(pwBomNumber6.getRemarks()); + list6.add(pwBomNumberTwo6); + + //查找下一级 + List list13 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber6.getFigureNumber(), code,pwBomNumber6.getNum()); + for (PwBomNumber pwBomNumber7 : list13) { + PwBomNumberTwo pwBomNumberTwo7 = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo7.setNum(pwBomNumber7.getNum()); + //图号 + pwBomNumberTwo7.setFigureNumber(pwBomNumber7.getFigureNumber()); + //名称 + pwBomNumberTwo7.setName(pwBomNumber7.getName()); + //单台数量 + pwBomNumberTwo7.setOneNumber(pwBomNumber7.getOneNumber()); + //材料 + pwBomNumberTwo7.setType(pwBomNumber7.getType()); + //单重 + pwBomNumberTwo7.setPieceWeight(pwBomNumber7.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo7.setSumNumber(pwBomNumber7.getOneNumber() * pwBomNumberTwo6.getSumNumber()); + //是否有库存 + + + //备注 + pwBomNumberTwo7.setRemarks(pwBomNumber7.getRemarks()); + list6.add(pwBomNumberTwo7); + + //查找下一级 + List list14 = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(pwBomNumber7.getFigureNumber(), code,pwBomNumber7.getNum()); + for (PwBomNumber pwBomNumber8 : list14) { + PwBomNumberTwo pwBomNumberTwo8 = new PwBomNumberTwo(); + //序号 + pwBomNumberTwo8.setNum(pwBomNumber8.getNum()); + //图号 + pwBomNumberTwo8.setFigureNumber(pwBomNumber8.getFigureNumber()); + //名称 + pwBomNumberTwo8.setName(pwBomNumber8.getName()); + //单台数量 + pwBomNumberTwo8.setOneNumber(pwBomNumber8.getOneNumber()); + //材料 + pwBomNumberTwo8.setType(pwBomNumber8.getType()); + //单重 + pwBomNumberTwo8.setPieceWeight(pwBomNumber8.getPieceWeight()); + //本批数量(本批数量=单台数量*台数) + pwBomNumberTwo8.setSumNumber(pwBomNumber8.getOneNumber() * pwBomNumberTwo7.getSumNumber()); + //是否有库存 + + //备注 + pwBomNumberTwo8.setRemarks(pwBomNumber8.getRemarks()); + list6.add(pwBomNumberTwo8); + } + } + } + } + } + } + } + } + } + return list6; + } + + /** + * 查询库存制作单列表(根据库存表的在途数量) + */ + @PreAuthorize("@ss.hasPermi('management:makeDocuments:list')") + @RequestMapping("/listproductionBillByInventoryDetailId/{inventoryDetailId}") + public TableDataInfo listproductionBillByInventoryDetailId(@PathVariable Long inventoryDetailId){ + //根据库存表的id查询库存表信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(inventoryDetailId); + if(null!=inventoryDetail){ + //根据物料名称和图号查询bom表中的物料信息(只查询未入库状态和入库中状态的,然后根据令号去重) + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByNameAndFigureNumberNoRepetition(inventoryDetail.getName(), inventoryDetail.getFigureNumber()); + startPage(); + List list = new ArrayList(); + for (PwBomNumberTwo pwBomNumberTwo : list2) { + //根据令号查询 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(pwBomNumberTwo.getProductionCode()); + if(null!=productionBill){ + list.add(productionBill); + } + } + return getDataTable(list); + }else{ + PwProductionBill pwProductionBill = new PwProductionBill(); + startPage(); + List list = pwProductionBillService.selectPwProductionBillList(pwProductionBill); + return getDataTable(list); + } + } + + /** + * 上传bom(派工) + */ + @RequestMapping("/uploadDispatchings") + @ResponseBody + public AjaxResult uploadDispatchings(@RequestParam("productionBillProduceId") String productionBillProduceId,@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/ruoyi/Dispatchings/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> result = ExcelUPg.readExcel(files); + //根据productionBillProduceId查询 + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductById(Long.valueOf(productionBillProduceId)); + PwProductionBill pwProductionBill = null; + if(null!=productionBillProduct){ + //根据执行单id查询执行单信息 + pwProductionBill = pwProductionBillService.selectPwProductionBillById(productionBillProduct.getProductionBillId()); + } + //获取生产令号 + String code = pwProductionBill.getCode(); + for (int i = 2; i < result.size(); i++) { + //根据令号和名称和图号查询 + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(code, result.get(i).get(2).toString(), result.get(i).get(1).toString()); + if(null!=bomNumberTwo){ + if(null!=result.get(i).get(9).toString()&&!"".equals(result.get(i).get(9).toString())){ + //完成时间 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if(result.get(i).get(9).toString().contains("/")){ + String replaceAll = result.get(i).get(9).toString().replaceAll("/", "-"); + Date date = sdf.parse(replaceAll); + bomNumberTwo.setCompletionDate(date); + }else{ + Date date = sdf.parse(result.get(i).get(9).toString()); + bomNumberTwo.setCompletionDate(date); + } + } + + if(null!=result.get(i).get(7).toString()&&!"".equals(result.get(i).get(7).toString())){ + //派工部门 + //判断完成时间和是否入库是否有数据,如果没有数据,则返回失败 + if(null!=result.get(i).get(8).toString()&&!"".equals(result.get(i).get(8).toString())&&null!=result.get(i).get(9).toString()&&!"".equals(result.get(i).get(9).toString())){ + //查询派工部门是否标准 + String replaceAll = result.get(i).get(7).toString().replaceAll("(", "("); + String replaceAll2 = replaceAll.replaceAll(")", ")"); + SysDept dept = new SysDept(); + dept.setDeptName(replaceAll2.trim()); + List list = deptService.selectDeptLists(dept); + if(list.size()>0){ + bomNumberTwo.setDepartmentName(replaceAll2.trim()); + }else{ + return AjaxResult.error("未查询到此部门"); + } + }else{ + return AjaxResult.error("请完善时间和是否入库列"); + } + } + + if(null!=result.get(i).get(8).toString()&&!"".equals(result.get(i).get(8).toString())){ + //是否入库 + //判断是否是"是"或者"否" + String trim = result.get(i).get(8).toString().trim(); + if(!"是".equals(trim)&&!"否".equals(trim)){ + return AjaxResult.error("请正确填写是否入库(是或否)"); + } + bomNumberTwo.setGodownEntry(trim); + } + } + pwBomNumberTwoService.updatePwBomNumberTwo(bomNumberTwo); + } + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success("文件上传成功"); + } + return AjaxResult.error("非excel文件不允许上传"); + } + + + /** + * 上传bom + */ + @RequestMapping("/uploadWF") + @ResponseBody + public AjaxResult uploadWF(String code,@RequestParam("file") MultipartFile filePath){ + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String substring = originalFilename.substring(originalFilename.length()-4); + //判断是否是xlsx文件或xls文件 + if("xls".equals(postfix)||"xlsx".equals(substring)){ + try { + InputStream is = filePath.getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file = new File("D:/WF/"+originalFilename); + FileOutputStream fos = new FileOutputStream(file); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + is.close(); + fos.close(); + bos.close(); + File files = new File(file.getAbsolutePath()); + ArrayList> allRows = ExcelU.readExcel(files); + List list = new ArrayList<>(); + //型号名称 + String typeName = ""; + for (int y = 2; y < allRows.size(); y++) { + PwBomNumber bom = new PwBomNumber(); + for (int j = 0; j < allRows.get(y).size(); j++) { + //令号 + bom.setProductionCode(code); + //名称 + bom.setName(allRows.get(y).get(2).toString().trim()); + //图号 + bom.setFigureNumber(allRows.get(y).get(1).toString()); + //单台数量 + if (null != allRows.get(y).get(3).toString() && !"".equals(allRows.get(y).get(3).toString())) { + bom.setOneNumber(Double.valueOf(allRows.get(y).get(3).toString()).longValue()); + } + //材料 + bom.setType(allRows.get(y).get(4).toString()); + //单重 + if (null != allRows.get(y).get(5).toString() && !"".equals(allRows.get(y).get(5).toString())) { + bom.setPieceWeight(Double.valueOf(allRows.get(y).get(5).toString())); + } + if("-9.0".equals(allRows.get(y).get(9).toString())){ + //型号 + typeName = allRows.get(y).get(1).toString(); +// bom.setSumNumber(Double.valueOf(allRows.get(y).get(7).toString()).longValue()); + } + //父级名称 + bom.setParentLevelName((allRows.get(y).get(8).toString())); + //备注 + bom.setRemarks(allRows.get(y).get(7).toString()); + //父级图号 + if("-9.0".equals(allRows.get(y).get(9).toString())){ +// bom.setParentLevelFigureNumber(null); + }else{ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString()); + } + //型号 + bom.setTypeName(typeName); + break; + } + // 保存到list,然后批量添加 + list.add(bom); + } + int i = pwBomNumberService.insertPwBoms(list); + if(i<1){ + return AjaxResult.error("文件上传失败"); + } +// AjaxResult ajaxResult = counterNum(code,typeName); + + //根据令号查询当前令号下所有的零部件,加入到物料信息表和库存信息表中 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByProductionCode(code); + for (PwBomNumberTwo pwBomNumberTwo : list2) { + //判断是否已经添加了此物料 + ImMaterial imMaterial2 = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=imMaterial2){ + //如果有库存信息,则直接更新锁定数量和可用数量 + //更新可用数量(如果库存数量大于等于锁定数量,则可用数量为库存数量-锁定数量) + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(imMaterial2.getMaterialName(), imMaterial2.getFigureNumber()); + //添加锁定数量 + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()+pwBomNumberTwo.getSumNumber()); + //判断库存+在途数量是否大于锁定数量,如果小于(需要制作),则把本批数量添加到在途上,大于则不添加(代表不需要制作) + /*if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<0){ + //代表不够本次数量,需要制作或者购买,把本批数量添加到在途数量上 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBomNumberTwo.getSumNumber()); + }*/ + if(inventoryDetail.getQuantity()>=inventoryDetail.getLockNumber()){ + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + //判断此物料是否有安全库存设置,如果有安全库存设置,则把此物料添加到预制单详情表,等待生产预制单 + if(imMaterial2.getMinimum()!=0&&imMaterial2.getHighest()!=0){ + //最低最高库存不为0,则代表有安全库存设置,然后判断可用数量是否大于最低库存数量,如果大于则不做处理,如果小于则把当前物料添加到预制单详情表中 + if(inventoryDetail.getAvailableNumber() list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorIdNotIsNull(bill.getCode()); + i = pwBomNumberTwoGongxuService.insertPwBomNumberTwoGongxus(list); + } + return toAjax(i); + } + + /** + * 引用工序按钮 + */ + @RequestMapping("/submitFormQuoteXus") + public AjaxResult submitFormQuoteXus(@RequestBody PwProductionBill pwProductionBill) { + if(null==pwProductionBill.getCode()||"".equals(pwProductionBill.getCode())){ + return AjaxResult.error("请填写需要引用的令号"); + } + //根据令号查询工序引用表中是否有此令号 + PwBomNumberTwoGongxu pwBomNumberTwoGongxu = new PwBomNumberTwoGongxu(); + pwBomNumberTwoGongxu.setProductionCode(pwProductionBill.getCode()); + List list = pwBomNumberTwoGongxuService.selectPwBomNumberTwoGongxuList(pwBomNumberTwoGongxu); + if(list.size()<1){ + return AjaxResult.error("未查询到当前令号的工序信息"); + } + //查询需要引用的执行单信息 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(pwProductionBill.getId()); + //根据令号查询bom信息 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCode(productionBill.getCode()); + int i = 0; + for (PwBomNumberTwo pwBomNumberTwo : list2) { + //根据名称和图号查询工序引用表中是否有工序 + pwBomNumberTwoGongxu = new PwBomNumberTwoGongxu(); + pwBomNumberTwoGongxu.setParentLevelName(pwBomNumberTwo.getName()); + pwBomNumberTwoGongxu.setParentLevelFigureNumber(pwBomNumberTwo.getFigureNumber()); + List list3 = pwBomNumberTwoGongxuService.selectPwBomNumberTwoGongxuList(pwBomNumberTwoGongxu); + if(list3.size()>0){ + //说明有工序 + //父級id + Long id = pwBomNumberTwo.getId(); + for (PwBomNumberTwoGongxu pwBomNumberTwoGongxu2 : list3) { + //名称 + pwBomNumberTwo.setName(pwBomNumberTwoGongxu2.getName()); + //图号 + pwBomNumberTwo.setFigureNumber(pwBomNumberTwoGongxu2.getFigureNumber()); + //工序 + pwBomNumberTwo.setProcessName(pwBomNumberTwoGongxu2.getProcessName()); + //是否入库 + pwBomNumberTwo.setGodownEntry(pwBomNumberTwoGongxu2.getGodownEntry()); + //上级id + pwBomNumberTwo.setSuperiorId(id); + //派工部门 + pwBomNumberTwo.setDepartmentName(pwBomNumberTwoGongxu2.getDepartmentName()); + //完工时间 + pwBomNumberTwo.setCompletionDate(pwBomNumberTwoGongxu2.getCompletionDate()); + //材料id + pwBomNumberTwo.setMaterialId(pwBomNumberTwoGongxu2.getMaterialId()); + //材料名称 + pwBomNumberTwo.setMaterialsName(pwBomNumberTwoGongxu2.getMaterialsName()); + //材料图号 + pwBomNumberTwo.setMaterialsSpecification(pwBomNumberTwoGongxu2.getMaterialsSpecification()); + //材料长度 + pwBomNumberTwo.setLen(pwBomNumberTwoGongxu2.getLen()); + //材料宽度 + pwBomNumberTwo.setWid(pwBomNumberTwoGongxu2.getWid()); + //下料尺寸(长*宽) + pwBomNumberTwo.setSpecification(pwBomNumberTwoGongxu2.getSpecification()); + //下料尺寸 + pwBomNumberTwo.setMeasure(pwBomNumberTwoGongxu2.getMeasure()); + //毛坯数量 + pwBomNumberTwo.setWorkblank(pwBomNumberTwoGongxu2.getWorkblank()); + //成品数量 + pwBomNumberTwo.setFinished(pwBomNumberTwoGongxu2.getFinished()); + //序描述 + pwBomNumberTwo.setXuDescribe(pwBomNumberTwoGongxu2.getXuDescribe()); + //序工时 + pwBomNumberTwo.setXuTime(pwBomNumberTwoGongxu2.getXuTime()); + //备用字段4 + pwBomNumberTwo.setSparedFour(pwBomNumberTwoGongxu2.getSparedFour()); + //删除标记 + pwBomNumberTwo.setDelFlag(0); + + i = pwBomNumberTwoService.insertPwBomNumberTwo(pwBomNumberTwo); + } + } + + } + return toAjax(i); + } + + private void recursionSonOrNumber(List reslist,String number,List list,String result_order){ + JdInterFace dto = null; + for(int p=0;p 0){ + reslist.add(dto); + } + recursionSonOrNumber(reslist,list.get(p).getMaterialCode(),list,result_order); + } + } + } + + private List recursionSonList(String number,List list){ + List rzlist = new ArrayList(); + JdInterFaceDto dto = null; + for(int p=0;p paramList = pwMaterialParamsService.selectPwMaterialParamsList(null); + for (PwMaterialParams pwMaterialParams : paramList) { + if(name.equals(pwMaterialParams.getParamName())){ + return pwMaterialParams.getParamValue(); + } + } + return null; + } + + /** + * 下载电气BOM模板 + * @return + */ + @GetMapping("/importTemplate") + public AjaxResult importTemplate() { + ExcelUtil util = new ExcelUtil(ProdictBillBom.class); + return util.importTemplateExcel("BOM模板"); + } + + @PostMapping("/importBom") + public AjaxResult importData(MultipartFile file) throws Exception { + ExcelUtil util = new ExcelUtil(ProdictBillBom.class); + List billList = util.importExcel(file.getInputStream()); + String message = pwProductionBillService.importProductBill(billList); + return AjaxResult.success(message); + } + + @RequestMapping("/uploadPDF") + public AjaxResult uploadPDF(Long id) { + SimpleDateFormat sdf= new SimpleDateFormat("MM月dd日"); + // 根据id查询令号 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(id); + String code = productionBill.getCode(); + String arr = ""; + if("-".equals(code.substring(2,3))){ + arr += "F:/20"+code.substring(3,5); + }else{ + arr += "F:/20"+code.substring(2,4); + } + arr += "/product/"; + //删除目录和文件夹 + DeleteFile.deleteDirectory(arr+code+"/zip"); + //创建打包的文件夹,如果存在,先删除再创建 + File filesZip = new File(arr+code+"/zip"); + //创建文件夹 + if (!filesZip.exists()) { + filesZip.mkdir(); + } + //删除目录和文件夹 + DeleteFile.deleteDirectory(arr+code+"/bom"); + //创建打包的文件夹,如果存在,先删除再创建 + File bom = new File(arr+code+"/bom"); + //创建文件夹 + if (!bom.exists()) { + bom.mkdir(); + } + //删除目录和文件夹 + DeleteFile.deleteDirectory(arr+code+"/bomThree"); + //创建打包的文件夹,如果存在,先删除再创建 + File bomThree = new File(arr+code+"/bomThree"); + //创建文件夹 + if (!bomThree.exists()) { + bomThree.mkdir(); + } + //获取产品信息 + List pro_list = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(id); + //获取当前图号的所属型号 + String replaceAll = pro_list.get(0).getProductType().replaceAll("/","-") + "-PDF"; + File f = new File(arr+code+"/"+replaceAll); + if(!f.exists()){ + return AjaxResult.error("路径不存在"); + } + //获取所有的pdf文件 + PdfReader reader = null; + File fa[] = f.listFiles(); + PDFDocHelper pd = new PDFDocHelper(); + for (int i = 0; i < fa.length; i++) { + File fs = fa[i]; + String name = fs.getName(); + try { + //读取纸张大小 + reader = new PdfReader(arr+code+"/"+replaceAll+"/" + name); + // 获取pdf的宽和高 + Rectangle pageSize = reader.getPageSize(1); + float height = pageSize.getHeight(); + float width = pageSize.getWidth(); + float[] pawX = {width-100}; + float[] pawY = {height-20}; + //把当前zip路径下所有的图片添加上文字水印 + List> reviews = new ArrayList<>(); + Map review = new HashMap<>(); + // 获取文件名(图号),根据图号查询表中数量 + review.put("result", width+" * "+height); + review.put("type", "1"); + reviews.add(review); + pd.imageWatermark(arr+code+"/"+ replaceAll + "/" + name, arr+code, name, "D:/java/tuzhizhang.png", reviews, pawX, pawY); + pd.imageWatermark(arr+code+"/"+ replaceAll + "/" + name, arr+code+"/bomThree/"+name.substring(name.indexOf("-")+1), "D:/java/tuzhizhang.png"); + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.error(); + }finally { + if(reader != null){ + reader.close(); + } + } + } + // 把当前文件夹下所有的文件打包,把路径保存到数据库 + boolean flag = FileToZip.fileToZip(arr + code + "/zip", arr + code + "/zip", code); + if (flag) { + return AjaxResult.success(code); + } else { + return AjaxResult.error(); + } + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillNonstandardController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillNonstandardController.java new file mode 100644 index 0000000..44653b1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillNonstandardController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwProductionBillNonstandard; +import com.ruoyi.project.management.service.IPwProductionBillNonstandardService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 产品非标生产执行单关联Controller + * + * @author zhukangchao + * @date 2020-07-21 + */ +@RestController +@RequestMapping("/management/productionBillNonstandard") +public class PwProductionBillNonstandardController extends BaseController +{ + @Autowired + private IPwProductionBillNonstandardService pwProductionBillNonstandardService; + + /** + * 查询产品非标生产执行单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillNonstandard:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductionBillNonstandard pwProductionBillNonstandard) + { + startPage(); + List list = pwProductionBillNonstandardService.selectPwProductionBillNonstandardList(pwProductionBillNonstandard); + return getDataTable(list); + } + + /** + * 导出产品非标生产执行单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillNonstandard:export')") + @Log(title = "产品非标生产执行单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductionBillNonstandard pwProductionBillNonstandard) + { + List list = pwProductionBillNonstandardService.selectPwProductionBillNonstandardList(pwProductionBillNonstandard); + ExcelUtil util = new ExcelUtil(PwProductionBillNonstandard.class); + return util.exportExcel(list, "productionBillNonstandard"); + } + + /** + * 获取产品非标生产执行单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillNonstandard:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductionBillNonstandardService.selectPwProductionBillNonstandardById(id)); + } + + /** + * 新增产品非标生产执行单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillNonstandard:add')") + @Log(title = "产品非标生产执行单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductionBillNonstandard pwProductionBillNonstandard) + { + return toAjax(pwProductionBillNonstandardService.insertPwProductionBillNonstandard(pwProductionBillNonstandard)); + } + + /** + * 修改产品非标生产执行单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillNonstandard:edit')") + @Log(title = "产品非标生产执行单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductionBillNonstandard pwProductionBillNonstandard) + { + return toAjax(pwProductionBillNonstandardService.updatePwProductionBillNonstandard(pwProductionBillNonstandard)); + } + + /** + * 删除产品非标生产执行单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillNonstandard:remove')") + @Log(title = "产品非标生产执行单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProductionBillNonstandardService.deletePwProductionBillNonstandardByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillProductController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillProductController.java new file mode 100644 index 0000000..7fb4fe6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionBillProductController.java @@ -0,0 +1,345 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; + +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 销齿链生产执行单关联Controller + * + * @author zhukangchao + * @date 2020-07-21 + */ +@RestController +@RequestMapping("/management/productionBillProduct") +public class PwProductionBillProductController extends BaseController +{ + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //领料bom表信息 + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //用户信息 + @Autowired + private TokenService tokenService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //bom表信息 + @Autowired + private IPwBomNumberService pwBomNumberService; + + /** + * 查询销齿链生产执行单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillProduct:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductionBillProduct pwProductionBillProduct) + { + startPage(); + List list = pwProductionBillProductService.selectPwProductionBillProductList(pwProductionBillProduct); + return getDataTable(list); + } + + /** + * 导出销齿链生产执行单关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillProduct:export')") + @Log(title = "销齿链生产执行单关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductionBillProduct pwProductionBillProduct) + { + List list = pwProductionBillProductService.selectPwProductionBillProductList(pwProductionBillProduct); + ExcelUtil util = new ExcelUtil(PwProductionBillProduct.class); + return util.exportExcel(list, "productionBillProduct"); + } + + /** + * 获取销齿链生产执行单关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillProduct:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductionBillProductService.selectPwProductionBillProductById(id)); + } + + /** + * 新增销齿链生产执行单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillProduct:add')") + @Log(title = "销齿链生产执行单关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductionBillProduct pwProductionBillProduct) + { + return toAjax(pwProductionBillProductService.insertPwProductionBillProduct(pwProductionBillProduct)); + } + + /** + * 修改销齿链生产执行单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillProduct:edit')") + @Log(title = "销齿链生产执行单关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductionBillProduct pwProductionBillProduct) + { + return toAjax(pwProductionBillProductService.updatePwProductionBillProduct(pwProductionBillProduct)); + } + + /** + * 删除销齿链生产执行单关联 + */ + @PreAuthorize("@ss.hasPermi('management:productionBillProduct:remove')") + @Log(title = "销齿链生产执行单关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProductionBillProductService.deletePwProductionBillProductByIds(ids)); + } + + /** + * 申请领料按钮(返回剩余申领数量) + * + */ + @RequestMapping("/storesRequisition/{id}") + public AjaxResult storesRequisition(@PathVariable("id") Long id){ + //获取要申请领料的型号的id + PwProductionBillProduct productionBillProduct = pwProductionBillProductService.selectPwProductionBillProductById(id); + //根据执行单id查询执行单信息 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(productionBillProduct.getProductionBillId()); + //根据code查询领料单 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCodeAndTypeName(productionBill.getCode(),productionBillProduct.getProductType()); + if(null!=stockRequisition){ + if(null!=stockRequisition.getSparedThree()){ + if(productionBillProduct.getQuantity() - stockRequisition.getSparedThree()<=0){ + productionBillProduct.setShuliang(0L); + }else{ + productionBillProduct.setShuliang(productionBillProduct.getQuantity() - stockRequisition.getSparedThree()); + } + } + }else{ + productionBillProduct.setShuliang(productionBillProduct.getQuantity()); + } + return AjaxResult.success(productionBillProduct); + } + + /** + * 申请领料提交按钮 + */ + @RequestMapping("/lingliao") + public AjaxResult lingliao(@RequestBody PwProductionBillProduct pwProductionBillProduct){ + //获取本次领料数量 + if(pwProductionBillProduct.getShuliang()==0){ + return AjaxResult.error("请输入申领数量"); + } + //根据执行单id查询执行单信息 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(pwProductionBillProduct.getProductionBillId()); + //根据执行单令号和产品型号查询bom表信息 + List list = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingliaoByCodeAndProductType(productionBill.getCode(), pwProductionBillProduct.getProductType()); + int i = 0; + //遍历集合,把父级为null或者空串的本批数量相加(父级为null代表是成品) + for (PwBomNumberTwoLingliao pwBomNumberTwoLingliao2 : list) { + if(null==pwBomNumberTwoLingliao2.getParentLevelFigureNumber()||"".equals(pwBomNumberTwoLingliao2.getParentLevelFigureNumber())){ + i = i + pwBomNumberTwoLingliao2.getSumNumber().intValue(); + } + } + if(pwProductionBillProduct.getShuliang()>i){ + return AjaxResult.error("申领数量不可大于总数量"); + } + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //库存是否满足本次领料标记 TODO 返回库存数量不够的数据 + List list7 = new ArrayList(); + int a = 0; + //先查询库存数量是否够本次领料的数量,如果不够,则不允许申请领 + for (PwBomNumberTwoLingliao pwBomNumberTwoLingliao2 : list) { + //根据code和名称和图号查询 + if(null!=pwBomNumberTwoLingliao2.getParentLevelFigureNumber()&&!"".equals(pwBomNumberTwoLingliao2.getParentLevelFigureNumber())&&null==pwBomNumberTwoLingliao2.getSuperiorId()&&pwBomNumberTwoLingliao2.getSumNumber()!=0){ + int t = 0; + //根据物料名称和图号和令号查询bomTwo + PwBomNumberTwo bomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(pwBomNumberTwoLingliao2.getProductionCode(), pwBomNumberTwoLingliao2.getName(), pwBomNumberTwoLingliao2.getFigureNumber()); + //根据当前物料id查询子集工序 + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwoLingliao2.getProductionCode(), bomNumberTwo.getId()); + /*if(list3.size()>0&&("装配车间".equals(list3.get(list3.size()-1).getDepartmentName())||"企标工段".equals(list3.get(list3.size()-1).getDepartmentName())||"销齿链组".equals(list3.get(list3.size()-1).getDepartmentName()))||"非标设备组".equals(list3.get(list3.size()-1).getDepartmentName())||"综合工段".equals(list3.get(list3.size()-1).getDepartmentName())){ + t = 1; + }*/ + if(t!=1&&(!"部件".equals(pwBomNumberTwoLingliao2.getType())&&!"是".equals(pwBomNumberTwoLingliao2.getTheoretical()))&& null != pwBomNumberTwoLingliao2.getName() && !pwBomNumberTwoLingliao2.getName().contains("木箱")){ + //根据物料名称和图号查询库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwoLingliao2.getName(), pwBomNumberTwoLingliao2.getFigureNumber()); + Long p = pwBomNumberTwoLingliao2.getSumNumber()/i*pwProductionBillProduct.getShuliang(); + if(inventoryDetail.getQuantity()i){ + return AjaxResult.error("申领数量不可大于总数量"); + }else{ + //修改申领数量 + stockRequisition.setSparedThree(stockRequisition.getSparedThree()+pwProductionBillProduct.getShuliang()); + stockRequisition.setGetStatus("未出库"); + int j = imStockRequisitionService.updateImStockRequisition(stockRequisition); + if(j<1){ + return AjaxResult.error("申领失败"); + } + + for (PwBomNumberTwoLingliao pwBomNumberTwoLingliao2 : list) { + //根据code和名称和图号查询 + if(null!=pwBomNumberTwoLingliao2.getParentLevelFigureNumber()&&!"".equals(pwBomNumberTwoLingliao2.getParentLevelFigureNumber())&&null==pwBomNumberTwoLingliao2.getSuperiorId()&&pwBomNumberTwoLingliao2.getSumNumber()!=0){ + //创建物料出库明细 + ImStockRequisitionMaterial stockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + stockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + stockRequisitionMaterial.setCode(stockRequisition.getCode()); + //物料名称 + stockRequisitionMaterial.setMaterialName(pwBomNumberTwoLingliao2.getName()); + //物料图号 + stockRequisitionMaterial.setFigureNumber(pwBomNumberTwoLingliao2.getFigureNumber()); + //材料 + stockRequisitionMaterial.setMaterials(pwBomNumberTwoLingliao2.getType()); + //单重 + stockRequisitionMaterial.setPieceWeight(pwBomNumberTwoLingliao2.getPieceWeight()); + //申请人 + stockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //应发数量 + stockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoLingliao2.getSumNumber()/i*pwProductionBillProduct.getShuliang()); + //申请数量 + stockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoLingliao2.getSumNumber()/i*pwProductionBillProduct.getShuliang()); + //已发数量 + stockRequisitionMaterial.setAlreadyQuantity(0L); + //实发数量 + stockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwoLingliao2.getSumNumber()/i*pwProductionBillProduct.getShuliang()); + //出库状态 + stockRequisitionMaterial.setGetStatus("未出库"); + int k = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(stockRequisitionMaterial); + if(k<0){ + return AjaxResult.error("申请出库失败"); + } + } + } + } + }else{ + //创建领料单对象 + stockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + stockRequisition.setCode(productionBill.getCode()); + //产品型号 + stockRequisition.setTypeName(pwProductionBillProduct.getProductType()); + //领料状态 + stockRequisition.setGetStatus("未出库"); + //申领数量 + stockRequisition.setSparedThree(pwProductionBillProduct.getShuliang()); + int ii = imStockRequisitionService.insertImStockRequisition(stockRequisition); + //批量添加物料申请详情 + List listss = new ArrayList(); + for (PwBomNumberTwoLingliao pwBomNumberTwoLingliao2 : list) { + //如果没有上级图号的数据为成品或是部件,不添加到lists中 + if(null!=pwBomNumberTwoLingliao2.getParentLevelFigureNumber()&&!"".equals(pwBomNumberTwoLingliao2.getParentLevelFigureNumber())&&null==pwBomNumberTwoLingliao2.getSuperiorId()&&pwBomNumberTwoLingliao2.getSumNumber()!=0){ + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(stockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(productionBill.getCode()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwBomNumberTwoLingliao2.getName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwBomNumberTwoLingliao2.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwBomNumberTwoLingliao2.getType()); + //单重 + imStockRequisitionMaterial.setPieceWeight(pwBomNumberTwoLingliao2.getPieceWeight()); + //申请人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwBomNumberTwoLingliao2.getSumNumber()/i*pwProductionBillProduct.getShuliang()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwBomNumberTwoLingliao2.getSumNumber()/i*pwProductionBillProduct.getShuliang()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwBomNumberTwoLingliao2.getSumNumber()/i*pwProductionBillProduct.getShuliang()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + listss.add(imStockRequisitionMaterial); + } + } + //批量添加 + int j = iImStockRequisitionMaterialService.insertImStockRequisitionMaterials(listss); + } + //修改领料状态 + if(pwProductionBillProduct.getQuantity() - stockRequisition.getSparedThree()<=0){ + pwProductionBillProduct.setSparedOne("已领料"); + }else if(pwProductionBillProduct.getQuantity() - stockRequisition.getSparedThree()>0&&stockRequisition.getSparedThree() list = pwProductionOrderService.selectPwProductionOrderList(pwProductionOrder); + return getDataTable(list); + } + + /** + * 导出生产订单信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrder:export')") + @Log(title = "生产订单信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductionOrder pwProductionOrder) + { + List list = pwProductionOrderService.selectPwProductionOrderList(pwProductionOrder); + ExcelUtil util = new ExcelUtil(PwProductionOrder.class); + return util.exportExcel(list, "pwProductionOrder"); + } + + /** + * 获取生产订单信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrder:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductionOrderService.selectPwProductionOrderById(id)); + } + + /** + * 新增生产订单信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrder:add')") + @Log(title = "生产订单信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductionOrder pwProductionOrder) + { + return toAjax(pwProductionOrderService.insertPwProductionOrder(pwProductionOrder)); + } + + /** + * 修改生产订单信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrder:edit')") + @Log(title = "生产订单信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductionOrder pwProductionOrder) + { + return toAjax(pwProductionOrderService.updatePwProductionOrder(pwProductionOrder)); + } + + /** + * 删除生产订单信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrder:remove')") + @Log(title = "生产订单信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + //删除生产订单前,把生产订单明细数据删除 + for (Long id : ids) { + PwProductionOrderInfo pwProductionOrderInfo = new PwProductionOrderInfo(); + pwProductionOrderInfo.setProductionOrderId(id); + List list = pwProductionOrderInfoService.selectPwProductionOrderInfoList(pwProductionOrderInfo); + for (PwProductionOrderInfo pwProductionOrderInfo2 : list) { + //删除前,根据合同明细的id查询合同明细,把状态改为否 + PwContractInfo contractInfo = pwContractInfoService.selectPwContractInfoById(pwProductionOrderInfo2.getSparedThree()); + contractInfo.setProductionOrder("否"); + pwContractInfoService.updatePwContractInfo(contractInfo); + pwProductionOrderInfoService.deletePwProductionOrderInfoById(pwProductionOrderInfo2.getId()); + } + } + return toAjax(pwProductionOrderService.deletePwProductionOrderByIds(ids)); + } + + /** + * 推送生产 生产订单信息,修改其状态 + */ + @RequestMapping("/shengchans/{ids}") + public AjaxResult shengchans(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + PwProductionOrder productionOrder = pwProductionOrderService.selectPwProductionOrderById(id); + //判断当前生产订单是否为没有推送的状态 + if(!"未下发".equals(productionOrder.getStatus())){ + return AjaxResult.error("当前订单不允许推送"); + } + productionOrder.setStatus("待生产"); + i = pwProductionOrderService.updatePwProductionOrder(productionOrder); + } + return toAjax(i); + } + + /** + * 推送发运 生产订单信息 ,修改其状态后,添加发运信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrder:remove')") + @Log(title = "生产订单信息", businessType = BusinessType.DELETE) + @DeleteMapping("/fayuns/{ids}") + public AjaxResult fayuns(@PathVariable Long[] ids){ + int i = 0; + //生产订单编号 + for (Long id : ids) { + PwProductionOrder productionOrder = pwProductionOrderService.selectPwProductionOrderById(id); + + //判断当前生产订单是否为没有推送的状态 + if(!"未下发".equals(productionOrder.getStatus())){ + return AjaxResult.error("当前订单不允许推送"); + } + + //查询当前生产订单编号下的所有信息 + PwProductionOrderInfo pwProductionOrderInfo = new PwProductionOrderInfo(); + pwProductionOrderInfo.setProductionOrderId(productionOrder.getId()); + List list = pwProductionOrderInfoService.selectPwProductionOrderInfoList(pwProductionOrderInfo); + for (PwProductionOrderInfo pwProductionOrderInfo2 : list) { + //判断是否库存充足,如果库存不足,则不允许推送发运 + //查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwProductionOrderInfo2.getMaterialName(), pwProductionOrderInfo2.getFigureNumber()); + if(inventoryDetail.getQuantity() list = pwProductionOrderInfoService.selectPwProductionOrderInfoList(pwProductionOrderInfo); + return getDataTable(list); + } + + /** + * 导出生产订单详情信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrderInfo:export')") + @Log(title = "生产订单详情信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductionOrderInfo pwProductionOrderInfo) + { + List list = pwProductionOrderInfoService.selectPwProductionOrderInfoList(pwProductionOrderInfo); + ExcelUtil util = new ExcelUtil(PwProductionOrderInfo.class); + return util.exportExcel(list, "pwProductionOrderInfo"); + } + + /** + * 获取生产订单详情信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrderInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductionOrderInfoService.selectPwProductionOrderInfoById(id)); + } + + /** + * 新增生产订单详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrderInfo:add')") + @Log(title = "生产订单详情信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductionOrderInfo pwProductionOrderInfo) + { + return toAjax(pwProductionOrderInfoService.insertPwProductionOrderInfo(pwProductionOrderInfo)); + } + + /** + * 修改生产订单详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrderInfo:edit')") + @Log(title = "生产订单详情信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductionOrderInfo pwProductionOrderInfo) + { + return toAjax(pwProductionOrderInfoService.updatePwProductionOrderInfo(pwProductionOrderInfo)); + } + + /** + * 删除生产订单详情信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionOrderInfo:remove')") + @Log(title = "生产订单详情信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProductionOrderInfoService.deletePwProductionOrderInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionSchedulingController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionSchedulingController.java new file mode 100644 index 0000000..19d2ea2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionSchedulingController.java @@ -0,0 +1,1910 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.PwBomNumber; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.domain.PwProductionScheduling; +import com.ruoyi.project.management.domain.PwProductionSchedulingNumber; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IPwBomNumberService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; +import com.ruoyi.project.management.service.IPwProductionBillProductService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.project.management.service.IPwProductionSchedulingNumberService; +import com.ruoyi.project.management.service.IPwProductionSchedulingService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 排产信息Controller + * + * @author zhukangchao + * @date 2023-06-08 + */ +@RestController +@RequestMapping("/management/pwProductionScheduling") +public class PwProductionSchedulingController extends BaseController +{ + @Autowired + private IPwProductionSchedulingService pwProductionSchedulingService; + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //产品型号信息 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //bom信息 + @Autowired + private IPwBomNumberService pwBomNumberService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //检验信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //入库信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //缺料信息 + @Autowired + private IPwProductionSchedulingNumberService pwProductionSchedulingNumberService; + //企标单详情信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + + /** + * 查询排产信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionScheduling:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductionScheduling pwProductionScheduling) + { +// startPage(); + List list = pwProductionSchedulingService.selectPwProductionSchedulingList(pwProductionScheduling); + return getDataTable(list); + } + + /** + * 导出排产信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionScheduling:export')") + @Log(title = "排产信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductionScheduling pwProductionScheduling) + { + List list = pwProductionSchedulingService.selectPwProductionSchedulingList(pwProductionScheduling); + ExcelUtil util = new ExcelUtil(PwProductionScheduling.class); + return util.exportExcel(list, "pwProductionScheduling"); + } + + /** + * 获取排产信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionScheduling:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductionSchedulingService.selectPwProductionSchedulingById(id)); + } + + /** + * 新增排产信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionScheduling:add')") + @Log(title = "排产信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductionScheduling pwProductionScheduling) + { + return toAjax(pwProductionSchedulingService.insertPwProductionScheduling(pwProductionScheduling)); + } + + /** + * 修改排产信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionScheduling:edit')") + @Log(title = "排产信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductionScheduling pwProductionScheduling) + { + return toAjax(pwProductionSchedulingService.updatePwProductionScheduling(pwProductionScheduling)); + } + + /** + * 删除排产信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionScheduling:remove')") + @Log(title = "排产信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProductionSchedulingService.deletePwProductionSchedulingByIds(ids)); + } + + /** + * 根据令号查询型号 + */ + @RequestMapping("/getTypeNameLists/{code}") + public AjaxResult getTypeNameLists(@PathVariable String code){ + //根据令号查询执行单 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillByProductionCode(code); + List list = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(productionBill.getId()); + return AjaxResult.success(list); + } + + /** + * 查询缺料信息 + */ + @RequestMapping("/getProductionSchedulingNumberList") + public AjaxResult getTypeNameLists(){ + //获取所有排产计划(完成了的不参与计算) + List list = pwProductionSchedulingService.selectPwProductionSchedulingLists(); + //创建缺料信息对象 + PwProductionSchedulingNumber pwProductionSchedulingNumber = new PwProductionSchedulingNumber(); + //添加之前先把当前表的数据清空 + pwProductionSchedulingNumberService.celerPwProductionSchedulingNumber(); + int w = 0; + for (PwProductionScheduling pwProductionScheduling : list) { + List list2 = pwBomNumberService.selectPwBomNumberByCodeAndTypeName(pwProductionScheduling.getCode(), pwProductionScheduling.getTypeName()); + for (PwBomNumber pwBomNumber : list2) { + if(!"部件".equals(pwBomNumber.getType())){ + + pwProductionSchedulingNumber = new PwProductionSchedulingNumber(); + //图号 + pwProductionSchedulingNumber.setFigureNumber(pwBomNumber.getFigureNumber()); + //名称 + pwProductionSchedulingNumber.setName(pwBomNumber.getName()); + //库存数量 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null!=inventoryDetail){ + pwProductionSchedulingNumber.setQuantity(inventoryDetail.getQuantity()); + }else{ + pwProductionSchedulingNumber.setQuantity(0L); + } + if(w == 0){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long oneNumber = 0L; + oneNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + if(pwProductionSchedulingNumber.getQuantity()- oneNumber<0){ + pwProductionSchedulingNumber.setOneNumber(pwProductionSchedulingNumber.getQuantity()- oneNumber); + }else{ + pwProductionSchedulingNumber.setOneNumber(0L); + } + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + //合并缺料数量 + if(null == productionSchedulingNumber.getOneNumber()){ + productionSchedulingNumber.setOneNumber(0L); + } + if(null == pwProductionSchedulingNumber.getOneNumber()){ + pwProductionSchedulingNumber.setOneNumber(0L); + } + productionSchedulingNumber.setOneNumber(productionSchedulingNumber.getOneNumber() + pwProductionSchedulingNumber.getOneNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(0 > pwProductionSchedulingNumber.getOneNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 1){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twoNumber = 0L; + twoNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + pwProductionSchedulingNumber.setTwoNumber(productionSchedulingNumber.getOneNumber() + (0-twoNumber)); + //合并缺料数量 + if(null == productionSchedulingNumber.getTwoNumber()){ + productionSchedulingNumber.setTwoNumber(0L); + } + if(null == pwProductionSchedulingNumber.getTwoNumber()){ + pwProductionSchedulingNumber.setTwoNumber(0L); + } + productionSchedulingNumber.setTwoNumber(productionSchedulingNumber.getTwoNumber() + pwProductionSchedulingNumber.getTwoNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twoNumber < 0){ + pwProductionSchedulingNumber.setTwoNumber(pwProductionSchedulingNumber.getQuantity() - twoNumber); + }else{ + pwProductionSchedulingNumber.setTwoNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getTwoNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 2){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long threeNumber = 0L; + threeNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setThreeNumber(productionSchedulingNumber.getTwoNumber() + (0-threeNumber)); + }else{ + pwProductionSchedulingNumber.setThreeNumber(productionSchedulingNumber.getOneNumber()+productionSchedulingNumber.getTwoNumber() + (0-threeNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getThreeNumber()){ + productionSchedulingNumber.setThreeNumber(0L); + } + if(null == pwProductionSchedulingNumber.getThreeNumber()){ + pwProductionSchedulingNumber.setThreeNumber(0L); + } + productionSchedulingNumber.setThreeNumber(productionSchedulingNumber.getThreeNumber() + pwProductionSchedulingNumber.getThreeNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- threeNumber < 0){ + pwProductionSchedulingNumber.setThreeNumber(pwProductionSchedulingNumber.getQuantity() - threeNumber); + }else{ + pwProductionSchedulingNumber.setThreeNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getThreeNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 3){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long fourNumber = 0L; + fourNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getThreeNumber()< 0){ + pwProductionSchedulingNumber.setFourNumber(productionSchedulingNumber.getThreeNumber() + (0-fourNumber)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setFourNumber(productionSchedulingNumber.getTwoNumber() + (0-fourNumber)); + }else{ + pwProductionSchedulingNumber.setFourNumber(productionSchedulingNumber.getOneNumber() + (0-fourNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getFourNumber()){ + productionSchedulingNumber.setFourNumber(0L); + } + if(null == pwProductionSchedulingNumber.getFourNumber()){ + pwProductionSchedulingNumber.setFourNumber(0L); + } + productionSchedulingNumber.setFourNumber(productionSchedulingNumber.getFourNumber() + pwProductionSchedulingNumber.getFourNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- fourNumber < 0){ + pwProductionSchedulingNumber.setFourNumber(pwProductionSchedulingNumber.getQuantity() - fourNumber); + }else{ + pwProductionSchedulingNumber.setFourNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getFourNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 4){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long fiveNumber = 0L; + fiveNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getFourNumber() < 0){ + pwProductionSchedulingNumber.setFiveNumber(productionSchedulingNumber.getFourNumber() + (0-fiveNumber)); + }else if(productionSchedulingNumber.getThreeNumber() < 0){ + pwProductionSchedulingNumber.setFiveNumber(productionSchedulingNumber.getThreeNumber() + (0-fiveNumber)); + }else if(productionSchedulingNumber.getTwoNumber() < 0){ + pwProductionSchedulingNumber.setFiveNumber(productionSchedulingNumber.getTwoNumber() + (0-fiveNumber)); + }else { + pwProductionSchedulingNumber.setFiveNumber(productionSchedulingNumber.getOneNumber()+ (0-fiveNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getFiveNumber()){ + productionSchedulingNumber.setFiveNumber(0L); + } + if(null == pwProductionSchedulingNumber.getFiveNumber()){ + pwProductionSchedulingNumber.setFiveNumber(0L); + } + productionSchedulingNumber.setFiveNumber(productionSchedulingNumber.getFiveNumber() + pwProductionSchedulingNumber.getFiveNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- fiveNumber < 0){ + pwProductionSchedulingNumber.setFiveNumber(pwProductionSchedulingNumber.getQuantity() - fiveNumber); + }else{ + pwProductionSchedulingNumber.setFiveNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getFiveNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 5){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long sixNumber = 0L; + sixNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getFiveNumber() < 0){ + pwProductionSchedulingNumber.setSixNumber(productionSchedulingNumber.getFiveNumber() + (0-sixNumber)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setSixNumber(productionSchedulingNumber.getFourNumber() + (0-sixNumber)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setSixNumber(productionSchedulingNumber.getThreeNumber() + (0-sixNumber)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setSixNumber(productionSchedulingNumber.getTwoNumber() + (0-sixNumber)); + }else { + pwProductionSchedulingNumber.setSixNumber(productionSchedulingNumber.getOneNumber() + (0-sixNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getSixNumber()){ + productionSchedulingNumber.setSixNumber(0L); + } + if(null == pwProductionSchedulingNumber.getSixNumber()){ + pwProductionSchedulingNumber.setSixNumber(0L); + } + productionSchedulingNumber.setSixNumber(productionSchedulingNumber.getSixNumber() + pwProductionSchedulingNumber.getSixNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- sixNumber < 0){ + pwProductionSchedulingNumber.setSixNumber(pwProductionSchedulingNumber.getQuantity() - sixNumber); + }else{ + pwProductionSchedulingNumber.setSixNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getSixNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 6){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long sevenNumber = 0L; + sevenNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getSixNumber() < 0){ + pwProductionSchedulingNumber.setSevenNumber(productionSchedulingNumber.getSixNumber() + (0-sevenNumber)); + }else if(productionSchedulingNumber.getFiveNumber() < 0){ + pwProductionSchedulingNumber.setSevenNumber(productionSchedulingNumber.getFiveNumber() + (0-sevenNumber)); + }else if(productionSchedulingNumber.getFourNumber() < 0){ + pwProductionSchedulingNumber.setSevenNumber(productionSchedulingNumber.getFourNumber() + (0-sevenNumber)); + }else if(productionSchedulingNumber.getThreeNumber() < 0){ + pwProductionSchedulingNumber.setSevenNumber(productionSchedulingNumber.getThreeNumber() + (0-sevenNumber)); + }else if(productionSchedulingNumber.getTwoNumber() < 0){ + pwProductionSchedulingNumber.setSevenNumber(productionSchedulingNumber.getTwoNumber() + (0-sevenNumber)); + }else{ + pwProductionSchedulingNumber.setSevenNumber(productionSchedulingNumber.getOneNumber() + (0-sevenNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getSevenNumber()){ + productionSchedulingNumber.setSevenNumber(0L); + } + if(null == pwProductionSchedulingNumber.getSevenNumber()){ + pwProductionSchedulingNumber.setSevenNumber(0L); + } + productionSchedulingNumber.setSevenNumber(productionSchedulingNumber.getSevenNumber() + pwProductionSchedulingNumber.getSevenNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- sevenNumber < 0){ + pwProductionSchedulingNumber.setSevenNumber(pwProductionSchedulingNumber.getQuantity() - sevenNumber); + }else{ + pwProductionSchedulingNumber.setSevenNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getSevenNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 7){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long eightNumber = 0L; + eightNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getSevenNumber() < 0){ + pwProductionSchedulingNumber.setEightNumber(productionSchedulingNumber.getSevenNumber() + (0-eightNumber)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setEightNumber(productionSchedulingNumber.getSixNumber() + (0-eightNumber)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setEightNumber(productionSchedulingNumber.getFiveNumber() + (0-eightNumber)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setEightNumber(productionSchedulingNumber.getFourNumber() + (0-eightNumber)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setEightNumber(productionSchedulingNumber.getThreeNumber() + (0-eightNumber)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setEightNumber(productionSchedulingNumber.getTwoNumber() + (0-eightNumber)); + }else { + pwProductionSchedulingNumber.setEightNumber(productionSchedulingNumber.getOneNumber() + (0-eightNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getEightNumber()){ + productionSchedulingNumber.setEightNumber(0L); + } + if(null == pwProductionSchedulingNumber.getEightNumber()){ + pwProductionSchedulingNumber.setEightNumber(0L); + } + productionSchedulingNumber.setEightNumber(productionSchedulingNumber.getEightNumber() + pwProductionSchedulingNumber.getEightNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- eightNumber < 0){ + pwProductionSchedulingNumber.setEightNumber(pwProductionSchedulingNumber.getQuantity() - eightNumber); + }else{ + pwProductionSchedulingNumber.setEightNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getEightNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 8){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long nineNumber = 0L; + nineNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getEightNumber() + (0-nineNumber)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getSevenNumber() + (0-nineNumber)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getSixNumber() + (0-nineNumber)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getFiveNumber() + (0-nineNumber)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getFourNumber() + (0-nineNumber)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getThreeNumber() + (0-nineNumber)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getTwoNumber() + (0-nineNumber)); + }else { + pwProductionSchedulingNumber.setNineNumber(productionSchedulingNumber.getOneNumber() + (0-nineNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getNineNumber()){ + productionSchedulingNumber.setNineNumber(0L); + } + if(null == pwProductionSchedulingNumber.getNineNumber()){ + pwProductionSchedulingNumber.setNineNumber(0L); + } + productionSchedulingNumber.setNineNumber(productionSchedulingNumber.getNineNumber() + pwProductionSchedulingNumber.getNineNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- nineNumber < 0){ + pwProductionSchedulingNumber.setNineNumber(pwProductionSchedulingNumber.getQuantity() - nineNumber); + }else{ + pwProductionSchedulingNumber.setNineNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getNineNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 9){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long tenNumber = 0L; + tenNumber = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getNineNumber()+ (0-tenNumber)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getEightNumber() + (0-tenNumber)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getSevenNumber() + (0-tenNumber)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getSixNumber() + (0-tenNumber)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getFiveNumber() + (0-tenNumber)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getFourNumber() + (0-tenNumber)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getThreeNumber() + (0-tenNumber)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getTwoNumber() + (0-tenNumber)); + }else { + pwProductionSchedulingNumber.setTenNumber(productionSchedulingNumber.getOneNumber() + (0-tenNumber)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTenNumber()){ + productionSchedulingNumber.setTenNumber(0L); + } + if(null == pwProductionSchedulingNumber.getTenNumber()){ + pwProductionSchedulingNumber.setTenNumber(0L); + } + productionSchedulingNumber.setTenNumber(productionSchedulingNumber.getTenNumber() + pwProductionSchedulingNumber.getTenNumber()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- tenNumber < 0){ + pwProductionSchedulingNumber.setTenNumber(pwProductionSchedulingNumber.getQuantity() - tenNumber); + }else{ + pwProductionSchedulingNumber.setTenNumber(0L); + } + if(0 > pwProductionSchedulingNumber.getTenNumber()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 10){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long eleven = 0L; + eleven = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getTenNumber() + (0-eleven)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getNineNumber()+ (0-eleven)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getEightNumber() + (0-eleven)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getSevenNumber() + (0-eleven)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getSixNumber() + (0-eleven)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getFiveNumber() + (0-eleven)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getFourNumber() + (0-eleven)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getThreeNumber() + (0-eleven)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getTwoNumber() + (0-eleven)); + }else { + pwProductionSchedulingNumber.setEleven(productionSchedulingNumber.getOneNumber() + (0-eleven)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getEleven()){ + productionSchedulingNumber.setEleven(0L); + } + if(null == pwProductionSchedulingNumber.getEleven()){ + pwProductionSchedulingNumber.setEleven(0L); + } + productionSchedulingNumber.setEleven(productionSchedulingNumber.getEleven() + pwProductionSchedulingNumber.getEleven()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- eleven < 0){ + pwProductionSchedulingNumber.setEleven(pwProductionSchedulingNumber.getQuantity() - eleven); + }else{ + pwProductionSchedulingNumber.setEleven(0L); + } + if(0 > pwProductionSchedulingNumber.getEleven()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 11){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twelve = 0L; + twelve = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getEleven()+ (0-twelve)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getTenNumber() + (0-twelve)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getNineNumber()+ (0-twelve)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getEightNumber() + (0-twelve)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getSevenNumber() + (0-twelve)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getSixNumber() + (0-twelve)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getFiveNumber() + (0-twelve)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getFourNumber() + (0-twelve)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getThreeNumber() + (0-twelve)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getTwoNumber() + (0-twelve)); + }else { + pwProductionSchedulingNumber.setTwelve(productionSchedulingNumber.getOneNumber() + (0-twelve)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwelve()){ + productionSchedulingNumber.setTwelve(0L); + } + if(null == pwProductionSchedulingNumber.getTwelve()){ + pwProductionSchedulingNumber.setTwelve(0L); + } + productionSchedulingNumber.setTwelve(productionSchedulingNumber.getTwelve() + pwProductionSchedulingNumber.getTwelve()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twelve < 0){ + pwProductionSchedulingNumber.setTwelve(pwProductionSchedulingNumber.getQuantity() - twelve); + }else{ + pwProductionSchedulingNumber.setTwelve(0L); + } + if(0 > pwProductionSchedulingNumber.getTwelve()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 12){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long thirteen = 0L; + thirteen = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getTwelve() + (0-thirteen)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getEleven()+ (0-thirteen)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getTenNumber() + (0-thirteen)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getNineNumber()+ (0-thirteen)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getEightNumber() + (0-thirteen)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getSevenNumber() + (0-thirteen)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getSixNumber() + (0-thirteen)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getFiveNumber() + (0-thirteen)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getFourNumber() + (0-thirteen)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getThreeNumber() + (0-thirteen)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getTwoNumber() + (0-thirteen)); + }else { + pwProductionSchedulingNumber.setThirteen(productionSchedulingNumber.getOneNumber() + (0-thirteen)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getThirteen()){ + productionSchedulingNumber.setThirteen(0L); + } + if(null == pwProductionSchedulingNumber.getThirteen()){ + pwProductionSchedulingNumber.setThirteen(0L); + } + productionSchedulingNumber.setThirteen(productionSchedulingNumber.getThirteen() + pwProductionSchedulingNumber.getThirteen()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- thirteen < 0){ + pwProductionSchedulingNumber.setThirteen(pwProductionSchedulingNumber.getQuantity() - thirteen); + }else{ + pwProductionSchedulingNumber.setThirteen(0L); + } + if(0 > pwProductionSchedulingNumber.getThirteen()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 13){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long fourteen = 0L; + fourteen = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getThirteen() + (0-fourteen)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getTwelve() + (0-fourteen)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getEleven()+ (0-fourteen)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getTenNumber() + (0-fourteen)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getNineNumber()+ (0-fourteen)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getEightNumber() + (0-fourteen)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getSevenNumber() + (0-fourteen)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getSixNumber() + (0-fourteen)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getFiveNumber() + (0-fourteen)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getFourNumber() + (0-fourteen)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getThreeNumber() + (0-fourteen)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getTwoNumber() + (0-fourteen)); + }else { + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getOneNumber() + (0-fourteen)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getFourteen()){ + productionSchedulingNumber.setFourteen(0L); + } + if(null == pwProductionSchedulingNumber.getFourteen()){ + pwProductionSchedulingNumber.setFourteen(0L); + } + productionSchedulingNumber.setFourteen(productionSchedulingNumber.getFourteen() + pwProductionSchedulingNumber.getFourteen()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- fourteen < 0){ + pwProductionSchedulingNumber.setFourteen(pwProductionSchedulingNumber.getQuantity() - fourteen); + }else{ + pwProductionSchedulingNumber.setFourteen(0L); + } + if(0 > pwProductionSchedulingNumber.getFourteen()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 14){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long fifteen = 0L; + fifteen = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getFourteen() + (0-fifteen)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getThirteen() + (0-fifteen)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getTwelve() + (0-fifteen)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getEleven()+ (0-fifteen)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getTenNumber() + (0-fifteen)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getNineNumber()+ (0-fifteen)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getEightNumber() + (0-fifteen)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getSevenNumber() + (0-fifteen)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getSixNumber() + (0-fifteen)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getFiveNumber() + (0-fifteen)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getFourNumber() + (0-fifteen)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getThreeNumber() + (0-fifteen)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setFifteen(productionSchedulingNumber.getTwoNumber() + (0-fifteen)); + }else { + pwProductionSchedulingNumber.setFourteen(productionSchedulingNumber.getOneNumber() + (0-fifteen)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getFifteen()){ + productionSchedulingNumber.setFifteen(0L); + } + if(null == pwProductionSchedulingNumber.getFifteen()){ + pwProductionSchedulingNumber.setFifteen(0L); + } + productionSchedulingNumber.setFifteen(productionSchedulingNumber.getFifteen() + pwProductionSchedulingNumber.getFifteen()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- fifteen < 0){ + pwProductionSchedulingNumber.setFifteen(pwProductionSchedulingNumber.getQuantity() - fifteen); + }else{ + pwProductionSchedulingNumber.setFifteen(0L); + } + if(0 > pwProductionSchedulingNumber.getFifteen()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 15){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long sixteen = 0L; + sixteen = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getFifteen() + (0-sixteen)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getFourteen() + (0-sixteen)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getThirteen() + (0-sixteen)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getTwelve() + (0-sixteen)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getEleven()+ (0-sixteen)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getTenNumber() + (0-sixteen)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getNineNumber()+ (0-sixteen)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getEightNumber() + (0-sixteen)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getSevenNumber() + (0-sixteen)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getSixNumber() + (0-sixteen)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getFiveNumber() + (0-sixteen)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getFourNumber() + (0-sixteen)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getThreeNumber() + (0-sixteen)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getTwoNumber() + (0-sixteen)); + }else { + pwProductionSchedulingNumber.setSixteen(productionSchedulingNumber.getOneNumber() + (0-sixteen)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getSixteen()){ + productionSchedulingNumber.setSixteen(0L); + } + if(null == pwProductionSchedulingNumber.getSixteen()){ + pwProductionSchedulingNumber.setSixteen(0L); + } + productionSchedulingNumber.setSixteen(productionSchedulingNumber.getSixteen() + pwProductionSchedulingNumber.getSixteen()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- sixteen < 0){ + pwProductionSchedulingNumber.setSixteen(pwProductionSchedulingNumber.getQuantity() - sixteen); + }else{ + pwProductionSchedulingNumber.setSixteen(0L); + } + if(0 > pwProductionSchedulingNumber.getSixteen()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 16){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long seventeen = 0L; + seventeen = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getSixteen() + (0-seventeen)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getFifteen() + (0-seventeen)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getFourteen() + (0-seventeen)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getThirteen() + (0-seventeen)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getTwelve() + (0-seventeen)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getEleven()+ (0-seventeen)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getTenNumber() + (0-seventeen)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getNineNumber()+ (0-seventeen)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getEightNumber() + (0-seventeen)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getSevenNumber() + (0-seventeen)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getSixNumber() + (0-seventeen)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getFiveNumber() + (0-seventeen)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getFourNumber() + (0-seventeen)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getThreeNumber() + (0-seventeen)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getTwoNumber() + (0-seventeen)); + }else { + pwProductionSchedulingNumber.setSeventeen(productionSchedulingNumber.getOneNumber() + (0-seventeen)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getSeventeen()){ + productionSchedulingNumber.setSeventeen(0L); + } + if(null == pwProductionSchedulingNumber.getSeventeen()){ + pwProductionSchedulingNumber.setSeventeen(0L); + } + productionSchedulingNumber.setSeventeen(productionSchedulingNumber.getSeventeen() + pwProductionSchedulingNumber.getSeventeen()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- seventeen < 0){ + pwProductionSchedulingNumber.setSeventeen(pwProductionSchedulingNumber.getQuantity() - seventeen); + }else{ + pwProductionSchedulingNumber.setSeventeen(0L); + } + if(0 > pwProductionSchedulingNumber.getSeventeen()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 17){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long eighteen = 0L; + eighteen = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getSeventeen() + (0-eighteen)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getSixteen() + (0-eighteen)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getFifteen() + (0-eighteen)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getFourteen() + (0-eighteen)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getThirteen() + (0-eighteen)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getTwelve() + (0-eighteen)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getEleven()+ (0-eighteen)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getTenNumber() + (0-eighteen)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getNineNumber()+ (0-eighteen)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getEightNumber() + (0-eighteen)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getSevenNumber() + (0-eighteen)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getSixNumber() + (0-eighteen)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getFiveNumber() + (0-eighteen)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getFourNumber() + (0-eighteen)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getThreeNumber() + (0-eighteen)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getTwoNumber() + (0-eighteen)); + }else { + pwProductionSchedulingNumber.setEighteen(productionSchedulingNumber.getOneNumber() + (0-eighteen)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getEighteen()){ + productionSchedulingNumber.setEighteen(0L); + } + if(null == pwProductionSchedulingNumber.getEighteen()){ + pwProductionSchedulingNumber.setEighteen(0L); + } + productionSchedulingNumber.setEighteen(productionSchedulingNumber.getEighteen() + pwProductionSchedulingNumber.getEighteen()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- eighteen < 0){ + pwProductionSchedulingNumber.setEighteen(pwProductionSchedulingNumber.getQuantity() - eighteen); + }else{ + pwProductionSchedulingNumber.setEighteen(0L); + } + if(0 > pwProductionSchedulingNumber.getEighteen()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 18){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long nineteen = 0L; + nineteen = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getEighteen() + (0-nineteen)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getSeventeen() + (0-nineteen)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getSixteen() + (0-nineteen)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getFifteen() + (0-nineteen)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getFourteen() + (0-nineteen)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getThirteen() + (0-nineteen)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getTwelve() + (0-nineteen)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getEleven()+ (0-nineteen)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getTenNumber() + (0-nineteen)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getNineNumber()+ (0-nineteen)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getEightNumber() + (0-nineteen)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getSevenNumber() + (0-nineteen)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getSixNumber() + (0-nineteen)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getFiveNumber() + (0-nineteen)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getFourNumber() + (0-nineteen)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getThreeNumber() + (0-nineteen)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getTwoNumber() + (0-nineteen)); + }else { + pwProductionSchedulingNumber.setNineteen(productionSchedulingNumber.getOneNumber() + (0-nineteen)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getNineteen()){ + productionSchedulingNumber.setNineteen(0L); + } + if(null == pwProductionSchedulingNumber.getNineteen()){ + pwProductionSchedulingNumber.setNineteen(0L); + } + productionSchedulingNumber.setNineteen(productionSchedulingNumber.getNineteen() + pwProductionSchedulingNumber.getNineteen()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- nineteen < 0){ + pwProductionSchedulingNumber.setNineteen(pwProductionSchedulingNumber.getQuantity() - nineteen); + }else{ + pwProductionSchedulingNumber.setNineteen(0L); + } + if(0 > pwProductionSchedulingNumber.getNineteen()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 19){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twenty = 0L; + twenty = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getNineteen() + (0-twenty)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getEighteen() + (0-twenty)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getSeventeen() + (0-twenty)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getSixteen() + (0-twenty)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getFifteen() + (0-twenty)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getFourteen() + (0-twenty)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getThirteen() + (0-twenty)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getTwelve() + (0-twenty)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getEleven()+ (0-twenty)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getTenNumber() + (0-twenty)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getNineNumber()+ (0-twenty)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getEightNumber() + (0-twenty)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getSevenNumber() + (0-twenty)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getSixNumber() + (0-twenty)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getFiveNumber() + (0-twenty)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getFourNumber() + (0-twenty)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getThreeNumber() + (0-twenty)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getTwoNumber() + (0-twenty)); + }else { + pwProductionSchedulingNumber.setTwenty(productionSchedulingNumber.getOneNumber() + (0-twenty)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwenty()){ + productionSchedulingNumber.setTwenty(0L); + } + if(null == pwProductionSchedulingNumber.getTwenty()){ + pwProductionSchedulingNumber.setTwenty(0L); + } + productionSchedulingNumber.setTwenty(productionSchedulingNumber.getTwenty() + pwProductionSchedulingNumber.getTwenty()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twenty < 0){ + pwProductionSchedulingNumber.setTwenty(pwProductionSchedulingNumber.getQuantity() - twenty); + }else{ + pwProductionSchedulingNumber.setTwenty(0L); + } + if(0 > pwProductionSchedulingNumber.getTwenty()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 20){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentyOne = 0L; + twentyOne = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getTwenty() + (0-twentyOne)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getNineteen() + (0-twentyOne)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getEighteen() + (0-twentyOne)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getSeventeen() + (0-twentyOne)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getSixteen() + (0-twentyOne)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getFifteen() + (0-twentyOne)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getFourteen() + (0-twentyOne)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getThirteen() + (0-twentyOne)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getTwelve() + (0-twentyOne)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getEleven()+ (0-twentyOne)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getTenNumber() + (0-twentyOne)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getNineNumber()+ (0-twentyOne)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getEightNumber() + (0-twentyOne)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getSevenNumber() + (0-twentyOne)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getSixNumber() + (0-twentyOne)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getFiveNumber() + (0-twentyOne)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getFourNumber() + (0-twentyOne)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getThreeNumber() + (0-twentyOne)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getTwoNumber() + (0-twentyOne)); + }else { + pwProductionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getOneNumber() + (0-twentyOne)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentyOne()){ + productionSchedulingNumber.setTwentyOne(0L); + } + if(null == pwProductionSchedulingNumber.getTwentyOne()){ + pwProductionSchedulingNumber.setTwentyOne(0L); + } + productionSchedulingNumber.setTwentyOne(productionSchedulingNumber.getTwentyOne() + pwProductionSchedulingNumber.getTwentyOne()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentyOne < 0){ + pwProductionSchedulingNumber.setTwentyOne(pwProductionSchedulingNumber.getQuantity() - twentyOne); + }else{ + pwProductionSchedulingNumber.setTwentyOne(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentyOne()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 21){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentyTwo = 0L; + twentyTwo = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getTwentyOne() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getTwenty() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getNineteen() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getEighteen() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getSeventeen() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getSixteen() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getFifteen() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getFourteen() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getThirteen() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getTwelve() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getEleven()+ (0-twentyTwo)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getTenNumber() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getNineNumber()+ (0-twentyTwo)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getEightNumber() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getSevenNumber() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getSixNumber() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getFiveNumber() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getFourNumber() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getThreeNumber() + (0-twentyTwo)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getTwoNumber() + (0-twentyTwo)); + }else { + pwProductionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getOneNumber() + (0-twentyTwo)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentyTwo()){ + productionSchedulingNumber.setTwentyTwo(0L); + } + if(null == pwProductionSchedulingNumber.getTwentyTwo()){ + pwProductionSchedulingNumber.setTwentyTwo(0L); + } + productionSchedulingNumber.setTwentyTwo(productionSchedulingNumber.getTwentyTwo() + pwProductionSchedulingNumber.getTwentyTwo()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentyTwo < 0){ + pwProductionSchedulingNumber.setTwentyTwo(pwProductionSchedulingNumber.getQuantity() - twentyTwo); + }else{ + pwProductionSchedulingNumber.setTwentyTwo(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentyTwo()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 22){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentyThree = 0L; + twentyThree = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getTwentyTwo() + (0-twentyThree)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getTwentyOne() + (0-twentyThree)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getTwenty() + (0-twentyThree)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getNineteen() + (0-twentyThree)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getEighteen() + (0-twentyThree)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getSeventeen() + (0-twentyThree)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getSixteen() + (0-twentyThree)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getFifteen() + (0-twentyThree)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getFourteen() + (0-twentyThree)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getThirteen() + (0-twentyThree)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getTwelve() + (0-twentyThree)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getEleven()+ (0-twentyThree)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getTenNumber() + (0-twentyThree)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getNineNumber()+ (0-twentyThree)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getEightNumber() + (0-twentyThree)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getSevenNumber() + (0-twentyThree)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getSixNumber() + (0-twentyThree)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getFiveNumber() + (0-twentyThree)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getFourNumber() + (0-twentyThree)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getThreeNumber() + (0-twentyThree)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getTwoNumber() + (0-twentyThree)); + }else { + pwProductionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getOneNumber() + (0-twentyThree)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentyThree()){ + productionSchedulingNumber.setTwentyThree(0L); + } + if(null == pwProductionSchedulingNumber.getTwentyThree()){ + pwProductionSchedulingNumber.setTwentyThree(0L); + } + productionSchedulingNumber.setTwentyThree(productionSchedulingNumber.getTwentyThree() + pwProductionSchedulingNumber.getTwentyThree()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentyThree < 0){ + pwProductionSchedulingNumber.setTwentyThree(pwProductionSchedulingNumber.getQuantity() - twentyThree); + }else{ + pwProductionSchedulingNumber.setTwentyThree(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentyThree()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 23){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentyFour = 0L; + twentyFour = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentyThree() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTwentyThree() + (0-twentyFour)); + }else if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTwentyTwo() + (0-twentyFour)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTwentyOne() + (0-twentyFour)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTwenty() + (0-twentyFour)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getNineteen() + (0-twentyFour)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getEighteen() + (0-twentyFour)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getSeventeen() + (0-twentyFour)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getSixteen() + (0-twentyFour)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getFifteen() + (0-twentyFour)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getFourteen() + (0-twentyFour)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getThirteen() + (0-twentyFour)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTwelve() + (0-twentyFour)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getEleven()+ (0-twentyFour)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTenNumber() + (0-twentyFour)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getNineNumber()+ (0-twentyFour)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getEightNumber() + (0-twentyFour)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getSevenNumber() + (0-twentyFour)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getSixNumber() + (0-twentyFour)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getFiveNumber() + (0-twentyFour)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getFourNumber() + (0-twentyFour)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getThreeNumber() + (0-twentyFour)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTwoNumber() + (0-twentyFour)); + }else { + pwProductionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getOneNumber() + (0-twentyFour)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentyFour()){ + productionSchedulingNumber.setTwentyFour(0L); + } + if(null == pwProductionSchedulingNumber.getTwentyFour()){ + pwProductionSchedulingNumber.setTwentyFour(0L); + } + productionSchedulingNumber.setTwentyFour(productionSchedulingNumber.getTwentyFour() + pwProductionSchedulingNumber.getTwentyFour()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentyFour < 0){ + pwProductionSchedulingNumber.setTwentyFour(pwProductionSchedulingNumber.getQuantity() - twentyFour); + }else{ + pwProductionSchedulingNumber.setTwentyFour(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentyFour()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 24){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentyFive = 0L; + twentyFive = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentyFour() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwentyFour() + (0-twentyFive)); + }else if(productionSchedulingNumber.getTwentyThree() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwentyThree() + (0-twentyFive)); + }else if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwentyTwo() + (0-twentyFive)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwentyOne() + (0-twentyFive)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwenty() + (0-twentyFive)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getNineteen() + (0-twentyFive)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getEighteen() + (0-twentyFive)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getSeventeen() + (0-twentyFive)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getSixteen() + (0-twentyFive)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getFifteen() + (0-twentyFive)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getFourteen() + (0-twentyFive)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getThirteen() + (0-twentyFive)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwelve() + (0-twentyFive)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getEleven()+ (0-twentyFive)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTenNumber() + (0-twentyFive)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getNineNumber()+ (0-twentyFive)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getEightNumber() + (0-twentyFive)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getSevenNumber() + (0-twentyFive)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getSixNumber() + (0-twentyFive)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getFiveNumber() + (0-twentyFive)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getFourNumber() + (0-twentyFive)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getThreeNumber() + (0-twentyFive)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwoNumber() + (0-twentyFive)); + }else { + pwProductionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getOneNumber() + (0-twentyFive)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentyFive()){ + productionSchedulingNumber.setTwentyFive(0L); + } + if(null == pwProductionSchedulingNumber.getTwentyFive()){ + pwProductionSchedulingNumber.setTwentyFive(0L); + } + productionSchedulingNumber.setTwentyFive(productionSchedulingNumber.getTwentyFive() + pwProductionSchedulingNumber.getTwentyFive()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentyFive < 0){ + pwProductionSchedulingNumber.setTwentyFive(pwProductionSchedulingNumber.getQuantity() - twentyFive); + }else{ + pwProductionSchedulingNumber.setTwentyFive(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentyFive()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 25){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentySix = 0L; + twentySix = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentyFive() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwentyFive() + (0-twentySix)); + }else if(productionSchedulingNumber.getTwentyFour() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwentyFour() + (0-twentySix)); + }else if(productionSchedulingNumber.getTwentyThree() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwentyThree() + (0-twentySix)); + }else if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwentyTwo() + (0-twentySix)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwentyOne() + (0-twentySix)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwenty() + (0-twentySix)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getNineteen() + (0-twentySix)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getEighteen() + (0-twentySix)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getSeventeen() + (0-twentySix)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getSixteen() + (0-twentySix)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getFifteen() + (0-twentySix)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getFourteen() + (0-twentySix)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getThirteen() + (0-twentySix)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwelve() + (0-twentySix)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getEleven()+ (0-twentySix)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTenNumber() + (0-twentySix)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getNineNumber()+ (0-twentySix)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getEightNumber() + (0-twentySix)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getSevenNumber() + (0-twentySix)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getSixNumber() + (0-twentySix)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getFiveNumber() + (0-twentySix)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getFourNumber() + (0-twentySix)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getThreeNumber() + (0-twentySix)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwoNumber() + (0-twentySix)); + }else { + pwProductionSchedulingNumber.setTwentySix(productionSchedulingNumber.getOneNumber() + (0-twentySix)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentySix()){ + productionSchedulingNumber.setTwentySix(0L); + } + if(null == pwProductionSchedulingNumber.getTwentySix()){ + pwProductionSchedulingNumber.setTwentySix(0L); + } + productionSchedulingNumber.setTwentySix(productionSchedulingNumber.getTwentySix() + pwProductionSchedulingNumber.getTwentySix()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentySix < 0){ + pwProductionSchedulingNumber.setTwentySix(pwProductionSchedulingNumber.getQuantity() - twentySix); + }else{ + pwProductionSchedulingNumber.setTwentySix(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentySix()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 26){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentySeven = 0L; + twentySeven = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentySix() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwentySix() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwentyFive() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwentyFive() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwentyFour() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwentyFour() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwentyThree() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwentyThree() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwentyTwo() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwentyOne() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwenty() + (0-twentySeven)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getNineteen() + (0-twentySeven)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getEighteen() + (0-twentySeven)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getSeventeen() + (0-twentySeven)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getSixteen() + (0-twentySeven)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getFifteen() + (0-twentySeven)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getFourteen() + (0-twentySeven)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getThirteen() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwelve() + (0-twentySeven)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getEleven()+ (0-twentySeven)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTenNumber() + (0-twentySeven)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getNineNumber()+ (0-twentySeven)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getEightNumber() + (0-twentySeven)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getSevenNumber() + (0-twentySeven)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getSixNumber() + (0-twentySeven)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getFiveNumber() + (0-twentySeven)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getFourNumber() + (0-twentySeven)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getThreeNumber() + (0-twentySeven)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwoNumber() + (0-twentySeven)); + }else { + pwProductionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getOneNumber() + (0-twentySeven)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentySeven()){ + productionSchedulingNumber.setTwentySeven(0L); + } + if(null == pwProductionSchedulingNumber.getTwentySeven()){ + pwProductionSchedulingNumber.setTwentySeven(0L); + } + productionSchedulingNumber.setTwentySeven(productionSchedulingNumber.getTwentySeven() + pwProductionSchedulingNumber.getTwentySeven()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentySeven < 0){ + pwProductionSchedulingNumber.setTwentySeven(pwProductionSchedulingNumber.getQuantity() - twentySeven); + }else{ + pwProductionSchedulingNumber.setTwentySeven(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentySeven()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 27){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentyEight = 0L; + twentyEight = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentySeven() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentySeven() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwentySix() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentySix() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwentyFive() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentyFive() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwentyFour() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentyFour() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwentyThree() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentyThree() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentyTwo() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentyOne() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwenty() + (0-twentyEight)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getNineteen() + (0-twentyEight)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getEighteen() + (0-twentyEight)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getSeventeen() + (0-twentyEight)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getSixteen() + (0-twentyEight)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getFifteen() + (0-twentyEight)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getFourteen() + (0-twentyEight)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getThirteen() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwelve() + (0-twentyEight)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getEleven()+ (0-twentyEight)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTenNumber() + (0-twentyEight)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getNineNumber()+ (0-twentyEight)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getEightNumber() + (0-twentyEight)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getSevenNumber() + (0-twentyEight)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getSixNumber() + (0-twentyEight)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getFiveNumber() + (0-twentyEight)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getFourNumber() + (0-twentyEight)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getThreeNumber() + (0-twentyEight)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwoNumber() + (0-twentyEight)); + }else { + pwProductionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getOneNumber() + (0-twentyEight)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentyEight()){ + productionSchedulingNumber.setTwentyEight(0L); + } + if(null == pwProductionSchedulingNumber.getTwentyEight()){ + pwProductionSchedulingNumber.setTwentyEight(0L); + } + productionSchedulingNumber.setTwentyEight(productionSchedulingNumber.getTwentyEight() + pwProductionSchedulingNumber.getTwentyEight()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentyEight < 0){ + pwProductionSchedulingNumber.setTwentyEight(pwProductionSchedulingNumber.getQuantity() - twentyEight); + }else{ + pwProductionSchedulingNumber.setTwentyEight(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentyEight()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 28){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long twentyNine = 0L; + twentyNine = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentyEight() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentyEight() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwentySeven() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentySeven() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwentySix() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentySix() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwentyFive() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentyFive() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwentyFour() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentyFour() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwentyThree() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentyThree() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentyTwo() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentyOne() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwenty() + (0-twentyNine)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getNineteen() + (0-twentyNine)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getEighteen() + (0-twentyNine)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getSeventeen() + (0-twentyNine)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getSixteen() + (0-twentyNine)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getFifteen() + (0-twentyNine)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getFourteen() + (0-twentyNine)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getThirteen() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwelve() + (0-twentyNine)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getEleven()+ (0-twentyNine)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTenNumber() + (0-twentyNine)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getNineNumber()+ (0-twentyNine)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getEightNumber() + (0-twentyNine)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getSevenNumber() + (0-twentyNine)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getSixNumber() + (0-twentyNine)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getFiveNumber() + (0-twentyNine)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getFourNumber() + (0-twentyNine)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getThreeNumber() + (0-twentyNine)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwoNumber() + (0-twentyNine)); + }else { + pwProductionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getOneNumber() + (0-twentyNine)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getTwentyNine()){ + productionSchedulingNumber.setTwentyNine(0L); + } + if(null == pwProductionSchedulingNumber.getTwentyNine()){ + pwProductionSchedulingNumber.setTwentyNine(0L); + } + productionSchedulingNumber.setTwentyNine(productionSchedulingNumber.getTwentyNine() + pwProductionSchedulingNumber.getTwentyNine()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- twentyNine < 0){ + pwProductionSchedulingNumber.setTwentyNine(pwProductionSchedulingNumber.getQuantity() - twentyNine); + }else{ + pwProductionSchedulingNumber.setTwentyNine(0L); + } + if(0 > pwProductionSchedulingNumber.getTwentyNine()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + }else if(w == 29){ + //缺料数量(库存数量-本批数量)(本批数量 = 单台数量 * 排产数量) + Long thirty = 0L; + thirty = pwBomNumber.getOneNumber() * pwProductionScheduling.getQuantity(); + //添加时先判断是否有此数据了 + PwProductionSchedulingNumber productionSchedulingNumber = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberByNameAndFigureNumber(pwProductionSchedulingNumber.getName(), pwProductionSchedulingNumber.getFigureNumber()); + if(null != productionSchedulingNumber){ + if(productionSchedulingNumber.getTwentyNine() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentyNine() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentyEight() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentyEight() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentySeven() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentySeven() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentySix() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentySix() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentyFive() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentyFive() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentyFour() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentyFour() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentyThree() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentyThree() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentyTwo() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentyTwo() + (0-thirty)); + }else if(productionSchedulingNumber.getTwentyOne() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwentyOne() + (0-thirty)); + }else if(productionSchedulingNumber.getTwenty() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwenty() + (0-thirty)); + }else if(productionSchedulingNumber.getNineteen() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getNineteen() + (0-thirty)); + }else if(productionSchedulingNumber.getEighteen() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getEighteen() + (0-thirty)); + }else if(productionSchedulingNumber.getSeventeen() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getSeventeen() + (0-thirty)); + }else if(productionSchedulingNumber.getSixteen() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getSixteen() + (0-thirty)); + }else if(productionSchedulingNumber.getFifteen() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getFifteen() + (0-thirty)); + }else if(productionSchedulingNumber.getFourteen() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getFourteen() + (0-thirty)); + }else if(productionSchedulingNumber.getThirteen() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getThirteen() + (0-thirty)); + }else if(productionSchedulingNumber.getTwelve() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwelve() + (0-thirty)); + }else if(productionSchedulingNumber.getEleven() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getEleven()+ (0-thirty)); + }else if(productionSchedulingNumber.getTenNumber() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTenNumber() + (0-thirty)); + }else if(productionSchedulingNumber.getNineNumber() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getNineNumber()+ (0-thirty)); + }else if(productionSchedulingNumber.getEightNumber() < 0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getEightNumber() + (0-thirty)); + }else if(productionSchedulingNumber.getSevenNumber()<0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getSevenNumber() + (0-thirty)); + }else if(productionSchedulingNumber.getSixNumber()<0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getSixNumber() + (0-thirty)); + }else if(productionSchedulingNumber.getFiveNumber()<0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getFiveNumber() + (0-thirty)); + }else if(productionSchedulingNumber.getFourNumber()<0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getFourNumber() + (0-thirty)); + }else if(productionSchedulingNumber.getThreeNumber()<0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getThreeNumber() + (0-thirty)); + }else if(productionSchedulingNumber.getTwoNumber()<0){ + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getTwoNumber() + (0-thirty)); + }else { + pwProductionSchedulingNumber.setThirty(productionSchedulingNumber.getOneNumber() + (0-thirty)); + } + //合并缺料数量 + if(null == productionSchedulingNumber.getThirty()){ + productionSchedulingNumber.setThirty(0L); + } + if(null == pwProductionSchedulingNumber.getThirty()){ + pwProductionSchedulingNumber.setThirty(0L); + } + productionSchedulingNumber.setThirty(productionSchedulingNumber.getThirty() + pwProductionSchedulingNumber.getThirty()); + pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(productionSchedulingNumber); + }else{ + if(pwProductionSchedulingNumber.getQuantity()- thirty < 0){ + pwProductionSchedulingNumber.setThirty(pwProductionSchedulingNumber.getQuantity() - thirty); + }else{ + pwProductionSchedulingNumber.setThirty(0L); + } + if(0 > pwProductionSchedulingNumber.getThirty()){ + //添加新数据 + pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + } + } + + + } + } + w++; + } + + //查询缺料表信息,按照名称和图号去重 + List list2 = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberLists(); + + return AjaxResult.success(list2); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionSchedulingNumberController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionSchedulingNumberController.java new file mode 100644 index 0000000..98050a1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwProductionSchedulingNumberController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwProductionSchedulingNumber; +import com.ruoyi.project.management.service.IPwProductionSchedulingNumberService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 排产缺料统计Controller + * + * @author zhukangchao + * @date 2023-06-08 + */ +@RestController +@RequestMapping("/management/pwProductionSchedulingNumber") +public class PwProductionSchedulingNumberController extends BaseController +{ + @Autowired + private IPwProductionSchedulingNumberService pwProductionSchedulingNumberService; + + /** + * 查询排产缺料统计列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionSchedulingNumber:list')") + @GetMapping("/list") + public TableDataInfo list(PwProductionSchedulingNumber pwProductionSchedulingNumber) + { + startPage(); + List list = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberList(pwProductionSchedulingNumber); + return getDataTable(list); + } + + /** + * 导出排产缺料统计列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionSchedulingNumber:export')") + @Log(title = "排产缺料统计", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwProductionSchedulingNumber pwProductionSchedulingNumber) + { + List list = pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberLists(); + ExcelUtil util = new ExcelUtil(PwProductionSchedulingNumber.class); + return util.exportExcel(list, "pwProductionSchedulingNumber"); + } + + /** + * 获取排产缺料统计详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionSchedulingNumber:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwProductionSchedulingNumberService.selectPwProductionSchedulingNumberById(id)); + } + + /** + * 新增排产缺料统计 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionSchedulingNumber:add')") + @Log(title = "排产缺料统计", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwProductionSchedulingNumber pwProductionSchedulingNumber) + { + return toAjax(pwProductionSchedulingNumberService.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber)); + } + + /** + * 修改排产缺料统计 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionSchedulingNumber:edit')") + @Log(title = "排产缺料统计", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwProductionSchedulingNumber pwProductionSchedulingNumber) + { + return toAjax(pwProductionSchedulingNumberService.updatePwProductionSchedulingNumber(pwProductionSchedulingNumber)); + } + + /** + * 删除排产缺料统计 + */ + @PreAuthorize("@ss.hasPermi('management:pwProductionSchedulingNumber:remove')") + @Log(title = "排产缺料统计", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwProductionSchedulingNumberService.deletePwProductionSchedulingNumberByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseContractController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseContractController.java new file mode 100644 index 0000000..b50a20e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseContractController.java @@ -0,0 +1,646 @@ +package com.ruoyi.project.management.controller; + +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 采购合同Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/purchaseContract") +public class PwPurchaseContractController extends BaseController { + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + //采购合同详情信息 + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //供应商信息 + @Autowired + private IImSupplierService imSupplierService; + //发票信息 + @Autowired + private IPwInvoiceInfoService pwInvoiceInfoService; + //付款申请单 + @Autowired + private ICwOtherPaymentService cwOtherPaymentService; + //付款申请单明细 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + //用户信息 + @Autowired + private TokenService tokenService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + //其它往来单位信息 + @Autowired + private IPwOtherCorrespondentService pwOtherCorrespondentService; + //物流费用信息 + @Autowired + private ICwLogisticsFeesInfoService cwLogisticsFeesInfoService; + /** + * 查询采购合同列表 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContract:list')") + @GetMapping("/list") + public TableDataInfo list(PwPurchaseContract pwPurchaseContract) { + + if (null != pwPurchaseContract.getInvoice()) { + //说明是从发票处查询的,应该查询所有的 + pwPurchaseContract.setContractStatus(null); + } + startPage(); + List list = new ArrayList(); + if (null != pwPurchaseContract.getName() && !"".equals(pwPurchaseContract.getName())) { + List list2 = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByName(pwPurchaseContract.getName()); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial : list2) { + //根据单据id查询请购单 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(pwPurchaseContractMaterial.getPurchaseContractId()); + if (null != purchaseContract) { + list.add(purchaseContract); + } + } + } else { + list = pwPurchaseContractService.selectPwPurchaseContractList(pwPurchaseContract); + } + return getDataTable(list); + } + + /** + * 导出采购合同列表 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContract:export')") + @Log(title = "采购合同", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwPurchaseContract pwPurchaseContract) { + List list = pwPurchaseContractService.selectPwPurchaseContractList(pwPurchaseContract); + ExcelUtil util = new ExcelUtil(PwPurchaseContract.class); + return util.exportExcel(list, "purchaseContract"); + } + + /** + * 获取采购合同详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContract:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwPurchaseContractService.selectPwPurchaseContractById(id)); + } + + /** + * 新增采购合同 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContract:add')") + @Log(title = "采购合同", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwPurchaseContract pwPurchaseContract) { + // 买方名称(默认本公司名称) + pwPurchaseContract.setPurchaserName("河北伊特舞台机械制造有限公司"); + // 买方地址 + pwPurchaseContract.setPurchaserAddress("石家庄市裕华区东岗路164号东方官邸5-3-401"); + // 买方电话 + pwPurchaseContract.setPurchaserPhone("0311-86106496"); + // 买方传真 + pwPurchaseContract.setPurchaserFax("0311-86106496"); + // 买方纳税人识别号 + pwPurchaseContract.setPurchaserDutyParagraph("91130133MA08JW7T7B"); + // 买方开户行 + pwPurchaseContract.setPurchaserBankOfDeposit("中国农业银行石家庄中山东路支行"); + // 买方账号 + pwPurchaseContract.setPurchaserAccount("50356301040011696"); + //生成采购合同编号,合同编号格式为CG+当前日期时间串 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm-ss"); + String string = sdf.format(new Date()); + pwPurchaseContract.setContractCode("CG" + string); + pwPurchaseContract.setContractStatus((long) 1); + pwPurchaseContract.setDelFlag(0); + return toAjax(pwPurchaseContractService.insertPwPurchaseContract(pwPurchaseContract)); + } + + /** + * 修改采购合同 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContract:edit')") + @Log(title = "采购合同", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwPurchaseContract pwPurchaseContract) { + //获取卖家名称 + String sellerName = pwPurchaseContract.getSellerName(); + if (null == sellerName) { + return AjaxResult.error("请选择卖家名称"); + } else { + //根据卖家名称查询供应商信息 + ImSupplier imSupplier = imSupplierService.selectImSupplierByName(sellerName); + //协议 +// pwPurchaseContract.setAgreement(imSupplier.geta); + //卖方电话 + pwPurchaseContract.setSellerPhone(imSupplier.getSupplierPhone()); + //卖方传真 + pwPurchaseContract.setSellerFax(imSupplier.getFax()); + //卖方地址 + pwPurchaseContract.setSellerAddress(imSupplier.getSupplierAddress()); + //卖方账号 + pwPurchaseContract.setSellerAccount(imSupplier.getAccountNumber()); + //卖方税号 + pwPurchaseContract.setSellerDuctParagraph(imSupplier.getDutyParagraph()); + //卖方开户行 + pwPurchaseContract.setSellerBankOfDeposit(imSupplier.getOpeningBank()); + } + return toAjax(pwPurchaseContractService.updatePwPurchaseContract(pwPurchaseContract)); + } + + /** + * 删除采购合同 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContract:remove')") + @Log(title = "采购合同", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + //删除采购合同时,查询此采购合同下的所有所有物料,把合同id设置为null + for (Long id : ids) { + //根据合同id查询采购单详情信息 + List list = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractId(id); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial : list) { + pwPurchaseContractMaterial.setPurchaseContractId(null); + pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + } + } + return toAjax(pwPurchaseContractService.deletePwPurchaseContractByIds(ids)); + } + + /** + * 查询未完成合同列表,采购入库单选择使用 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContract:list')") + @GetMapping("/selectByStatus") + public TableDataInfo selectByStatus() { + PwPurchaseContract pwPurchaseContract = new PwPurchaseContract(); + pwPurchaseContract.setContractStatus((long) 1); + List list = pwPurchaseContractService.selectPwPurchaseContractList(pwPurchaseContract); + return getDataTable(list); + } + + /** + * 打印合同 + * + * @param ids + * @return + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids) { + if (ids.length > 1) { + return AjaxResult.error("不同合同不允许合并打印"); + } + HashMap printMessageMap = new HashMap<>(); + //根据id获取合同信息 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(ids[0]); + //获得产品列表 + List list = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractId(purchaseContract.getId()); + Long i = 1L; + for (PwPurchaseContractMaterial pwPurchaseContractMaterial : list) { + pwPurchaseContractMaterial.setNum(i); + i++; + } + + //如果备注为null则显示空 + if (null == purchaseContract.getRemark()) { + purchaseContract.setRemark(""); + } + //根据供应商名称查询供应商信息 + ImSupplier supplier = imSupplierService.selectImSupplierByName(purchaseContract.getSellerName()); + + //产品列表 + printMessageMap.put("purchaseContractMaterialLlist", list); + printMessageMap.put("contractObj", purchaseContract); + printMessageMap.put("supplier", supplier); + return AjaxResult.success("success", printMessageMap); + } + + + /** + * 开具发票功能 + */ + @RequestMapping("/issueAnInvoices/{ids}") + public AjaxResult remissueAnInvoicesove(@PathVariable Long[] ids) { + + int i = 0; + //判断是否是统一的供应商 + //供应商名称 + String preferentialOriginName = ""; + for (Long id : ids) { + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(id); + if (null == purchaseContract.getSellerName() || "".equals(purchaseContract.getSellerName())) { + return AjaxResult.error("请完善合同的供应商名称"); + } + if (null == purchaseContract.getTaxRate()) { + return AjaxResult.error("请完善合同的税率"); + } + if (0 == purchaseContract.getTotalPrices()) { + return AjaxResult.error("请完善合同的价格"); + } + if (2 != purchaseContract.getContractStatus()) { + return AjaxResult.error("未完成的合同,不允许开具发票"); + } + if ("是".equals(purchaseContract.getBillingInformation())) { + return AjaxResult.error("已经开具发票的合同不允许重复开票"); + } + if ("".equals(preferentialOriginName) || null == preferentialOriginName) { + preferentialOriginName = purchaseContract.getSellerName(); + } else { + //查看供应商名称是否一致,如果不一致,则直接返回提示,如果一致,则把供应商名称赋值 + if (!preferentialOriginName.equals(purchaseContract.getSellerName())) { + return AjaxResult.error("不同供应商不可开具发票"); + } + } + } + + //生成发票信息 + PwInvoiceInfo pwInvoiceInfo = new PwInvoiceInfo(); + //发票的供应商名称 + pwInvoiceInfo.setSupplierName(preferentialOriginName); + //是否付款 + pwInvoiceInfo.setPayment("否"); + //合同来源 + pwInvoiceInfo.setSource("标准件"); + i = pwInvoiceInfoService.insertPwInvoiceInfo(pwInvoiceInfo); + + //修改开具发票后的合同状态 + for (Long id : ids) { + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(id); + //是否开票 + purchaseContract.setBillingInformation("是"); + //发票id + purchaseContract.setInvoice(pwInvoiceInfo.getId()); + pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + } + return toAjax(i); + } + + /** + * 申请付款 + */ + @RequestMapping("/addPayment") + public AjaxResult addPayment(@RequestBody PwPurchaseContract pwPurchaseContract) { + //校验付款金额 + if (null == pwPurchaseContract.getPaymentAmount() || "".equals(pwPurchaseContract.getPaymentAmount()) || 0 == pwPurchaseContract.getPaymentAmount()) { + return AjaxResult.error("请填写付款金额"); + } + //获取合同id + Long[] ids = pwPurchaseContract.getIds(); + //供应商名称 + String name = ""; + //合同总金额 + Double d = 0.0; + for (Long id : ids) { + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(id); + //校验当前选中的合同是否为同一个供应商 + if (!"".equals(name)) { + //校验name是否和供应商名称相同 + if (!name.equals(purchaseContract.getSellerName())) { + return AjaxResult.error("不同供应商不可合并付款"); + } + } else { + name = purchaseContract.getSellerName(); + } + + //计算合同总金额 + d += purchaseContract.getTotalPrices(); + } + + //校验付款金额是否大于合同总金额 + if (d < pwPurchaseContract.getPaymentAmount()) { + return AjaxResult.error("付款金额不能大于合同总金额"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //付款申请单 + CwOtherPayment cwOtherPayment = new CwOtherPayment(); + //申请单编号 + cwOtherPayment.setCode("FKSQ-" + sdf.format(new Date())); + //姓名 + cwOtherPayment.setUserName(user.getNickName()); + //部门 + cwOtherPayment.setDeptName(user.getDept().getDeptName()); + //申请日期 + cwOtherPayment.setDateTime(new Date()); + //金额 + cwOtherPayment.setMoney(pwPurchaseContract.getPaymentAmount()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = MoneyUtil.toChinese(cwOtherPayment.getMoney() + ""); + cwOtherPayment.setBigMoney(chinese); + //支付类型 + cwOtherPayment.setSparedOne("付款"); + //单位名称 + cwOtherPayment.setUnitName(name); + //未付款金额(初始为填写的金额) + cwOtherPayment.setNotInvoiceAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //未开票金额(初始为填写的金额) + cwOtherPayment.setNotProceedsAmount(BigDecimal.valueOf(cwOtherPayment.getMoney())); + //结算比例(初始为0) + cwOtherPayment.setSettlementRatio(new BigDecimal("0")); + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(cwOtherPayment.getUnitName()); + if (null != supplier) { + //账号 + cwOtherPayment.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(supplier.getOpeningBank()); + } else { + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwOtherPayment.getUnitName()); + if (null != employeeInformation) { + //账号 + cwOtherPayment.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(employeeInformation.getOpeningBank()); + } else { + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwOtherPayment.getUnitName()); + if (null != customer) { + //账号 + cwOtherPayment.setAccountNumber(customer.getBankNumber()); + //开户行 + cwOtherPayment.setOpeningBank(customer.getBank()); + } else { + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwOtherPayment.getUnitName()); + if (null != otherCorrespondent) { + //账号 + cwOtherPayment.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwOtherPayment.setOpeningBank(otherCorrespondent.getOpeningBank()); + } else { + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwOtherPaymentService.insertCwOtherPayment(cwOtherPayment); + if (i > 0) { + //生成付款申请单及付款申请单明细 + for (Long id : ids) { + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(id); + + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + //付款单id + cwOtherPaymentInfo.setOtherPaymentId(cwOtherPayment.getId()); + //付款单编号 + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + //关联合同编号 + cwOtherPaymentInfo.setCode(purchaseContract.getContractCode()); + //合同金额 + cwOtherPaymentInfo.setContractMoney(purchaseContract.getTotalPrices()); + //付款金额(计算) 合同金额*(付款金额/总金额) + cwOtherPaymentInfo.setPaymentAmount(purchaseContract.getTotalPrices() * (pwPurchaseContract.getPaymentAmount() / d)); + //付款比例(计算) 付款金额/合同金额 + cwOtherPaymentInfo.setProportion(cwOtherPaymentInfo.getPaymentAmount() / purchaseContract.getTotalPrices() * 100); + //合同类型 + cwOtherPaymentInfo.setSparedOne("外购件采购合同"); + cwOtherPaymentInfoService.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + } + return toAjax(i); + } + + /** + * 生成物流费用单 + */ + @RequestMapping("/addLogistics") + public AjaxResult addLogistics(@RequestBody PwPurchaseContract pwPurchaseContract) { + //校验付款金额 + if (null == pwPurchaseContract.getMoney() || "".equals(pwPurchaseContract.getMoney()) || 0 == pwPurchaseContract.getMoney()) { + return AjaxResult.error("请填写付款金额"); + } + //校验支付方式 + if(null==pwPurchaseContract.getPayWay()||"".equals(pwPurchaseContract.getPayWay())){ + return AjaxResult.error("请选择支付方式"); + } + //校验单位名称 + if(null==pwPurchaseContract.getUnitName()||"".equals(pwPurchaseContract.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + //物料费用单 + CwLogisticsFeesInfo cwLogisticsFeesInfo = new CwLogisticsFeesInfo(); + + //编号 + cwLogisticsFeesInfo.setCode("WLFY-"+sdf.format(new Date())); + //关联单据编号 所勾选的合同编号 + //获取合同id + Long[] ids = pwPurchaseContract.getIds(); + //拼接合同编号 + String code = ""; + for (Long id : ids) { + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(id); + code += purchaseContract.getContractCode()+","; + } + cwLogisticsFeesInfo.setRelevanceCode(code); + //单据类型 + cwLogisticsFeesInfo.setRelevanceType("外采件采购合同"); + //记录申请人 + cwLogisticsFeesInfo.setUserName(user.getNickName()); + //部门 + cwLogisticsFeesInfo.setDeptName(user.getDept().getDeptName()); + //申请时间 + cwLogisticsFeesInfo.setDate(new Date()); + //小写金额 + cwLogisticsFeesInfo.setMoney(pwPurchaseContract.getMoney()); + //大写金额 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(pwPurchaseContract.getMoney()+""); + cwLogisticsFeesInfo.setBigMoney(chinese); + //事由 + cwLogisticsFeesInfo.setCause("采购运费"); + //支付方式 + cwLogisticsFeesInfo.setPayWay(pwPurchaseContract.getPayWay()); + //单位名称 + cwLogisticsFeesInfo.setUnitName(pwPurchaseContract.getUnitName()); + //未付款金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotInvoiceAmount(new BigDecimal(pwPurchaseContract.getMoney())); + //未开票金额(初始为填写的金额) + cwLogisticsFeesInfo.setNotProceedsAmount(new BigDecimal(pwPurchaseContract.getMoney())); + //结算比例(初始为0) + cwLogisticsFeesInfo.setSettlementRatio(new BigDecimal("0")); + + //根据单位名称查询 供应商信息表或者客户信息表或者员工信息表,获取其银行账号和开户行 + ImSupplier supplier = imSupplierService.selectImSupplierByName(pwPurchaseContract.getUnitName()); + if(null!=supplier){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(supplier.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(supplier.getOpeningBank()); + }else{ + //查询员工信息表 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=employeeInformation){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(employeeInformation.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(employeeInformation.getOpeningBank()); + }else{ + //查询客户信息表 + ImCustomer customer = imCustomerService.selectImCustomerByCustomerName(cwLogisticsFeesInfo.getUnitName()); + if(null!=customer){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(customer.getBankNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(customer.getBank()); + }else{ + //查询其他往来单位信息 + PwOtherCorrespondent otherCorrespondent = pwOtherCorrespondentService.selectPwOtherCorrespondentByName(cwLogisticsFeesInfo.getUnitName()); + if(null!=otherCorrespondent){ + //账号 + cwLogisticsFeesInfo.setAccountNumber(otherCorrespondent.getAccountNumber()); + //开户行 + cwLogisticsFeesInfo.setOpeningBank(otherCorrespondent.getOpeningBank()); + }else{ + return AjaxResult.error("未查询到相关往来单位"); + } + } + } + } + int i = cwLogisticsFeesInfoService.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); + return toAjax(i); + } + + /** + * 领导审批 + */ + @RequestMapping("/lingDaoApprover/{ids}") + public AjaxResult lingDaoApprover(@PathVariable Long[] ids) { + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + for (Long id : ids) { + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(id); + if (purchaseContract.getSellerName() == null || purchaseContract.getSellerName().isEmpty()) { + AjaxResult.error("供应商信息不全,请补充完整"); + } + if (purchaseContract.getTaxRate() == null || purchaseContract.getTaxRate() == 0) { + AjaxResult.error("税率信息不全,请补充完整"); + } + if (purchaseContract.getTotalPrices() == 0.0) { + AjaxResult.error("总价不全,请补充完整"); + } + if (purchaseContract.getDeliveryType() == null || purchaseContract.getDeliveryType().isEmpty()) { + AjaxResult.error("交货方式不全,请补充完整"); + } + if (purchaseContract.getPayer() == null || purchaseContract.getPayer().isEmpty()) { + AjaxResult.error("运费支付方不全,请补充完整"); + } + if (purchaseContract.getDeliveryAddress() == null || purchaseContract.getDeliveryAddress().isEmpty()) { + AjaxResult.error("交货地点不全,请补充完整"); + } + if (purchaseContract.getModeOfPayment() == null || purchaseContract.getModeOfPayment().isEmpty()) { + return AjaxResult.error("货款支付方式不全,请补充完整"); + } + if (null != purchaseContract.getLeadership()) { + purchaseContract.setLeadership(""); + } else { + purchaseContract.setLeadership(user.getNickName()); + //审批时间 + purchaseContract.setLeadershipTime(new Date()); + } + i = pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + } + return toAjax(i); + } + + /** + * 上传合同的PDF + * + * @param id + * @param filePath + * @return + */ + @RequestMapping("/uploadContractPDF") + @ResponseBody + public AjaxResult uploadContractPDF(@RequestParam("id") String id, @RequestParam("file") MultipartFile filePath) { + String originalFilename = filePath.getOriginalFilename(); + if (originalFilename != null) { + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"jpg".equals(suffix) && !"jpeg".equals(suffix) && !"png".equals(suffix) && !"pdf".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传"); + } else { + PwPurchaseContract pwPurchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(Long.valueOf(id)); + //根据id 获取合同信息 + String newfilenname = generateUniqueFileName(originalFilename); + try (InputStream is = filePath.getInputStream(); + //在对应的文件夹下生成新的图片 + FileOutputStream fos = new FileOutputStream("D:/contract/" + newfilenname); + BufferedOutputStream bos = new BufferedOutputStream(fos)) { + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + //映射路径 + pwPurchaseContract.setContractPath(newfilenname); + //更新 + pwPurchaseContractService.updatePwPurchaseContract(pwPurchaseContract); + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + } + } + } + return AjaxResult.success("文件上传成功"); + + } + + /** + * 生成随机文件名 + * + * @param originalFilename + * @return + */ + private String generateUniqueFileName(String originalFilename) { + String filename = originalFilename.substring(0, originalFilename.lastIndexOf(".")); + String extension = originalFilename.substring(originalFilename.lastIndexOf(".")); + //生成年月日加 毫秒值的 文件名称 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String date = dateFormat.format(new Date()); + return filename + "_" + date + System.currentTimeMillis() + extension; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseContractMaterialController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseContractMaterialController.java new file mode 100644 index 0000000..ee04fc4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseContractMaterialController.java @@ -0,0 +1,836 @@ +package com.ruoyi.project.management.controller; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import javax.validation.constraints.Size; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImPurchaseReceiptMaterial; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwCompletionNotice; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMaterialPrice; +import com.ruoyi.project.management.domain.PwOutsourceContract; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImPurchaseReceiptMaterialService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMaterialPriceService; +import com.ruoyi.project.management.service.IPwPurchaseContractMaterialService; +import com.ruoyi.project.management.service.IPwPurchaseContractService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物料和采购合同关联Controller + * + * @author zhukangchao + * @date 2020-07-06 + */ +@RestController +@RequestMapping("/management/purchaseContractMaterial") +public class PwPurchaseContractMaterialController extends BaseController +{ + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //采购入库单和物料关联信息 + @Autowired + private IImPurchaseReceiptMaterialService imPurchaseReceiptMaterialService; + //采购合同信息 + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //用户信息 + @Autowired + private TokenService tokenService; + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //质检通知单信息 + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //物料价格信息 + @Autowired + private IPwMaterialPriceService pwMaterialPriceService; + + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询物料和采购合同关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:list')") + @GetMapping("/list") + public TableDataInfo list(PwPurchaseContractMaterial pwPurchaseContractMaterial) + { + startPage(); + List list = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialList(pwPurchaseContractMaterial); + return getDataTable(list); + } + /** + * 查询所有未生成采购合同的数据 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:list')") + @GetMapping("/getListByPurchaseContractId") + public TableDataInfo getListByPurchaseContractId(){ + startPage(); + List list = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractIdList(); + return getDataTable(list); + } + + /** + * 导出物料和采购合同关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:export')") + @Log(title = "物料和采购合同关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwPurchaseContractMaterial pwPurchaseContractMaterial) + { + List list = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialList(pwPurchaseContractMaterial); + ExcelUtil util = new ExcelUtil(PwPurchaseContractMaterial.class); + return util.exportExcel(list, "purchaseContractMaterial"); + } + + /** + * 获取物料和采购合同关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id){ + PwPurchaseContractMaterial contractMaterial = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialById(id); + //根据采购合同id查询采购合同的编号 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(contractMaterial.getPurchaseContractId()); + if(null!=purchaseContract){ + //根据采购合同的编号查询入库单 + ImProductReceipt imProductReceipt = imProductReceiptService.selectImProductReceiptByContractCode(purchaseContract.getContractCode()); + if(null!=imProductReceipt){ + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber(imProductReceipt.getId(), contractMaterial.getMaterialName(),contractMaterial.getFigureNumber()); + //根据令号和图号和名称查询入库单详情 +// List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(contractMaterial.getCode(),contractMaterial.getMaterialName(),contractMaterial.getFigureNumber()); + int i = 0; + //计算修改入库的剩余数量 + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + i += imProductReceiptMaterial.getActualQuantity(); + } + contractMaterial.setNumber(contractMaterial.getAmount()-i); + }else{ + contractMaterial.setNumber(contractMaterial.getAmount()); + } + } + return AjaxResult.success(contractMaterial); + } + + /** + * 新增物料和采购合同关联 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:add')") + @Log(title = "物料和采购合同关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwPurchaseContractMaterial pwPurchaseContractMaterial){ + //根据物料id查询物料信息 + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialById(pwPurchaseContractMaterial.getMaterialId()); + //获取数量 + Long amount = purchaseContractMaterial.getAmount(); + //获取单价 + double univalence = pwPurchaseContractMaterial.getUnivalence(); + //计算总价 + purchaseContractMaterial.setTotalPrices(amount*univalence); + //合同id + purchaseContractMaterial.setPurchaseContractId(pwPurchaseContractMaterial.getPurchaseContractId()); + //保存单价 + purchaseContractMaterial.setUnivalence(univalence); + //删除标记0默认为未删除 + purchaseContractMaterial.setDelFlag(0); + + //把所有物料的总价加入到合同中 + //根据采购合同id查询采购合同 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(pwPurchaseContractMaterial.getPurchaseContractId()); + //合同总金额 + purchaseContract.setTotalPrices(purchaseContract.getTotalPrices()+purchaseContractMaterial.getTotalPrices()); + //修改合同总金额 + pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + return toAjax(pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(purchaseContractMaterial)); + } + + /** + * 修改物料和采购合同关联 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:edit')") + @Log(title = "物料和采购合同关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwPurchaseContractMaterial pwPurchaseContractMaterial){ + + if(null!=pwPurchaseContractMaterial.getUnivalence()){ + if(pwPurchaseContractMaterial.getUnivalence()>0){ + pwPurchaseContractMaterial.setTotalPrices(pwPurchaseContractMaterial.getAmount()*pwPurchaseContractMaterial.getUnivalence()); + }else{ + return AjaxResult.error("单价不可小于0"); + } + } + + //判断价格是否和物料价格中一致 + PwMaterialPrice materialPrice = pwMaterialPriceService.selectPwMaterialPriceByNameAndFigureNumber(pwPurchaseContractMaterial.getMaterialName(), pwPurchaseContractMaterial.getFigureNumber()); + if(null!=materialPrice){ + if(!pwPurchaseContractMaterial.getUnivalence().equals(materialPrice.getUnitPrice())){ + return AjaxResult.error("单价和物料单价信息中不一致,请核实!"); + } + } + + int i = pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + //把当前的合同id下的所有的物料的总价相加,保存到合同的总价上 + Long purchaseContractId = pwPurchaseContractMaterial.getPurchaseContractId(); + //根据id查询采购合同 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(purchaseContractId); + if(null!=purchaseContract){ + List list = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractId(purchaseContractId); + purchaseContract.setTotalPrices(0); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial2 : list) { + if(null != pwPurchaseContractMaterial2.getTotalPrices()&&pwPurchaseContractMaterial2.getTotalPrices()>0){ + purchaseContract.setTotalPrices(purchaseContract.getTotalPrices()+pwPurchaseContractMaterial2.getTotalPrices()); + } + } + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(purchaseContract.getTotalPrices()+""); + purchaseContract.setBigTotalPrices(chinese); + pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + } + return toAjax(i); + } + + /** + * 删除物料和采购合同关联 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:remove')") + @Log(title = "物料和采购合同关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id查询 + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialById(id); + //如果合同id不为空,则需要减去合同的总金额 + if(null!=purchaseContractMaterial.getPurchaseContractId()){ + //根据合同id查询合同 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(purchaseContractMaterial.getPurchaseContractId()); + if(null!=purchaseContract){ + if(null==purchaseContractMaterial.getTotalPrices()){ + purchaseContractMaterial.setTotalPrices(0.0); + } + if(purchaseContract.getTotalPrices()-purchaseContractMaterial.getTotalPrices()<0){ + purchaseContract.setTotalPrices(0.0); + }else{ + purchaseContract.setTotalPrices(purchaseContract.getTotalPrices()-purchaseContractMaterial.getTotalPrices()); + } + pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + } + //把此条信息的合同id置为null + purchaseContractMaterial.setPurchaseContractId(null); + //单价设置为null +// purchaseContractMaterial.setUnivalence(0); + //总价设置为null +// purchaseContractMaterial.setTotalPrices(0); + i = pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(purchaseContractMaterial); + }else{ + //删除之前把在途减掉 + //查询库存信息 + //判断库存数量是否还够本次退货 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(purchaseContractMaterial.getMaterialName(), purchaseContractMaterial.getFigureNumber()); + if(null != inventoryDetail){ + /*if(inventoryDetail.getPreliminaryInventory()-purchaseContractMaterial.getAmount()>0){ + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()-purchaseContractMaterial.getAmount()); + }else{ + inventoryDetail.setPreliminaryInventory(0L); + }*/ + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + } + i = pwPurchaseContractMaterialService.deletePwPurchaseContractMaterialById(id); + } + } + return toAjax(i); + } + + + /** + * 撤销入库申请 + */ + @PreAuthorize("@ss.hasPermi('management:purchaseContractMaterial:remove')") + @Log(title = "物料和采购合同关联", businessType = BusinessType.DELETE) + @DeleteMapping("/revocationMaterial/{ids}") + public AjaxResult revocationMaterial(@PathVariable Long[] ids){ + int i = 0; + for (Long id : ids) { + //根据id查询物料信息 + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialById(id); + //查询采购合同信息 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(purchaseContractMaterial.getPurchaseContractId()); + + //撤销质检单和质检单详情信息 + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(purchaseContract.getContractCode()); + if(null!=completionNotice){ + //根据code和名称和图号查询 + List list = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(purchaseContract.getCode(), purchaseContractMaterial.getMaterialName(), purchaseContractMaterial.getFigureNumber()); + + pwCompletionNoticeProductService.deletePwCompletionNoticeProductById(list.get(list.size()-1).getId()); + List list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCnpId(completionNotice.getId()); + if(list2.size()==0){ + pwCompletionNoticeService.deletePwCompletionNoticeById(completionNotice.getId()); + } + } + + //根据物料信息的令号和名称和图号查询入库单信息 + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(purchaseContract.getCode(),purchaseContractMaterial.getMaterialName(), purchaseContractMaterial.getFigureNumber()); + //如果已入库则不允许撤销 + if(list.get(list.size()-1).getInventoryStatus().equals("已入库")){ + return AjaxResult.error("已入库的物料不允许撤销"); + }else{ + //删除入库申请明细(只删除最近入库的一条数据) + i = imProductReceiptMaterialService.deleteImProductReceiptMaterialById(list.get(list.size()-1).getId()); + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptId(list.get(list.size()-1).getProductReceiptId()); + if(list2.size()==0){ + imProductReceiptService.deleteImProductReceiptById(list.get(list.size()-1).getProductReceiptId()); + } + } + //修改采购申请单明细状态 + purchaseContractMaterial.setInventoryStatus("未入库"); + pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(purchaseContractMaterial); + } + return toAjax(i); + } + + /** + * 生成采购合同 + */ + @RequestMapping("/createPurchaseContract/{ids}") + public AjaxResult createPurchaseContract(@PathVariable Long[] ids){ + int i = pwPurchaseContractMaterialService.createPurchaseContract(ids); + if(i == 805){ + return AjaxResult.error("不同令号不能生成同一个采购单"); + } + if(i==201){ + return AjaxResult.error("请勿重复生成合同"); + } + if(i==202){ + return AjaxResult.error("请完善单价信息"); + } + return AjaxResult.success(i); + } + + /** + * 申请退货 + */ + @RequestMapping("/hadnBacks") + public AjaxResult hadnBacks(@RequestBody PwPurchaseContractMaterial pwPurchaseContractMaterial){ + if(pwPurchaseContractMaterial.getNumber()>pwPurchaseContractMaterial.getAmount()){ + return AjaxResult.error("退还数量不允许大于采购数量"); + } + //查询采购单 + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(pwPurchaseContractMaterial.getPurchaseContractId()); + if(null==purchaseContract){ + return AjaxResult.error("未生成采购单的不允许退库"); + }else{ + //判断库存数量是否还够本次退货 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwPurchaseContractMaterial.getMaterialName(), pwPurchaseContractMaterial.getFigureNumber()); + if(null == inventoryDetail){ + return AjaxResult.error("未查询到库存信息"); + }else{ + if(inventoryDetail.getQuantity()>=pwPurchaseContractMaterial.getNumber()){ + //说明可以退 + //重新计算采购合同详情价格 + pwPurchaseContractMaterial.setAmount(pwPurchaseContractMaterial.getAmount()-pwPurchaseContractMaterial.getNumber()); + //计算总价 + pwPurchaseContractMaterial.setTotalPrices(pwPurchaseContractMaterial.getAmount()*pwPurchaseContractMaterial.getUnivalence()); + pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + //修改合同总价 + List list = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByPurchaseContractId(purchaseContract.getId()); + purchaseContract.setTotalPrices(0); + for (PwPurchaseContractMaterial pwPurchaseContractMaterial2 : list) { + if(null != pwPurchaseContractMaterial2.getTotalPrices()&&pwPurchaseContractMaterial2.getTotalPrices()>0){ + purchaseContract.setTotalPrices(purchaseContract.getTotalPrices()+pwPurchaseContractMaterial2.getTotalPrices()); + } + } + pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + + //修改入库单信息 + //根据令号和名称和图号查询入库单信息 + List list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwPurchaseContractMaterial.getCode(), pwPurchaseContractMaterial.getMaterialName(), pwPurchaseContractMaterial.getFigureNumber()); + for (ImProductReceiptMaterial imProductReceiptMaterial : list2) { + //未入库的不算 + if(imProductReceiptMaterial.getInventoryStatus().equals("已入库")){ + //如果已收数量小于等于退库数量,则删除本条数据,同时减掉退库数量,如果大于则直接修改应收数量,实收数量和申请数量 减掉退库数量,重新计算总价 + if(imProductReceiptMaterial.getReceived()<=pwPurchaseContractMaterial.getNumber()){ + //记录id等待删除 + imProductReceiptMaterialService.deleteImProductReceiptMaterialById(imProductReceiptMaterial.getId()); + //减掉退还数量 + pwPurchaseContractMaterial.setNumber(pwPurchaseContractMaterial.getNumber().longValue()-imProductReceiptMaterial.getReceived().longValue()); + }else{ + imProductReceiptMaterial.setActualQuantity(imProductReceiptMaterial.getActualQuantity()-pwPurchaseContractMaterial.getNumber()); + imProductReceiptMaterial.setReceived(imProductReceiptMaterial.getReceived()-pwPurchaseContractMaterial.getNumber()); + imProductReceiptMaterial.setReceivableQuantity(imProductReceiptMaterial.getReceivableQuantity()-pwPurchaseContractMaterial.getNumber()); + //重新计算总价 + imProductReceiptMaterial.setTotalPrices(imProductReceiptMaterial.getReceived()*imProductReceiptMaterial.getUnivalence()); + imProductReceiptMaterialService.updateImProductReceiptMaterial(imProductReceiptMaterial); + break; + } + } + } + + //减掉库存数量和锁定数量 + inventoryDetail.setQuantity(inventoryDetail.getQuantity()-pwPurchaseContractMaterial.getNumber()); + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwPurchaseContractMaterial.getNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + }else{ + //说明库存数量不够本次退库 + return AjaxResult.error("库存数量不足,请联系库管核实"); + } + } + } + return AjaxResult.success(); + } + + /** + * 申请入库 + */ + @RequestMapping("/storages") + public AjaxResult storages(@RequestBody PwPurchaseContractMaterial pwPurchaseContractMaterial){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + if(null==pwPurchaseContractMaterial.getNumber()||"".equals(pwPurchaseContractMaterial.getNumber())||pwPurchaseContractMaterial.getNumber()==0){ + return AjaxResult.error("请输入申请入库数量"); + } + if(null==pwPurchaseContractMaterial.getUnivalence()||"".equals(pwPurchaseContractMaterial.getUnivalence())||pwPurchaseContractMaterial.getUnivalence()==0){ + return AjaxResult.error("请输入单价"); + } + + if(pwPurchaseContractMaterial.getAmount() list = imProductReceiptMaterialService.selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber(receipt.getId(), pwPurchaseContractMaterial.getMaterialName(), pwPurchaseContractMaterial.getFigureNumber()); + Long r = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list) { + //可入库数量 = 总数量 - (已质检的合格数量+未质检的申请数量) + r += imProductReceiptMaterial.getActualQuantity().longValue(); + } + if(pwPurchaseContractMaterial.getAmount() - r < pwPurchaseContractMaterial.getNumber()){ + return AjaxResult.error("入库数量不可大于总数量"); + } + } + + //根据合同id查看此合同是否已经添加到待入库申请表了,如果添加到了则不再添加,反之则直接添加 + ImProductReceipt productReceipt = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(purchaseContract.getContractCode()); + if(null!=productReceipt){ + //根据企标号查询入库单id + ImProductReceipt ipr = imProductReceiptService.selectImProductReceiptByMakeDocumentsCode(productReceipt.getMakeDocumentsCode()); + //根据令号和名称和图号和材料查询 + ImProductReceiptMaterial im = new ImProductReceiptMaterial(); + //入库单据 + im.setProductReceiptId(ipr.getId()); + //令号 + im.setCode(pwPurchaseContractMaterial.getCode()); + //名称 + im.setMaterialName(pwPurchaseContractMaterial.getMaterialName()); + //图号 + im.setSpecification(pwPurchaseContractMaterial.getFigureNumber()); + //材料 + im.setMaterialType(pwPurchaseContractMaterial.getMaterials()); + List list = imProductReceiptMaterialService.selectImProductReceiptMaterialLists(im); + int s = 0; + for (ImProductReceiptMaterial imProductReceiptMaterial2 : list) { + s += imProductReceiptMaterial2.getActualQuantity(); + } + //如果不等于null 则直接把物料添加到待入库详情表中 + //添加入库单详情 + //根据id查询需要入库的物料详情 + if(!"未入库".equals(pwPurchaseContractMaterial.getInventoryStatus())&&null!=pwPurchaseContractMaterial.getInventoryStatus()){ + return AjaxResult.error("无需重复申请"); + }else if(s+pwPurchaseContractMaterial.getNumber()>pwPurchaseContractMaterial.getAmount()){ + return AjaxResult.error("申请数量不可大于本批数量"); + }else{ + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //入库单id + imProductReceiptMaterial.setProductReceiptId(ipr.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwPurchaseContractMaterial.getCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwPurchaseContractMaterial.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwPurchaseContractMaterial.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwPurchaseContractMaterial.getMaterials()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + + //未税单价 + //计算税率 + double d = purchaseContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(pwPurchaseContractMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //含税单价 + imProductReceiptMaterial.setUnivalence(pwPurchaseContractMaterial.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwPurchaseContractMaterial.getNumber() * pwPurchaseContractMaterial.getUnivalence()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(purchaseContract.getSellerName()); + if(null!=pwPurchaseContractMaterial.getFigureNumber()&&("009".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))||"017".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))||" ".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,2)))){ + imProductReceiptMaterial.setQualityInspector("免检"); + } + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); +// imProductReceiptMaterial.setQualityInspector("标准件"); + int i = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + + //非免检物料,质检之后再生成待办项 + if("免检".equals(imProductReceiptMaterial.getQualityInspector())){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("标准件待入库",pwPurchaseContractMaterial.getCode(),pwPurchaseContractMaterial.getMaterialName(),pwPurchaseContractMaterial.getFigureNumber(),user.getNickName(),"库管","审核入库","物料入库管理","/inventory/imProductReceiptMaterial?id="+imProductReceiptMaterial.getProductReceiptId()); + } + + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + if(s+pwPurchaseContractMaterial.getNumber() == pwPurchaseContractMaterial.getAmount()){ + //修改预制单详情的入库状态,改为已申请 + pwPurchaseContractMaterial.setInventoryStatus("已申请"); + int k = pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + + if(null!=pwPurchaseContractMaterial.getFigureNumber()&&!"009".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&!"017".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&!" ".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,2))){ + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + + //根据令号查询质检通知单id + PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(purchaseContract.getContractCode()); + if(null == completionNotice){ + if(null!=pwPurchaseContractMaterial.getFigureNumber()&&!"009".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&!"017".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&!" ".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,2))){ + completionNotice = new PwCompletionNotice(); + //保存生产令号 + completionNotice.setProductionCode(purchaseContract.getContractCode()); + //保存项目名称 + completionNotice.setProjectName(purchaseContract.getCode()+"(外购件)"); + //质检审核状态 + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.insertPwCompletionNotice(completionNotice); + } + } + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(completionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(pwPurchaseContractMaterial.getCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(pwPurchaseContractMaterial.getMaterialName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(pwPurchaseContractMaterial.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(pwPurchaseContractMaterial.getMaterials()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(purchaseContract.getSellerName()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + completionNotice.setQualityInspectorAudit(0); + pwCompletionNoticeService.updatePwCompletionNotice(completionNotice); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("外购件待质检",pwPurchaseContractMaterial.getCode(),pwPurchaseContractMaterial.getMaterialName(),pwPurchaseContractMaterial.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + } + } + }else{ + //如果等于null 则先添加待入库单 + //创建待入库单对象 + ImProductReceipt imProductReceipt = new ImProductReceipt(); + //关联单据 + imProductReceipt.setMakeDocumentsCode(purchaseContract.getContractCode()); + //项目名称(采购为供应商名称) + imProductReceipt.setProjectName(purchaseContract.getSellerName()); + //关联令号 + imProductReceipt.setCode(pwPurchaseContractMaterial.getCode()); + //申请人(获取当前操作者账号) +// imProductReceipt.setProposer(user.getNickName()); + //入库状态 + imProductReceipt.setInventoryStatus("未入库"); + //添加入库单 + int i = imProductReceiptService.insertImProductReceipt(imProductReceipt); + if(i<1){ + return AjaxResult.error("申请入库失败"); + } + //创建质检通知单对象 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + if(null!=pwPurchaseContractMaterial.getFigureNumber()&&!"009".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&!"017".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&!" ".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,2))){ + //保存生产令号 + pwCompletionNotice.setProductionCode(purchaseContract.getContractCode()); + //保存项目名称 + pwCompletionNotice.setProjectName(purchaseContract.getCode()+"(外购件)"); + //质检审核状态 + pwCompletionNotice.setQualityInspectorAudit(0); + int j = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + } + //添加入库单详情 + if(!"未入库".equals(pwPurchaseContractMaterial.getInventoryStatus())||null==pwPurchaseContractMaterial.getInventoryStatus()){ + return AjaxResult.error("无需重复申请"); + }else{ + + //创建待入库明细详情 + ImProductReceiptMaterial imProductReceiptMaterial = new ImProductReceiptMaterial(); + //入库单id + imProductReceiptMaterial.setProductReceiptId(imProductReceipt.getId()); + //执行单code + imProductReceiptMaterial.setCode(pwPurchaseContractMaterial.getCode()); + //物料名称 + imProductReceiptMaterial.setMaterialName(pwPurchaseContractMaterial.getMaterialName()); + //图号 + imProductReceiptMaterial.setSpecification(pwPurchaseContractMaterial.getFigureNumber()); + //材料 + imProductReceiptMaterial.setMaterialType(pwPurchaseContractMaterial.getMaterials()); + //应收数量 + imProductReceiptMaterial.setReceivableQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + //已收数量 + imProductReceiptMaterial.setReceived(0.0); + //实收数量 + imProductReceiptMaterial.setActualQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + + //未税单价 + //计算税率 + double d = purchaseContract.getTaxRate()/100.0 + 1.0; + imProductReceiptMaterial.setUnitPrice(new BigDecimal(pwPurchaseContractMaterial.getUnivalence()+"").divide(new BigDecimal(d),4,RoundingMode.HALF_UP).doubleValue()); + + //含税单价 + imProductReceiptMaterial.setUnivalence(pwPurchaseContractMaterial.getUnivalence()); + //总价 + imProductReceiptMaterial.setTotalPrices(pwPurchaseContractMaterial.getNumber() * pwPurchaseContractMaterial.getUnivalence()); + //申请人 + imProductReceiptMaterial.setProposer(user.getNickName()); + //供应商 + imProductReceiptMaterial.setPreferentialOriginName(purchaseContract.getSellerName()); + + if(null!=pwPurchaseContractMaterial.getFigureNumber()&&("009".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))||"017".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))||" ".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,2)))){ + imProductReceiptMaterial.setQualityInspector("免检"); + } + //入库状态 + imProductReceiptMaterial.setInventoryStatus("未入库"); +// imProductReceiptMaterial.setQualityInspector("标准件"); + int h = imProductReceiptMaterialService.insertImProductReceiptMaterial(imProductReceiptMaterial); + if(h<1){ + return AjaxResult.error("申请入库失败"); + } + + //非免检物料,质检之后再生成待办项 + if("免检".equals(imProductReceiptMaterial.getQualityInspector())){ + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("标准件待入库",pwPurchaseContractMaterial.getCode(),pwPurchaseContractMaterial.getMaterialName(),pwPurchaseContractMaterial.getFigureNumber(),user.getNickName(),"库管","审核入库","物料入库管理","/inventory/imProductReceiptMaterial?id="+imProductReceiptMaterial.getProductReceiptId()); + } + + + if(pwPurchaseContractMaterial.getNumber().longValue() == pwPurchaseContractMaterial.getAmount().longValue()){ + //修改预制单详情的入库状态,改为已申请 + pwPurchaseContractMaterial.setInventoryStatus("已申请"); + int k = pwPurchaseContractMaterialService.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + if(k<1){ + return AjaxResult.error("申请失败"); + } + } + if(null!=pwPurchaseContractMaterial.getFigureNumber()&&! "009".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&! "017".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,3))&&!" ".equals(pwPurchaseContractMaterial.getFigureNumber().substring(0,2))){ + //创建待质检明细详情 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + //根据令号查询质检通知单id +// PwCompletionNotice completionNotice = pwCompletionNoticeService.selectPwCompletionNoticeByCode(pwPurchaseContractMaterial.getCode()); + //质检通知单id + pwCompletionNoticeProduct.setCompletionNoticeId(pwCompletionNotice.getId()); + if(null!=imProductReceiptMaterial){ + //入库单id + pwCompletionNoticeProduct.setProductReceiptMaterialId(imProductReceiptMaterial.getId()); + } + //生产令号 + pwCompletionNoticeProduct.setCode(pwPurchaseContractMaterial.getCode()); + //物料名称 + pwCompletionNoticeProduct.setProductName(pwPurchaseContractMaterial.getMaterialName()); + //图号 + pwCompletionNoticeProduct.setFigureNumber(pwPurchaseContractMaterial.getFigureNumber()); + //材料 + pwCompletionNoticeProduct.setMaterials(pwPurchaseContractMaterial.getMaterials()); + //供应商 + pwCompletionNoticeProduct.setPreferentialOriginName(purchaseContract.getSellerName()); + //应检数量 + pwCompletionNoticeProduct.setReceivableQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + //已检数量 + pwCompletionNoticeProduct.setQuantity(0.0); + //实检数量 + pwCompletionNoticeProduct.setActualQuantity(pwPurchaseContractMaterial.getNumber().doubleValue()); + //申请人 + pwCompletionNoticeProduct.setUserName(user.getNickName()); + //交检部门 + pwCompletionNoticeProduct.setSparedOne(user.getDept().getDeptName()); + //入库状态 + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + //是否入库 + pwCompletionNoticeProduct.setGodownEntry("是"); + int p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p<1){ + return AjaxResult.error("申请入库失败"); + } + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("外购件待质检",pwPurchaseContractMaterial.getCode(),pwPurchaseContractMaterial.getMaterialName(),pwPurchaseContractMaterial.getFigureNumber(),user.getNickName(),"质检员","审核质检","质检管理","/production/completionNoticeProduct?id="+pwCompletionNoticeProduct.getCompletionNoticeId()); + + } + } + } + return AjaxResult.success(); + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseController.java new file mode 100644 index 0000000..1484f8d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwPurchaseController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwPurchase; +import com.ruoyi.project.management.service.IPwPurchaseService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 部件Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/purchase") +public class PwPurchaseController extends BaseController +{ + @Autowired + private IPwPurchaseService pwPurchaseService; + + /** + * 查询部件列表 + */ + @PreAuthorize("@ss.hasPermi('management:purchase:list')") + @GetMapping("/list") + public TableDataInfo list(PwPurchase pwPurchase) + { + startPage(); + List list = pwPurchaseService.selectPwPurchaseList(pwPurchase); + return getDataTable(list); + } + + /** + * 导出部件列表 + */ + @PreAuthorize("@ss.hasPermi('management:purchase:export')") + @Log(title = "部件", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwPurchase pwPurchase) + { + List list = pwPurchaseService.selectPwPurchaseList(pwPurchase); + ExcelUtil util = new ExcelUtil(PwPurchase.class); + return util.exportExcel(list, "purchase"); + } + + /** + * 获取部件详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:purchase:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwPurchaseService.selectPwPurchaseById(id)); + } + + /** + * 新增部件 + */ + @PreAuthorize("@ss.hasPermi('management:purchase:add')") + @Log(title = "部件", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwPurchase pwPurchase) + { + return toAjax(pwPurchaseService.insertPwPurchase(pwPurchase)); + } + + /** + * 修改部件 + */ + @PreAuthorize("@ss.hasPermi('management:purchase:edit')") + @Log(title = "部件", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwPurchase pwPurchase) + { + return toAjax(pwPurchaseService.updatePwPurchase(pwPurchase)); + } + + /** + * 删除部件 + */ + @PreAuthorize("@ss.hasPermi('management:purchase:remove')") + @Log(title = "部件", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwPurchaseService.deletePwPurchaseByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwQrcodeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwQrcodeController.java new file mode 100644 index 0000000..d30c1d3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwQrcodeController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwQrcode; +import com.ruoyi.project.management.service.IPwQrcodeService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 二维码信息Controller + * + * @author zhukangchao + * @date 2023-04-19 + */ +@RestController +@RequestMapping("/management/pwQrcode") +public class PwQrcodeController extends BaseController +{ + @Autowired + private IPwQrcodeService pwQrcodeService; + + /** + * 查询二维码信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwQrcode:list')") + @GetMapping("/list") + public TableDataInfo list(PwQrcode pwQrcode) + { + startPage(); + List list = pwQrcodeService.selectPwQrcodeList(pwQrcode); + return getDataTable(list); + } + + /** + * 导出二维码信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwQrcode:export')") + @Log(title = "二维码信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwQrcode pwQrcode) + { + List list = pwQrcodeService.selectPwQrcodeList(pwQrcode); + ExcelUtil util = new ExcelUtil(PwQrcode.class); + return util.exportExcel(list, "pwQrcode"); + } + + /** + * 获取二维码信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwQrcode:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwQrcodeService.selectPwQrcodeById(id)); + } + + /** + * 新增二维码信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwQrcode:add')") + @Log(title = "二维码信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwQrcode pwQrcode) + { + return toAjax(pwQrcodeService.insertPwQrcode(pwQrcode)); + } + + /** + * 修改二维码信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwQrcode:edit')") + @Log(title = "二维码信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwQrcode pwQrcode) + { + return toAjax(pwQrcodeService.updatePwQrcode(pwQrcode)); + } + + /** + * 删除二维码信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwQrcode:remove')") + @Log(title = "二维码信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwQrcodeService.deletePwQrcodeByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwQuotationController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwQuotationController.java new file mode 100644 index 0000000..e827fac --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwQuotationController.java @@ -0,0 +1,496 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.DataScope; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.management.domain.ImCustomer; +import com.ruoyi.project.management.domain.PcCurtainMachine; +import com.ruoyi.project.management.domain.PcDetent; +import com.ruoyi.project.management.domain.PcElectricalMachineryAc; +import com.ruoyi.project.management.domain.PcFTypeReducer; +import com.ruoyi.project.management.domain.PcFireCurtainDampingDrive; +import com.ruoyi.project.management.domain.PcHooksCoupling; +import com.ruoyi.project.management.domain.PcRigidChain; +import com.ruoyi.project.management.domain.PcStrokeMeasurement; +import com.ruoyi.project.management.domain.PcToothedCoupling; +import com.ruoyi.project.management.domain.PcTravelSwitch; +import com.ruoyi.project.management.domain.PcTwoStageReductionGear; +import com.ruoyi.project.management.domain.PcWindlass; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwProductQuotation; +import com.ruoyi.project.management.domain.PwQuotation; +import com.ruoyi.project.management.domain.PwScheme; +import com.ruoyi.project.management.domain.Scheme; +import com.ruoyi.project.management.service.IImCustomerService; +import com.ruoyi.project.management.service.IPcCurtainMachineService; +import com.ruoyi.project.management.service.IPcDetentService; +import com.ruoyi.project.management.service.IPcElectricalMachineryAcService; +import com.ruoyi.project.management.service.IPcFTypeReducerService; +import com.ruoyi.project.management.service.IPcFireCurtainDampingDriveService; +import com.ruoyi.project.management.service.IPcHooksCouplingService; +import com.ruoyi.project.management.service.IPcRigidChainService; +import com.ruoyi.project.management.service.IPcStrokeMeasurementService; +import com.ruoyi.project.management.service.IPcToothedCouplingService; +import com.ruoyi.project.management.service.IPcTravelSwitchService; +import com.ruoyi.project.management.service.IPcTwoStageReductionGearService; +import com.ruoyi.project.management.service.IPcWindlassService; +import com.ruoyi.project.management.service.IPwContractService; +import com.ruoyi.project.management.service.IPwProductQuotationService; +import com.ruoyi.project.management.service.IPwQuotationService; +import com.ruoyi.project.management.service.IPwSchemeService; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 报价单Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/quotation") +public class PwQuotationController extends BaseController +{ + @Autowired + private IPwQuotationService pwQuotationService; + //客户信息 + @Autowired + private IImCustomerService imCustomerService; + //用户标识信息 + @Autowired + private TokenService tokenService; + //产品和报价单关联信息 + @Autowired + private IPwProductQuotationService pwProductQuotationService; + //合同信息 + @Autowired + private IPwContractService pwContractService; + //方案信息 + @Autowired + private IPwSchemeService pwSchemeService; + //产品型号信息 + @Autowired + private IPcCurtainMachineService pcCurtainMachineService; + @Autowired + private IPcDetentService pcDetentService; + @Autowired + private IPcElectricalMachineryAcService pcElectricalMachineryAcService; + @Autowired + private IPcFireCurtainDampingDriveService pcFireCurtainDampingDriveService; + @Autowired + private IPcFTypeReducerService pcFTypeReducerService; + @Autowired + private IPcHooksCouplingService pcHooksCouplingService; + @Autowired + private IPcRigidChainService pcRigidChainService; + @Autowired + private IPcStrokeMeasurementService pcStrokeMeasurementService; + @Autowired + private IPcToothedCouplingService pcToothedCouplingService; + @Autowired + private IPcTravelSwitchService pcTravelSwitchService; + @Autowired + private IPcTwoStageReductionGearService pcTwoStageReductionGearService; + @Autowired + private IPcWindlassService pcWindlassService; + + /** + * 查询报价单列表 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:list')") + @GetMapping("/list") + @DataScope(userAlias="q") + public TableDataInfo list(PwQuotation pwQuotation) + { + startPage(); + List list = pwQuotationService.selectPwQuotationList(pwQuotation); + return getDataTable(list); + } + + /** + * 新增报价单 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:add')") + @Log(title = "报价单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwQuotation pwQuotation){ + //校验单位名称(客户名称) + if(null==pwQuotation.getUnitName()||"".equals(pwQuotation.getUnitName())){ + return AjaxResult.error("请选择单位名称"); + } + //校验项目名称 + if(null==pwQuotation.getItemName()||"".equals(pwQuotation.getItemName())){ + return AjaxResult.error("请填写项目名称"); + } + //校验项目地址 + if(null==pwQuotation.getItemAddress()||"".equals(pwQuotation.getItemAddress())){ + return AjaxResult.error("请填写项目地址"); + } + //校验贸易方式 + if(null==pwQuotation.getModeOfTrade()||"".equals(pwQuotation.getModeOfTrade())){ + return AjaxResult.error("请选择贸易方式"); + } + //校验包装方式 + if(null==pwQuotation.getModeOfPacking()||"".equals(pwQuotation.getModeOfPacking())){ + return AjaxResult.error("请选择包装方式"); + } + //校验运输方式 + if(null==pwQuotation.getModeOfTransportation()||"".equals(pwQuotation.getModeOfTransportation())){ + return AjaxResult.error("请选择运输方式"); + } + //校验是否开票 + if(null==pwQuotation.getMakeOutAnInvoice()||"".equals(pwQuotation.getMakeOutAnInvoice())){ + return AjaxResult.error("请选择是否开票"); + } + //获取当前操作用户 + //获取当前用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + + //根据单位信息查询客户信息 + ImCustomer imCustomer = imCustomerService.selectImCustomerByCustomerName(pwQuotation.getUnitName()); + if(null == imCustomer){ + return AjaxResult.error("未查询到相关单位"); + }else{ + //询价人(客户信息中的负责人) + pwQuotation.setInquirer(imCustomer.getCustomerHead()); + //电话 + pwQuotation.setPhone(imCustomer.getPhone()); + //邮箱 + pwQuotation.seteMail(imCustomer.getEmail()); + } + //报价人 + pwQuotation.setOfferer(user.getNickName()); + //折扣率(暂时没有方案) + pwQuotation.setDiscountRate(10.0); + //总价(默认为0) + pwQuotation.setTotalPrices(0.0); + + int i = pwQuotationService.insertPwQuotation(pwQuotation); + return toAjax(i); + } + + /** + * 导出报价单列表 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:export')") + @Log(title = "报价单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwQuotation pwQuotation) + { + List list = pwQuotationService.selectPwQuotationList(pwQuotation); + ExcelUtil util = new ExcelUtil(PwQuotation.class); + return util.exportExcel(list, "quotation"); + } + + /** + * 获取报价单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwQuotationService.selectPwQuotationById(id)); + } + + /** + * 修改报价单 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:edit')") + @Log(title = "报价单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwQuotation pwQuotation) + { + return toAjax(pwQuotationService.updatePwQuotation(pwQuotation)); + } + + /** + * 删除报价单 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:remove')") + @Log(title = "报价单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwQuotationService.deletePwQuotationByIds(ids)); + } + + /** + * 销齿链生成报价单 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:add')") + @Log(title = "报价单", businessType = BusinessType.INSERT) + @RequestMapping("/createQuotation") + public AjaxResult createQuotation(@RequestBody PwQuotation pwQuotation){ + if(null==pwQuotation.getItemName()||"".equals(pwQuotation.getItemName().trim())){ + return AjaxResult.error("项目名称不能为空"); + } + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //报价单中保存报价人 + pwQuotation.setOfferer(user.getNickName()); + //报价单中保存折扣率 + pwQuotation.setDiscountRate(vipLevel); + //记录用户id + pwQuotation.setUserId(user.getUserId()); + //产品名称 +// pwQuotation.setProductName("销齿链"); + //先添加报价单 + int i = 0; + try { + i = pwQuotationService.insertPwQuotation(pwQuotation); + } catch (Exception e) { + e.printStackTrace(); + } + return toAjax(i); + } + + /** + * 卷扬机生成报价单 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:add')") + @Log(title = "报价单", businessType = BusinessType.INSERT) + @RequestMapping("/createWindlassQuotation") + public AjaxResult createWindlassQuotation(@RequestBody PwQuotation pwQuotation){ + if(null==pwQuotation.getItemName()||"".equals(pwQuotation.getItemName().trim())){ + return AjaxResult.error("项目名称不能为空"); + } + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //报价单中保存报价人 + pwQuotation.setOfferer(user.getNickName()); + //报价单中保存折扣率 + pwQuotation.setDiscountRate(vipLevel); + //记录用户id + pwQuotation.setUserId(user.getUserId()); + //产品名称 +// pwQuotation.setProductName("非标产品"); + //先添加报价单 + int i = 0; + try { + i = pwQuotationService.insertPwQuotation(pwQuotation); + } catch (Exception e) { + e.printStackTrace(); + } + return toAjax(i); + } + + /** + * 销齿链升降台驱动系统生成报价单 + */ + @PreAuthorize("@ss.hasPermi('management:quotation:add')") + @Log(title = "报价单", businessType = BusinessType.INSERT) + @RequestMapping("/createSchemeQuotation") + public AjaxResult createSchemeQuotation(@RequestBody PwQuotation pwQuotation){ + if(null==pwQuotation.getItemName()||"".equals(pwQuotation.getItemName().trim())){ + return AjaxResult.error("项目名称不能为空"); + } + //获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + //获取用户vip的等级 + double vipLevel = user.getVipLevel(); + //报价单中保存报价人 + pwQuotation.setOfferer(user.getNickName()); + //报价单中保存折扣率 + pwQuotation.setDiscountRate(vipLevel); + //先添加报价单 + int i = 0; + try { + i = pwQuotationService.insertPwQuotation(pwQuotation); + } catch (Exception e) { + e.printStackTrace(); + } + //报价单总价 + double totalPrices = 0; + //判断报价单是否保存成功 + if(i>0){ + //根据方案id查询方案信息 + PwScheme pwScheme = pwSchemeService.selectPwSchemeById(pwQuotation.getSchemeId()); + //获取方案的技术参数 + String technicalParameters = pwScheme.getTechnicalParameters(); + List list = JSONObject.parseArray(technicalParameters,Scheme.class); + for (Scheme scheme : list) { + //创建产品和报价单关联对象 + PwProductQuotation productQuotation = new PwProductQuotation(); + //报价单id + productQuotation.setQuotationId(pwQuotation.getId()); + //型号名称 + productQuotation.setTypeName(scheme.getTypeName()); + //数量 + productQuotation.setNumber((long)scheme.getNum()); + //判断是否是销齿链 + if(scheme.getName().equals("pc_rigid_chain")){ + //根据产品型号全称查询产品型号信息 + PcRigidChain pcRigidChain = pcRigidChainService.selectPcRigidChainByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("销齿链"); + //单位 + productQuotation.setUnit("台"); + //单价 + productQuotation.setUnivalence(pcRigidChain.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcRigidChain.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_f_type_reducer")){ + PcFTypeReducer pcFTypeReducer = pcFTypeReducerService.selectPcFTypeReducerByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("F型减速机"); + //单价 + productQuotation.setUnivalence(pcFTypeReducer.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcFTypeReducer.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_two_stage_reduction_gear")){ + PcTwoStageReductionGear pcTwoStageReductionGear = pcTwoStageReductionGearService.selectPcTwoStageReductionGearByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("二级减速机"); + //单价 + productQuotation.setUnivalence(pcTwoStageReductionGear.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcTwoStageReductionGear.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_toothed_coupling")){ + PcToothedCoupling pcToothedCoupling = pcToothedCouplingService.selectPcToothedCouplingByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("齿形联轴器"); + //单价 + productQuotation.setUnivalence(pcToothedCoupling.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcToothedCoupling.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_detent")){ + PcDetent pcDetent = pcDetentService.selectPcDetentByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("制动器"); + //单价 + productQuotation.setUnivalence(pcDetent.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcDetent.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_hooks_coupling")){ + PcHooksCoupling pcHooksCoupling = pcHooksCouplingService.selectPcHooksCouplingByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("万向联轴器"); + //单价 + productQuotation.setUnivalence(pcHooksCoupling.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcHooksCoupling.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_electrical_machinery_ac")){ + PcElectricalMachineryAc pcElectricalMachineryAc = pcElectricalMachineryAcService.selectPcElectricalMachineryAcByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("电机AC"); + //单价 + productQuotation.setUnivalence(pcElectricalMachineryAc.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcElectricalMachineryAc.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_curtain_machine")){ + PcCurtainMachine pcCurtainMachine = pcCurtainMachineService.selectPcCurtainMachineByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("大幕机"); + //单价 + productQuotation.setUnivalence(pcCurtainMachine.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcCurtainMachine.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_fire_curtain_damping_drive")){ + PcFireCurtainDampingDrive pcFireCurtainDampingDrive = pcFireCurtainDampingDriveService.selectPcFireCurtainDampingDriveByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("防火隔离幕驱动"); + //单价 + productQuotation.setUnivalence(pcFireCurtainDampingDrive.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcFireCurtainDampingDrive.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_stroke_measurement")){ + PcStrokeMeasurement pcStrokeMeasurement = pcStrokeMeasurementService.selectPcStrokeMeasurementByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("行程检测"); + //单价 + productQuotation.setUnivalence(pcStrokeMeasurement.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcStrokeMeasurement.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_travel_switch")){ + PcTravelSwitch pcTravelSwitch = pcTravelSwitchService.selectPcTravelSwitchByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("行程开关"); + //单价 + productQuotation.setUnivalence(pcTravelSwitch.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcTravelSwitch.getUnivalence()* scheme.getNum())); + }else if(scheme.getName().equals("pc_windlass")){ + PcWindlass pcWindlass = pcWindlassService.selectPcWindlassByTypeName(scheme.getTypeName()); + //产品名称 + productQuotation.setProductName("卷扬机"); + //单价 + productQuotation.setUnivalence(pcWindlass.getUnivalence()); + //合计 + productQuotation.setTotal((double)(pcWindlass.getUnivalence()* scheme.getNum())); + } + //记录报价单的总价 + totalPrices = totalPrices + productQuotation.getTotal(); + //删除标记默认未删除0 + productQuotation.setDelFlag(0); + pwProductQuotationService.insertPwProductQuotation(productQuotation); + } + //保存总价到报价单 + pwQuotation.setTotalPrices(totalPrices); + pwQuotationService.updatePwQuotation(pwQuotation); + }else{ + return AjaxResult.error("请选择产品型号"); + } + return toAjax(i); + } + + /** + * 查看报价单详情 + * 参数:合同id + */ + @RequestMapping("/getQuotationInfo") + public AjaxResult getQuotationInfo(Long id){ + //根据合同id查询合同 + PwContract pwContract = pwContractService.selectPwContractById(id); + //获取报价单id + String quotationId = pwContract.getQuotationId(); + //根据报价单id查询报价单详情 + PwQuotation pwQuotation = pwQuotationService.selectPwQuotationById(Long.valueOf(quotationId)); + return AjaxResult.success("成功",pwQuotation); + } + + /** + * 根据项目名称查询报价单 + * 参数:项目名称 + */ + @RequestMapping("/getQuotationByItemName") + public AjaxResult getQuotationByItemName(String itemName){ + if(null==itemName||"".equals(itemName.trim())){ + return AjaxResult.error("请输入项目名称"); + } + PwQuotation quotation = pwQuotationService.selectPwQuotationByItemName(itemName); + if(null!=quotation){ + return AjaxResult.error("该项目已报价",quotation); + } + return AjaxResult.success(); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwSafetyInventoryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwSafetyInventoryController.java new file mode 100644 index 0000000..5b737ad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwSafetyInventoryController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwSafetyInventory; +import com.ruoyi.project.management.service.IPwSafetyInventoryService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 安全库存明细Controller + * + * @author zhukangchao + * @date 2022-12-31 + */ +@RestController +@RequestMapping("/management/pwSafetyInventory") +public class PwSafetyInventoryController extends BaseController +{ + @Autowired + private IPwSafetyInventoryService pwSafetyInventoryService; + + /** + * 查询安全库存明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwSafetyInventory:list')") + @GetMapping("/list") + public TableDataInfo list(PwSafetyInventory pwSafetyInventory) + { + startPage(); + List list = pwSafetyInventoryService.selectPwSafetyInventoryList(pwSafetyInventory); + return getDataTable(list); + } + + /** + * 导出安全库存明细列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwSafetyInventory:export')") + @Log(title = "安全库存明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwSafetyInventory pwSafetyInventory) + { + List list = pwSafetyInventoryService.selectPwSafetyInventoryList(pwSafetyInventory); + ExcelUtil util = new ExcelUtil(PwSafetyInventory.class); + return util.exportExcel(list, "pwSafetyInventory"); + } + + /** + * 获取安全库存明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwSafetyInventory:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwSafetyInventoryService.selectPwSafetyInventoryById(id)); + } + + /** + * 新增安全库存明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwSafetyInventory:add')") + @Log(title = "安全库存明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwSafetyInventory pwSafetyInventory) + { + return toAjax(pwSafetyInventoryService.insertPwSafetyInventory(pwSafetyInventory)); + } + + /** + * 修改安全库存明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwSafetyInventory:edit')") + @Log(title = "安全库存明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwSafetyInventory pwSafetyInventory) + { + return toAjax(pwSafetyInventoryService.updatePwSafetyInventory(pwSafetyInventory)); + } + + /** + * 删除安全库存明细 + */ + @PreAuthorize("@ss.hasPermi('management:pwSafetyInventory:remove')") + @Log(title = "安全库存明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwSafetyInventoryService.deletePwSafetyInventoryByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwSchemeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwSchemeController.java new file mode 100644 index 0000000..26c00de --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwSchemeController.java @@ -0,0 +1,193 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwScheme; +import com.ruoyi.project.management.service.IPwSchemeService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 方案Controller + * + * @author zhukangchao + * @date 2020-06-09 + */ +@RestController +@RequestMapping("/management/scheme") +public class PwSchemeController extends BaseController { + @Value("${ruoyi.schemeUrl}") + private String schemeUrl; + + @Autowired + private IPwSchemeService pwSchemeService; + + /** + * 查询方案列表 + */ + @PreAuthorize("@ss.hasPermi('management:scheme:list')") + @GetMapping("/list") + public TableDataInfo list(PwScheme pwScheme) { + startPage(); + List list = pwSchemeService.selectPwSchemeList(pwScheme); + return getDataTable(list); + } + + /** + * 导出方案列表 + */ + @PreAuthorize("@ss.hasPermi('management:scheme:export')") + @Log(title = "方案", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwScheme pwScheme) { + List list = pwSchemeService.selectPwSchemeList(pwScheme); + ExcelUtil util = new ExcelUtil(PwScheme.class); + return util.exportExcel(list, "scheme"); + } + + /** + * 获取方案详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:scheme:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(pwSchemeService.selectPwSchemeById(id)); + } + +// /** +// * 新增方案 +// */ +// @PreAuthorize("@ss.hasPermi('management:scheme:add')") +// @Log(title = "方案", businessType = BusinessType.INSERT) +// @PostMapping +// public AjaxResult add(@RequestBody PwScheme pwScheme) { +// // 保存方案请求参数 +// int i = pwSchemeService.insertPwScheme(pwScheme); +// //方案id +// Long id = pwScheme.getId(); +// // 行程 +// Double journey = pwScheme.getJourney(); +// // 台长 +// Double liftingPlatformLong = pwScheme.getLiftingPlatformLong(); +// // 台宽 +// Double liftingPlatformWide = pwScheme.getLiftingPlatformWide(); +// // 动载荷 +// Double dynamicLoad = pwScheme.getDynamicLoad(); +// // 静载荷 +// Double deadLoad = pwScheme.getDeadLoad(); +// // 速度 +// Double speed = pwScheme.getSpeed(); +// // 拼接方案需要的参数 +// String s ="id="+id+"&stageJourney=" + journey + "&stageWidth=" + liftingPlatformLong + "&stageHeight=" +// + liftingPlatformWide + "&stageDynamic=" + dynamicLoad + "&stageStatic=" + deadLoad + "&stageSpeed=" + speed; +// // 请求三方接口,获取方案图及技术参数走回调接口 +// HttpUtils.sendGet("http://192.168.31.30:8089/scheme/scheme_design", s,"UTF-8"); +// return toAjax(i); +// } + + /** + * 修改方案 + */ + @PreAuthorize("@ss.hasPermi('management:scheme:edit')") + @Log(title = "方案", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwScheme pwScheme) { + return toAjax(pwSchemeService.updatePwScheme(pwScheme)); + } + + /** + * 删除方案 + */ + @PreAuthorize("@ss.hasPermi('management:scheme:remove')") + @Log(title = "方案", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(pwSchemeService.deletePwSchemeByIds(ids)); + } + + /** + * 新增方案 + */ + @PreAuthorize("@ss.hasPermi('management:scheme:add')") + @Log(title = "方案", businessType = BusinessType.INSERT) + @RequestMapping("/createScheme") + public AjaxResult add(@RequestBody PwScheme pwScheme) { +// // 保存方案请求参数 +// int i = pwSchemeService.insertPwScheme(pwScheme); +// //方案id +// Long id = pwScheme.getId(); + // 行程 + Double journey = pwScheme.getJourney(); + // 台长 + Double liftingPlatformLong = pwScheme.getLiftingPlatformLong(); + // 台宽 + Double liftingPlatformWide = pwScheme.getLiftingPlatformWide(); + // 动载荷 + Double dynamicLoad = pwScheme.getDynamicLoad(); + // 静载荷 + Double deadLoad = pwScheme.getDeadLoad(); + // 速度 + Double speed = pwScheme.getSpeed(); + //钢结构及其他 + Double steelStructure = pwScheme.getSteelStructure(); + // 拼接方案需要的参数 + String s ="stageJourney=" + journey + "&stageWidth=" + liftingPlatformLong + "&stageHeight=" + + liftingPlatformWide + "&stageDynamic=" + dynamicLoad + "&stageStatic=" + deadLoad + "&stageSpeed=" + speed+"&structure="+steelStructure; + // 请求三方接口,获取方案图及技术参数走回调接口 + String string = HttpUtils.sendGet(schemeUrl, s,"UTF-8"); + JSONObject rcm = JSONObject.parseObject(string); + JSONObject result = JSONObject.parseObject(rcm.get("result").toString()); + + //保存返回来的方案图路径 + pwScheme.setPicture(result.get("dxf").toString()); + //保存方案技术参数 + pwScheme.setTechnicalParameters(result.get("data").toString()); + pwSchemeService.insertPwScheme(pwScheme); + return AjaxResult.success("成功",pwScheme); + } + + /** + * 三方方案回调函数 + * 参数:方案id,返回的json串 + */ + @RequestMapping("/updateScheme") + public AjaxResult updateScheme(Long id,String result){ + if(null==id){ + return AjaxResult.error("id参数不能为null"); + } + //根据id查询相对应的方案 + PwScheme scheme = pwSchemeService.selectPwSchemeById(id); + if(null==scheme){ + return AjaxResult.error("未找到对应的方案信息"); + } + //把返回来的json串转成json对象 + JSONObject rcm = JSONObject.parseObject(result); + JSONObject r = JSONObject.parseObject(rcm.get("result").toString()); + //保存返回来的方案图路径 + scheme.setPicture(r.get("dxf").toString()); + // TODO + //修改 + int i = pwSchemeService.updatePwScheme(scheme); + if(i<1){ + return AjaxResult.error(0,"失败"); + } + return AjaxResult.success(); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwScrapInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwScrapInfoController.java new file mode 100644 index 0000000..5d37cfd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwScrapInfoController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwScrapInfo; +import com.ruoyi.project.management.service.IPwScrapInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 报废信息Controller + * + * @author zhukangchao + * @date 2023-04-01 + */ +@RestController +@RequestMapping("/management/pwScrapInfo") +public class PwScrapInfoController extends BaseController +{ + @Autowired + private IPwScrapInfoService pwScrapInfoService; + + /** + * 查询报废信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwScrapInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwScrapInfo pwScrapInfo) + { + startPage(); + List list = pwScrapInfoService.selectPwScrapInfoList(pwScrapInfo); + return getDataTable(list); + } + + /** + * 导出报废信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwScrapInfo:export')") + @Log(title = "报废信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwScrapInfo pwScrapInfo) + { + List list = pwScrapInfoService.selectPwScrapInfoList(pwScrapInfo); + ExcelUtil util = new ExcelUtil(PwScrapInfo.class); + return util.exportExcel(list, "pwScrapInfo"); + } + + /** + * 获取报废信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwScrapInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwScrapInfoService.selectPwScrapInfoById(id)); + } + + /** + * 新增报废信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwScrapInfo:add')") + @Log(title = "报废信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwScrapInfo pwScrapInfo) + { + return toAjax(pwScrapInfoService.insertPwScrapInfo(pwScrapInfo)); + } + + /** + * 修改报废信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwScrapInfo:edit')") + @Log(title = "报废信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwScrapInfo pwScrapInfo) + { + return toAjax(pwScrapInfoService.updatePwScrapInfo(pwScrapInfo)); + } + + /** + * 删除报废信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwScrapInfo:remove')") + @Log(title = "报废信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwScrapInfoService.deletePwScrapInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwSpectacularsController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwSpectacularsController.java new file mode 100644 index 0000000..36a8ccf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwSpectacularsController.java @@ -0,0 +1,428 @@ +package com.ruoyi.project.management.controller; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterialTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.domain.PwSpectaculars; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwProductionBillProductService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.project.management.service.IPwPurchaseContractMaterialService; +import com.ruoyi.project.management.service.IPwSpectacularsService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 生产看板Controller + * + * @author zhukangchao + * @date 2023-02-01 + */ +@RestController +@RequestMapping("/management/pwSpectaculars") +public class PwSpectacularsController extends BaseController{ + @Autowired + private IPwSpectacularsService pwSpectacularsService; + + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //标准件采购合同详情信息 + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //质检通知单信息 + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + + /** + * 查询生产看板列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwSpectaculars:list')") + @GetMapping("/list") + public TableDataInfo list(PwSpectaculars pwSpectaculars){ + List list = new ArrayList(); + if(null==pwSpectaculars.getCode()||"".equals(pwSpectaculars.getCode())){ + return getDataTable(list); + } + //根据令号查询bom表数据 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndKanBan(pwSpectaculars.getCode()); + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo2.getProductionCode(), pwBomNumberTwo2.getId()); + pwBomNumberTwo2.setChildren(list3); + } + //获取今天的日期 + Date date = new Date(); + + Long t = 1L; + for (PwBomNumberTwo pwBomNumberTwo : list2) { + pwSpectaculars = new PwSpectaculars(); + //序号 + pwSpectaculars.setNum(t); + //图号 + pwSpectaculars.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //名称 + pwSpectaculars.setName(pwBomNumberTwo.getName()); + //单台数量 + pwSpectaculars.setOneNumber(pwBomNumberTwo.getOneNumber()); + //材料 + pwSpectaculars.setType(pwBomNumberTwo.getType()); + //单重 + pwSpectaculars.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //本批数量 + pwSpectaculars.setSumNumber(pwBomNumberTwo.getSumNumber()); + //备注 + pwSpectaculars.setRemarks(pwBomNumberTwo.getRemarks()); + //派工部门 + pwSpectaculars.setDepartmentName(pwBomNumberTwo.getDepartmentName()); + //完成时间 + pwSpectaculars.setCompletionDate(pwBomNumberTwo.getCompletionDate()); + //是否入库 + pwSpectaculars.setGodownEntry(pwBomNumberTwo.getGodownEntry()); + //材料名称 + pwSpectaculars.setMaterialsName(pwBomNumberTwo.getMaterialsName()); + //材料图号 + pwSpectaculars.setMaterialsSpecification(pwBomNumberTwo.getMaterialsSpecification()); + //下料规格 + pwSpectaculars.setSpecification(pwBomNumberTwo.getSpecification()); + //毛坯数量 + pwSpectaculars.setWorkblank(pwBomNumberTwo.getWorkblank()); + //成品数量 + pwSpectaculars.setFinished(pwBomNumberTwo.getFinished()); + //领料数量 + pwSpectaculars.setReceiveNumber(pwBomNumberTwo.getReceiveNumber()); + //序描述 + pwSpectaculars.setXuDescribe(pwBomNumberTwo.getXuDescribe()); + + //根据名称和图号查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + //库存数量 + pwSpectaculars.setQuantity(inventoryDetail.getQuantity()); + }else{ + //库存数量 + pwSpectaculars.setQuantity(0L); + } + + //状态(已领料、待检验、待入库、已入库) + //判断如果有标准件或者外购件的,是否已经采购,如果生成了采购合同,状态为已采购,如果已经申请入库,状态为待入库,如果已经入库,则为已入库 + if(" ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2))|| "009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))|| "017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3))||pwBomNumberTwo.getRemarks().contains("外购件")){ + if(!"有库存".equals(pwBomNumberTwo.getSparedTwo())){ + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialService.selectPwPurchaseContractMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber(),pwBomNumberTwo.getMeasure()); + if(null!=purchaseContractMaterial){ + if(null==purchaseContractMaterial.getPurchaseContractId()){ + //说明没有生成合同 + pwSpectaculars.setStatus("未采购"); + //状态日期(领料日期,申请质检日期,申请入库日期,完成入库日期) +// pwSpectaculars.setStatusDate(purchaseContractMaterial.getCreateTime()); + }else{ + //说明生成合同 + pwSpectaculars.setStatus("已采购"); + //状态日期(领料日期,申请质检日期,申请入库日期,完成入库日期) + pwSpectaculars.setStatusDate(purchaseContractMaterial.getCreateTime()); + } + } + //判断是否入库了 + if("已采购".equals(pwSpectaculars.getStatus())){ + List list3 = imProductReceiptMaterialService.selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + //计算入库的数量 + Long y = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { + y += imProductReceiptMaterial.getReceived().longValue(); + } + //判断是否申请了质检 + if(list3.size()>0){ + if(y==0){ + //说明没有入库,为待入库状态 + pwSpectaculars.setStatus("待入库"); + //状态日期(领料日期,申请质检日期,申请入库日期,完成入库日期) + pwSpectaculars.setStatusDate(list3.get(0).getCreateTime()); + }else if(y>0&&y=本批数量。标记为已完成 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=pwSpectaculars.getSumNumber()){ + //入库完成,状态为已完成 + pwSpectaculars.setStatus("已完成"); + } + } + } + + if(null!=pwSpectaculars.getCompletionDate()){ + //计算当前时间是否晚于完成时间 + int i = 0; + //当前的日期 + if(date.after(pwSpectaculars.getCompletionDate())){ + i = 1; + } + if(i==1&&!"已完成".equals(pwSpectaculars.getStatus())){ + //说明超时了 + pwSpectaculars.setOverTime("是"); + }else{ + //说明没有超时 + pwSpectaculars.setOverTime("否"); + } + } + + //子集集合 + if(pwBomNumberTwo.getChildren().size()>0){ + //说明有子集工序,则查询子集工序的状态 + List children = pwBomNumberTwo.getChildren(); + for (int i = 0; i < children.size(); i++) { + children.get(i).setNum(null); + + //图号 + //获取图号的最后一个数(序的数值) + String substring = children.get(i).getFigureNumber().substring(children.get(i).getFigureNumber().lastIndexOf("-")+1); + String figureNumber = children.get(i).getFigureNumber().substring(0,children.get(i).getFigureNumber().lastIndexOf("-")); + Integer s = Integer.valueOf(substring)-1; + figureNumber = figureNumber+"-"+s; + + //状态(已领料、待检验、待入库、已入库) + + //除第一道序之外的所有序都要获取其上一道序的信息 + if(i==0){ + //说明是第一道序 + //判断是否填写了材料,如果填写了材料,则判断是否领料了,如果没有填写材料,则判断是否申请了质检 + if(null!=children.get(i).getMaterialId()){ + //根据材料信息查询领料表(查询原材料信息) + List list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialBySparedThree(children.get(i).getProductionCode(), children.get(i).getId()); + if(list5.size()>0){ + //说明已领料 + children.get(i).setStatus("已领料"); + //状态日期(领料日期,申请质检日期,申请入库日期,完成入库日期) + children.get(i).setStatusDate(list5.get(0).getCreateTime()); + }else{ + children.get(i).setStatus("未领料"); + } + }else{ + children.get(i).setStatus("无需领料"); + } + }else{ + //根据材料信息查询领料表(查询原材料信息) + List list5 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndFigureNumber(children.get(i-1).getProductionCode(), figureNumber); + if(list5.size()>0){ + //说明已领料 + children.get(i).setStatus("已领料"); + //状态日期(领料日期,申请质检日期,申请入库日期,完成入库日期) + children.get(i).setStatusDate(list5.get(0).getCreateTime()); + }else{ + children.get(i).setStatus("未领料"); + } + } + + //查询是否已申请质检 + if("已领料".equals(children.get(i).getStatus())||"无需领料".equals(children.get(i).getStatus())||"未领料".equals(children.get(i).getStatus())){ + //查询质检的信息 + List list3 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(children.get(i).getProductionCode(), children.get(i).getName(), children.get(i).getFigureNumber()); + //计算质检的数量 + Long y = 0L; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list3) { + y += pwCompletionNoticeProduct.getQuantity().longValue(); + } + //判断是否申请了质检 + if(list3.size()>0){ + if(y==0){ + //说明没有质检,为待质检状态 + children.get(i).setStatus("待质检"); + //状态日期(领料日期,申请质检日期,申请入库日期,完成入库日期) + children.get(i).setStatusDate(list3.get(0).getCreateTime()); + }else if(y>0&&y list3 = imProductReceiptMaterialService.selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(children.get(i).getProductionCode(), children.get(i).getName(), children.get(i).getFigureNumber()); + //计算入库的数量 + Long y = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list3) { + y += imProductReceiptMaterial.getReceived().longValue(); + } + //判断是否申请了质检 + if(list3.size()>0){ + if(y==0){ + //说明没有入库,为待入库状态 + children.get(i).setStatus("待入库"); + //状态日期(领料日期,申请质检日期,申请入库日期,完成入库日期) + children.get(i).setStatusDate(list3.get(0).getCreateTime()); + }else if(y>0&&y list = pwSpectacularsService.selectPwSpectacularsList(pwSpectaculars); +// ExcelUtil util = new ExcelUtil(PwSpectaculars.class); +// return util.exportExcel(list, "pwSpectaculars"); +// } +// +// /** +// * 获取生产看板详细信息 +// */ +// @PreAuthorize("@ss.hasPermi('management:pwSpectaculars:query')") +// @GetMapping(value = "/{id}") +// public AjaxResult getInfo(@PathVariable("id") Long id) +// { +// return AjaxResult.success(pwSpectacularsService.selectPwSpectacularsById(id)); +// } +// +// /** +// * 新增生产看板 +// */ +// @PreAuthorize("@ss.hasPermi('management:pwSpectaculars:add')") +// @Log(title = "生产看板", businessType = BusinessType.INSERT) +// @PostMapping +// public AjaxResult add(@RequestBody PwSpectaculars pwSpectaculars) +// { +// return toAjax(pwSpectacularsService.insertPwSpectaculars(pwSpectaculars)); +// } +// +// /** +// * 修改生产看板 +// */ +// @PreAuthorize("@ss.hasPermi('management:pwSpectaculars:edit')") +// @Log(title = "生产看板", businessType = BusinessType.UPDATE) +// @PutMapping +// public AjaxResult edit(@RequestBody PwSpectaculars pwSpectaculars) +// { +// return toAjax(pwSpectacularsService.updatePwSpectaculars(pwSpectaculars)); +// } +// +// /** +// * 删除生产看板 +// */ +// @PreAuthorize("@ss.hasPermi('management:pwSpectaculars:remove')") +// @Log(title = "生产看板", businessType = BusinessType.DELETE) +// @DeleteMapping("/{ids}") +// public AjaxResult remove(@PathVariable Long[] ids) +// { +// return toAjax(pwSpectacularsService.deletePwSpectacularsByIds(ids)); +// } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwSpectacularsInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwSpectacularsInfoController.java new file mode 100644 index 0000000..798d113 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwSpectacularsInfoController.java @@ -0,0 +1,1951 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoVo; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwSpectacularsInfo; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; +import com.ruoyi.project.management.service.IImProductReceiptService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; +import com.ruoyi.project.management.service.IPwPurchaseContractMaterialService; +import com.ruoyi.project.management.service.IPwSpectacularsInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 新生产看板信息Controller + * + * @author zhukangchao + * @date 2023-04-03 + */ +@RestController +@RequestMapping("/management/pwSpectacularsInfo") +public class PwSpectacularsInfoController extends BaseController +{ + @Autowired + private IPwSpectacularsInfoService pwSpectacularsInfoService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //企标单信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //标准件采购合同详情信息 + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //物料入库单信息 + @Autowired + private IImProductReceiptService imProductReceiptService; + //物料入库单详情信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //质检通知单信息 + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + + /** + * 查询新生产看板信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwSpectacularsInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwSpectacularsInfo pwSpectacularsInfo){ + List list = new ArrayList(); + if((null==pwSpectacularsInfo.getCode()||"".equals(pwSpectacularsInfo.getCode()))&&(null==pwSpectacularsInfo.getMakeDocumentCode()||"".equals(pwSpectacularsInfo.getMakeDocumentCode()))){ + return getDataTable(list); + } + if(null!=pwSpectacularsInfo.getMakeDocumentCode()&&pwSpectacularsInfo.getMakeDocumentCode().contains("QB")){ + List list2 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeMoHu(pwSpectacularsInfo.getMakeDocumentCode()); + Long t = 1L; + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list2) { + //需要返回的数据对象 + PwSpectacularsInfo pwSpectacularsInfo2 = new PwSpectacularsInfo(); + //主键 + pwSpectacularsInfo2.setId(pwMakeDocumentsDetail.getId()); + //序号 + pwSpectacularsInfo2.setNum(t); + //令号 + pwSpectacularsInfo2.setCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //图号 + pwSpectacularsInfo2.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //名称 + pwSpectacularsInfo2.setName(pwMakeDocumentsDetail.getName()); + //单台数量 +// pwSpectacularsInfo2.setOneNumber(pwMakeDocumentsDetail.getOneNumber()); + //材料 + pwSpectacularsInfo2.setType(pwMakeDocumentsDetail.getMaterialType()); + //单重 +// pwSpectacularsInfo2.setPieceWeight(pwMakeDocumentsDetail.getPieceWeight()); + //本批数量 + pwSpectacularsInfo2.setSumNumber(pwMakeDocumentsDetail.getQuantity()); + //备注 +// pwSpectacularsInfo2.setRemarks(pwMakeDocumentsDetail.getRemarks()); + + //查询每颗料的工序 + List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //创建第二行数据 + PwSpectacularsInfo pwSpectacularsInfo3 = new PwSpectacularsInfo(); + //创建第三行数据 + PwSpectacularsInfo pwSpectacularsInfo4 = new PwSpectacularsInfo(); + //创建第四行数据 + PwSpectacularsInfo pwSpectacularsInfo5 = new PwSpectacularsInfo(); + switch(list3.size()) { + case 0 : + //存入集合 + list.add(pwSpectacularsInfo2); + break ; + case 1: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 2: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 3: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 4: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 5: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 6: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 7: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 8: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + pwSpectacularsInfo2.setProcessNameEight(list3.get(7).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameEight(list3.get(7).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + if(null!=list3.get(7).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameEight(sdf.format(list3.get(7).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameEight(list3.get(7).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 9: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + pwSpectacularsInfo2.setProcessNameEight(list3.get(7).getProcessName()); + pwSpectacularsInfo2.setProcessNameNine(list3.get(8).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameEight(list3.get(7).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameNine(list3.get(8).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + if(null!=list3.get(7).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameEight(sdf.format(list3.get(7).getCompletionDate())); + } + if(null!=list3.get(8).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameNine(sdf.format(list3.get(8).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameEight(list3.get(7).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameNine(list3.get(8).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 10: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + pwSpectacularsInfo2.setProcessNameEight(list3.get(7).getProcessName()); + pwSpectacularsInfo2.setProcessNameNine(list3.get(8).getProcessName()); + pwSpectacularsInfo2.setProcessNameTen(list3.get(9).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameEight(list3.get(7).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameNine(list3.get(8).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTen(list3.get(9).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + if(null!=list3.get(7).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameEight(sdf.format(list3.get(7).getCompletionDate())); + } + if(null!=list3.get(8).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameNine(sdf.format(list3.get(8).getCompletionDate())); + } + if(null!=list3.get(9).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTen(sdf.format(list3.get(9).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameEight(list3.get(7).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameNine(list3.get(8).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTen(list3.get(9).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + default : + + break ; + } + + t++; + } + }else{ + //根据令号查询bom表数据 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndKanBan(pwSpectacularsInfo.getCode()); + Long t = 1L; + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + //需要返回的数据对象 + PwSpectacularsInfo pwSpectacularsInfo2 = new PwSpectacularsInfo(); + //主键 + pwSpectacularsInfo2.setId(pwBomNumberTwo2.getId()); + //序号 + pwSpectacularsInfo2.setNum(t); + //令号 + pwSpectacularsInfo2.setCode(pwBomNumberTwo2.getProductionCode()); + //图号 + pwSpectacularsInfo2.setFigureNumber(pwBomNumberTwo2.getFigureNumber()); + //名称 + pwSpectacularsInfo2.setName(pwBomNumberTwo2.getName()); + //单台数量 + pwSpectacularsInfo2.setOneNumber(pwBomNumberTwo2.getOneNumber()); + //材料 + pwSpectacularsInfo2.setType(pwBomNumberTwo2.getType()); + //单重 + pwSpectacularsInfo2.setPieceWeight(pwBomNumberTwo2.getPieceWeight()); + //本批数量 + pwSpectacularsInfo2.setSumNumber(pwBomNumberTwo2.getSumNumber()); + //备注 + pwSpectacularsInfo2.setRemarks(pwBomNumberTwo2.getRemarks()); + + //查询每颗料的工序 + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo2.getProductionCode(), pwBomNumberTwo2.getId()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //创建第二行数据 + PwSpectacularsInfo pwSpectacularsInfo3 = new PwSpectacularsInfo(); + //创建第三行数据 + PwSpectacularsInfo pwSpectacularsInfo4 = new PwSpectacularsInfo(); + //创建第四行数据 + PwSpectacularsInfo pwSpectacularsInfo5 = new PwSpectacularsInfo(); + switch(list3.size()) { + case 0 : + //存入集合 + list.add(pwSpectacularsInfo2); + break ; + case 1: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 2: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 3: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 4: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 5: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 6: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 7: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 8: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + pwSpectacularsInfo2.setProcessNameEight(list3.get(7).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameEight(list3.get(7).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + if(null!=list3.get(7).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameEight(sdf.format(list3.get(7).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameEight(list3.get(7).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + case 9: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + pwSpectacularsInfo2.setProcessNameEight(list3.get(7).getProcessName()); + pwSpectacularsInfo2.setProcessNameNine(list3.get(8).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameEight(list3.get(7).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameNine(list3.get(8).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + if(null!=list3.get(7).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameEight(sdf.format(list3.get(7).getCompletionDate())); + } + if(null!=list3.get(8).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameNine(sdf.format(list3.get(8).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameEight(list3.get(7).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameNine(list3.get(8).getGodownEntry()); + list.add(pwSpectacularsInfo5); + + break ; + case 10: + pwSpectacularsInfo2.setProcessNameOne(list3.get(0).getProcessName()); + pwSpectacularsInfo2.setProcessNameTwo(list3.get(1).getProcessName()); + pwSpectacularsInfo2.setProcessNameThree(list3.get(2).getProcessName()); + pwSpectacularsInfo2.setProcessNameFour(list3.get(3).getProcessName()); + pwSpectacularsInfo2.setProcessNameFive(list3.get(4).getProcessName()); + pwSpectacularsInfo2.setProcessNameSix(list3.get(5).getProcessName()); + pwSpectacularsInfo2.setProcessNameSeven(list3.get(6).getProcessName()); + pwSpectacularsInfo2.setProcessNameEight(list3.get(7).getProcessName()); + pwSpectacularsInfo2.setProcessNameNine(list3.get(8).getProcessName()); + pwSpectacularsInfo2.setProcessNameTen(list3.get(9).getProcessName()); + + //材料信息 + //材料名称 + pwSpectacularsInfo2.setMaterialsName(list3.get(0).getMaterialsName()); + //材料图号 + pwSpectacularsInfo2.setMaterialsSpecification(list3.get(0).getMaterialsSpecification()); + //下料规格 + pwSpectacularsInfo2.setSpecification(list3.get(0).getSpecification()); + //毛坯数量 + pwSpectacularsInfo2.setWorkblank(list3.get(0).getWorkblank()); + //成品数量 + pwSpectacularsInfo2.setFinished(list3.get(0).getFinished()); + //序描述 + pwSpectacularsInfo2.setXuDescribe(list3.get(0).getXuDescribe()); + + list.add(pwSpectacularsInfo2); + //创建第二行数据 + pwSpectacularsInfo3 = new PwSpectacularsInfo(); + pwSpectacularsInfo3.setProcessNameOne(list3.get(0).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTwo(list3.get(1).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameThree(list3.get(2).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFour(list3.get(3).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameFive(list3.get(4).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSix(list3.get(5).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameSeven(list3.get(6).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameEight(list3.get(7).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameNine(list3.get(8).getDepartmentName()); + pwSpectacularsInfo3.setProcessNameTen(list3.get(9).getDepartmentName()); + list.add(pwSpectacularsInfo3); + //创建第三行数据 + pwSpectacularsInfo4 = new PwSpectacularsInfo(); + if(null!=list3.get(0).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameOne(sdf.format(list3.get(0).getCompletionDate())); + } + if(null!=list3.get(1).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTwo(sdf.format(list3.get(1).getCompletionDate())); + } + if(null!=list3.get(2).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameThree(sdf.format(list3.get(2).getCompletionDate())); + } + if(null!=list3.get(3).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFour(sdf.format(list3.get(3).getCompletionDate())); + } + if(null!=list3.get(4).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameFive(sdf.format(list3.get(4).getCompletionDate())); + } + if(null!=list3.get(5).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSix(sdf.format(list3.get(5).getCompletionDate())); + } + if(null!=list3.get(6).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameSeven(sdf.format(list3.get(6).getCompletionDate())); + } + if(null!=list3.get(7).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameEight(sdf.format(list3.get(7).getCompletionDate())); + } + if(null!=list3.get(8).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameNine(sdf.format(list3.get(8).getCompletionDate())); + } + if(null!=list3.get(9).getCompletionDate()){ + pwSpectacularsInfo4.setProcessNameTen(sdf.format(list3.get(9).getCompletionDate())); + } + list.add(pwSpectacularsInfo4); + //创建第四行数据 + pwSpectacularsInfo5 = new PwSpectacularsInfo(); + pwSpectacularsInfo5.setProcessNameOne(list3.get(0).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTwo(list3.get(1).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameThree(list3.get(2).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFour(list3.get(3).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameFive(list3.get(4).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSix(list3.get(5).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameSeven(list3.get(6).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameEight(list3.get(7).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameNine(list3.get(8).getGodownEntry()); + pwSpectacularsInfo5.setProcessNameTen(list3.get(9).getGodownEntry()); + list.add(pwSpectacularsInfo5); + break ; + default : + + break ; + } + + t++; + } + } + return getDataTable(list); + } + + + /** + * 查询质检信息 + * + */ + @RequestMapping("/getCompletionNoticeInfo") + public AjaxResult getCompletionNoticeInfo(@RequestBody String data){ + JSONObject parseObject = JSON.parseObject(data); + + List list2 = new ArrayList(); + if(parseObject.getString("codes").toString().contains("QB")){ + //获取id,根据id查询当前物料的信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //查询第一道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询第二道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询第三道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询第四道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询第五道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询第六道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询第七道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询第八道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询第九道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询第10道质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(9).getName(),list.get(9).getFigureNumber()); + }else{ + + } + }else{ + //获取id,根据id查询当前物料的信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数据 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //查询第一道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询第二道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询第三道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询第四道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询第五道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询第六道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询第七道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询第八道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询第九道序的质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询第10道质检信息 + list2 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(9).getName(),list.get(9).getFigureNumber()); + }else{ + + } + } + return AjaxResult.success(list2); + } + + /** + * 查询入库信息 + * + */ + @RequestMapping("/getProductReceiptInfo") + public AjaxResult getProductReceiptInfo(@RequestBody String data){ + JSONObject parseObject = JSON.parseObject(data); + + List list2 = new ArrayList(); + if(parseObject.getString("codes").toString().contains("QB")){ + //获取id,根据id查询当前物料的信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //查询第一道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询第二道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询第三道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询第四道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询第五道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询第六道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询第七道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询第八道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询第九道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询第10道入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(9).getName(),list.get(9).getFigureNumber()); + }else{ + + } + }else{ + //获取id,根据id查询当前物料的信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数据 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //查询第一道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询第二道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询第三道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询第四道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询第五道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询第六道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询第七道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询第八道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询第九道序的入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询第10道入库信息 + list2 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(9).getName(),list.get(9).getFigureNumber()); + }else{ + + } + } + + return AjaxResult.success(list2); + } + + /** + * 查询出库信息 + * + */ + @RequestMapping("/getStockRequisition") + public AjaxResult getStockRequisition(@RequestBody String data){ + JSONObject parseObject = JSON.parseObject(data); + + List list2 = new ArrayList(); + if(parseObject.getString("codes").toString().contains("QB")){ + //获取id,根据id查询当前物料的信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(1==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第一道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + } + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(2==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第二道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + } + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(3==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第三道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + } + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(4==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第四道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + } + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(5==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第五道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + } + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(6==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第六道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + } + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(7==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第七道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + } + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(8==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第八道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + } + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(9==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第九道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + } + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(10==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getName(),makeDocumentsDetail.getFigureNumber()); + }else{ + //查询第10道出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(9).getName(),list.get(9).getFigureNumber()); + } + }else{ + + } + }else{ + //获取id,根据id查询当前物料的信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数据 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(1==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第一道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + } + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(2==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第二道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + } + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(3==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第三道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + } + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(4==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第四道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + } + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(5==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第五道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + } + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(6==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第六道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + } + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(7==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第七道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + } + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(8==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第八道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + } + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(9==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第九道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + } + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询当前物料有几道序 + if(10==list.size()){ + //说明只有一道序,只有一道序时查询成品的出库记录 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + }else{ + //查询第10道出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(9).getName(),list.get(9).getFigureNumber()); + } + }else{ + + } + } + + return AjaxResult.success(list2); + } + + /** + * 查询领料信息 + * + */ + @RequestMapping("/getLingLiao") + public AjaxResult getLingLiao(@RequestBody String data){ + JSONObject parseObject = JSON.parseObject(data); + + List list2 = new ArrayList(); + if(parseObject.getString("codes").toString().contains("QB")){ + //获取id,根据id查询当前物料的信息 + PwMakeDocumentsDetail makeDocumentsDetail = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //如果为第一序,判断有没有填写原材料,如果填了,则查询原材料的领用信息 + if(null!=makeDocumentsDetail.getMaterialsName()&&!"".equals(makeDocumentsDetail.getMaterialsName())&&null!=makeDocumentsDetail.getMaterialsSpecification()&&!"".equals(makeDocumentsDetail.getMaterialsSpecification())){ + //说明添加了原材料信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), makeDocumentsDetail.getMaterialsName(),makeDocumentsDetail.getMaterialsSpecification()); + } + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询第1道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询第三道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询第四道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询第五道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询第六道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询第七道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询第八道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询第九道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询第10道出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(makeDocumentsDetail.getMakeDocumentsCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + }else{ + + } + }else{ + //获取id,根据id查询当前物料的信息 + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoService.selectPwBomNumberTwoById(Long.valueOf(parseObject.getString("id").toString())); + //获取当前物料的第一道序的数据 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + if("1".equals(parseObject.getString("biaoji").toString())){ + //如果为第一序,判断有没有填写原材料,如果填了,则查询原材料的领用信息 + if(null!=pwBomNumberTwo.getMaterialsName()&&!"".equals(pwBomNumberTwo.getMaterialsName())&&null!=pwBomNumberTwo.getMaterialsSpecification()&&!"".equals(pwBomNumberTwo.getMaterialsSpecification())){ + //说明添加了原材料信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getMaterialsName(),pwBomNumberTwo.getMaterialsSpecification()); + } + }else if("2".equals(parseObject.getString("biaoji").toString())){ + //查询第1道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(0).getName(),list.get(0).getFigureNumber()); + }else if("3".equals(parseObject.getString("biaoji").toString())){ + //查询第三道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(1).getName(),list.get(1).getFigureNumber()); + }else if("4".equals(parseObject.getString("biaoji").toString())){ + //查询第四道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(2).getName(),list.get(2).getFigureNumber()); + }else if("5".equals(parseObject.getString("biaoji").toString())){ + //查询第五道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(3).getName(),list.get(3).getFigureNumber()); + }else if("6".equals(parseObject.getString("biaoji").toString())){ + //查询第六道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(4).getName(),list.get(4).getFigureNumber()); + }else if("7".equals(parseObject.getString("biaoji").toString())){ + //查询第七道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(5).getName(),list.get(5).getFigureNumber()); + }else if("8".equals(parseObject.getString("biaoji").toString())){ + //查询第八道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(6).getName(),list.get(6).getFigureNumber()); + }else if("9".equals(parseObject.getString("biaoji").toString())){ + //查询第九道序的出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(7).getName(),list.get(7).getFigureNumber()); + }else if("10".equals(parseObject.getString("biaoji").toString())){ + //查询第10道出库信息 + list2 = iImStockRequisitionMaterialService.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo.getProductionCode(), list.get(8).getName(),list.get(8).getFigureNumber()); + }else{ + + } + } + + return AjaxResult.success(list2); + } + + + /** + * 导出新生产看板信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwSpectacularsInfo:export')") + @Log(title = "新生产看板信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwSpectacularsInfo pwSpectacularsInfo) + { + List list = pwSpectacularsInfoService.selectPwSpectacularsInfoList(pwSpectacularsInfo); + ExcelUtil util = new ExcelUtil(PwSpectacularsInfo.class); + return util.exportExcel(list, "pwSpectacularsInfo"); + } + + /** + * 获取新生产看板信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwSpectacularsInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwSpectacularsInfoService.selectPwSpectacularsInfoById(id)); + } + + /** + * 新增新生产看板信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwSpectacularsInfo:add')") + @Log(title = "新生产看板信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwSpectacularsInfo pwSpectacularsInfo) + { + return toAjax(pwSpectacularsInfoService.insertPwSpectacularsInfo(pwSpectacularsInfo)); + } + + /** + * 修改新生产看板信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwSpectacularsInfo:edit')") + @Log(title = "新生产看板信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwSpectacularsInfo pwSpectacularsInfo) + { + return toAjax(pwSpectacularsInfoService.updatePwSpectacularsInfo(pwSpectacularsInfo)); + } + + /** + * 删除新生产看板信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwSpectacularsInfo:remove')") + @Log(title = "新生产看板信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwSpectacularsInfoService.deletePwSpectacularsInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwStoresRequisitionController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwStoresRequisitionController.java new file mode 100644 index 0000000..14abc9c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwStoresRequisitionController.java @@ -0,0 +1,573 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialTwo; +import com.ruoyi.project.management.domain.PwBuyingRequisitionTwo; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwStoresRequisition; +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionService; +import com.ruoyi.project.management.service.IPwBacklogService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialTwoService; +import com.ruoyi.project.management.service.IPwBuyingRequisitionTwoService; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwStoresRequisitionService; +import com.ruoyi.project.management.service.IPwStoresRequistionDetailService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 物品领料单Controller + * + * @author zhukangchao + * @date 2022-03-14 + */ +@RestController +@RequestMapping("/management/pwStoresRequisition") +public class PwStoresRequisitionController extends BaseController +{ + @Autowired + private IPwStoresRequisitionService pwStoresRequisitionService; + //领料单详情信息 + @Autowired + private IPwStoresRequistionDetailService pwStoresRequistionDetailService; + // 用户标识信息 + @Autowired + private TokenService tokenService; + //领料单信息 + @Autowired + private IImStockRequisitionService imStockRequisitionService; + //领料单详情信息 + @Autowired + private IImStockRequisitionMaterialService iImStockRequisitionMaterialService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //易耗品采购单 + @Autowired + private IPwBuyingRequisitionTwoService pwBuyingRequisitionTwoService; + @Autowired + private IPwBuyingRequisitionMaterialTwoService pwBuyingRequisitionMaterialTwoService; + + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + + /** + * 查询物品领料单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequisition:list')") + @GetMapping("/list") + public TableDataInfo list(PwStoresRequisition pwStoresRequisition){ + //判断角色权限,如果角色权限为车间班组则,只能看到自己申请的单据,如果角色为车间主任,则能看见本部门的单据,其他看见全部 + // 获取当前登录用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + if(!"admin".equals(user.getUserName())&&!"chenshitian".equals(user.getUserName())&&!"zhangmin".equals(user.getUserName())&&!"liwu".equals(user.getUserName())){ + pwStoresRequisition.setProposer(user.getNickName()); + } + startPage(); + List list = new ArrayList(); + if(null!=pwStoresRequisition.getMaterialName()&&!"".equals(pwStoresRequisition.getMaterialName())){ + List list2 = pwStoresRequistionDetailService.selectPwStoresRequistionDetailByName(pwStoresRequisition.getMaterialName()); + for (PwStoresRequistionDetail pwStoresRequistionDetail : list2) { + //根据单据id查询请购单 + PwStoresRequisition storesRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(pwStoresRequistionDetail.getStoresRequisitionId()); + if(null!=storesRequisition){ + list.add(storesRequisition); + } + } + }else{ + list = pwStoresRequisitionService.selectPwStoresRequisitionList(pwStoresRequisition); + } + return getDataTable(list); + } + + /** + * 导出物品领料单列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequisition:export')") + @Log(title = "物品领料单", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwStoresRequisition pwStoresRequisition) + { + List list = pwStoresRequisitionService.selectPwStoresRequisitionList(pwStoresRequisition); + ExcelUtil util = new ExcelUtil(PwStoresRequisition.class); + return util.exportExcel(list, "pwStoresRequisition"); + } + + /** + * 获取物品领料单详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequisition:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwStoresRequisitionService.selectPwStoresRequisitionById(id)); + } + + /** + * 打印流转单功能 + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据 + */ + @RequestMapping("/prints/{ids}") + public AjaxResult prints(@PathVariable Long[] ids){ + if(ids.length==0){ + return AjaxResult.error("请选择单据"); + } + List list2 = new ArrayList(); + //遍历ids + for (Long id : ids) { + //根据id获取申领单信息 + PwStoresRequisition storesRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(id); + if("未审批".equals(storesRequisition.getStatus())){ + return AjaxResult.error("未审批的单据不允许打印"); + } + //根据id获取申领单详情信息 + List list = pwStoresRequistionDetailService.selectPwStoresRequistionDetailByStoresRequistionId(id); + for (PwStoresRequistionDetail pwStoresRequistionDetail : list) { + //令号 + pwStoresRequistionDetail.setCode(storesRequisition.getCode()); + //审批人 + pwStoresRequistionDetail.setAuditor(storesRequisition.getAuditor()); + //修改申领人为本人(而不是代出单人) + pwStoresRequistionDetail.setPreferentialOriginName(pwStoresRequistionDetail.getRemarks()); + list2.add(pwStoresRequistionDetail); + } + } + //返回获得到的入库单信息 + HashMap godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list2); + return AjaxResult.success("success",godownMessage); + } + + + /** + * 打印流转单功能(易耗品) + * 物料id,根据物料id获取物料信息,根据物料信息生成pdf单据 + */ + @RequestMapping("/printsAll/{ids}") + public AjaxResult printAlls(@PathVariable Long[] ids){ + if(ids.length==0){ + return AjaxResult.error("请选择单据"); + } + List list2 = new ArrayList(); + //遍历ids + for (Long id : ids) { + //根据id获取申领单信息 + PwStoresRequisition storesRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(id); + if("未审批".equals(storesRequisition.getStatus())){ + return AjaxResult.error("未审批的单据不允许打印"); + } + //根据id获取申领单详情信息 + List list = pwStoresRequistionDetailService.selectPwStoresRequistionDetailByStoresRequistionId(id); + storesRequisition.setList(list); + list2.add(storesRequisition); + } + //返回获得到的入库单信息 + HashMap godownMessage = new HashMap<>(); + //物品信息 + godownMessage.put("list",list2); + return AjaxResult.success("success",godownMessage); + } + + /** + * 新增物品领料单 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequisition:add')") + @Log(title = "物品领料单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwStoresRequisition pwStoresRequisition){ + if(null==pwStoresRequisition.getName()){ + return AjaxResult.error("请输入名称"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + // 获取当前登录用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + pwStoresRequisition.setCode("SR"+sdf.format(new Date())); + pwStoresRequisition.setProposer(user.getNickName()); + pwStoresRequisition.setDemandDate(new Date()); + //领料单状态初始值为1,(待审核状态) + pwStoresRequisition.setStatus("未审核"); + return toAjax(pwStoresRequisitionService.insertPwStoresRequisition(pwStoresRequisition)); + } + + /** + * 修改物品领料单 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequisition:edit')") + @Log(title = "物品领料单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwStoresRequisition pwStoresRequisition) + { + return toAjax(pwStoresRequisitionService.updatePwStoresRequisition(pwStoresRequisition)); + } + + /** + * 删除物品领料单 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequisition:remove')") + @Log(title = "物品领料单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwStoresRequisitionService.deletePwStoresRequisitionByIds(ids)); + } + + /** + * 审核领料单 + */ + @RequestMapping("/auditTwoPwStoresRequisition") + public AjaxResult auditTwoPwStoresRequisition(Long id){ + PwStoresRequisition pwStoresRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(id); + + // 获取当前登录用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + + //判断当前领用单下的所有物料是否含有劳保 + pwStoresRequisition.setSparedOne(user.getNickName()); + pwStoresRequisition.setSparedTwo("已审核"); + + int i = pwStoresRequisitionService.updatePwStoresRequisition(pwStoresRequisition); + if(i<1){ + return AjaxResult.error("审核失败"); + }else{ + //把出库数据推送给库房,增加出库记录 + + } + return AjaxResult.success("审核成功"); + } + + /** + * 审批领料单 + */ + @RequestMapping("/auditPwStoresRequisition") + public AjaxResult auditPwStoresRequisition(Long id){ + PwStoresRequisition pwStoresRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(id); + + // 获取当前登录用户信息 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + + //判断当前领用单下的所有物料是否含有劳保 + List list = pwStoresRequistionDetailService.selectPwStoresRequistionDetailByStoresRequistionId(pwStoresRequisition.getId()); +// int s = 0; +// for (PwStoresRequistionDetail pwStoresRequistionDetail : list) { +// //根据物料名称和图号查询物料信息 +// ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwStoresRequistionDetail.getMaterialName(), pwStoresRequistionDetail.getFigureNumber()); +// if(null!=imMaterial.getWarehouseName()&&"劳保库".equals(imMaterial.getWarehouseName())){ +// s = 1; +// break; +// } +// } +// if(s==1){ +// if(!"zhangmin".equals(user.getUserName())&&!"admin".equals(user.getUserName())&&!"zhanglili".equals(user.getUserName())&&!"chenshitian".equals(user.getUserName())){ +// return AjaxResult.error("此账号没有权限审批,请联系上级领导"); +// } +// } + pwStoresRequisition.setStatus("已审批"); + pwStoresRequisition.setAuditor(user.getNickName()); + + //审核时触发计算安全库存 +// for (PwStoresRequistionDetail pwStoresRequistionDetail : list) { +// //查询物料详情 +// ImMaterial imMaterial = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwStoresRequistionDetail.getMaterialName(), pwStoresRequistionDetail.getFigureNumber()); +// PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwStoresRequistionDetail.getMaterialName(), pwStoresRequistionDetail.getFigureNumber()); +// if(null != imMaterial){ +// //如果是领料单申请领料,则查询库存数量是否还大于安全库存数量,如果小于,则自动产生易耗品采购单 +// if(null!=imMaterial.getProportion()&&imMaterial.getProportion()>1){ +// if((inventoryDetail.getQuantity()/imMaterial.getProportion())+(inventoryDetail.getPreliminaryInventory()/imMaterial.getProportion()) lists = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// Double zongjia = 0.0; +// for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : lists) { +// zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); +// } +// //根据采购单id查询采购单 +// PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// buyingRequisitionTwo.setTotalPrices(zongjia); +// pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); +// +// //加上在途数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBuyingRequisitionMaterialTwo.getNumber()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +//// addBacklog("易耗品待采购",pwBuyingRequisitionTwo.getCode(),pwBuyingRequisitionMaterialTwo.getMaterialName(),pwBuyingRequisitionMaterialTwo.getFigureNumber(),user.getNickName(),"采购","易耗品采购","请购单管理","/purchase/pwBuyingRequisitionMaterialTwo?id="+pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// +// } +// }else{ +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-pwStoresRequistionDetail.getNumber() lists = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// Double zongjia = 0.0; +// for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : lists) { +// zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); +// } +// //根据采购单id查询采购单 +// PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// //总价 +// buyingRequisitionTwo.setTotalPrices(zongjia); +// pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); +// +// //加上在途数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBuyingRequisitionMaterialTwo.getNumber()); +// pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); +// +// //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +//// addBacklog("易耗品待采购",pwBuyingRequisitionTwo.getCode(),pwBuyingRequisitionMaterialTwo.getMaterialName(),pwBuyingRequisitionMaterialTwo.getFigureNumber(),user.getNickName(),"采购","易耗品采购","请购单管理","/purchase/pwBuyingRequisitionMaterialTwo?id="+pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); +// +// } +// } +// +// } +// } + + //增加 + + int i = pwStoresRequisitionService.updatePwStoresRequisition(pwStoresRequisition); + if(i<1){ + return AjaxResult.error("审批失败"); + }else{ + //把出库数据推送给库房,增加出库记录 + + } + return AjaxResult.success("审批成功"); + } + + /** + * 申请领料 + */ + @RequestMapping("/applyForReceives/{ids}") + public AjaxResult applyForReceives(@PathVariable Long[] ids){ + //获取当前登录用户 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 发料人名称默认为当前账号 + SysUser user = loginUser.getUser(); + int i = 0; + //根据id查询当前领料单下所有的物料 + for (Long id : ids) { + //根据id查询领料单详情 + PwStoresRequisition pwStoresRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(id); + //未审核的单据不允许领料 + if(!pwStoresRequisition.getStatus().equals("已审批")){ + return AjaxResult.error("未审批的单据不允许申领"); + } + //根据领料单id查询领料单详情信息 + List list = pwStoresRequistionDetailService.selectPwStoresRequistionDetailByStoresRequistionId(id); + if(list.size()==0){ + return AjaxResult.error("此领料单下无物料"); + }else{ + //根据code查询此单据是否领过物料 + ImStockRequisition stockRequisition = imStockRequisitionService.selectImStockRequisitionByCode(pwStoresRequisition.getCode()); + if(null!=stockRequisition){ + return AjaxResult.error("此单据已申请领料"); + }else{ + //说明是此单据是第一次领料 + //创建领料单对象 + ImStockRequisition imStockRequisition = new ImStockRequisition(); + //关联单据(执行单code) + imStockRequisition.setCode(pwStoresRequisition.getCode()); + //项目名称 + imStockRequisition.setProjectName(pwStoresRequisition.getName()); + //领料状态 + imStockRequisition.setGetStatus("未出库"); + imStockRequisitionService.insertImStockRequisition(imStockRequisition); + //把当前领料单下所有物料添加到领料单下 + for (PwStoresRequistionDetail pwStoresRequistionDetail : list) { + //创建领料单详情对象,保存该单据下所有的物料(待出库) + ImStockRequisitionMaterial imStockRequisitionMaterial = new ImStockRequisitionMaterial(); + //领料单id + imStockRequisitionMaterial.setStockRequisitionId(imStockRequisition.getId()); + //关联单据code + imStockRequisitionMaterial.setCode(pwStoresRequisition.getCode()); + //物料名称 + imStockRequisitionMaterial.setMaterialName(pwStoresRequistionDetail.getMaterialName()); + //图号 + imStockRequisitionMaterial.setFigureNumber(pwStoresRequistionDetail.getFigureNumber()); + //材料 + imStockRequisitionMaterial.setMaterials(pwStoresRequistionDetail.getMaterials()); + //领料人 + imStockRequisitionMaterial.setMaterialHandlerName(user.getNickName()); + //应发数量 + imStockRequisitionMaterial.setSalaryQuantity(pwStoresRequistionDetail.getNumber()); + //申请数量 + imStockRequisitionMaterial.setApplyForQuantity(pwStoresRequistionDetail.getNumber()); + //单价 + imStockRequisitionMaterial.setUnivalence(pwStoresRequistionDetail.getUnivalence()); + //总价 + imStockRequisitionMaterial.setTotalPrices(pwStoresRequistionDetail.getUnivalence()*pwStoresRequistionDetail.getNumber()); + //已发数量默认为0 + imStockRequisitionMaterial.setAlreadyQuantity(0L); + //实出数量 + imStockRequisitionMaterial.setActualQuantityIssued(pwStoresRequistionDetail.getNumber()); + //出库状态,默认为未出库 + imStockRequisitionMaterial.setGetStatus("未出库"); + i = iImStockRequisitionMaterialService.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + } + //修改领料单的状态为已申请 + pwStoresRequisition.setStatus("已申请"); + pwStoresRequisitionService.updatePwStoresRequisition(pwStoresRequisition); + } + } + } + return toAjax(i); + } + + /** + * 创建待办事项 + * @param 事项名称 + * @param 关联令号 + * @param 推送人 + * @param 办理人 + * @param 办理方式 + * @param 模块名称 + * @param 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwStoresRequistionDetailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwStoresRequistionDetailController.java new file mode 100644 index 0000000..73a9de0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwStoresRequistionDetailController.java @@ -0,0 +1,197 @@ +package com.ruoyi.project.management.controller; + +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; +import com.ruoyi.project.management.domain.PwStoresRequisition; +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; +import com.ruoyi.project.management.service.IPwStoresRequisitionService; +import com.ruoyi.project.management.service.IPwStoresRequistionDetailService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 领料单详情Controller + * + * @author zhukangchao + * @date 2022-03-14 + */ +@RestController +@RequestMapping("/management/pwStoresRequistionDetail") +public class PwStoresRequistionDetailController extends BaseController +{ + @Autowired + private IPwStoresRequistionDetailService pwStoresRequistionDetailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //领料单信息 + @Autowired + private IPwStoresRequisitionService pwStoresRequisitionService; + //出库记录 + @Autowired + private IImStockRequisitionMaterialService imStockRequisitionMaterialService; + + /** + * 查询领料单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequistionDetail:list')") + @GetMapping("/list") + public TableDataInfo list(PwStoresRequistionDetail pwStoresRequistionDetail){ + if(null!=pwStoresRequistionDetail.getRemarks()&&!"".equals(pwStoresRequistionDetail.getRemarks())){ + //搜索所有的单据 + pwStoresRequistionDetail.setStoresRequisitionId(null); + } + startPage(); + List list = pwStoresRequistionDetailService.selectPwStoresRequistionDetailList(pwStoresRequistionDetail); + return getDataTable(list); + } + + /** + * 导出领料单详情列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequistionDetail:export')") + @Log(title = "领料单详情", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwStoresRequistionDetail pwStoresRequistionDetail) + { + List list = pwStoresRequistionDetailService.selectPwStoresRequistionDetailList(pwStoresRequistionDetail); + ExcelUtil util = new ExcelUtil(PwStoresRequistionDetail.class); + return util.exportExcel(list, "pwStoresRequistionDetail"); + } + + /** + * 获取领料单详情详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequistionDetail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwStoresRequistionDetailService.selectPwStoresRequistionDetailById(id)); + } + + /** + * 新增领料单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequistionDetail:add')") + @Log(title = "领料单详情", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwStoresRequistionDetail pwStoresRequistionDetail){ + //判断物料id是否为null + if(null == pwStoresRequistionDetail.getMaterialId()||"".equals(pwStoresRequistionDetail.getMaterialId())){ + return AjaxResult.error("请选择物料"); + } + //判断数量是否为null + if(null==pwStoresRequistionDetail.getNumber()||"".equals(pwStoresRequistionDetail.getNumber())){ + return AjaxResult.error("请填写需领料数量"); + } + //根据物料id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwStoresRequistionDetail.getMaterialId()); + //物料名称 + pwStoresRequistionDetail.setMaterialName(imMaterial.getMaterialName()); + //图号 + pwStoresRequistionDetail.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwStoresRequistionDetail.setMaterials(imMaterial.getMaterials()); + //单重 + pwStoresRequistionDetail.setPieceWeight(imMaterial.getPieceWeight()); + //单位 +// pwStoresRequistionDetail.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + pwStoresRequistionDetail.setUnitOfMeasurementName(imMaterial.getStockRequisitionUnit()); + //单价 + pwStoresRequistionDetail.setUnivalence(imMaterial.getUnivalence().doubleValue()); + //总价 + pwStoresRequistionDetail.setTotalprice(imMaterial.getUnivalence().doubleValue()*pwStoresRequistionDetail.getNumber()); + //入库状态初始为 未入库 + pwStoresRequistionDetail.setStatus("未出库"); + int i = pwStoresRequistionDetailService.insertPwStoresRequistionDetail(pwStoresRequistionDetail); + //根据领料单id查询采购单 + PwStoresRequisition pwStoresRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(pwStoresRequistionDetail.getStoresRequisitionId()); + //重置审核状态 + pwStoresRequisition.setSparedTwo("未审核"); + pwStoresRequisition.setStatus("未审批"); + pwStoresRequisition.setSparedOne(""); + pwStoresRequisition.setAuditor(""); + int j = pwStoresRequisitionService.updatePwStoresRequisition(pwStoresRequisition); + return toAjax(j); + } + + /** + * 修改领料单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequistionDetail:edit')") + @Log(title = "领料单详情", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwStoresRequistionDetail pwStoresRequistionDetail){ + //根据物料id查询物料信息 + ImMaterial imMaterial = imMaterialService.selectImMaterialById(pwStoresRequistionDetail.getMaterialId()); + //物料名称 + pwStoresRequistionDetail.setMaterialName(imMaterial.getMaterialName()); + //图号 + pwStoresRequistionDetail.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwStoresRequistionDetail.setMaterials(imMaterial.getMaterials()); + //单重 + pwStoresRequistionDetail.setPieceWeight(imMaterial.getPieceWeight()); + //单位 + pwStoresRequistionDetail.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + //单价 + pwStoresRequistionDetail.setUnivalence(imMaterial.getUnivalence().doubleValue()); + //总价 + pwStoresRequistionDetail.setTotalprice(imMaterial.getUnivalence().doubleValue()*pwStoresRequistionDetail.getNumber()); + int i = pwStoresRequistionDetailService.updatePwStoresRequistionDetail(pwStoresRequistionDetail); + //根据领料单id查询采购单 + PwStoresRequisition pwStoresRequisition = pwStoresRequisitionService.selectPwStoresRequisitionById(pwStoresRequistionDetail.getStoresRequisitionId()); + //重置审核状态 + pwStoresRequisition.setSparedTwo("未审核"); + pwStoresRequisition.setStatus("未审批"); + pwStoresRequisition.setSparedOne(""); + pwStoresRequisition.setAuditor(""); + int j = pwStoresRequisitionService.updatePwStoresRequisition(pwStoresRequisition); + return toAjax(j); + } + + /** + * 删除领料单详情 + */ + @PreAuthorize("@ss.hasPermi('management:pwStoresRequistionDetail:remove')") + @Log(title = "领料单详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwStoresRequistionDetailService.deletePwStoresRequistionDetailByIds(ids)); + } + + /** + * 查询出库记录 + * + */ + @RequestMapping("/getListImStockRequisitionMaterial") + public TableDataInfo getListImStockRequisitionMaterial(PwStoresRequistionDetail pwStoresRequistionDetail){ + //根据id获取名称和图号 + PwStoresRequistionDetail storesRequistionDetail = pwStoresRequistionDetailService.selectPwStoresRequistionDetailById(pwStoresRequistionDetail.getId()); + + startPage(); + List list = imStockRequisitionMaterialService.selectImStockRequisitionMaterialByNameAndFigureNumber(storesRequistionDetail.getMaterialName(), storesRequistionDetail.getFigureNumber()); + return getDataTable(list); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskBomController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskBomController.java new file mode 100644 index 0000000..2d93ce3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskBomController.java @@ -0,0 +1,110 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.PwTaskBom; +import com.ruoyi.project.management.service.IImMaterialService; +import com.ruoyi.project.management.service.IPwTaskBomService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 任务零部件关联Controller + * + * @author zhukangchao + * @date 2020-08-20 + */ +@RestController +@RequestMapping("/management/TaskBom") +public class PwTaskBomController extends BaseController +{ + @Autowired + private IPwTaskBomService pwTaskBomService; + @Autowired + private IImMaterialService imMaterialService; + + /** + * 查询任务零部件关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:TaskBom:list')") + @GetMapping("/list") + public TableDataInfo list(PwTaskBom pwTaskBom) + { + startPage(); + List list = pwTaskBomService.selectPwTaskBomList(pwTaskBom); + return getDataTable(list); + } + + /** + * 导出任务零部件关联列表 + */ + @PreAuthorize("@ss.hasPermi('management:TaskBom:export')") + @Log(title = "任务零部件关联", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwTaskBom pwTaskBom) + { + List list = pwTaskBomService.selectPwTaskBomList(pwTaskBom); + ExcelUtil util = new ExcelUtil(PwTaskBom.class); + return util.exportExcel(list, "TaskBom"); + } + + /** + * 获取任务零部件关联详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:TaskBom:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwTaskBomService.selectPwTaskBomById(id)); + } + + /** + * 新增任务零部件关联 + */ + @PreAuthorize("@ss.hasPermi('management:TaskBom:add')") + @Log(title = "任务零部件关联", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwTaskBom pwTaskBom){ + //根据物料图号查询物料信息 + ImMaterial material = imMaterialService.selectImMaterialById(pwTaskBom.getMaterialId()); + pwTaskBom.setMaterial(material.getMaterialName()); + pwTaskBom.setFigureNumber(material.getSpecificationType()); + return toAjax(pwTaskBomService.insertPwTaskBom(pwTaskBom)); + } + + /** + * 修改任务零部件关联 + */ + @PreAuthorize("@ss.hasPermi('management:TaskBom:edit')") + @Log(title = "任务零部件关联", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwTaskBom pwTaskBom) + { + return toAjax(pwTaskBomService.updatePwTaskBom(pwTaskBom)); + } + + /** + * 删除任务零部件关联 + */ + @PreAuthorize("@ss.hasPermi('management:TaskBom:remove')") + @Log(title = "任务零部件关联", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwTaskBomService.deletePwTaskBomByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskController.java new file mode 100644 index 0000000..1612740 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskController.java @@ -0,0 +1,173 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.config.Task; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.project.management.domain.PwTask; +import com.ruoyi.project.management.service.IPwTaskService; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 任务Controller + * + * @author zhukangchao + * @date 2020-08-11 + */ +@RestController +@RequestMapping("/management/task") +public class PwTaskController extends BaseController +{ + @Autowired + private IPwTaskService pwTaskService; + + /** + * 查询任务列表 + */ + @PreAuthorize("@ss.hasPermi('management:task:list')") + @GetMapping("/list") + public TableDataInfo list(PwTask pwTask) + { + startPage(); + List list = pwTaskService.selectPwTaskList(pwTask); + return getDataTable(list); + } + + /** + * 导出任务列表 + */ + @PreAuthorize("@ss.hasPermi('management:task:export')") + @Log(title = "任务", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwTask pwTask) + { + List list = pwTaskService.selectPwTaskList(pwTask); + ExcelUtil util = new ExcelUtil(PwTask.class); + return util.exportExcel(list, "task"); + } + + /** + * 获取任务详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:task:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwTaskService.selectPwTaskById(id)); + } + + /** + * 新增任务 + */ + @PreAuthorize("@ss.hasPermi('management:task:add')") + @Log(title = "任务", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwTask pwTask){ + int i = pwTaskService.insertPwTask(pwTask); + return toAjax(i); + } + + /** + * 修改任务 + */ + @PreAuthorize("@ss.hasPermi('management:task:edit')") + @Log(title = "任务", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwTask pwTask) + { + return toAjax(pwTaskService.updatePwTask(pwTask)); + } + + /** + * 删除任务 + */ + @PreAuthorize("@ss.hasPermi('management:task:remove')") + @Log(title = "任务", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwTaskService.deletePwTaskByIds(ids)); + } + + /** + * 发布任务按钮 + * 修改任务状态 + */ + @RequestMapping("/publishTask") + public AjaxResult publishTask(Long id){ + PwTask pwTask = pwTaskService.selectPwTaskById(id); + pwTask.setTaskStatus(1); + int i = pwTaskService.updatePwTask(pwTask); + if(i<1){ + return AjaxResult.error("发布任务失败"); + } + return AjaxResult.success("发布成功"); + } + + /** + * 领取任务按钮 + * 添加任务开始时间 + * 修改任务状态 + */ + @RequestMapping("/getTask") + public AjaxResult getTask(Long id){ + PwTask pwTask = pwTaskService.selectPwTaskById(id); + pwTask.setBeginTimes(new Date()); + pwTask.setTaskStatus(2); + int i = pwTaskService.updatePwTask(pwTask); + if(i<1){ + return AjaxResult.error("领取任务失败"); + } + return AjaxResult.success("领取成功"); + } + + /** + * 完成任务按钮 + * 添加完成时间 + * 计算任务用时 + * 修改任务状态 + */ + @RequestMapping("/accomplishTask") + public AjaxResult accomplishTask(Long id){ + int i = pwTaskService.accomplishTask(id); + if(i<1){ + return AjaxResult.error("完成失败,请稍后尝试"); + } + return AjaxResult.success("成功"); + } + + /** + * 质检审核 + */ + @RequestMapping("/auditTask") + public AjaxResult auditTask(Long id){ + PwTask pwTask = pwTaskService.selectPwTaskById(id); + //已完成状态,可入库状态 + pwTask.setTaskStatus(4); + int i = pwTaskService.updatePwTask(pwTask); + if(i<1){ + return AjaxResult.error("完成失败,请稍后尝试"); + } + return AjaxResult.success("成功"); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskOverTimeInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskOverTimeInfoController.java new file mode 100644 index 0000000..402ad3e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwTaskOverTimeInfoController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwTaskOverTimeInfo; +import com.ruoyi.project.management.service.IPwTaskOverTimeInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 任务超时信息Controller + * + * @author zhukangchao + * @date 2023-09-01 + */ +@RestController +@RequestMapping("/management/pwTaskOverTimeInfo") +public class PwTaskOverTimeInfoController extends BaseController +{ + @Autowired + private IPwTaskOverTimeInfoService pwTaskOverTimeInfoService; + + /** + * 查询任务超时信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwTaskOverTimeInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwTaskOverTimeInfo pwTaskOverTimeInfo) + { + startPage(); + List list = pwTaskOverTimeInfoService.selectPwTaskOverTimeInfoList(pwTaskOverTimeInfo); + return getDataTable(list); + } + + /** + * 导出任务超时信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwTaskOverTimeInfo:export')") + @Log(title = "任务超时信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwTaskOverTimeInfo pwTaskOverTimeInfo) + { + List list = pwTaskOverTimeInfoService.selectPwTaskOverTimeInfoList(pwTaskOverTimeInfo); + ExcelUtil util = new ExcelUtil(PwTaskOverTimeInfo.class); + return util.exportExcel(list, "pwTaskOverTimeInfo"); + } + + /** + * 获取任务超时信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTaskOverTimeInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwTaskOverTimeInfoService.selectPwTaskOverTimeInfoById(id)); + } + + /** + * 新增任务超时信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTaskOverTimeInfo:add')") + @Log(title = "任务超时信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwTaskOverTimeInfo pwTaskOverTimeInfo) + { + return toAjax(pwTaskOverTimeInfoService.insertPwTaskOverTimeInfo(pwTaskOverTimeInfo)); + } + + /** + * 修改任务超时信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTaskOverTimeInfo:edit')") + @Log(title = "任务超时信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwTaskOverTimeInfo pwTaskOverTimeInfo) + { + return toAjax(pwTaskOverTimeInfoService.updatePwTaskOverTimeInfo(pwTaskOverTimeInfo)); + } + + /** + * 删除任务超时信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTaskOverTimeInfo:remove')") + @Log(title = "任务超时信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwTaskOverTimeInfoService.deletePwTaskOverTimeInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwTicketInfoController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwTicketInfoController.java new file mode 100644 index 0000000..bb80b24 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwTicketInfoController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwTicketInfo; +import com.ruoyi.project.management.service.IPwTicketInfoService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 处罚单信息Controller + * + * @author zhukangchao + * @date 2023-08-01 + */ +@RestController +@RequestMapping("/management/pwTicketInfo") +public class PwTicketInfoController extends BaseController +{ + @Autowired + private IPwTicketInfoService pwTicketInfoService; + + /** + * 查询处罚单信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwTicketInfo:list')") + @GetMapping("/list") + public TableDataInfo list(PwTicketInfo pwTicketInfo) + { + startPage(); + List list = pwTicketInfoService.selectPwTicketInfoList(pwTicketInfo); + return getDataTable(list); + } + + /** + * 导出处罚单信息列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwTicketInfo:export')") + @Log(title = "处罚单信息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwTicketInfo pwTicketInfo) + { + List list = pwTicketInfoService.selectPwTicketInfoList(pwTicketInfo); + ExcelUtil util = new ExcelUtil(PwTicketInfo.class); + return util.exportExcel(list, "pwTicketInfo"); + } + + /** + * 获取处罚单信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTicketInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwTicketInfoService.selectPwTicketInfoById(id)); + } + + /** + * 新增处罚单信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTicketInfo:add')") + @Log(title = "处罚单信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwTicketInfo pwTicketInfo) + { + return toAjax(pwTicketInfoService.insertPwTicketInfo(pwTicketInfo)); + } + + /** + * 修改处罚单信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTicketInfo:edit')") + @Log(title = "处罚单信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwTicketInfo pwTicketInfo) + { + return toAjax(pwTicketInfoService.updatePwTicketInfo(pwTicketInfo)); + } + + /** + * 删除处罚单信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwTicketInfo:remove')") + @Log(title = "处罚单信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwTicketInfoService.deletePwTicketInfoByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/PwUserEmailController.java b/evo/src/main/java/com/ruoyi/project/management/controller/PwUserEmailController.java new file mode 100644 index 0000000..88ba0c2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/PwUserEmailController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PwUserEmail; +import com.ruoyi.project.management.service.IPwUserEmailService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 邮箱Controller + * + * @author zhukangchao + * @date 2022-09-24 + */ +@RestController +@RequestMapping("/management/pwUserEmail") +public class PwUserEmailController extends BaseController +{ + @Autowired + private IPwUserEmailService pwUserEmailService; + + /** + * 查询邮箱列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwUserEmail:list')") + @GetMapping("/list") + public TableDataInfo list(PwUserEmail pwUserEmail) + { + startPage(); + List list = pwUserEmailService.selectPwUserEmailList(pwUserEmail); + return getDataTable(list); + } + + /** + * 导出邮箱列表 + */ + @PreAuthorize("@ss.hasPermi('management:pwUserEmail:export')") + @Log(title = "邮箱", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(PwUserEmail pwUserEmail) + { + List list = pwUserEmailService.selectPwUserEmailList(pwUserEmail); + ExcelUtil util = new ExcelUtil(PwUserEmail.class); + return util.exportExcel(list, "pwUserEmail"); + } + + /** + * 获取邮箱详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:pwUserEmail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(pwUserEmailService.selectPwUserEmailById(id)); + } + + /** + * 新增邮箱 + */ + @PreAuthorize("@ss.hasPermi('management:pwUserEmail:add')") + @Log(title = "邮箱", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PwUserEmail pwUserEmail) + { + return toAjax(pwUserEmailService.insertPwUserEmail(pwUserEmail)); + } + + /** + * 修改邮箱 + */ + @PreAuthorize("@ss.hasPermi('management:pwUserEmail:edit')") + @Log(title = "邮箱", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PwUserEmail pwUserEmail) + { + return toAjax(pwUserEmailService.updatePwUserEmail(pwUserEmail)); + } + + /** + * 删除邮箱 + */ + @PreAuthorize("@ss.hasPermi('management:pwUserEmail:remove')") + @Log(title = "邮箱", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pwUserEmailService.deletePwUserEmailByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/SysConfigIniController.java b/evo/src/main/java/com/ruoyi/project/management/controller/SysConfigIniController.java new file mode 100644 index 0000000..09f2480 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/SysConfigIniController.java @@ -0,0 +1,221 @@ +package com.ruoyi.project.management.controller; + +import java.io.*; +import java.util.List; + +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.PwContract; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.SysConfigIni; +import com.ruoyi.project.management.service.ISysConfigIniService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 图纸配置Controller + * + * @author zhukangchao + * @date 2021-03-05 + */ +@RestController +@RequestMapping("/management/configIni") +public class SysConfigIniController extends BaseController +{ + @Autowired + private ISysConfigIniService sysConfigIniService; + + /** + * 查询图纸配置列表 + */ + @PreAuthorize("@ss.hasPermi('management:configIni:list')") + @GetMapping("/list") + public TableDataInfo list(SysConfigIni sysConfigIni) + { + startPage(); + List list = sysConfigIniService.selectSysConfigIniList(sysConfigIni); + return getDataTable(list); + } + + /** + * 导出图纸配置列表 + */ + @PreAuthorize("@ss.hasPermi('management:configIni:export')") + @Log(title = "图纸配置", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(SysConfigIni sysConfigIni) + { + List list = sysConfigIniService.selectSysConfigIniList(sysConfigIni); + ExcelUtil util = new ExcelUtil(SysConfigIni.class); + return util.exportExcel(list, "configIni"); + } + + /** + * 获取图纸配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:configIni:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(sysConfigIniService.selectSysConfigIniById(id)); + } + + /** + * 新增图纸配置 + */ + @PreAuthorize("@ss.hasPermi('management:configIni:add')") + @Log(title = "图纸配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysConfigIni sysConfigIni){ + //新增之前查询是否已经有了此型号 + String fileType = sysConfigIni.getFileType(); + SysConfigIni configIni = sysConfigIniService.selectSysConfigIniByFileType(fileType); + if(null!=configIni){ + return AjaxResult.error("此型号已存在"); + } + sysConfigIni.setDir("D:"+"\\\\"+"evoEngine"+"\\\\"+"static"+"\\\\"+"scheme_design"+"\\\\"); + sysConfigIni.setUrl("http://110.249.133.106:8902/scheme_design/"); + sysConfigIni.setProductDir("D:"+"\\\\"+"evoEngine"+"\\\\"+"static"+"\\\\"+"product"+"\\\\"); + return toAjax(sysConfigIniService.insertSysConfigIni(sysConfigIni)); + } + + /** + * 修改图纸配置 + */ + @PreAuthorize("@ss.hasPermi('management:configIni:edit')") + @Log(title = "图纸配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysConfigIni sysConfigIni) + { + return toAjax(sysConfigIniService.updateSysConfigIni(sysConfigIni)); + } + + /** + * 删除图纸配置 + */ + @PreAuthorize("@ss.hasPermi('management:configIni:remove')") + @Log(title = "图纸配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysConfigIniService.deleteSysConfigIniByIds(ids)); + } + + @GetMapping("/queryAlllist") + public List queryAlllist() + { + List list = sysConfigIniService.selectSysConfigIniList(null); + return list; + } + + /** + * 上传dwg图纸 + * + * @param code + * @param filePath + * @return + */ + @RequestMapping("/uploadDwg") + @ResponseBody + public AjaxResult uploadContractPDF(@RequestParam("code") String code, @RequestParam("file") MultipartFile filePath) { + String originalFilename = filePath.getOriginalFilename(); + if (StringUtils.isEmpty(originalFilename)) { + return AjaxResult.error("获取文件名称错误!!"); + } + //校验文件后缀 jpg jpeg pdf 格式的文件不允许上传 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); + if (!"dwg".equals(suffix)) { + return AjaxResult.error("禁止非法文件上传!!"); + } + if(StringUtils.isEmpty(code)){ + return AjaxResult.error("请填写生产执行单号!!"); + } + //判断名称重复 + SysConfigIni configIni = sysConfigIniService.selectSysConfigIniByFileType(code); + if(configIni != null){ + return AjaxResult.error("图纸类型重复!!"); + } + //获取路径 + String path = Constants.BASIC_URL; + if(code.indexOf("XCL") != -1 && code.indexOf("(") == -1){ + path += Constants.BASIC_URL_BZ + Constants.XCL_URL + code; + }else if(code.indexOf("ELS") != -1){ + path += Constants.BASIC_URL_BZ + Constants.ELS_URL + code; + }else if(code.indexOf("EDS") != -1){ + path += Constants.BASIC_URL_BZ + Constants.EDS_URL + code; + }else if(code.indexOf("WB") != -1){ + path += Constants.BASIC_URL_BZ + Constants.WB_URL + code; + }else if(code.indexOf("QD") != -1){ + path += Constants.BASIC_URL_BZ + Constants.QD_URL + code; + }else if(code.indexOf("ZHD") != -1){ + path += Constants.BASIC_URL_BZ + Constants.ZHD_URL + code; + }else if(code.indexOf("ETK") != -1){ + path += Constants.BASIC_URL_BZ + Constants.ETK_URL + code; + }else if(code.indexOf("ETT") != -1){ + path += Constants.BASIC_URL_BZ + Constants.ETT_URL + code; + }else if(code.indexOf("ETP") != -1){ + path += Constants.BASIC_URL_BZ + Constants.ETP_URL + code; + }else if(code.indexOf("ETH") != -1){ + path += Constants.BASIC_URL_BZ + Constants.ETH_URL + code; + }else { + path += Constants.BASIC_URL_FB + code; + } + + //创建文件夹 + File files = new File(path); + if (!files.exists()) { + files.mkdir(); + } + + path = path + "/" + originalFilename; + + InputStream is = null; + FileOutputStream fos = null; + BufferedOutputStream bos = null; + try{ + is = filePath.getInputStream(); + fos = new FileOutputStream(path); + bos = new BufferedOutputStream(fos); + // 读取输入流并写入文件 + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + bos.write(buffer, 0, bytesRead); + } + bos.flush(); + }catch (Exception e){ + e.printStackTrace(); + return AjaxResult.error("文件上传失败"); + }finally { + try{ + if(is != null){ + is.close(); + } + if(bos != null){ + bos.close(); + } + if(fos != null){ + fos.close(); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + //反写图纸 + SysConfigIni sysConfigIni = new SysConfigIni(); + sysConfigIni.setFileUrl(path); + sysConfigIni.setFileType(code); + int p = sysConfigIniService.insertSysConfigIni(sysConfigIni); + if(p < 1){ + return AjaxResult.error("上传失败!!"); + } + return AjaxResult.success("文件上传成功!!"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/TimeAttendanceController.java b/evo/src/main/java/com/ruoyi/project/management/controller/TimeAttendanceController.java new file mode 100644 index 0000000..565849c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/TimeAttendanceController.java @@ -0,0 +1,873 @@ +package com.ruoyi.project.management.controller; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.web.bind.annotation.RestController; + +import com.ruoyi.project.management.domain.CwAttendanceRecordDetail; +import com.ruoyi.project.management.domain.CwAttendanceUser; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CyConsumptionInfo; +import com.ruoyi.project.management.domain.CyFaceInfo; +import com.ruoyi.project.management.domain.CyStatisticsInfo; +import com.ruoyi.project.management.domain.PwUserEmail; +import com.ruoyi.project.management.service.ICwAttendanceRecordDetailService; +import com.ruoyi.project.management.service.ICwAttendanceUserService; +import com.ruoyi.project.management.service.ICwNewAttendanceService; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICyConsumptionInfoService; +import com.ruoyi.project.management.service.ICyFaceInfoService; +import com.ruoyi.project.management.service.ICyStatisticsInfoService; +import com.ruoyi.project.management.service.IPwUserEmailService; +import com.ruoyi.project.management.utils.SendEmail; + +@EnableScheduling +@RestController +public class TimeAttendanceController { + + //考勤记录信息 + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + //考勤记录统计信息 + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + //员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + @Autowired + private ICwAttendanceRecordDetailService cwAttendanceRecordDetailService; + + //餐饮消费统计信息 + @Autowired + private ICyStatisticsInfoService cyStatisticsInfoService; + //每日消费统计 + @Autowired + private ICyConsumptionInfoService cyConsumptionInfoService; + //打卡员工的信息 + @Autowired + private ICwAttendanceUserService cwAttendanceUserService; + //餐饮刷脸信息 + @Autowired + private ICyFaceInfoService cyFaceInfoService; + //用户邮箱信息 + @Autowired + private IPwUserEmailService pwUserEmailService; + + + /** + * 每天早上定时统计当日员工的刷脸次数,计算出昨日的早餐,午餐,晚餐的消费情况及补贴情况 + */ + @SuppressWarnings("deprecation") + @Scheduled(cron = "0 30 03 * * ?") + public void autoJiSuan(){ + SimpleDateFormat sdff= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdfs= new SimpleDateFormat("yyyy-MM"); + // 创建 Calendar 对象 + Calendar calendar = Calendar.getInstance(); + + //查询前一天所有的消费日明细 + calendar.add(calendar.DATE,-1); + Date date = calendar.getTime(); + List list2 = cyConsumptionInfoService.selectCyConsumptionInfoByDate(date); + for (CyConsumptionInfo cyConsumptionInfo : list2) { + //查询员工信息 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cyConsumptionInfo.getName()); + //查询当天的打卡记录 + CwNewAttendance newAttendance = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDateAndDay(cyConsumptionInfo.getName(), sdf.format(cyConsumptionInfo.getDateTime())); + if(null!=newAttendance){ + if(null!=newAttendance.getWorkStartTime()){ + cyConsumptionInfo.setShangBan(sdff.format(newAttendance.getWorkStartTime())); + } + if(null!=newAttendance.getWorkEndTime()){ + cyConsumptionInfo.setXiaBan(sdff.format(newAttendance.getWorkEndTime())); + } + //工作时长 + cyConsumptionInfo.setDuration(newAttendance.getWorkSum()); + } + + //早餐次数 + Long zaocan = 0L; + //午餐次数 + Long wucan = 0L; + //晚餐次数 + Long wancan = 0L; + + //根据消费日明细的姓名和日期查询刷脸记录 + List list = cyFaceInfoService.selectCyFaceInfoByNameAndDate(cyConsumptionInfo.getName(),cyConsumptionInfo.getDateTime()); + for (CyFaceInfo cyFaceInfo : list) { + int hour = cyFaceInfo.getTime().getHours(); + //判断刷脸时间是早餐还是午餐还是晚餐 + if(hour>=6&&hour<=8){ + //说明是早餐 + zaocan++; + }else if(hour>=11&&hour<=13){ + //说明是午餐 + wucan++; + }else if(hour>=18&&hour<=20){ + //说明是晚餐 + wancan++; + }else{ + //超出的不处理 + } + } + + //早餐次数 + cyConsumptionInfo.setBreakfastNumber(zaocan); + //判断如果早餐次数为0 ,则不没有补助,没有个人消费,没有总消费 + if(cyConsumptionInfo.getBreakfastNumber()>0){ + //早餐补助(获取员工信息表中的数据),如果工作时长不足8小时,则没有补助 + if(null!=employeeInformation){ + cyConsumptionInfo.setBreakfastSubsidy(employeeInformation.getBreakfastSubsidy()); + }else{ + cyConsumptionInfo.setBreakfastSubsidy(0.0); + } + //早餐个人消费(早餐总消费-补助) + cyConsumptionInfo.setBreakfastPersonalConsumption((cyConsumptionInfo.getBreakfastNumber().doubleValue()*4)-cyConsumptionInfo.getBreakfastSubsidy()); + //早餐总消费(次数*固定的金额4元) + cyConsumptionInfo.setBreakfastSumConsumption(cyConsumptionInfo.getBreakfastNumber().doubleValue()*4); + } + + //午餐次数 + cyConsumptionInfo.setLunchNumber(wucan); + if(cyConsumptionInfo.getLunchNumber()>0){ + //午餐补助(获取员工信息表中的数据) + if(null!=employeeInformation){ + cyConsumptionInfo.setLunchSubsidy(employeeInformation.getLunchSubsidy()); + }else{ + cyConsumptionInfo.setLunchSubsidy(0.0); + } + //午餐个人消费(午餐总消费-补助) + cyConsumptionInfo.setLunchPresonalConsumption((cyConsumptionInfo.getLunchNumber().doubleValue()*8)-cyConsumptionInfo.getLunchSubsidy()); + //午餐总消费(次数*固定的金额10元) + cyConsumptionInfo.setLunchSumConsumption(cyConsumptionInfo.getLunchNumber().doubleValue()*8); + } + + //晚餐次数 + cyConsumptionInfo.setSupperNumber(wancan); + if(cyConsumptionInfo.getSupperNumber()>0){ + //晚餐补助(获取员工信息表中的数据) + if(null!=employeeInformation){ + cyConsumptionInfo.setSupperSubsidy(employeeInformation.getSupperSubsidy()); + }else{ + cyConsumptionInfo.setSupperSubsidy(0.0); + } + //晚餐个人消费 + cyConsumptionInfo.setSupperPersonalConsumption((cyConsumptionInfo.getSupperNumber().doubleValue()*8)-cyConsumptionInfo.getSupperSubsidy()); + //晚餐总消费 + cyConsumptionInfo.setSupperSumConsumption(cyConsumptionInfo.getSupperNumber().doubleValue()*8); + } + //总补贴(早餐补贴+午餐补贴+晚餐补贴) + cyConsumptionInfo.setSumSubsidy(cyConsumptionInfo.getBreakfastSubsidy()+cyConsumptionInfo.getLunchSubsidy()+cyConsumptionInfo.getSupperSubsidy()); + //个人总消费(早餐个人消费+午餐个人消费+晚餐个人消费) + cyConsumptionInfo.setPersonalSumConsumption(cyConsumptionInfo.getBreakfastPersonalConsumption()+cyConsumptionInfo.getLunchPresonalConsumption()+cyConsumptionInfo.getSupperPersonalConsumption()); + //总消费(早餐总消费+午餐总消费+晚餐总消费) + cyConsumptionInfo.setSumConsumption(cyConsumptionInfo.getBreakfastSumConsumption()+cyConsumptionInfo.getLunchSumConsumption()+cyConsumptionInfo.getSupperSumConsumption()); + + cyConsumptionInfoService.updateCyConsumptionInfo(cyConsumptionInfo); + + //查询月统计信息,更新月统计信息 + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoByNameAndDate(cyConsumptionInfo.getName(), sdfs.format(cyConsumptionInfo.getDateTime())); + if(null!=statisticsInfo){ + //早餐次数 + statisticsInfo.setBreakfastNumber(statisticsInfo.getBreakfastNumber()+cyConsumptionInfo.getBreakfastNumber()); + if(statisticsInfo.getBreakfastNumber()>0){ + //早餐补助 + statisticsInfo.setBreakfastSubsidy(statisticsInfo.getBreakfastSubsidy()+cyConsumptionInfo.getBreakfastSubsidy()); + //早餐个人消费 + statisticsInfo.setBreakfastPersonalConsumption(statisticsInfo.getBreakfastPersonalConsumption()+cyConsumptionInfo.getBreakfastPersonalConsumption()); + //早餐总消费 + statisticsInfo.setBreakfastSumConsumption(statisticsInfo.getBreakfastSumConsumption()+cyConsumptionInfo.getBreakfastSumConsumption()); + } + //午餐次数 + statisticsInfo.setLunchNumber(statisticsInfo.getLunchNumber()+cyConsumptionInfo.getLunchNumber()); + if(statisticsInfo.getLunchNumber()>0){ + //午餐补助 + statisticsInfo.setLunchSubsidy(statisticsInfo.getLunchSubsidy()+cyConsumptionInfo.getLunchSubsidy()); + //午餐个人消费 + statisticsInfo.setLunchPresonalConsumption(statisticsInfo.getLunchPresonalConsumption()+cyConsumptionInfo.getLunchPresonalConsumption()); + //午餐总消费 + statisticsInfo.setLunchSumConsumption(statisticsInfo.getLunchSumConsumption()+cyConsumptionInfo.getLunchSumConsumption()); + } + //晚餐次数 + statisticsInfo.setSupperNumber(statisticsInfo.getSupperNumber()+cyConsumptionInfo.getSupperNumber()); + if(statisticsInfo.getSupperNumber()>0){ + //晚餐补助 + statisticsInfo.setSupperSubsidy(statisticsInfo.getSupperSubsidy()+cyConsumptionInfo.getSupperSubsidy()); + //晚餐个人消费 + statisticsInfo.setSupperPersonalConsumption(statisticsInfo.getSupperPersonalConsumption()+cyConsumptionInfo.getSupperPersonalConsumption()); + //晚餐总消费 + statisticsInfo.setSupperSumConsumption(statisticsInfo.getSupperSumConsumption()+cyConsumptionInfo.getSupperSumConsumption()); + } + //总补贴 + statisticsInfo.setSumSubsidy(statisticsInfo.getSumSubsidy()+cyConsumptionInfo.getSumSubsidy()); + //个人总消费 + statisticsInfo.setPersonalSumConsumption(statisticsInfo.getPersonalSumConsumption()+cyConsumptionInfo.getPersonalSumConsumption()); + //总消费 + statisticsInfo.setSumConsumption(statisticsInfo.getSumConsumption()+cyConsumptionInfo.getSumConsumption()); + + cyStatisticsInfoService.updateCyStatisticsInfo(statisticsInfo); + } + + } + } + + /** + * 每月1号自动校正餐饮统计数据 + */ + @Scheduled(cron = "0 40 04 1 * ?") + public void autoJiaoZhengCanFei(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + //查询上月所有的员工(月统计信息中的) + // 获取当前日期 + Calendar calendar = Calendar.getInstance(); + // 将日期设置为上个月 + calendar.add(Calendar.MONTH, -1); + // 格式化日期 + String lastMonthDate = sdf.format(calendar.getTime()); + + CyStatisticsInfo cyStatisticsInfo = new CyStatisticsInfo(); + cyStatisticsInfo.setDate(lastMonthDate); + List list4 = cyStatisticsInfoService.selectCyStatisticsInfoList(cyStatisticsInfo); + for (CyStatisticsInfo statisticsInfo : list4) { + //重置当前员工的的早餐次数,午餐次数,晚餐次数,及补助和消费,总消费 + statisticsInfo.setBreakfastNumber(0L); + statisticsInfo.setBreakfastSubsidy(0.0); + statisticsInfo.setBreakfastPersonalConsumption(0.0); + statisticsInfo.setBreakfastSumConsumption(0.0); + + statisticsInfo.setLunchNumber(0L); + statisticsInfo.setLunchSubsidy(0.0); + statisticsInfo.setLunchPresonalConsumption(0.0); + statisticsInfo.setLunchSumConsumption(0.0); + + statisticsInfo.setSupperNumber(0L); + statisticsInfo.setSupperSubsidy(0.0); + statisticsInfo.setSupperPersonalConsumption(0.0); + statisticsInfo.setSupperSumConsumption(0.0); + + statisticsInfo.setSumSubsidy(0.0); + statisticsInfo.setPersonalSumConsumption(0.0); + statisticsInfo.setSumConsumption(0.0); + + //获取当前所属月 + String date = statisticsInfo.getDate(); + Date parse = null; + try { + parse = sdf.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + } + List list = cyConsumptionInfoService.selectCyConsumptionInfoByYue(parse,statisticsInfo.getName()); + + for (CyConsumptionInfo cyConsumptionInfo : list) { + + //查询员工信息 + CwNewEmployeeInformation employeeInformation = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByName(cyConsumptionInfo.getName()); + //获取当前天,查询当天的刷脸记录 + Date dateTime = cyConsumptionInfo.getDateTime(); + //早餐次数 + Long zaocan = 0L; + //午餐次数 + Long wucan = 0L; + //晚餐次数 + Long wancan = 0L; + List list2 = cyFaceInfoService.selectCyFaceInfoByNameAndDate(cyConsumptionInfo.getName(), dateTime); + for (CyFaceInfo cyFaceInfo : list2) { + int hour = cyFaceInfo.getTime().getHours(); + //判断刷脸时间是早餐还是午餐还是晚餐 + if(hour>=6&&hour<=8){ + //说明是早餐 + zaocan++; + }else if(hour>=11&&hour<=13){ + //说明是午餐 + wucan++; + }else if(hour>=18&&hour<=20){ + //说明是晚餐 + wancan++; + }else{ + //超出的不处理 + } + } + + //早餐次数 + cyConsumptionInfo.setBreakfastNumber(zaocan); + //判断如果早餐次数为0 ,则不没有补助,没有个人消费,没有总消费 + if(cyConsumptionInfo.getBreakfastNumber()>0){ + //早餐补助(获取员工信息表中的数据),如果工作时长不足8小时,则没有补助 + if(null!=employeeInformation){ + cyConsumptionInfo.setBreakfastSubsidy(employeeInformation.getBreakfastSubsidy()); + }else{ + cyConsumptionInfo.setBreakfastSubsidy(0.0); + } + //早餐个人消费(早餐总消费-补助) + cyConsumptionInfo.setBreakfastPersonalConsumption((cyConsumptionInfo.getBreakfastNumber().doubleValue()*4)-cyConsumptionInfo.getBreakfastSubsidy()); + //早餐总消费(次数*固定的金额4元) + cyConsumptionInfo.setBreakfastSumConsumption(cyConsumptionInfo.getBreakfastNumber().doubleValue()*4); + } + + //午餐次数 + cyConsumptionInfo.setLunchNumber(wucan); + if(cyConsumptionInfo.getLunchNumber()>0){ + //午餐补助(获取员工信息表中的数据) + if(null!=employeeInformation){ + cyConsumptionInfo.setLunchSubsidy(employeeInformation.getLunchSubsidy()); + }else{ + cyConsumptionInfo.setLunchSubsidy(0.0); + } + //午餐个人消费(午餐总消费-补助) + cyConsumptionInfo.setLunchPresonalConsumption((cyConsumptionInfo.getLunchNumber().doubleValue()*8)-cyConsumptionInfo.getLunchSubsidy()); + //午餐总消费(次数*固定的金额10元) + cyConsumptionInfo.setLunchSumConsumption(cyConsumptionInfo.getLunchNumber().doubleValue()*8); + } + + //晚餐次数 + cyConsumptionInfo.setSupperNumber(wancan); + if(cyConsumptionInfo.getSupperNumber()>0){ + //晚餐补助(获取员工信息表中的数据) + if(null!=employeeInformation){ + cyConsumptionInfo.setSupperSubsidy(employeeInformation.getSupperSubsidy()); + }else{ + cyConsumptionInfo.setSupperSubsidy(0.0); + } + //晚餐个人消费 + cyConsumptionInfo.setSupperPersonalConsumption((cyConsumptionInfo.getSupperNumber().doubleValue()*8)-cyConsumptionInfo.getSupperSubsidy()); + //晚餐总消费 + cyConsumptionInfo.setSupperSumConsumption(cyConsumptionInfo.getSupperNumber().doubleValue()*8); + } + //总补贴(早餐补贴+午餐补贴+晚餐补贴) + cyConsumptionInfo.setSumSubsidy(cyConsumptionInfo.getBreakfastSubsidy()+cyConsumptionInfo.getLunchSubsidy()+cyConsumptionInfo.getSupperSubsidy()); + //个人总消费(早餐个人消费+午餐个人消费+晚餐个人消费) + cyConsumptionInfo.setPersonalSumConsumption(cyConsumptionInfo.getBreakfastPersonalConsumption()+cyConsumptionInfo.getLunchPresonalConsumption()+cyConsumptionInfo.getSupperPersonalConsumption()); + //总消费(早餐总消费+午餐总消费+晚餐总消费) + cyConsumptionInfo.setSumConsumption(cyConsumptionInfo.getBreakfastSumConsumption()+cyConsumptionInfo.getLunchSumConsumption()+cyConsumptionInfo.getSupperSumConsumption()); + cyConsumptionInfoService.updateCyConsumptionInfo(cyConsumptionInfo); + } + + List list3 = cyConsumptionInfoService.selectCyConsumptionInfoByYue(parse,statisticsInfo.getName()); + for (CyConsumptionInfo cyConsumptionInfo2 : list3) { + //早餐次数 + statisticsInfo.setBreakfastNumber(statisticsInfo.getBreakfastNumber()+cyConsumptionInfo2.getBreakfastNumber()); + if(statisticsInfo.getBreakfastNumber()>0){ + //早餐补助 + statisticsInfo.setBreakfastSubsidy(statisticsInfo.getBreakfastSubsidy()+cyConsumptionInfo2.getBreakfastSubsidy()); + //早餐个人消费 + statisticsInfo.setBreakfastPersonalConsumption(statisticsInfo.getBreakfastPersonalConsumption()+cyConsumptionInfo2.getBreakfastPersonalConsumption()); + //早餐总消费 + statisticsInfo.setBreakfastSumConsumption(statisticsInfo.getBreakfastSumConsumption()+cyConsumptionInfo2.getBreakfastSumConsumption()); + } + //午餐次数 + statisticsInfo.setLunchNumber(statisticsInfo.getLunchNumber()+cyConsumptionInfo2.getLunchNumber()); + if(statisticsInfo.getLunchNumber()>0){ + //午餐补助 + statisticsInfo.setLunchSubsidy(statisticsInfo.getLunchSubsidy()+cyConsumptionInfo2.getLunchSubsidy()); + //午餐个人消费 + statisticsInfo.setLunchPresonalConsumption(statisticsInfo.getLunchPresonalConsumption()+cyConsumptionInfo2.getLunchPresonalConsumption()); + //午餐总消费 + statisticsInfo.setLunchSumConsumption(statisticsInfo.getLunchSumConsumption()+cyConsumptionInfo2.getLunchSumConsumption()); + } + //晚餐次数 + statisticsInfo.setSupperNumber(statisticsInfo.getSupperNumber()+cyConsumptionInfo2.getSupperNumber()); + if(statisticsInfo.getSupperNumber()>0){ + //晚餐补助 + statisticsInfo.setSupperSubsidy(statisticsInfo.getSupperSubsidy()+cyConsumptionInfo2.getSupperSubsidy()); + //晚餐个人消费 + statisticsInfo.setSupperPersonalConsumption(statisticsInfo.getSupperPersonalConsumption()+cyConsumptionInfo2.getSupperPersonalConsumption()); + //晚餐总消费 + statisticsInfo.setSupperSumConsumption(statisticsInfo.getSupperSumConsumption()+cyConsumptionInfo2.getSupperSumConsumption()); + } + //总补贴 + statisticsInfo.setSumSubsidy(statisticsInfo.getSumSubsidy()+cyConsumptionInfo2.getSumSubsidy()); + //个人总消费 + statisticsInfo.setPersonalSumConsumption(statisticsInfo.getPersonalSumConsumption()+cyConsumptionInfo2.getPersonalSumConsumption()); + //总消费 + statisticsInfo.setSumConsumption(statisticsInfo.getSumConsumption()+cyConsumptionInfo2.getSumConsumption()); + } + + cyStatisticsInfoService.updateCyStatisticsInfo(statisticsInfo); + } + } + + /** + * 每月1号定时添加所有员工当月的餐饮统计数据,获取当月的自然天数,循环添加每天的餐饮消费数据 + */ + @Scheduled(cron = "0 20 0 1 * ?") + public void autoConsumptionInfo(){ + //获取当前月份 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + String yue = sdf.format(new Date()); + + //获取当前月份的自然日天数 + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.roll(Calendar.DAY_OF_MONTH, -1); + String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); + // 得今天是2022年10月13号,所以这个月的最大天数是 31 + int tianshu = Integer.parseInt(format.substring((format.lastIndexOf("-") + 1))); + + //格式化每天的日期 + SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd"); + + CwAttendanceUser cwAttendanceUser = new CwAttendanceUser(); + + List list = cwAttendanceUserService.selectCwAttendanceUserList(cwAttendanceUser); + + CyStatisticsInfo cyStatisticsInfo = new CyStatisticsInfo(); + + CyConsumptionInfo cyConsumptionInfo = new CyConsumptionInfo(); + + for (CwAttendanceUser cwAttendanceUser2 : list) { + //餐饮统计信息 + cyStatisticsInfo = new CyStatisticsInfo(); + //所属月份 + cyStatisticsInfo.setDate(yue); + //姓名 + cyStatisticsInfo.setName(cwAttendanceUser2.getName()); + + cyStatisticsInfoService.insertCyStatisticsInfo(cyStatisticsInfo); + + for (int i = 0; i < tianshu; i++) { + cyConsumptionInfo = new CyConsumptionInfo(); + //考勤统计记录id + cyConsumptionInfo.setStatisticsId(cyStatisticsInfo.getId()); + //员工姓名 + cyConsumptionInfo.setName(cwAttendanceUser2.getName()); + //日期(每天一条记录) + int s = 0; + s = i+1; + String day = yue+"-"+s; + try { + cyConsumptionInfo.setDateTime(sdfDay.parse(day)); + } catch (ParseException e) { + e.printStackTrace(); + } + cyConsumptionInfoService.insertCyConsumptionInfo(cyConsumptionInfo); + } + } + + } + + /** + * 每月1号定时添加所有员工当月的考勤统计数据,获取当月的自然天数,循环添加每天的考勤数据 + * + */ + @Scheduled(cron = "0 02 0 1 * ?") + public void autoAddAttendance(){ + + //获取当前月份 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + String yue = sdf.format(new Date()); + + //获取当前月份的自然日天数 + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.roll(Calendar.DAY_OF_MONTH, -1); + String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); + // 得今天是2022年10月13号,所以这个月的最大天数是 31 + int tianshu = Integer.parseInt(format.substring((format.lastIndexOf("-") + 1))); + + //格式化每天的日期 + SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd"); + + + //获取所有真实员工的信息 + CwNewEmployeeInformation cwNewEmployeeInformation = new CwNewEmployeeInformation(); + cwNewEmployeeInformation.setVirtualWorkstation(0); + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + + CwNewAttendanceStatistical cwNewAttendanceStatistical = new CwNewAttendanceStatistical(); + + CwNewAttendance cwNewAttendance = new CwNewAttendance(); + + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list) { + + //添加考勤记录统计信息 + cwNewAttendanceStatistical = new CwNewAttendanceStatistical(); + //所属月份 + cwNewAttendanceStatistical.setDate(yue); + //姓名 + cwNewAttendanceStatistical.setName(cwNewEmployeeInformation2.getName()); + //所属部门 + cwNewAttendanceStatistical.setDeptName(cwNewEmployeeInformation2.getDeptName()); + //实出勤(初始为0) + cwNewAttendanceStatistical.setRealAttendance(0L); + + cwNewAttendanceStatisticalService.insertCwNewAttendanceStatistical(cwNewAttendanceStatistical); + + LinkedList list2 = new LinkedList(); + for (int i = 0; i < tianshu; i++) { + cwNewAttendance = new CwNewAttendance(); + //考勤统计记录id + cwNewAttendance.setStatisticalId(cwNewAttendanceStatistical.getId()); + //员工姓名 + cwNewAttendance.setName(cwNewEmployeeInformation2.getName()); + //所属部门 + cwNewAttendance.setDeptName(cwNewEmployeeInformation2.getDeptName()); + //日期(每天一条记录) + int s = 0; + s = i+1; + String day = yue+"-"+s; + try { + cwNewAttendance.setAttendanceDate(sdfDay.parse(day)); + } catch (ParseException e) { + e.printStackTrace(); + } + list2.add(cwNewAttendance); + cwNewAttendanceService.insertCwNewAttendance(cwNewAttendance); + } + + //批量添加(批量添加默认值不生效) +// cwNewAttendanceService.insertCwNewAttendanceList(list2); + } + } + + /** + * 定时器每天早上8点推送给食堂人员刷脸就餐人员的总数(早餐) + */ + @Scheduled(cron = "0 0 09 * * ?") + public void autoTuiSongZaoCan(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //查询食堂的邮箱 + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("食堂"); + //获取当前日期 + List list = cyFaceInfoService.selectCyFaceInfoByDate(new Date()); + //就餐人数 + int i= 0; + //就餐人 + String data = ""; + for (CyFaceInfo cyFaceInfo : list) { + int hour = cyFaceInfo.getTime().getHours(); + //判断刷脸时间是早餐还是午餐还是晚餐 + if(hour>=6&&hour<=8){ + //说明是早餐 + i++; + data += cyFaceInfo.getName()+"\n
"; + } + } + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + + if(null!=userEmail){ + //拼接邮件内容 + content = sdf.format(new Date())+"早餐人员打卡人数:"+i+"人"+"\n
"+"详情如下:"+"\n
"+data; + try { + send.sendEmail("就餐人员打卡通知",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + /** + * 定时器每天下午2点推送给食堂人员刷脸就餐人员的总数(午餐) + */ + @Scheduled(cron = "0 30 13 * * ?") + public void autoTuiSongWuCan(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //查询食堂的邮箱 + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("食堂"); + //获取当前日期 + List list = cyFaceInfoService.selectCyFaceInfoByDate(new Date()); + //就餐人数 + int i= 0; + //就餐人 + String data = ""; + for (CyFaceInfo cyFaceInfo : list) { + int hour = cyFaceInfo.getTime().getHours(); + //判断刷脸时间是早餐还是午餐还是晚餐 + if(hour>=11&&hour<=13){ + //说明是早餐 + i++; + data += cyFaceInfo.getName()+"\n
"; + } + } + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + + if(null!=userEmail){ + //拼接邮件内容 + content = sdf.format(new Date())+"午餐人员打卡人数:"+i+"人"+"\n
"+"详情如下:"+"\n
"+data; + try { + send.sendEmail("就餐人员打卡通知",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + /** + * 定时器每天晚上8点推送给食堂人员刷脸就餐人员的总数(晚餐) + */ + @Scheduled(cron = "0 30 20 * * ?") + public void autoTuiSongWanCan(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //查询食堂的邮箱 + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("食堂"); + //获取当前日期 + List list = cyFaceInfoService.selectCyFaceInfoByDate(new Date()); + //就餐人数 + int i= 0; + //就餐人 + String data = ""; + for (CyFaceInfo cyFaceInfo : list) { + int hour = cyFaceInfo.getTime().getHours(); + //判断刷脸时间是早餐还是午餐还是晚餐 + if(hour>=18&&hour<=20){ + //说明是早餐 + i++; + data += cyFaceInfo.getName()+"\n
"; + } + } + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + + if(null!=userEmail){ + //拼接邮件内容 + content = sdf.format(new Date())+"晚餐人员打卡人数:"+i+"人"+"\n
"+"详情如下:"+"\n
"+data; + try { + send.sendEmail("就餐人员打卡通知",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + } + + + /** + * 校正数据 + * + */ +// @Scheduled(cron = "0 21 9 1 * ?") +// public void xiaozheng(){ +// //查询6月1号的数据,把上班时间和班制同步到考勤记录中 +// //获取所有真实员工的信息 +// CwNewEmployeeInformation cwNewEmployeeInformation = new CwNewEmployeeInformation(); +// cwNewEmployeeInformation.setVirtualWorkstation(0); +// List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); +// +// for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list) { +// //根据姓名查询考勤记录6月1号的 +// List list2 = cwNewAttendanceService.selectCwNewAttendanceByNameAndAttendanceDate(cwNewEmployeeInformation2.getName(), "2023-07"); +// int i = 1; +// for (CwNewAttendance cwNewAttendance : list2) { +// if(i==1){ +// //查询1号的打卡记录 +// //说明带着时间,需要格式化时间 +// CwAttendanceRecordDetail cwAttendanceRecordDetail = new CwAttendanceRecordDetail(); +// String format = "2023-07-01"; +// cwAttendanceRecordDetail.setDateTime(null); +// cwAttendanceRecordDetail.setSparedOne(format); +// cwAttendanceRecordDetail.setName(cwNewEmployeeInformation2.getName()); +// List list3 = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailList(cwAttendanceRecordDetail); +// if(list3.size()>0&&null!=list3.get(list3.size()-1).getButtonType()){ +// //班制 +// cwNewAttendance.setRules(list3.get(list3.size()-1).getButtonType()); +// //上班时间 +// cwNewAttendance.setWorkStartTime(list3.get(list3.size()-1).getDateTime()); +// cwNewAttendanceService.updateCwNewAttendance(cwNewAttendance); +// } +// } +// i++; +// } +// } +// } + + /** + * 定时器每天早上9点查询需要打卡的人员,查询每个人的上次打卡记录距离当前天是否等于4天,等于7天,等于10天时发送邮件给人事部和直属部门领导 + */ + @Scheduled(cron = "0 0 09 * * ?") + public void autoTuiSongWeiDaKa(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd"); + //查询需打开人员 + CwAttendanceUser cwAttendanceUser = new CwAttendanceUser(); + cwAttendanceUser.setSparedOne("是"); + List list = cwAttendanceUserService.selectCwAttendanceUserList(cwAttendanceUser); + for (CwAttendanceUser cwAttendanceUser2 : list) { + //根据员工姓名查询打卡记录 + List list2 = cwAttendanceRecordDetailService.selectCwAttendanceRecordDetailByCode(cwAttendanceUser2.getId()+""); + if(list2.size()>0){ + //获取最后一次的打卡记录 + CwAttendanceRecordDetail detail = list2.get(list2.size()-1); + //判断打卡日期距离现在的天数 + String format = sdf.format(detail.getDateTime()); + try { + Date star = dft.parse(format);//开始时间 + Date endDay=dft.parse(sdf.format(new Date()));//结束时间 + Long starTime=star.getTime(); + Long endTime=endDay.getTime(); + Long num=endTime-starTime;//时间戳相差的毫秒数 + if(num/24/60/60/1000==4||num/24/60/60/1000==7||num/24/60/60/1000==10){ + //发送邮件 + //根据员工姓名查询部门及部门负责人,和人事的邮箱 + //查询食堂的邮箱 + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("人事"); + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + + if(null!=userEmail){ + //拼接邮件内容 + content = cwAttendanceUser2 + " 的上次打卡记录距离今天已超过"+num/24/60/60/1000+"天,请及时关注此员工动态"; + try { + send.sendEmail("员工长时间未打卡通知",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + }catch (ParseException e) { + e.printStackTrace(); + } + } + } + } + //校正餐饮数据 + //@Scheduled(cron = "0 02 17 5 * ?") + public void autosss(){ + SimpleDateFormat sdfs= new SimpleDateFormat("yyyy-MM"); + //查询员工信息 + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationList(null); + try{ + for (CwNewEmployeeInformation cwNewEmployeeInformation : list) { + List list_c = + cyConsumptionInfoService.selectCyConsumptionInfoByYue(sdfs.parse("2025-04"),cwNewEmployeeInformation.getName()); + Long zccs = 0l; + Long wccs = 0l; + Long wwcs = 0l; + for (CyConsumptionInfo cyConsumptionInfo : list_c) { + //早餐次数 + Long zaocan = 0L; + //午餐次数 + Long wucan = 0L; + //晚餐次数 + Long wancan = 0L; + //根据消费日明细的姓名和日期查询刷脸记录 + List list_f = cyFaceInfoService.selectCyFaceInfoByNameAndDate(cyConsumptionInfo.getName(),cyConsumptionInfo.getDateTime()); + for (CyFaceInfo cyFaceInfo : list_f) { + if("早餐".equals(cyFaceInfo.getSign())){ + zaocan = 1L; + zccs += 1; + } + if("午餐".equals(cyFaceInfo.getSign())){ + wucan = 1L; + wccs += 1; + } + if("晚餐".equals(cyFaceInfo.getSign())){ + wancan = 1L; + wwcs += 1; + } + } + //早餐次数 + cyConsumptionInfo.setBreakfastNumber(zaocan); + cyConsumptionInfo.setBreakfastSubsidy(cwNewEmployeeInformation.getBreakfastSubsidy()); + if(zaocan == 0){ + //早餐个人消费(早餐总消费-补助) + cyConsumptionInfo.setBreakfastPersonalConsumption(0.0); + }else{ + //早餐个人消费(早餐总消费-补助) + cyConsumptionInfo.setBreakfastPersonalConsumption((cyConsumptionInfo.getBreakfastNumber().doubleValue()*4)-cyConsumptionInfo.getBreakfastSubsidy()); + } + //早餐总消费(次数*固定的金额4元) + cyConsumptionInfo.setBreakfastSumConsumption(cyConsumptionInfo.getBreakfastNumber().doubleValue()*4); + + //午餐次数 + cyConsumptionInfo.setLunchNumber(wucan); + cyConsumptionInfo.setLunchSubsidy(cwNewEmployeeInformation.getLunchSubsidy()); + if(wucan == 0){ + //午餐个人消费(午餐总消费-补助) + cyConsumptionInfo.setLunchPresonalConsumption(0.0); + }else{ + //午餐个人消费(午餐总消费-补助) + cyConsumptionInfo.setLunchPresonalConsumption((cyConsumptionInfo.getLunchNumber().doubleValue()*8)-cyConsumptionInfo.getLunchSubsidy()); + } + //午餐总消费(次数*固定的金额10元) + cyConsumptionInfo.setLunchSumConsumption(cyConsumptionInfo.getLunchNumber().doubleValue()*8); + + //晚餐次数 + cyConsumptionInfo.setSupperNumber(wancan); + cyConsumptionInfo.setSupperSubsidy(cwNewEmployeeInformation.getSupperSubsidy()); + if(wancan == 0){ + //晚餐个人消费 + cyConsumptionInfo.setSupperPersonalConsumption(0.0); + }else{ + //晚餐个人消费 + cyConsumptionInfo.setSupperPersonalConsumption((cyConsumptionInfo.getSupperNumber().doubleValue()*8)-cyConsumptionInfo.getSupperSubsidy()); + } + //晚餐总消费 + cyConsumptionInfo.setSupperSumConsumption(cyConsumptionInfo.getSupperNumber().doubleValue()*8); + + //总补贴(早餐补贴+午餐补贴+晚餐补贴) + cyConsumptionInfo.setSumSubsidy(cyConsumptionInfo.getBreakfastSubsidy()+cyConsumptionInfo.getLunchSubsidy()+cyConsumptionInfo.getSupperSubsidy()); + //个人总消费(早餐个人消费+午餐个人消费+晚餐个人消费) + cyConsumptionInfo.setPersonalSumConsumption(cyConsumptionInfo.getBreakfastPersonalConsumption()+cyConsumptionInfo.getLunchPresonalConsumption()+cyConsumptionInfo.getSupperPersonalConsumption()); + //总消费(早餐总消费+午餐总消费+晚餐总消费) + cyConsumptionInfo.setSumConsumption(cyConsumptionInfo.getBreakfastSumConsumption()+cyConsumptionInfo.getLunchSumConsumption()+cyConsumptionInfo.getSupperSumConsumption()); + cyConsumptionInfoService.updateCyConsumptionInfo(cyConsumptionInfo); + } + //查询月统计信息,更新月统计信息 + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoByNameAndDate(cwNewEmployeeInformation.getName(), "2025-04"); + if(null!=statisticsInfo){ + //早餐次数 + statisticsInfo.setBreakfastNumber(zccs); + if(statisticsInfo.getBreakfastNumber()>0){ + //早餐补助 + statisticsInfo.setBreakfastSubsidy(zccs * cwNewEmployeeInformation.getBreakfastSubsidy()); + //早餐个人消费 + statisticsInfo.setBreakfastPersonalConsumption( zccs * (4 - cwNewEmployeeInformation.getBreakfastSubsidy())); + //早餐总消费 + statisticsInfo.setBreakfastSumConsumption(zccs.doubleValue() * 4); + } + //午餐次数 + statisticsInfo.setLunchNumber(wccs); + if(statisticsInfo.getLunchNumber()>0){ + //午餐补助 + statisticsInfo.setLunchSubsidy(wccs * cwNewEmployeeInformation.getLunchSubsidy()); + //午餐个人消费 + statisticsInfo.setLunchPresonalConsumption(wccs.doubleValue() * (8 - cwNewEmployeeInformation.getLunchSubsidy())); + //午餐总消费 + statisticsInfo.setLunchSumConsumption(wccs.doubleValue() * 8); + } + //晚餐次数 + statisticsInfo.setSupperNumber(wwcs); + if(statisticsInfo.getSupperNumber()>0){ + //晚餐补助 + statisticsInfo.setSupperSubsidy(wwcs * cwNewEmployeeInformation.getSupperSubsidy()); + //晚餐个人消费 + statisticsInfo.setSupperPersonalConsumption(wwcs * (8 -cwNewEmployeeInformation.getSupperSubsidy())); + //晚餐总消费 + statisticsInfo.setSupperSumConsumption(wwcs.doubleValue() * 8); + } + //总补贴 + statisticsInfo.setSumSubsidy(statisticsInfo.getBreakfastSubsidy()+statisticsInfo.getLunchSubsidy()+statisticsInfo.getSupperSubsidy()); + //个人总消费 + statisticsInfo.setPersonalSumConsumption(statisticsInfo.getBreakfastPersonalConsumption()+statisticsInfo.getLunchPresonalConsumption()+statisticsInfo.getSupperPersonalConsumption()); + //总消费 + statisticsInfo.setSumConsumption(statisticsInfo.getBreakfastSumConsumption()+statisticsInfo.getLunchSumConsumption()+statisticsInfo.getSupperSumConsumption()); + + cyStatisticsInfoService.updateCyStatisticsInfo(statisticsInfo); + } + } + }catch (Exception e){ + + } + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/TimeController.java b/evo/src/main/java/com/ruoyi/project/management/controller/TimeController.java new file mode 100644 index 0000000..898f287 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/TimeController.java @@ -0,0 +1,2259 @@ +package com.ruoyi.project.management.controller; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import com.kingdee.bos.webapi.sdk.K3CloudApi; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.service.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.project.management.utils.SendEmail; +import javax.annotation.Resource; + + +@EnableScheduling +@RestController +public class TimeController { + + //执行单信息 + @Autowired + private IPwProductionBillService pwProductionBillService; + //执行单详情信息 + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + //bom表信息 + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //企标单信息 + @Autowired + private IPwMakeDocumentsService pwMakeDocumentsService; + //企标单详情信息 + @Autowired + private IPwMakeDocumentsDetailService pwMakeDocumentsDetailService; + //原材料采购单信息 + @Autowired + private IPwBuyingRequisitionService pwBuyingRequisitionService; + //原材料采购单明细信息 + @Autowired + private IPwBuyingRequisitionMaterialService pwBuyingRequisitionMaterialService; + //用户邮箱信息 + @Autowired + private IPwUserEmailService pwUserEmailService; + //物料信息 + @Autowired + private IImMaterialService imMaterialService; + //库存信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + //标准件采购合同详情信息 + @Autowired + private IPwPurchaseContractMaterialService pwPurchaseContractMaterialService; + //安全库存信息 + @Autowired + private IPwSafetyInventoryService pwSafetyInventoryService; + //物料工序信息 + @Autowired + private IPwMaterialProcessService pwMaterialProcessService; + //零部件关联信息 + @Autowired + private IPwModulePartService pwModulePartService; + //待办事项信息 + @Autowired + private IPwBacklogService pwBacklogService; + //打卡信息 + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + //入库信息 + @Autowired + private IImProductReceiptMaterialService imProductReceiptMaterialService; + //物料超时信息 + @Autowired + private IPwTaskOverTimeInfoService pwTaskOverTimeInfoService; + //质检通知单详情信息 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + //请购单信息 + @Autowired + private IPwBuyingRequisitionTwoService pwBuyingRequisitionTwoService; + //请购单详情信息 + @Autowired + private IPwBuyingRequisitionMaterialTwoService pwBuyingRequisitionMaterialTwoService; + //安全库存设置 + @Autowired + private IMaterialSecureService materialSecureService; + //金蝶出单系统 + @Autowired + private IAutoInventoryIssueService autoInventoryIssueService; + @Resource + private PlannedOrderService plannedOrderService; + + @Resource + private IJdBomMateriallsService iJdBomMateriallsService; + + /** + * 定时器 ,每隔1小时查询1次 + * + * 所有设置了安全库存的物料(不包含易耗品,只查询生产上的物料) + * 添加到安全库存明细表中 + */ +// @Scheduled(cron = "0 0 */1 * * ?") +// @Scheduled(cron = "0 */1 * * * ?") + public void autoSafetyInventory(){ + //查询所有设置了安全库存的物料 + List list = imMaterialService.selectImMaterialListByMinimumAndHighest(); + + //编号 + String str = ""; + //型号 + String str2 = ""; + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + //年份 + String substring2 = ss.substring(2); + + //出完采购单或者企标件制作单后,邮箱通知相关人员继续往下推进事宜 + + for (ImMaterial imMaterial : list) { + if(!"易耗品".equals(imMaterial.getMaterialTypeName())){ + + //安全库存信息记录 + PwSafetyInventory pwSafetyInventory = new PwSafetyInventory(); + //根据物料名称和图号查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + if(null != inventoryDetail){ + //名称 + pwSafetyInventory.setName(imMaterial.getMaterialName()); + //图号 + pwSafetyInventory.setFigureNumber(imMaterial.getFigureNumber()); + //根据物料的名称和图号查询安全库存信息中是否存在了此物料,如果存在则修改,如果不存在,则新增 + PwSafetyInventory pwSafetyInventory2 = pwSafetyInventoryService.selectPwSafetyInventoryByNameAndFigureNumber(imMaterial.getMaterialName(),imMaterial.getFigureNumber()); + if(null==pwSafetyInventory2){ + //说明没有查询,则添加 + + //材料 + pwSafetyInventory.setMaterials(imMaterial.getMaterials()); + //单重 + pwSafetyInventory.setPieceWeight(imMaterial.getPieceWeight()); + //最低安全库存 + pwSafetyInventory.setMinimum(imMaterial.getMinimum()); + //最高安全库存 + pwSafetyInventory.setHighest(imMaterial.getHighest()); + //现有库存 + pwSafetyInventory.setQuantity(inventoryDetail.getQuantity()); + + + //修改逻辑为库存数量+在途数量低于最小安全库存,则触发 + //在途(在制)数量(如果库存数量+在途数量-预定数量<=最低安全库存时)触发企标单或者采购单 + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=imMaterial.getMinimum()){ +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()<=imMaterial.getMinimum()){ + //判断当前物料是标准件还是企标件 + + if("外采".equals(imMaterial.getPurchaseMark())){ + //原材料外购 + + //添加原材料采购单 + PwBuyingRequisition pwBuyingRequisition = new PwBuyingRequisition(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //令号 + pwBuyingRequisition.setCode("QG"+sdf.format(new Date())); + if(null==pwBuyingRequisition.getName()){ + //名称(统一为原材料) + pwBuyingRequisition.setName("原材料"); + } + if(null==pwBuyingRequisition.getPurpose()){ + //用途(手动添加的为 安全库存) + pwBuyingRequisition.setPurpose("安全库存"); + } + pwBuyingRequisition.setProposer("系统"); + pwBuyingRequisition.setTotalPrices(0.0); + //请购单状态初始值为1,(待审核状态) + pwBuyingRequisition.setStatus(1); + pwBuyingRequisitionService.insertPwBuyingRequisition(pwBuyingRequisition); + + //添加原材料采购单明细 + PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial = new PwBuyingRequisitionMaterial(); + //令号 为请购单号 + pwBuyingRequisitionMaterial.setCode(pwBuyingRequisition.getCode()); + //请购单id + pwBuyingRequisitionMaterial.setBuyingRequisitionId(pwBuyingRequisition.getId()); + //物料名称 + pwBuyingRequisitionMaterial.setMaterialName(imMaterial.getMaterialName()); + //物料图号 + pwBuyingRequisitionMaterial.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterial.setMaterials(imMaterial.getMaterials()); + //单重 + pwBuyingRequisitionMaterial.setPieceWeight(imMaterial.getPieceWeight()); + //单位(如果材料单位为毫米,需要转换为米,如果材料单位为平方毫米,需要转换为平方米,其它的直接使用材料的单位) + if(imMaterial.getUnitOfMeasurementName().equals("毫米")){ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName("米"); + }else if(imMaterial.getUnitOfMeasurementName().equals("平方毫米")){ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName("平方米"); + }else{ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + } + //数量(如果材料单位为毫米,转换成米数,如果材料单位为平方毫米,转换为平方米)其他的不做转换 + if(imMaterial.getUnitOfMeasurementName().equals("毫米")){ + //修改采购数量(触发为最高安全库存数量-最低安全库存数量)不再计算锁定数量 + + //最高安全库存-库存-在途+预定 +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()))/1000); +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-imMaterial.getMinimum())/1000); + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest())/1000); + }else if(imMaterial.getUnitOfMeasurementName().equals("平方毫米")){ +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-imMaterial.getMinimum())/1000000); + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest())/1000000); + }else{ +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-imMaterial.getMinimum())); + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest())); + } + //单价(获取原材料的单价) + pwBuyingRequisitionMaterial.setUnivalence(imMaterial.getUnitPrice().doubleValue()); + //总价(单价*数量) + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getNumber()*imMaterial.getUnitPrice().doubleValue()); + //理论重量(数量*材料的单重) + pwBuyingRequisitionMaterial.setReferenceNumber(pwBuyingRequisitionMaterial.getNumber()*imMaterial.getPieceWeight()); + //实际重量 + pwBuyingRequisitionMaterial.setPracticalNumber(0.0); + //入库状态 + pwBuyingRequisitionMaterial.setInventoryStatus("未入库"); + pwBuyingRequisitionMaterialService.insertPwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + + //修改库存的在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+(imMaterial.getHighest())); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("原材料待采购",pwBuyingRequisition.getCode(),"安全库存","","系统出单","原材料采购","原材料采购","原材料采购单","/purchase/pwBuyingRequisitionMaterial?id="+pwBuyingRequisition.getId()); + + }else{ + if(null!=imMaterial.getFigureNumber()&&(" ".equals(imMaterial.getFigureNumber().substring(0,2)) || "009".equals(imMaterial.getFigureNumber().substring(0,3)) || "017".equals(imMaterial.getFigureNumber().substring(0,3)))){ + //标准件外购 + //添加标准件采购单 + //添加到采购合同详情信息中 + //创建采购明细 + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code(此种单据没有code,暂时定为无) + pcm.setCode("系统出单"); + //物料名称 + pcm.setMaterialName(imMaterial.getMaterialName()); + //图号 + pcm.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pcm.setMaterials(imMaterial.getMaterials()); + //含税单价 + pcm.setUnivalence(imMaterial.getUnitPrice().doubleValue()); + + //修改采购数量(触发为最高安全库存数量-最低安全库存数量)不再计算锁定数量 + + //数量 +// pcm.setAmount(imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); +// pcm.setAmount(imMaterial.getHighest()-imMaterial.getMinimum()); + pcm.setAmount(imMaterial.getHighest()); + //总价 + pcm.setTotalPrices(imMaterial.getUnitPrice().doubleValue()*pcm.getAmount()); + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + + //下单日期+5天为采购计划完成时间 + Calendar now =Calendar.getInstance(); + now.setTime(new Date()); + now.set(Calendar.DATE,now.get(Calendar.DATE)+5); + //计划采购完成日期 + pcm.setCompleteDate(now.getTime()); + + //记录采购数量的由来 + pcm.setQuantity(inventoryDetail.getQuantity()); + pcm.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + pcm.setLockNumber(inventoryDetail.getLockNumber()); + pwPurchaseContractMaterialService.insertPwPurchaseContractMaterial(pcm); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pcm.getAmount()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("标准件待采购",pcm.getCode(),"安全库存","","系统出单","采购","标准件采购","采购合同物料详情","/purchase/purchaseContractMaterial"); + + }else{ + //自制件(企标件) + + //判断是否设置了最高上限,如果有最高上限,则判断所有企标单的下单数量是否超出 + if(null!=imMaterial.getHighestNumber()&&imMaterial.getHighestNumber()>0){ + //说明设置了最高上限 + //根据图号和名称查询所有企标单 + List list8 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByNameAndFigureNumber(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + //出单数量 + Long chudan = 0L; + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list8) { + chudan += pwMakeDocumentsDetail.getQuantity(); + } + //计算应出单的数量 + 已出单的数量是否超出最高上限,如果超出最高上限,则不再出单,反之则出单 + if(chudan >= imMaterial.getHighestNumber()){ + //无需出单 + }else{ + Long xuchudan = 0L; + String biaoji = ""; + //判断此次的出单数量 + 已出单数量是否超出最高限制 +// if(chudan + (imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())) > imMaterial.getHighestNumber()){ +// if(chudan + (imMaterial.getHighest()-imMaterial.getMinimum()) > imMaterial.getHighestNumber()){ + if(chudan + (imMaterial.getHighest()) > imMaterial.getHighestNumber()){ + //出单数量为 最高限制 - 已出单数量,同时标记达到最高上限 + xuchudan = imMaterial.getHighestNumber() - chudan; + biaoji = "达到最高上限"; + }else{ + //正常出单 +// xuchudan = imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()); +// xuchudan = imMaterial.getHighest()-imMaterial.getMinimum(); + xuchudan = imMaterial.getHighest(); + } + //如果库存数量+在途数量-预订数量<=最低安全库存数量,则添加一条企标单信息 + //遍历其图号 + String figureNumber = imMaterial.getFigureNumber(); + //判断图号中是否包函点 + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + str2 = figureNumber.substring(0, figureNumber.indexOf(".")); + }else{ + str2 = "MP"; + } + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsService.selectList(); + if(null==documents){ + Integer valueOf = 1; + str = String.format("%04d", valueOf); + }else{ + String code = documents.getCode(); + String substring = code.substring(code.length()-7,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + str = String.format("%04d", valueOf); + } + + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //code + if(str2.equals("MP")){ + pwMakeDocuments.setCode("QB-"+str2+"-"+str+"-"+substring2); + }else{ + pwMakeDocuments.setCode("QB-XCL"+str2+"-"+str+"-"+substring2); + } + if(str2.equals("MP")){ + //单据名称 + pwMakeDocuments.setName("毛坯料预制清单"); + }else{ + //单据名称 + pwMakeDocuments.setName(str2+"预制清单"); + } + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(str2)){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else if(figureNumber.contains("(M)")||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("组件"))||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("部件"))){ + //图纸类型 + pwMakeDocuments.setSparedOne(str2+"组件"); + }else if("MP".equals(str2)){ + //图纸类型 + pwMakeDocuments.setSparedOne("毛坯料"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(str2); + } + if(null!=biaoji&&!"".equals(biaoji)){ + pwMakeDocuments.setRemark(biaoji); + } + pwMakeDocumentsService.newInsertPwMakeDocuments(pwMakeDocuments); + + //添加企标单详情信息 + PwMakeDocumentsDetail pmdd = new PwMakeDocumentsDetail(); + //令号 + pmdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pmdd.setName(imMaterial.getMaterialName()); + //图号 + pmdd.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pmdd.setMaterialType(imMaterial.getMaterials()); + //数量 + pmdd.setQuantity(xuchudan); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pmdd); + + //把详情信息保存到企标单中 + pwMakeDocuments.setDeclares(pmdd.getName()); + pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pmdd.getQuantity()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //判断此物料是否在零部件关联表中配置,如果配置了,则把部件的子零件全部加入到库存制作单中 + List lists = pwModulePartService.selectPwModulePartByMaterialId(imMaterial.getId()); + for (PwModulePart pwModulePart : lists) { + //根据零件id查询零件信息 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd2 = new PwMakeDocumentsDetail(); + //令号 + pdd2.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd2.setName(pwModulePart.getName()); + //图号 + pdd2.setFigureNumber(pwModulePart.getSpecification()); + //材料 + pdd2.setMaterialType(material.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd2.setQuantity(pmdd.getQuantity()*pwModulePart.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd2); + + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()+pdd2.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + + List listsTwo = pwModulePartService.selectPwModulePartByMaterialId(pwModulePart.getPartId()); + for (PwModulePart pwModulePart2 : listsTwo) { + //根据零件id查询零件信息 + ImMaterial materialTwo = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd3 = new PwMakeDocumentsDetail(); + //令号 + pdd3.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd3.setName(pwModulePart2.getName()); + //图号 + pdd3.setFigureNumber(pwModulePart2.getSpecification()); + //材料 + pdd3.setMaterialType(materialTwo.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd3.setQuantity(pdd2.getQuantity()*pwModulePart2.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd3); + + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()+pdd3.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + + //自动添加工序 + List list2 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pmdd.getName(),pmdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess : list2) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pmdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pmdd.getFigureNumber()+"-"+pwMaterialProcess.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail2.setName(pmdd.getName()+"-"+pwMaterialProcess.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pmdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pmdd.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pmdd.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pmdd.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pmdd.getFigureNumber()); + //工序名称 + pwMakeDocumentsDetail2.setProcessName(pwMaterialProcess.getProcess()); + //派工部门 + pwMakeDocumentsDetail2.setDepartmentName(pwMaterialProcess.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail2.setGodownEntry(pwMaterialProcess.getStorage()); + //判断是否有原材料信息 + if(null!=pwMaterialProcess.getMaterialsId()){ + //原材料id + pwMakeDocumentsDetail2.setMaterialId(pwMaterialProcess.getMaterialsId()); + //材料名称 + pwMakeDocumentsDetail2.setMaterialsName(pwMaterialProcess.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail2.setMaterialsSpecification(pwMaterialProcess.getMaterialsSpecification()); + if(null!=pwMaterialProcess.getLen()){ + //下料长度 + pwMakeDocumentsDetail2.setLen(pwMaterialProcess.getLen().longValue()); + } + if(null!=pwMaterialProcess.getWid()){ + //下料宽度 + pwMakeDocumentsDetail2.setWid(pwMaterialProcess.getWid().longValue()); + } + //只有第一道序有 + if(1==pwMaterialProcess.getSerialNumber()){ + if(null!=pwMaterialProcess.getMaterialsId()){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess.getWorkblank()&&pwMaterialProcess.getWorkblank()!=0){ + if(pwMakeDocumentsDetail2.getQuantity()%pwMaterialProcess.getWorkblank()!=0){ + pwMakeDocumentsDetail2.setWorkblank((pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail2.setFinished(pwMakeDocumentsDetail2.getQuantity()); + + } + + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess.getLen()&&pwMaterialProcess.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess.getWid()&&pwMaterialProcess.getWid()!=0){ + pwMakeDocumentsDetail2.setMeasure((pwMaterialProcess.getLen().longValue()*pwMaterialProcess.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+"*"+pwMaterialProcess.getWid().longValue()); + + }else{ + pwMakeDocumentsDetail2.setMeasure(pwMaterialProcess.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+""); + } + + ImMaterial material = imMaterialService.selectImMaterialById(pwMaterialProcess.getMaterialsId()); + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())+(3*pwMakeDocumentsDetail2.getWorkblank())); + }else{ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())); + } + } + + if(null!=pwMaterialProcess.getMaterialsId()){ + //把毛坯数量添加到库存信息的预定数量中 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMaterialProcess.getMaterialsName(), pwMaterialProcess.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail2.getWorkblank()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + } + } + + //序描述 + pwMakeDocumentsDetail2.setXuDescribe(pwMaterialProcess.getSparedOne()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == material){ + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == detail){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + } + } + }else{ + + //如果库存数量+在途数量-预订数量<=最低安全库存数量,则添加一条企标单信息 + //遍历其图号 + String figureNumber = imMaterial.getFigureNumber(); + //判断图号中是否包函点 + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + str2 = figureNumber.substring(0, figureNumber.indexOf(".")); + }else{ + str2 = "MP"; + } + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsService.selectList(); + if(null==documents){ + Integer valueOf = 1; + str = String.format("%04d", valueOf); + }else{ + String code = documents.getCode(); + String substring = code.substring(code.length()-7,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + str = String.format("%04d", valueOf); + } + + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //code + if(str2.equals("MP")){ + pwMakeDocuments.setCode("QB-"+str2+"-"+str+"-"+substring2); + }else{ + pwMakeDocuments.setCode("QB-XCL"+str2+"-"+str+"-"+substring2); + } + if(str2.equals("MP")){ + //单据名称 + pwMakeDocuments.setName("毛坯料预制清单"); + }else{ + //单据名称 + pwMakeDocuments.setName(str2+"预制清单"); + } + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(str2)){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else if(figureNumber.contains("(M)")||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("组件"))||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("部件"))){ + //图纸类型 + pwMakeDocuments.setSparedOne(str2+"组件"); + }else if("MP".equals(str2)){ + //图纸类型 + pwMakeDocuments.setSparedOne("毛坯料"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(str2); + } + pwMakeDocumentsService.newInsertPwMakeDocuments(pwMakeDocuments); + + //添加企标单详情信息 + PwMakeDocumentsDetail pmdd = new PwMakeDocumentsDetail(); + //令号 + pmdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pmdd.setName(imMaterial.getMaterialName()); + //图号 + pmdd.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pmdd.setMaterialType(imMaterial.getMaterials()); + //数量 +// pmdd.setQuantity(imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); +// pmdd.setQuantity(imMaterial.getHighest()-imMaterial.getMinimum()); + pmdd.setQuantity(imMaterial.getHighest()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pmdd); + + //把详情信息保存到企标单中 + pwMakeDocuments.setDeclares(pmdd.getName()); + pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pmdd.getQuantity()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //判断此物料是否在零部件关联表中配置,如果配置了,则把部件的子零件全部加入到库存制作单中 + List lists = pwModulePartService.selectPwModulePartByMaterialId(imMaterial.getId()); + for (PwModulePart pwModulePart : lists) { + //根据零件id查询零件信息 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd2 = new PwMakeDocumentsDetail(); + //令号 + pdd2.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd2.setName(pwModulePart.getName()); + //图号 + pdd2.setFigureNumber(pwModulePart.getSpecification()); + //材料 + pdd2.setMaterialType(material.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd2.setQuantity(pmdd.getQuantity()*pwModulePart.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd2); + + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()+pdd2.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + + List listsTwo = pwModulePartService.selectPwModulePartByMaterialId(pwModulePart.getPartId()); + for (PwModulePart pwModulePart2 : listsTwo) { + //根据零件id查询零件信息 + ImMaterial materialTwo = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd3 = new PwMakeDocumentsDetail(); + //令号 + pdd3.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd3.setName(pwModulePart2.getName()); + //图号 + pdd3.setFigureNumber(pwModulePart2.getSpecification()); + //材料 + pdd3.setMaterialType(materialTwo.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd3.setQuantity(pdd2.getQuantity()*pwModulePart2.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd3); + + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()+pdd3.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + + //自动添加工序 + List list2 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pmdd.getName(),pmdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess : list2) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pmdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pmdd.getFigureNumber()+"-"+pwMaterialProcess.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail2.setName(pmdd.getName()+"-"+pwMaterialProcess.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pmdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pmdd.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pmdd.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pmdd.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pmdd.getFigureNumber()); + //工序名称 + pwMakeDocumentsDetail2.setProcessName(pwMaterialProcess.getProcess()); + //派工部门 + pwMakeDocumentsDetail2.setDepartmentName(pwMaterialProcess.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail2.setGodownEntry(pwMaterialProcess.getStorage()); + + //判断是否有原材料信息 + if(null!=pwMaterialProcess.getMaterialsId()){ + //原材料id + pwMakeDocumentsDetail2.setMaterialId(pwMaterialProcess.getMaterialsId()); + //材料名称 + pwMakeDocumentsDetail2.setMaterialsName(pwMaterialProcess.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail2.setMaterialsSpecification(pwMaterialProcess.getMaterialsSpecification()); + if(null!=pwMaterialProcess.getLen()){ + //下料长度 + pwMakeDocumentsDetail2.setLen(pwMaterialProcess.getLen().longValue()); + } + if(null!=pwMaterialProcess.getWid()){ + //下料宽度 + pwMakeDocumentsDetail2.setWid(pwMaterialProcess.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess.getSerialNumber()==1){ + if(null!=pwMaterialProcess.getMaterialsId()){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess.getWorkblank()&&pwMaterialProcess.getWorkblank()!=0){ + if(pwMakeDocumentsDetail2.getQuantity()%pwMaterialProcess.getWorkblank()!=0){ + pwMakeDocumentsDetail2.setWorkblank((pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail2.setFinished(pwMakeDocumentsDetail2.getQuantity()); + } + + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess.getLen()&&pwMaterialProcess.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess.getWid()&&pwMaterialProcess.getWid()!=0){ + pwMakeDocumentsDetail2.setMeasure((pwMaterialProcess.getLen().longValue()*pwMaterialProcess.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+"*"+pwMaterialProcess.getWid().longValue()); + }else{ + pwMakeDocumentsDetail2.setMeasure(pwMaterialProcess.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+""); + } + ImMaterial material = imMaterialService.selectImMaterialById(pwMaterialProcess.getMaterialsId()); + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())+(3*pwMakeDocumentsDetail2.getWorkblank())); + }else{ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())); + } + } + + if(null!=pwMaterialProcess.getMaterialsId()){ + //把毛坯数量添加到库存信息的预定数量中 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMaterialProcess.getMaterialsName(), pwMaterialProcess.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail2.getWorkblank()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + } + } + + //序描述 + pwMakeDocumentsDetail2.setXuDescribe(pwMaterialProcess.getSparedOne()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == material){ + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == detail){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + } + } + } + } + + pwSafetyInventory.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + }else{ + pwSafetyInventory.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + } + //项目预定数量 + pwSafetyInventory.setLockNumber(inventoryDetail.getLockNumber()); + + //计算触发系数(现有库存+在途-预定-最小安全库存数量 = 再出多少数量就会触发安全库存) + Double d = (inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()-imMaterial.getMinimum())/imMaterial.getMinimum().doubleValue(); + pwSafetyInventory.setProportion((long)(d * 100)); + pwSafetyInventoryService.insertPwSafetyInventory(pwSafetyInventory); + }else{ + //说明之前添加过,则修改 + + //材料 + pwSafetyInventory2.setMaterials(imMaterial.getMaterials()); + //单重 + pwSafetyInventory2.setPieceWeight(imMaterial.getPieceWeight()); + //最低安全库存 + pwSafetyInventory2.setMinimum(imMaterial.getMinimum()); + //最高安全库存 + pwSafetyInventory2.setHighest(imMaterial.getHighest()); + //现有库存 + pwSafetyInventory2.setQuantity(inventoryDetail.getQuantity()); + + //在途(在制)数量(如果库存数量+在途数量-预定数量<=最低安全库存时)触发企标单或者采购单 + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=imMaterial.getMinimum()){ +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()<=imMaterial.getMinimum()){ + //判断当前物料是标准件还是企标件 + + //判断是否是标准件 + if("外采".equals(imMaterial.getPurchaseMark())){ + //原材料采购 + //添加原材料采购单 + PwBuyingRequisition pwBuyingRequisition = new PwBuyingRequisition(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + //令号 + pwBuyingRequisition.setCode("QG"+sdf.format(new Date())); + if(null==pwBuyingRequisition.getName()){ + //名称(统一为原材料) + pwBuyingRequisition.setName("原材料"); + } + if(null==pwBuyingRequisition.getPurpose()){ + //用途(手动添加的为 安全库存) + pwBuyingRequisition.setPurpose("安全库存"); + } + pwBuyingRequisition.setProposer("系统"); + pwBuyingRequisition.setTotalPrices(0.0); + //请购单状态初始值为1,(待审核状态) + pwBuyingRequisition.setStatus(1); + pwBuyingRequisitionService.insertPwBuyingRequisition(pwBuyingRequisition); + + //添加原材料采购单明细 + PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial = new PwBuyingRequisitionMaterial(); + //令号 为请购单号 + pwBuyingRequisitionMaterial.setCode(pwBuyingRequisition.getCode()); + //请购单id + pwBuyingRequisitionMaterial.setBuyingRequisitionId(pwBuyingRequisition.getId()); + //物料名称 + pwBuyingRequisitionMaterial.setMaterialName(imMaterial.getMaterialName()); + //物料图号 + pwBuyingRequisitionMaterial.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pwBuyingRequisitionMaterial.setMaterials(imMaterial.getMaterials()); + //单重 + pwBuyingRequisitionMaterial.setPieceWeight(imMaterial.getPieceWeight()); + //单位(如果材料单位为毫米,需要转换为米,如果材料单位为平方毫米,需要转换为平方米,其它的直接使用材料的单位) + if(imMaterial.getUnitOfMeasurementName().equals("毫米")){ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName("米"); + }else if(imMaterial.getUnitOfMeasurementName().equals("平方毫米")){ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName("平方米"); + }else{ + pwBuyingRequisitionMaterial.setUnitOfMeasurementName(imMaterial.getUnitOfMeasurementName()); + } + //数量(如果材料单位为毫米,转换成米数,如果材料单位为平方毫米,转换为平方米)其他的不做转换 + if(imMaterial.getUnitOfMeasurementName().equals("毫米")){ + //最高安全库存-库存-在途+预定 +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()))/1000); +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-imMaterial.getMinimum())/1000); + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest())/1000); + }else if(imMaterial.getUnitOfMeasurementName().equals("平方毫米")){ +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-imMaterial.getMinimum())/1000000); + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest())/1000000); + }else{ +// pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest()-imMaterial.getMinimum())); + pwBuyingRequisitionMaterial.setNumber((double)(imMaterial.getHighest())); + } + //单价(获取原材料的单价) + pwBuyingRequisitionMaterial.setUnivalence(imMaterial.getUnitPrice().doubleValue()); + //总价(单价*数量) + pwBuyingRequisitionMaterial.setTotalprice(pwBuyingRequisitionMaterial.getNumber()*imMaterial.getUnitPrice().doubleValue()); + //理论重量(数量*材料的单重) + pwBuyingRequisitionMaterial.setReferenceNumber(pwBuyingRequisitionMaterial.getNumber()*imMaterial.getPieceWeight()); + //实际重量 + pwBuyingRequisitionMaterial.setPracticalNumber(0.0); + //入库状态 + pwBuyingRequisitionMaterial.setInventoryStatus("未入库"); + pwBuyingRequisitionMaterialService.insertPwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + + //修改库存的在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+(imMaterial.getHighest())); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("原材料待采购",pwBuyingRequisition.getCode(),"安全库存","","系统出单","原材料采购","原材料采购","原材料采购单","/purchase/pwBuyingRequisitionMaterial?id="+pwBuyingRequisition.getId()); + + }else{ + if(null!=imMaterial.getFigureNumber()&&(" ".equals(imMaterial.getFigureNumber().substring(0,2)) || "009".equals(imMaterial.getFigureNumber().substring(0,3)) || "017".equals(imMaterial.getFigureNumber().substring(0,3)))){ + //标准件 + //添加标准件采购单 + //添加到采购合同详情信息中 + //创建采购明细 + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code(此种单据没有code,暂时定为无) + pcm.setCode("系统出单"); + //物料名称 + pcm.setMaterialName(imMaterial.getMaterialName()); + //图号 + pcm.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pcm.setMaterials(imMaterial.getMaterials()); + //含税单价 + pcm.setUnivalence(imMaterial.getUnitPrice().doubleValue()); + //数量 +// pcm.setAmount(imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); +// pcm.setAmount(imMaterial.getHighest()-imMaterial.getMinimum()); + pcm.setAmount(imMaterial.getHighest()); + //总价 + pcm.setTotalPrices(imMaterial.getUnitPrice().doubleValue()*pcm.getAmount()); + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + + //下单日期+5天为采购计划完成时间 + Calendar now =Calendar.getInstance(); + now.setTime(new Date()); + now.set(Calendar.DATE,now.get(Calendar.DATE)+5); + //计划采购完成日期 + pcm.setCompleteDate(now.getTime()); + + //记录采购数量的由来 + pcm.setQuantity(inventoryDetail.getQuantity()); + pcm.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + pcm.setLockNumber(inventoryDetail.getLockNumber()); + + pwPurchaseContractMaterialService.insertPwPurchaseContractMaterial(pcm); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pcm.getAmount()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("标准件待采购",pcm.getCode(),"安全库存","","系统出单","采购","标准件采购","采购合同物料详情","/purchase/purchaseContractMaterial"); + + }else{ + //自制件 + + //判断是否设置了最高上限,如果有最高上限,则判断所有企标单的下单数量是否超出 + if(null!=imMaterial.getHighestNumber()&&imMaterial.getHighestNumber()>0){ + //说明设置了最高上限 + //根据图号和名称查询所有企标单 + List list8 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByNameAndFigureNumber(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + //出单数量 + Long chudan = 0L; + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list8) { + chudan += pwMakeDocumentsDetail.getQuantity(); + } + //计算应出单的数量 + 已出单的数量是否超出最高上限,如果超出最高上限,则不再出单,反之则出单 + if(chudan >= imMaterial.getHighestNumber()){ + //无需出单 + }else{ + Long xuchudan = 0L; + String biaoji = ""; + //判断此次的出单数量 + 已出单数量是否超出最高限制 +// if(chudan + (imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())) > imMaterial.getHighestNumber()){ +// if(chudan + (imMaterial.getHighest()-imMaterial.getMinimum()) > imMaterial.getHighestNumber()){ + if(chudan + (imMaterial.getHighest()) > imMaterial.getHighestNumber()){ + //出单数量为 最高限制 - 已出单数量,同时标记达到最高上限 + xuchudan = imMaterial.getHighestNumber() - chudan; + biaoji = "达到最高上限"; + }else{ + //正常出单 +// xuchudan = imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()); +// xuchudan = imMaterial.getHighest()-imMaterial.getMinimum(); + xuchudan = imMaterial.getHighest(); + } + //如果库存数量+在途数量-预订数量<=最低安全库存数量,则添加一条企标单信息 + //遍历其图号 + String figureNumber = imMaterial.getFigureNumber(); + //判断图号中是否包函点 + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + str2 = figureNumber.substring(0, figureNumber.indexOf(".")); + }else{ + str2 = "MP"; + } + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsService.selectList(); + if(null==documents){ + Integer valueOf = 1; + str = String.format("%04d", valueOf); + }else{ + String code = documents.getCode(); + String substring = code.substring(code.length()-7,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + str = String.format("%04d", valueOf); + } + + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //code + if(str2.equals("MP")){ + pwMakeDocuments.setCode("QB-"+str2+"-"+str+"-"+substring2); + }else{ + pwMakeDocuments.setCode("QB-XCL"+str2+"-"+str+"-"+substring2); + } + if(str2.equals("MP")){ + //单据名称 + pwMakeDocuments.setName("毛坯料预制清单"); + }else{ + //单据名称 + pwMakeDocuments.setName(str2+"预制清单"); + } + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(str2)){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else if(figureNumber.contains("(M)")||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("组件"))||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("部件"))){ + //图纸类型 + pwMakeDocuments.setSparedOne(str2+"组件"); + }else if("MP".equals(str2)){ + //图纸类型 + pwMakeDocuments.setSparedOne("毛坯料"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(str2); + } + if(null!=biaoji&&!"".equals(biaoji)){ + pwMakeDocuments.setRemark(biaoji); + } + pwMakeDocumentsService.newInsertPwMakeDocuments(pwMakeDocuments); + + //添加企标单详情信息 + PwMakeDocumentsDetail pmdd = new PwMakeDocumentsDetail(); + //令号 + pmdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pmdd.setName(imMaterial.getMaterialName()); + //图号 + pmdd.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pmdd.setMaterialType(imMaterial.getMaterials()); + //数量 + pmdd.setQuantity(xuchudan); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pmdd); + + //把详情信息保存到企标单中 + pwMakeDocuments.setDeclares(pmdd.getName()); + pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pmdd.getQuantity()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //判断此物料是否在零部件关联表中配置,如果配置了,则把部件的子零件全部加入到库存制作单中 + List lists = pwModulePartService.selectPwModulePartByMaterialId(imMaterial.getId()); + for (PwModulePart pwModulePart : lists) { + //根据零件id查询零件信息 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd2 = new PwMakeDocumentsDetail(); + //令号 + pdd2.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd2.setName(pwModulePart.getName()); + //图号 + pdd2.setFigureNumber(pwModulePart.getSpecification()); + //材料 + pdd2.setMaterialType(material.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd2.setQuantity(pmdd.getQuantity()*pwModulePart.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd2); + + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()+pdd2.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + + List listsTwo = pwModulePartService.selectPwModulePartByMaterialId(pwModulePart.getPartId()); + for (PwModulePart pwModulePart2 : listsTwo) { + //根据零件id查询零件信息 + ImMaterial materialTwo = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd3 = new PwMakeDocumentsDetail(); + //令号 + pdd3.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd3.setName(pwModulePart2.getName()); + //图号 + pdd3.setFigureNumber(pwModulePart2.getSpecification()); + //材料 + pdd3.setMaterialType(materialTwo.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd3.setQuantity(pdd2.getQuantity()*pwModulePart2.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd3); + + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()+pdd3.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + + //自动添加工序 + List list2 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pmdd.getName(),pmdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess : list2) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pmdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pmdd.getFigureNumber()+"-"+pwMaterialProcess.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail2.setName(pmdd.getName()+"-"+pwMaterialProcess.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pmdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pmdd.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pmdd.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pmdd.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pmdd.getFigureNumber()); + //工序名称 + pwMakeDocumentsDetail2.setProcessName(pwMaterialProcess.getProcess()); + //派工部门 + pwMakeDocumentsDetail2.setDepartmentName(pwMaterialProcess.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail2.setGodownEntry(pwMaterialProcess.getStorage()); + + //判断是否有原材料信息 + if(null!=pwMaterialProcess.getMaterialsId()){ + //原材料id + pwMakeDocumentsDetail2.setMaterialId(pwMaterialProcess.getMaterialsId()); + //材料名称 + pwMakeDocumentsDetail2.setMaterialsName(pwMaterialProcess.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail2.setMaterialsSpecification(pwMaterialProcess.getMaterialsSpecification()); + if(null!=pwMaterialProcess.getLen()){ + //下料长度 + pwMakeDocumentsDetail2.setLen(pwMaterialProcess.getLen().longValue()); + } + if(null!=pwMaterialProcess.getWid()){ + //下料宽度 + pwMakeDocumentsDetail2.setWid(pwMaterialProcess.getWid().longValue()); + } + //只有第一道序有 + if(1==pwMaterialProcess.getSerialNumber()){ + if(null!=pwMaterialProcess.getMaterialsId()){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess.getWorkblank()&&pwMaterialProcess.getWorkblank()!=0){ + if(pwMakeDocumentsDetail2.getQuantity()%pwMaterialProcess.getWorkblank()!=0){ + pwMakeDocumentsDetail2.setWorkblank((pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail2.setFinished(pwMakeDocumentsDetail2.getQuantity()); + } + + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess.getLen()&&pwMaterialProcess.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess.getWid()&&pwMaterialProcess.getWid()!=0){ + pwMakeDocumentsDetail2.setMeasure((pwMaterialProcess.getLen().longValue()*pwMaterialProcess.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+"*"+pwMaterialProcess.getWid().longValue()); + }else{ + pwMakeDocumentsDetail2.setMeasure(pwMaterialProcess.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+""); + } + ImMaterial material = imMaterialService.selectImMaterialById(pwMaterialProcess.getMaterialsId()); + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())+(3*pwMakeDocumentsDetail2.getWorkblank())); + }else{ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())); + } + } + + if(null!=pwMaterialProcess.getMaterialsId()){ + //把毛坯数量添加到库存信息的预定数量中 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMaterialProcess.getMaterialsName(), pwMaterialProcess.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail2.getWorkblank()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + } + } + + //序描述 + pwMakeDocumentsDetail2.setXuDescribe(pwMaterialProcess.getSparedOne()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == material){ + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == detail){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + } + } + }else{ + + //如果库存数量+在途数量-预订数量<=最低安全库存数量,则添加一条企标单信息 + //遍历其图号 + String figureNumber = imMaterial.getFigureNumber(); + //判断图号中是否包函点 + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + str2 = figureNumber.substring(0, figureNumber.indexOf(".")); + }else{ + str2 = "MP"; + } + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsService.selectList(); + if(null==documents){ + Integer valueOf = 1; + str = String.format("%04d", valueOf); + }else{ + String code = documents.getCode(); + String substring = code.substring(code.length()-7,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + str = String.format("%04d", valueOf); + } + + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //code + if(str2.equals("MP")){ + pwMakeDocuments.setCode("QB-"+str2+"-"+str+"-"+substring2); + }else{ + pwMakeDocuments.setCode("QB-XCL"+str2+"-"+str+"-"+substring2); + } + if(str2.equals("MP")){ + //单据名称 + pwMakeDocuments.setName("毛坯料预制清单"); + }else{ + //单据名称 + pwMakeDocuments.setName(str2+"预制清单"); + } + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(str2)){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else if(figureNumber.contains("(M)")||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("组件"))||(null!=imMaterial.getMaterials()&&imMaterial.getMaterials().equals("部件"))){ + //图纸类型 + pwMakeDocuments.setSparedOne(str2+"组件"); + }else if("MP".equals(str2)){ + //图纸类型 + pwMakeDocuments.setSparedOne("毛坯料"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(str2); + } + pwMakeDocumentsService.newInsertPwMakeDocuments(pwMakeDocuments); + + //添加企标单详情信息 + PwMakeDocumentsDetail pmdd = new PwMakeDocumentsDetail(); + //令号 + pmdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pmdd.setName(imMaterial.getMaterialName()); + //图号 + pmdd.setFigureNumber(imMaterial.getFigureNumber()); + //材料 + pmdd.setMaterialType(imMaterial.getMaterials()); + //数量 +// pmdd.setQuantity(imMaterial.getHighest()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); +// pmdd.setQuantity(imMaterial.getHighest()-imMaterial.getMinimum()); + pmdd.setQuantity(imMaterial.getHighest()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pmdd); + + //把详情信息保存到企标单中 + pwMakeDocuments.setDeclares(pmdd.getName()); + pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pmdd.getQuantity()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //判断此物料是否在零部件关联表中配置,如果配置了,则把部件的子零件全部加入到库存制作单中 + List lists = pwModulePartService.selectPwModulePartByMaterialId(imMaterial.getId()); + for (PwModulePart pwModulePart : lists) { + //根据零件id查询零件信息 + ImMaterial material = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd2 = new PwMakeDocumentsDetail(); + //令号 + pdd2.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd2.setName(pwModulePart.getName()); + //图号 + pdd2.setFigureNumber(pwModulePart.getSpecification()); + //材料 + pdd2.setMaterialType(material.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd2.setQuantity(pmdd.getQuantity()*pwModulePart.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd2); + + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()+pdd2.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + + List listsTwo = pwModulePartService.selectPwModulePartByMaterialId(pwModulePart.getPartId()); + for (PwModulePart pwModulePart2 : listsTwo) { + //根据零件id查询零件信息 + ImMaterial materialTwo = imMaterialService.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd3 = new PwMakeDocumentsDetail(); + //令号 + pdd3.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd3.setName(pwModulePart2.getName()); + //图号 + pdd3.setFigureNumber(pwModulePart2.getSpecification()); + //材料 + pdd3.setMaterialType(materialTwo.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd3.setQuantity(pdd2.getQuantity()*pwModulePart2.getNumber()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pdd3); + + PwInventoryDetail inventoryDetail3 = pwInventoryDetailService.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()+pdd3.getQuantity()); + //更新库存信息 + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + + //自动添加工序 + List list2 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pmdd.getName(),pmdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess : list2) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pmdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pmdd.getFigureNumber()+"-"+pwMaterialProcess.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail2.setName(pmdd.getName()+"-"+pwMaterialProcess.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pmdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pmdd.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pmdd.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pmdd.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pmdd.getFigureNumber()); + //工序名称 + pwMakeDocumentsDetail2.setProcessName(pwMaterialProcess.getProcess()); + //派工部门 + pwMakeDocumentsDetail2.setDepartmentName(pwMaterialProcess.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail2.setGodownEntry(pwMaterialProcess.getStorage()); + + //判断是否有原材料信息 + if(null!=pwMaterialProcess.getMaterialsId()){ + //原材料id + pwMakeDocumentsDetail2.setMaterialId(pwMaterialProcess.getMaterialsId()); + //材料名称 + pwMakeDocumentsDetail2.setMaterialsName(pwMaterialProcess.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail2.setMaterialsSpecification(pwMaterialProcess.getMaterialsSpecification()); + if(null!=pwMaterialProcess.getLen()){ + //下料长度 + pwMakeDocumentsDetail2.setLen(pwMaterialProcess.getLen().longValue()); + } + if(null!=pwMaterialProcess.getWid()){ + //下料宽度 + pwMakeDocumentsDetail2.setWid(pwMaterialProcess.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess.getSerialNumber()==1){ + if(null!=pwMaterialProcess.getMaterialsId()){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess.getWorkblank()&&pwMaterialProcess.getWorkblank()!=0){ + if(pwMakeDocumentsDetail2.getQuantity()%pwMaterialProcess.getWorkblank()!=0){ + pwMakeDocumentsDetail2.setWorkblank((pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail2.setFinished(pwMakeDocumentsDetail2.getQuantity()); + } + + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess.getLen()&&pwMaterialProcess.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess.getWid()&&pwMaterialProcess.getWid()!=0){ + pwMakeDocumentsDetail2.setMeasure((pwMaterialProcess.getLen().longValue()*pwMaterialProcess.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+"*"+pwMaterialProcess.getWid().longValue()); + }else{ + pwMakeDocumentsDetail2.setMeasure(pwMaterialProcess.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen().longValue()+""); + } + ImMaterial material = imMaterialService.selectImMaterialById(pwMaterialProcess.getMaterialsId()); + if(null!=material.getMaterialTypeName()&&!"毛坯".equals(material.getMaterialTypeName())&&material.getMinimum()==0&&material.getHighest()==0){ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())+(3*pwMakeDocumentsDetail2.getWorkblank())); + }else{ + //领料数量 + pwMakeDocumentsDetail2.setReceiveNumber(pwMakeDocumentsDetail2.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail2.getMeasure())); + } + } + + if(null!=pwMaterialProcess.getMaterialsId()){ + //把毛坯数量添加到库存信息的预定数量中 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMaterialProcess.getMaterialsName(), pwMaterialProcess.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail2.getWorkblank()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail2); + } + } + } + } + + //序描述 + pwMakeDocumentsDetail2.setXuDescribe(pwMaterialProcess.getSparedOne()); + pwMakeDocumentsDetailService.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material = imMaterialService.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == material){ + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialService.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == detail){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + pwInventoryDetailService.insertPwInventoryDetail(pwInventoryDetail); + } + } + } + } + } + pwSafetyInventory2.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + }else{ + pwSafetyInventory2.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + } + + //项目预定数量 + pwSafetyInventory2.setLockNumber(inventoryDetail.getLockNumber()); + + //计算触发系数(现有库存+在途-预定-最小安全库存数量 = 再出多少数量就会触发安全库存) + Double d = (inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()-imMaterial.getMinimum())/imMaterial.getMinimum().doubleValue(); + pwSafetyInventory2.setProportion((long)(d * 100)); + + pwSafetyInventoryService.updatePwSafetyInventory(pwSafetyInventory2); + } + + } + }else if("易耗品".equals(imMaterial.getMaterialTypeName())){ + //执行单低值易耗品的逻辑 + + //根据物料名称和图号查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailByNameAndFigureNumber(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + + if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory() lists = pwBuyingRequisitionMaterialTwoService.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + //总价 + Double zongjia = 0.0; + for (PwBuyingRequisitionMaterialTwo PwBuyingRequisitionMaterialTwo2 : lists) { + zongjia += PwBuyingRequisitionMaterialTwo2.getTotalprice(); + } + //根据采购单id查询采购单 + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoService.selectPwBuyingRequisitionTwoById(pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + //总价 + buyingRequisitionTwo.setTotalPrices(zongjia); + pwBuyingRequisitionTwoService.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + + //加上在途数量 + inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pwBuyingRequisitionMaterialTwo.getNumber()); + pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + + //创建新的待办事项(事项名称,关联令号,推送人,办理人,办理方式,模块名称,路由地址) +// addBacklog("易耗品待采购",pwBuyingRequisitionTwo.getCode(),pwBuyingRequisitionMaterialTwo.getMaterialName(),pwBuyingRequisitionMaterialTwo.getFigureNumber(),user.getNickName(),"采购","易耗品采购","请购单管理","/purchase/pwBuyingRequisitionMaterialTwo?id="+pwBuyingRequisitionMaterialTwo.getBuyingRequisitionId()); + } + } + } + + //刀具设置了安全库存的 + + } + + /** + * 定时器,每隔1小时查询一次 + * + * 需要查询 执行单、企标单、原材料采购单信息 + */ +// @Scheduled(cron = "0 0 */5 * * ?") +// @Scheduled(cron = "0 */1 * * * ?") + public void autoDetection(){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //获取今天的日期 + Date date = new Date(); + + //查询所有未完成的执行单 + List list = pwProductionBillService.selectPwProductionBillByStatus("未完成"); + for (PwProductionBill pwProductionBill : list) { + int i = 0; + //根据执行单id查询执行单详情信息 + List list2 = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(pwProductionBill.getId()); + for (PwProductionBillProduct pwProductionBillProduct : list2) { + //获取执行单详情信息中的完工日期 + Date completeDate = pwProductionBillProduct.getCompleteDate(); + if(null!=completeDate){ + //当前的日期 + if(date.after(completeDate)){ + i = 1; + } + } + } + if(i==1){ + if(null!=pwProductionBill.getOvertime()&&"是".equals(pwProductionBill.getOvertime())){ + + }else{ + //说明超时了 + pwProductionBill.setOvertime("是"); + pwProductionBillService.updatePwProductionBill(pwProductionBill); + } + }else{ + if(null!=pwProductionBill.getOvertime()&&"否".equals(pwProductionBill.getOvertime())){ + + }else{ + //说明没有超时 + pwProductionBill.setOvertime("否"); + pwProductionBillService.updatePwProductionBill(pwProductionBill); + } + } + } + + //查询所有的企标单 + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + pwMakeDocuments.setHid(0); + List list2 = pwMakeDocumentsService.selectPwMakeDocumentsList(pwMakeDocuments); + for (PwMakeDocuments pwMakeDocuments2 : list2) { + int i = 0; + //根据生产令号查询当前生产令号下所有的物料 + List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCode(pwMakeDocuments2.getCode()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list3) { + List list4 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getSuperiorId()); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list4) { + if(null==pwMakeDocumentsDetail2.getInventoryStatus()||!pwMakeDocumentsDetail2.getInventoryStatus().equals("已入库")){ + Date completionDate = pwMakeDocumentsDetail2.getCompletionDate(); + if(null!=completionDate){ + //当前的日期 + if(date.after(completionDate)){ + i = 1; + } + if(i==1){ + //说明超时了 + pwMakeDocuments2.setOvertime("是"); + pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments2); + }else{ + //说明没有超时 + pwMakeDocuments2.setOvertime("否"); + pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments2); + } + } + } + } + } + } + + //查询所有原材料采购单 + PwBuyingRequisition pwBuyingRequisition = new PwBuyingRequisition(); + List list3 = pwBuyingRequisitionService.selectPwBuyingRequisitionList(pwBuyingRequisition ); + for (PwBuyingRequisition pwBuyingRequisition2 : list3) { + int i = 0; + Date date2 = pwBuyingRequisition2.getDemandDate(); + if(null!=date2){ + //当前的日期 + if(date.after(date2)){ + i = 1; + } + } + if(i==1){ + //说明超时了 + pwBuyingRequisition2.setOvertime("是"); + pwBuyingRequisitionService.updatePwBuyingRequisition(pwBuyingRequisition2); + }else{ + //说明没有超时 + pwBuyingRequisition2.setOvertime("否"); + pwBuyingRequisitionService.updatePwBuyingRequisition(pwBuyingRequisition2); + } + } + } + + /** + * 定时器,每天8点半查询一次 + * + * 需要执行单详情中所有木箱包装的型号,判断是否增加了木箱及木箱添加了工序及是否派工了,如果没有增加木箱则提醒,没有派工也提醒 + */ + @Scheduled(cron = "0 10 08 */1 * ?") +// @Scheduled(cron = "0 */1 * * * ?") + public void autoMuxiangWarn(){ + //当前日期 + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //执行单详情信息 + PwProductionBillProduct pwProductionBillProduct = new PwProductionBillProduct(); + pwProductionBillProduct.setPackType("木箱"); + //按照令号分组,每一种令号查询出一条数据 + List list = pwProductionBillProductService.selectPwProductionBillProductLists(pwProductionBillProduct); + for (PwProductionBillProduct pwProductionBillProduct2 : list) { + //日期加上一个月 + Calendar calendars = Calendar.getInstance(); + calendars.setTime(date); + calendars.add(Calendar.DATE, 3); + Date time = calendars.getTime(); + //判断时间是否满足提醒条件了,判断当前时间+3天,是否大于等于完工时间(小于时为true,大于等于时提醒) + if(!time.before(pwProductionBillProduct2.getCompleteDate())){ + //说明是木箱包装,根据其执行单id查询执行单信息 + PwProductionBill productionBill = pwProductionBillService.selectPwProductionBillById(pwProductionBillProduct2.getProductionBillId()); + //判断此执行单是否已经完成,如果已经完成,则不再查询 + if(null!=productionBill&&!productionBill.getStatus().equals("已完成")){ + //根据执行单code查询bom表中是否有标准轻型木箱,重型木箱,出口轻型木箱,出口重型木箱,如果没有,则判断当前产品型号的完成时间 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndMuXiang(productionBill.getCode()); + //是否有木箱标识,0代表有,1代表没有,但是,2代表没有工序 3代表没有派工 + int i = 0; + if(list2.size() < 1){ + //说明没有木箱 + i = 1; + }else{ + //说明有,则判断是否添加了工序 + for (PwBomNumberTwo pwBomNumberTwo2 : list2) { + //查询是否添加了工序 + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo2.getProductionCode(), pwBomNumberTwo2.getId()); + if(list3.size() < 1){ + //说明没有添加工序 + i = 2; + break; + }else{ + for (PwBomNumberTwo pwBomNumberTwo3 : list3) { + if(null==pwBomNumberTwo3.getDepartmentName()||"".equals(pwBomNumberTwo3.getDepartmentName())){ + i = 3; + break; + } + } + } + } + } + + if(i == 1){ + //没有添加木箱bom + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("生产部"); + if(null!=userEmail){ + //拼接邮件内容 + content = "执行单:"+"\n
"+"令号:"+productionBill.getCode()+"\n
"+"项目名称:"+productionBill.getProjectName()+ + "\n
"+"交货日期:"+sdf.format(pwProductionBillProduct2.getCompleteDate())+"\n
"+"未添加包装箱bom清单,请核实"; + try { + send.sendEmail("木箱bom提醒",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + }else if(i == 2){ + //没有工序 + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("生产部"); + if(null!=userEmail){ + //拼接邮件内容 + content = "执行单:"+"\n
"+"令号:"+productionBill.getCode()+"\n
"+"项目名称:"+productionBill.getProjectName()+ + "\n
"+"交货日期:"+sdf.format(pwProductionBillProduct2.getCompleteDate())+"\n
"+"未添加包装箱工序信息,请核实"; + try { + send.sendEmail("木箱工序提醒",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + }else if(i == 3){ + //没有派工 + //没有工序 + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName("生产部"); + if(null!=userEmail){ + //拼接邮件内容 + content = "执行单:"+"\n
"+"令号:"+productionBill.getCode()+"\n
"+"项目名称:"+productionBill.getProjectName()+ + "\n
"+"交货日期:"+sdf.format(pwProductionBillProduct2.getCompleteDate())+"\n
"+"未派工包装箱工序信息,请核实"; + try { + send.sendEmail("木箱工序派工提醒",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + } + } + } + + /** + * 定时推送当天的打卡数据 + * 定时器,每天8点20执行一次 + * + */ + @Scheduled(cron = "0 20 08 */1 * ?") + public void autoDaKa(){ + //当前日期 + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdff = new SimpleDateFormat("HH:mm:ss"); + + String bumen = "机一工段,机二工段,机三工段,质检部门,库房部门"; + String[] split = bumen.split(","); + for (String string : split) { + PwUserEmail userEmail = pwUserEmailService.selectPwUserEmailByName(string); + //查询机一车间、机二车间、机三车间、企标工段,销齿链组,非标设备组,综合工段和质检、库房的考勤数据 + List list = cwNewAttendanceService.selectCwNewAttendanceByDeptAndDate(string,sdf.format(date)); + //考勤记录 + String data = ""; + + for (CwNewAttendance cwNewAttendance : list) { + if(null==cwNewAttendance.getRules()){ + cwNewAttendance.setRules(""); + } + if(null==cwNewAttendance.getWorkStartTime()){ + data += "姓名:"+cwNewAttendance.getName()+"        "+"班制:"+cwNewAttendance.getRules()+"\n"+"上班时间:"+""+"\n
"; + }else{ + data += "姓名:"+cwNewAttendance.getName()+"        "+"班制:"+cwNewAttendance.getRules()+"\n"+"上班时间:"+sdff.format(cwNewAttendance.getWorkStartTime())+"\n
"; + } + } + SendEmail send = new SendEmail(); + //邮件内容 + String content = ""; + + if(null!=userEmail){ + //拼接邮件内容 + content = sdf.format(date)+"考勤记录:"+"\n
"+data; + try { + send.sendEmail(string+"考勤通知",content,userEmail.getEmail()); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + } + + /** + * 定时查询企标单的状态,完成之后,自动隐藏 + * + */ + @Scheduled(cron = "0 20 03 * * ?") + public void autoCloseMakeDocuments(){ + //获取所有未隐藏的企标单 + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + pwMakeDocuments.setHid(0); + List list2 = pwMakeDocumentsService.selectPwMakeDocumentsList(pwMakeDocuments); + for (PwMakeDocuments pwMakeDocuments2 : list2) { + //根据企标单令号查询当前令号下所有的物料 + List list = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndDeleteXu(pwMakeDocuments2.getCode()); + //根据物料id查询所有的工序,查询工序的入库状态 + int t = 0; + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list) { + List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getId()); + int s = 0; + for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list3) { + //查询当前序的入库状态 + List list4 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwMakeDocumentsDetail2.getMakeDocumentsCode(), pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + //统计已入库的数量 + Long l = 0L; + for (ImProductReceiptMaterial imProductReceiptMaterial : list4) { + l += imProductReceiptMaterial.getReceived().longValue(); + } + if(l.equals(pwMakeDocumentsDetail2.getQuantity())){ + //说明已全部入库 + s = 1; + }else{ + s = 0; + break; + } + } + if(s == 1){ + //说明当前令号下的物料都已完成入库 + t = 1; + }else{ + t = 0; + break; + } + } + if(t == 1){ + //隐藏当前企标单 + pwMakeDocuments2.setHid(1); + pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments2); + } + } + + } + + + /** + * 定时查询执行单,企标单,标准件采购单,原材料采购单是否超时,超时后添加到任务超时信息表中 + * + */ + @Scheduled(cron = "0 10 02 * * ?") + public void autoSelectOverTime(){ + + //执行之前把表清空 + pwTaskOverTimeInfoService.eliminate(); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //获取今天的日期 + Date date = new Date(); + + List lists = new ArrayList(); + PwTaskOverTimeInfo pwTaskOverTimeInfo = new PwTaskOverTimeInfo(); + + //查询所有未完成的执行单 + //查询所有未完成的执行单 + List list = pwProductionBillService.selectPwProductionBillByStatus("未完成"); + for (PwProductionBill pwProductionBill : list) { + //根据执行单id查询执行单详情信息 + List list2 = pwProductionBillProductService.selectPwProductionBillProductByProductionBillId(pwProductionBill.getId()); + for (PwProductionBillProduct pwProductionBillProduct : list2) { + //根据令号和型号查询bom信息 + List list3 = pwBomNumberTwoService.selectBomTwoByCodeAndSparedOne(pwProductionBill.getCode(), pwProductionBillProduct.getProductType()); + for (PwBomNumberTwo pwBomNumberTwo : list3) { + //查询工序 + List list4 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndSuperiorId(pwBomNumberTwo.getProductionCode(), pwBomNumberTwo.getId()); + //判断工序是否有超时的,如果有超时的,则把当前物料添加到超时信息表中 + for (PwBomNumberTwo pwBomNumberTwo2 : list4) { + + if(null!=pwBomNumberTwo2.getCompletionDate()&&date.after(pwBomNumberTwo2.getCompletionDate())){ + //先判断当前物料是否入库了,如果入库了则不再添加,如果没有入库,则添加 + //入库数量 + List list6 = imProductReceiptMaterialService.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(pwBomNumberTwo2.getProductionCode(), pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + //入库数量 + Double d = 0.0; + for (ImProductReceiptMaterial imProductReceiptMaterial : list6) { + d += imProductReceiptMaterial.getReceived(); + } + if(d < pwBomNumberTwo2.getSumNumber()){ + //说明超时了 + pwTaskOverTimeInfo = new PwTaskOverTimeInfo(); + //生产令号 + pwTaskOverTimeInfo.setCode(pwBomNumberTwo.getProductionCode()); + //项目名称 + pwTaskOverTimeInfo.setProductName(pwProductionBill.getProjectName()); + //物料名称 + pwTaskOverTimeInfo.setName(pwBomNumberTwo2.getName()); + //物料图号 + pwTaskOverTimeInfo.setFigureNumber(pwBomNumberTwo2.getFigureNumber()); + //本批数量 + pwTaskOverTimeInfo.setSumNumber(pwBomNumberTwo2.getSumNumber()); + //下单时间 + pwTaskOverTimeInfo.setOrderTime(pwBomNumberTwo2.getCreateTime()); + //工序名称 + pwTaskOverTimeInfo.setProcessName(pwBomNumberTwo2.getProcessName()); + //加工部门 + pwTaskOverTimeInfo.setDepartmentName(pwBomNumberTwo2.getDepartmentName()); + //计划完成时间 + pwTaskOverTimeInfo.setCompletionDate(pwBomNumberTwo2.getCompletionDate()); + //超时时间(天) + //计算当前时间距离计划时间的差值 + Long l = (date.getTime() - pwBomNumberTwo2.getCompletionDate().getTime())/1000/60/60/24; + pwTaskOverTimeInfo.setTimeoutDays(l); + //领料数量 +// iImStockRequisitionMaterialService.selectcode + pwTaskOverTimeInfo.setMaterialRequisitionQuantity(0.0); + //请检数量 + List list5 = pwCompletionNoticeProductService.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(pwTaskOverTimeInfo.getCode(), pwTaskOverTimeInfo.getName(), pwTaskOverTimeInfo.getFigureNumber()); + //请检数量 + Double s = 0.0; + //检验数量 + Double r = 0.0; + for (PwCompletionNoticeProduct pwCompletionNoticeProduct : list5) { + s += pwCompletionNoticeProduct.getReceivableQuantity(); + r += (pwCompletionNoticeProduct.getQuantity()+pwCompletionNoticeProduct.getConcessionQuantity()); + } + pwTaskOverTimeInfo.setApplyForQuantity(s); + //检验数量 + pwTaskOverTimeInfo.setCheckoutQuantity(r); + //入库数量 + pwTaskOverTimeInfo.setStorageQuantity(d); + //所属单据 + pwTaskOverTimeInfo.setSparedOne("执行单"); + lists.add(pwTaskOverTimeInfo); + } + } + } + } + } + } + pwTaskOverTimeInfoService.insertPwTaskOverTimeInfos(lists); + + //查询所有未隐藏的企标单 + + //查询所有标准件采购单 + + //查询所有原材料采购单 + + + //查询所有的企标单 +// PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); +// pwMakeDocuments.setHid(0); +// List list2 = pwMakeDocumentsService.selectPwMakeDocumentsList(pwMakeDocuments); +// for (PwMakeDocuments pwMakeDocuments2 : list2) { +// int i = 0; +// //根据生产令号查询当前生产令号下所有的物料 +// List list3 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCode(pwMakeDocuments2.getCode()); +// for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list3) { +// List list4 = pwMakeDocumentsDetailService.selectPwMakeDocumentsDetailByCodeAndSuperiorId(pwMakeDocumentsDetail.getMakeDocumentsCode(), pwMakeDocumentsDetail.getSuperiorId()); +// for (PwMakeDocumentsDetail pwMakeDocumentsDetail2 : list4) { +// if(null==pwMakeDocumentsDetail2.getInventoryStatus()||!pwMakeDocumentsDetail2.getInventoryStatus().equals("已入库")){ +// Date completionDate = pwMakeDocumentsDetail2.getCompletionDate(); +// if(null!=completionDate){ +// //当前的日期 +// if(date.after(completionDate)){ +// i = 1; +// } +// if(i==1){ +// //说明超时了 +// pwMakeDocuments2.setOvertime("是"); +// pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments2); +// }else{ +// //说明没有超时 +// pwMakeDocuments2.setOvertime("否"); +// pwMakeDocumentsService.updatePwMakeDocuments(pwMakeDocuments2); +// } +// } +// } +// } +// } +// } +// +// //查询所有原材料采购单 +// PwBuyingRequisition pwBuyingRequisition = new PwBuyingRequisition(); +// List list3 = pwBuyingRequisitionService.selectPwBuyingRequisitionList(pwBuyingRequisition ); +// for (PwBuyingRequisition pwBuyingRequisition2 : list3) { +// int i = 0; +// Date date2 = pwBuyingRequisition2.getDemandDate(); +// if(null!=date2){ +// //当前的日期 +// if(date.after(date2)){ +// i = 1; +// } +// } +// if(i==1){ +// //说明超时了 +// pwBuyingRequisition2.setOvertime("是"); +// pwBuyingRequisitionService.updatePwBuyingRequisition(pwBuyingRequisition2); +// }else{ +// //说明没有超时 +// pwBuyingRequisition2.setOvertime("否"); +// pwBuyingRequisitionService.updatePwBuyingRequisition(pwBuyingRequisition2); +// } +// } +// + } + + + /** + * 创建待办事项 + * @param matterName 事项名称 + * @param code 关联令号 + * @param nickName 推送人 + * @param recipientName 办理人 + * @param processMode 办理方式 + * @param moduleName 模块名称 + * @param address 路由地址 + */ + private void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + pwBacklogService.insertPwBacklog(pwBacklog); + } + + /** + * 自动触发金蝶安全库存出单 + */ + @Scheduled(cron = "0 0 08 0/1 * ?") + public void autoIssue(){ + //查询所有设置了安全库存的物料 + List list = materialSecureService.selectMaterialSecureList(null); + //拼接参数 + String param = ""; + for(int i=0;i即使库存 + if(materialSecure.getMinimum() > 0 && materialSecure.getHighest() > 0 && materialSecure.getMinimum() > Double.parseDouble(arr[1])){ + if(inventoryIssue != null){ + break; + } + autoInventoryIssue = new AutoInventoryIssue(); + BeanUtils.copyProperties(materialSecure,autoInventoryIssue); + autoInventoryIssue.setFlag("0"); + autoInventoryIssue.setQuantity(materialSecure.getHighest()); + autoInventoryIssueService.insertAutoInventoryIssue(autoInventoryIssue); + break; + }else{ + if(inventoryIssue == null){ + break; + } + //删除信息 + autoInventoryIssueService.deleteAutoInventoryIssueById(inventoryIssue.getId()); + break; + } + } + } + } + } + + /** + * 定时投放接口 + */ + //@Scheduled(cron = "0 0 0/1 * * ?") + private void autoQueryPlannedOrder(){ + plannedOrderService.queryPlannedOrders(); + } + + /** + * 定时查询物料信息 + */ + //@Scheduled(cron = "0 0 0/2 * * ?") + private void autoQueryMaterials(){ + imMaterialService.queryJdBaseInformation(); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/YcBomNumberPreliminaryInquiryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/YcBomNumberPreliminaryInquiryController.java new file mode 100644 index 0000000..44d5d23 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/YcBomNumberPreliminaryInquiryController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.YcBomNumberPreliminaryInquiry; +import com.ruoyi.project.management.service.IYcBomNumberPreliminaryInquiryService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 预查询点件Controller + * + * @author zhukangchao + * @date 2021-12-08 + */ +@RestController +@RequestMapping("/management/ycBomNumberPreliminaryInquiry") +public class YcBomNumberPreliminaryInquiryController extends BaseController +{ + @Autowired + private IYcBomNumberPreliminaryInquiryService ycBomNumberPreliminaryInquiryService; + + /** + * 查询预查询点件列表 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberPreliminaryInquiry:list')") + @GetMapping("/list") + public TableDataInfo list(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry) + { + startPage(); + List list = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryList(ycBomNumberPreliminaryInquiry); + return getDataTable(list); + } + + /** + * 导出预查询点件列表 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberPreliminaryInquiry:export')") + @Log(title = "预查询点件", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry) + { + List list = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryList(ycBomNumberPreliminaryInquiry); + ExcelUtil util = new ExcelUtil(YcBomNumberPreliminaryInquiry.class); + return util.exportExcel(list, "ycBomNumberPreliminaryInquiry"); + } + + /** + * 获取预查询点件详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberPreliminaryInquiry:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryById(id)); + } + + /** + * 新增预查询点件 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberPreliminaryInquiry:add')") + @Log(title = "预查询点件", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry) + { + return toAjax(ycBomNumberPreliminaryInquiryService.insertYcBomNumberPreliminaryInquiry(ycBomNumberPreliminaryInquiry)); + } + + /** + * 修改预查询点件 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberPreliminaryInquiry:edit')") + @Log(title = "预查询点件", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry) + { + return toAjax(ycBomNumberPreliminaryInquiryService.updateYcBomNumberPreliminaryInquiry(ycBomNumberPreliminaryInquiry)); + } + + /** + * 删除预查询点件 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberPreliminaryInquiry:remove')") + @Log(title = "预查询点件", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ycBomNumberPreliminaryInquiryService.deleteYcBomNumberPreliminaryInquiryByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/YcBomNumberTwoPreliminaryInquiryController.java b/evo/src/main/java/com/ruoyi/project/management/controller/YcBomNumberTwoPreliminaryInquiryController.java new file mode 100644 index 0000000..717e4ab --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/YcBomNumberTwoPreliminaryInquiryController.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.YcBomNumberTwoPreliminaryInquiry; +import com.ruoyi.project.management.service.IYcBomNumberTwoPreliminaryInquiryService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 预查询计算后的点件Controller + * + * @author zhukangchao + * @date 2021-12-08 + */ +@RestController +@RequestMapping("/management/ycBomNumberTwoInquiry") +public class YcBomNumberTwoPreliminaryInquiryController extends BaseController +{ + @Autowired + private IYcBomNumberTwoPreliminaryInquiryService ycBomNumberTwoPreliminaryInquiryService; + + /** + * 查询预查询计算后的点件列表 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberTwoInquiry:list')") + @GetMapping("/list") + public TableDataInfo list(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry) + { + startPage(); + List list = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryList(ycBomNumberTwoPreliminaryInquiry); + return getDataTable(list); + } + + /** + * 导出预查询计算后的点件列表 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberTwoInquiry:export')") + @Log(title = "预查询计算后的点件", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry) + { + List list = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryList(ycBomNumberTwoPreliminaryInquiry); + ExcelUtil util = new ExcelUtil(YcBomNumberTwoPreliminaryInquiry.class); + return util.exportExcel(list, "ycBomNumberTwoInquiry"); + } + + /** + * 获取预查询计算后的点件详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberTwoInquiry:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryById(id)); + } + + /** + * 新增预查询计算后的点件 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberTwoInquiry:add')") + @Log(title = "预查询计算后的点件", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry) + { + return toAjax(ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(ycBomNumberTwoPreliminaryInquiry)); + } + + /** + * 修改预查询计算后的点件 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberTwoInquiry:edit')") + @Log(title = "预查询计算后的点件", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry) + { + return toAjax(ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(ycBomNumberTwoPreliminaryInquiry)); + } + + /** + * 删除预查询计算后的点件 + */ + @PreAuthorize("@ss.hasPermi('management:ycBomNumberTwoInquiry:remove')") + @Log(title = "预查询计算后的点件", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ycBomNumberTwoPreliminaryInquiryService.deleteYcBomNumberTwoPreliminaryInquiryByIds(ids)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/controller/YcProductController.java b/evo/src/main/java/com/ruoyi/project/management/controller/YcProductController.java new file mode 100644 index 0000000..c4c10b7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/controller/YcProductController.java @@ -0,0 +1,925 @@ +package com.ruoyi.project.management.controller; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.ArrayList; +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.management.domain.PcRigidChain; +import com.ruoyi.project.management.domain.YcBomNumberPreliminaryInquiry; +import com.ruoyi.project.management.domain.YcBomNumberTwoPreliminaryInquiry; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwProductQuotation; +import com.ruoyi.project.management.domain.PwProductionBill; +import com.ruoyi.project.management.domain.YcBomNumberPreliminaryInquiry; +import com.ruoyi.project.management.domain.YcBomNumberTwoPreliminaryInquiry; +import com.ruoyi.project.management.domain.YcProduct; +import com.ruoyi.project.management.mapper.PcRigidChainMapper; +import com.ruoyi.project.management.mapper.PwInventoryDetailMapper; +import com.ruoyi.project.management.service.IYcBomNumberPreliminaryInquiryService; +import com.ruoyi.project.management.service.IYcBomNumberTwoPreliminaryInquiryService; +import com.ruoyi.project.management.service.IYcProductService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 预查询产品Controller + * + * @author zhukangchao + * @date 2021-12-08 + */ +@RestController +@RequestMapping("/management/ycProduct") +public class YcProductController extends BaseController +{ + @Autowired + private IYcProductService ycProductService; + //产品型号信息 + @Autowired + private PcRigidChainMapper pcRigidChainMapper; + @Autowired + private IYcBomNumberPreliminaryInquiryService ycBomNumberPreliminaryInquiryService; + @Autowired + private IYcBomNumberTwoPreliminaryInquiryService ycBomNumberTwoPreliminaryInquiryService; + @Autowired + private PwInventoryDetailMapper pwInventoryDetailMapper; + + /** + * 查询预查询产品列表 + */ + @PreAuthorize("@ss.hasPermi('management:ycProduct:list')") + @GetMapping("/list") + public TableDataInfo list(YcProduct ycProduct) + { + startPage(); + List list = ycProductService.selectYcProductList(ycProduct); + return getDataTable(list); + } + + /** + * 导出预查询产品列表 + */ + @PreAuthorize("@ss.hasPermi('management:ycProduct:export')") + @Log(title = "预查询产品", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(YcProduct ycProduct) + { + List list = ycProductService.selectYcProductList(ycProduct); + ExcelUtil util = new ExcelUtil(YcProduct.class); + return util.exportExcel(list, "ycProduct"); + } + + /** + * 获取预查询产品详细信息 + */ + @PreAuthorize("@ss.hasPermi('management:ycProduct:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(ycProductService.selectYcProductById(id)); + } + + /** + * 新增预查询产品 + */ + @PreAuthorize("@ss.hasPermi('management:ycProduct:add')") + @Log(title = "预查询产品", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody YcProduct ycProduct) throws Exception { + if(null==ycProduct.getProductType()||"".equals(ycProduct.getProductType())){ + return AjaxResult.error("请选择型号"); + } + if(null==ycProduct.getNumber()||"".equals(ycProduct.getNumber())||0==ycProduct.getNumber()){ + return AjaxResult.error("请填写数量"); + } + ycProductService.insertYcProduct(ycProduct); + //根据型号查询产品信息 + PcRigidChain rigidChain = pcRigidChainMapper.selectPcRigidChainByTypeName(ycProduct.getProductType()); + // 拼接生产总图需要的参数 + String s = "typeName=" + ycProduct.getProductType() + "<ype=" + rigidChain.getAxialDirection() + "&num=" + "1" + "&productNumber=" + "0000" + "&productId=" + "0000" + "&endTime=" + "2021-12-08"; + // 获取生产总图 + String sendGet = HttpUtils.sendGet("http://localhost:8900/product/product_mesh_list", s, "UTF-8"); + // json串转对象 + JSONObject rcm = JSONObject.parseObject(sendGet); + JSONObject result = JSONObject.parseObject(rcm.get("result").toString()); + // 保存零部件明细信息 + List> allRows = new ArrayList>(); + InputStream is = null; + Workbook wb = null; + try { + URL url = new URL(result.get("form").toString()); + URLConnection conn = url.openConnection(); + conn.setConnectTimeout(3000); + conn.setReadTimeout(3 * 60 * 1000); + is = conn.getInputStream(); + wb = WorkbookFactory.create(is); + Sheet sheet = wb.getSheetAt(0); + allRows = ExcelUtil.readExcel2007(sheet); + } catch (Exception e) { + throw new IOException(e); + } finally { + if (is != null) { + is.close(); + } + } + List list = new ArrayList<>(); + for (int y = 2; y < allRows.size(); y++) { + YcBomNumberPreliminaryInquiry bom = new YcBomNumberPreliminaryInquiry(); + for (int j = 0; j < allRows.get(y).size(); j++) { + bom.setProductionCode(ycProduct.getId().toString()); + if(null!=allRows.get(y).get(2).toString()){ + //名称 + bom.setName(allRows.get(y).get(2).toString().trim().replaceAll(" ","")); + }else{ + bom.setName(allRows.get(y).get(2).toString()); + } + if(null!=allRows.get(y).get(1).toString()&&!"".equals(allRows.get(y).get(1).toString())){ + String substring = allRows.get(y).get(1).toString().substring(0, 3); + String substring11 = allRows.get(y).get(1).toString().substring(0, 2); + if("009".equals(substring) || "017".equals(substring) || " ".equals(substring11)){ + String replaceAll = allRows.get(y).get(1).toString().replaceAll(" ", ""); + replaceAll = " "+replaceAll; + //图号 + bom.setFigureNumber(replaceAll); + }else{ + if(allRows.get(y).get(1).toString().contains("/2-1")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","").replaceAll("/2-1", "")); + }else if(allRows.get(y).get(1).toString().contains("/2-2")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","").replaceAll("/2-2", "")); + }else{ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","")); + } + } + }else{ + bom.setFigureNumber(allRows.get(y).get(1).toString()); + } + //单台数量 + if (null != allRows.get(y).get(3).toString() && !"".equals(allRows.get(y).get(3).toString())) { + bom.setOneNumber(Double.valueOf(allRows.get(y).get(3).toString()).longValue()); + } + //材料 + bom.setType(allRows.get(y).get(4).toString()); + //单重 + if (null != allRows.get(y).get(5).toString() && !"".equals(allRows.get(y).get(5).toString())) { + bom.setPieceWeight(Double.valueOf(allRows.get(y).get(5).toString())); + } + if("-9.0".equals(allRows.get(y).get(9).toString())){ + bom.setSumNumber(ycProduct.getNumber()); + } + //父级名称 + bom.setParentLevelName((allRows.get(y).get(8).toString())); + //备注 + bom.setRemarks(allRows.get(y).get(7).toString()); + //父级图号 + if("-9.0".equals(allRows.get(y).get(9).toString())){ +// bom.setParentLevelFigureNumber(null); + }else{ + if(allRows.get(y).get(9).toString().contains("/2-1")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","").replaceAll("/2-1", "")); + }else if(allRows.get(y).get(9).toString().contains("/2-2")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","").replaceAll("/2-2", "")); + }else{ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","")); + } + } + //型号 + bom.setTypeName(ycProduct.getProductType()); + break; + } + // 保存到list,然后批量添加 + list.add(bom); + //计算数量保存到bomNumber表中,然后通知python出图 + } + int i2 = ycBomNumberPreliminaryInquiryService.insertYcBomNumberPreliminaryInquirys(list); + AjaxResult ajaxResult = counterNum(ycProduct.getId().toString(),ycProduct.getProductType()); + return toAjax(i2); + } + + /** + * 修改预查询产品 + */ + @PreAuthorize("@ss.hasPermi('management:ycProduct:edit')") + @Log(title = "预查询产品", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody YcProduct ycProduct) + { + return toAjax(ycProductService.updateYcProduct(ycProduct)); + } + + /** + * 删除预查询产品 + */ + @PreAuthorize("@ss.hasPermi('management:ycProduct:remove')") + @Log(title = "预查询产品", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ycProductService.deleteYcProductByIds(ids)); + } + + /** + * 计算bom表的单台数量和本批数量 + * @return + */ + public AjaxResult counterNum(String code,String typeName){ + YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry = new YcBomNumberPreliminaryInquiry(); + ycBomNumberPreliminaryInquiry.setProductionCode(code); + ycBomNumberPreliminaryInquiry.setTypeName(typeName); + //获取所有零部件数据集 + List list = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryList(ycBomNumberPreliminaryInquiry); + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry2 : list) { + //获取总装图 + if(null==ycBomNumberPreliminaryInquiry2.getParentLevelFigureNumber()||"".equals(ycBomNumberPreliminaryInquiry2.getParentLevelFigureNumber())){ + //把数据保存到数量保存表中 + YcBomNumberTwoPreliminaryInquiry pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry2.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry2.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry2.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry2.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry2.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry2.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry2.getParentLevelName()); + //把总装图的单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry2.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry2.getRemarks()); + pbt.setDelFlag(0); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + }else{ + System.out.println("未找到总装图"); + return AjaxResult.error(); + } + //根据总装图的图号查找其下所有子集 + List listTwo = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry2.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry2.getProductionCode()); + //遍历子集 + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry3 : listTwo) { + //把数据保存到数量保存表中 + YcBomNumberTwoPreliminaryInquiry pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry3.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry3.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry3.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry3.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry3.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry3.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry3.getParentLevelName()); + //把单台数量保存到本批数量中,最后单台数量乘以总台数,就是本批数量 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry3.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry3.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry3.getName(), ycBomNumberPreliminaryInquiry3.getFigureNumber()); + if(null!=inventoryDetail){ + //如果可用数量大于本批数量,则说明不用制作 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber())); + } + } + } + //插入数据前根据令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + //判断零部件的备注是否是借用件,如果为借用件则在累加了数量之后再添加一条新的数据,然后查找其是否有子集,如果有则把其所有子集再添加一次(数量全部为0) + YcBomNumberTwoPreliminaryInquiry bomNumberTwo = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry3.getProductionCode(),ycBomNumberPreliminaryInquiry3.getName(),ycBomNumberPreliminaryInquiry3.getFigureNumber()); + if(null!=bomNumberTwo){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo.setOneNumber(bomNumberTwo.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo.setSumNumber(bomNumberTwo.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + //继续查找下一级 + List listThree = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry3.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry3.getProductionCode()); + if(listThree.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry4 : listThree) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry4.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry4.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry4.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry4.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry4.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry4.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry4.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry4.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry4.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry4.getName(), ycBomNumberPreliminaryInquiry4.getFigureNumber()); + if(null!=inventoryDetail2){ + if(inventoryDetail2.getQuantity()-inventoryDetail2.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail2.getQuantity()-inventoryDetail2.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail2.getQuantity()-inventoryDetail2.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号和名称(标准件图号相同,规格型号不同)查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo2 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry4.getProductionCode(),ycBomNumberPreliminaryInquiry4.getName(),ycBomNumberPreliminaryInquiry4.getFigureNumber()); + if(null!=bomNumberTwo2){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo2.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo2.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo2.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo2.setOneNumber(bomNumberTwo2.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo2.setSumNumber(bomNumberTwo2.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo2); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo2.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo2); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List listFour = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry4.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(listFour.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry5 : listFour) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry5.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry5.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry5.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry5.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry5.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry5.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry5.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry5.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry5.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail3 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry5.getName(), ycBomNumberPreliminaryInquiry5.getFigureNumber()); + if(null!=inventoryDetail3){ + if(inventoryDetail3.getQuantity()-inventoryDetail3.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail3.getQuantity()-inventoryDetail3.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail3.getQuantity()-inventoryDetail3.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo3 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry5.getProductionCode(),ycBomNumberPreliminaryInquiry5.getName(),ycBomNumberPreliminaryInquiry5.getFigureNumber()); + if(null!=bomNumberTwo3){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo3.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo3.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo3.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo3.setOneNumber(bomNumberTwo3.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo3.setSumNumber(bomNumberTwo3.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo3); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo3.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo3); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List listFive = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry5.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(listFive.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry6 : listFive) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry6.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry6.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry6.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry6.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry6.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry6.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry6.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry6.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry6.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail4 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry6.getName(), ycBomNumberPreliminaryInquiry6.getFigureNumber()); + if(null!=inventoryDetail4){ + if(inventoryDetail4.getQuantity()-inventoryDetail4.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail4.getQuantity()-inventoryDetail4.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail4.getQuantity()-inventoryDetail4.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo4 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry6.getProductionCode(),ycBomNumberPreliminaryInquiry6.getName(),ycBomNumberPreliminaryInquiry6.getFigureNumber()); + if(null!=bomNumberTwo4){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo4.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo4.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo4.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo4.setOneNumber(bomNumberTwo4.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo4.setSumNumber(bomNumberTwo4.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo4); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo4.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo4); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List listSix = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry6.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(listSix.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry7 : listSix) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry7.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry7.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry7.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry7.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry7.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry7.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry7.getParentLevelName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry7.getRemarks()); + pbt.setDelFlag(0); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry7.getTypeName()); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail5 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry7.getName(), ycBomNumberPreliminaryInquiry7.getFigureNumber()); + if(null!=inventoryDetail5){ + if(inventoryDetail5.getQuantity()-inventoryDetail5.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail5.getQuantity()-inventoryDetail5.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail5.getQuantity()-inventoryDetail5.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo5 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry7.getProductionCode(),ycBomNumberPreliminaryInquiry7.getName(),ycBomNumberPreliminaryInquiry7.getFigureNumber()); + if(null!=bomNumberTwo5){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo5.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo5.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo5.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo5.setOneNumber(bomNumberTwo5.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo5.setSumNumber(bomNumberTwo5.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo5); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo5.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo5); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List listSeven = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry7.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(listSeven.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry8 : listSeven) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry8.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry8.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry8.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry8.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry8.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry8.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry8.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry8.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry8.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail6 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry8.getName(), ycBomNumberPreliminaryInquiry8.getFigureNumber()); + if(null!=inventoryDetail6){ + if(inventoryDetail6.getQuantity()-inventoryDetail6.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail6.getQuantity()-inventoryDetail6.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail6.getQuantity()-inventoryDetail6.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo6 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry8.getProductionCode(),ycBomNumberPreliminaryInquiry8.getName(),ycBomNumberPreliminaryInquiry8.getFigureNumber()); + if(null!=bomNumberTwo6){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo6.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo6.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo6.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo6.setOneNumber(bomNumberTwo6.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo6.setSumNumber(bomNumberTwo6.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo6); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo6.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo6); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List listEgint = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry8.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(listEgint.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry9 : listEgint) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry9.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry9.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry9.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry9.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry9.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry9.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry9.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry9.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry9.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail7 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry9.getName(), ycBomNumberPreliminaryInquiry9.getFigureNumber()); + if(null!=inventoryDetail7){ + if(inventoryDetail7.getQuantity()-inventoryDetail7.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail7.getQuantity()-inventoryDetail7.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail7.getQuantity()-inventoryDetail7.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo7 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry9.getProductionCode(),ycBomNumberPreliminaryInquiry9.getName(),ycBomNumberPreliminaryInquiry9.getFigureNumber()); + if(null!=bomNumberTwo7){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo7.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo7.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo7.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo7.setOneNumber(bomNumberTwo7.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo7.setSumNumber(bomNumberTwo7.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo7); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo7.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo7); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List listNigt = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry9.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(listNigt.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry10 : listNigt) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry10.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry10.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry10.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry10.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry10.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry10.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry10.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry10.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry10.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail8 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry10.getName(), ycBomNumberPreliminaryInquiry10.getFigureNumber()); + if(null!=inventoryDetail8){ + if(inventoryDetail8.getQuantity()-inventoryDetail8.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail8.getQuantity()-inventoryDetail8.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail8.getQuantity()-inventoryDetail8.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo8 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry10.getProductionCode(),ycBomNumberPreliminaryInquiry10.getName(),ycBomNumberPreliminaryInquiry10.getFigureNumber()); + if(null!=bomNumberTwo8){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo8.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo8.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo8.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo8.setOneNumber(bomNumberTwo8.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo8.setSumNumber(bomNumberTwo8.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo8); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo8.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo8); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List listTen = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry10.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(listTen.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry11 : listTen) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry11.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry11.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry11.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry11.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry11.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry11.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry11.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry11.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry11.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail9 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry11.getName(), ycBomNumberPreliminaryInquiry11.getFigureNumber()); + if(null!=inventoryDetail9){ + if(inventoryDetail9.getQuantity()-inventoryDetail9.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail9.getQuantity()-inventoryDetail9.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail9.getQuantity()-inventoryDetail9.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo9 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry11.getProductionCode(),ycBomNumberPreliminaryInquiry11.getName(),ycBomNumberPreliminaryInquiry11.getFigureNumber()); + if(null!=bomNumberTwo9){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo9.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo9.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo9.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo9.setOneNumber(bomNumberTwo9.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo9.setSumNumber(bomNumberTwo9.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo9); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo9.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo9); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List list11 = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry11.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(list11.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry12 : list11) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry12.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry12.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry12.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry12.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry12.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry12.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry12.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry12.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry12.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail10 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry12.getName(), ycBomNumberPreliminaryInquiry12.getFigureNumber()); + if(null!=inventoryDetail10){ + if(inventoryDetail10.getQuantity()-inventoryDetail10.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail10.getQuantity()-inventoryDetail10.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail10.getQuantity()-inventoryDetail10.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo10 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry12.getProductionCode(),ycBomNumberPreliminaryInquiry12.getName(),ycBomNumberPreliminaryInquiry12.getFigureNumber()); + if(null!=bomNumberTwo10){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo10.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo10.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo10.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo10.setOneNumber(bomNumberTwo10.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo10.setSumNumber(bomNumberTwo10.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo10); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo10.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo10); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List list12 = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry12.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(list12.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry13 : list12) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry13.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry13.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry13.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry13.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry13.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry13.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry13.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry13.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry13.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail11 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry13.getName(), ycBomNumberPreliminaryInquiry13.getFigureNumber()); + if(null!=inventoryDetail11){ + if(inventoryDetail11.getQuantity()-inventoryDetail11.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail11.getQuantity()-inventoryDetail11.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail11.getQuantity()-inventoryDetail11.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo11 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry13.getProductionCode(),ycBomNumberPreliminaryInquiry13.getName(),ycBomNumberPreliminaryInquiry13.getFigureNumber()); + if(null!=bomNumberTwo11){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo11.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo11.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo11.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo11.setOneNumber(bomNumberTwo11.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo11.setSumNumber(bomNumberTwo11.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo11); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo11.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo11); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List list13 = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry13.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(list13.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry14 : list13) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry14.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry14.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry14.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry14.getOneNumber()*ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry14.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry14.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry14.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry14.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry14.getOneNumber()*ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry14.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry14.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail12 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry14.getName(), ycBomNumberPreliminaryInquiry14.getFigureNumber()); + if(null!=inventoryDetail12){ + if(inventoryDetail12.getQuantity()-inventoryDetail12.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail12.getQuantity()-inventoryDetail12.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail12.getQuantity()-inventoryDetail12.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo12 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry14.getProductionCode(),ycBomNumberPreliminaryInquiry14.getName(),ycBomNumberPreliminaryInquiry14.getFigureNumber()); + if(null!=bomNumberTwo12){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo12.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo12.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo12.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo12.setOneNumber(bomNumberTwo12.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo12.setSumNumber(bomNumberTwo12.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo12); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo12.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo12); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List list14 = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry14.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(list14.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry15 : list14) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry15.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry15.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry15.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry15.getOneNumber()*ycBomNumberPreliminaryInquiry14.getOneNumber()*ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry15.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry15.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry15.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry15.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry15.getOneNumber()*ycBomNumberPreliminaryInquiry14.getOneNumber()*ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry15.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry15.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail13 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry15.getName(), ycBomNumberPreliminaryInquiry15.getFigureNumber()); + if(null!=inventoryDetail13){ + if(inventoryDetail13.getQuantity()-inventoryDetail13.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail13.getQuantity()-inventoryDetail13.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail13.getQuantity()-inventoryDetail13.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo13 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry15.getProductionCode(),ycBomNumberPreliminaryInquiry15.getName(),ycBomNumberPreliminaryInquiry15.getFigureNumber()); + if(null!=bomNumberTwo13){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo13.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo13.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo13.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo13.setOneNumber(bomNumberTwo13.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo13.setSumNumber(bomNumberTwo13.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo13); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo13.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo13); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + List list15 = ycBomNumberPreliminaryInquiryService.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(ycBomNumberPreliminaryInquiry15.getFigureNumber(),typeName,ycBomNumberPreliminaryInquiry.getProductionCode()); + if(list15.size()>0){ + for (YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry16 : list15) { + //把数据保存到数量保存表中 + pbt = new YcBomNumberTwoPreliminaryInquiry(); + pbt.setProductionCode(ycBomNumberPreliminaryInquiry16.getProductionCode()); + pbt.setFigureNumber(ycBomNumberPreliminaryInquiry16.getFigureNumber()); + pbt.setName(ycBomNumberPreliminaryInquiry16.getName()); + pbt.setOneNumber(ycBomNumberPreliminaryInquiry16.getOneNumber()*ycBomNumberPreliminaryInquiry15.getOneNumber()*ycBomNumberPreliminaryInquiry14.getOneNumber()*ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()); + pbt.setType(ycBomNumberPreliminaryInquiry16.getType()); + pbt.setPieceWeight(ycBomNumberPreliminaryInquiry16.getPieceWeight()); + pbt.setParentLevelFigureNumber(ycBomNumberPreliminaryInquiry16.getParentLevelFigureNumber()); + pbt.setParentLevelName(ycBomNumberPreliminaryInquiry16.getParentLevelName()); + //把单台数量保存到本批数量中 + pbt.setSumNumber(ycBomNumberPreliminaryInquiry16.getOneNumber()*ycBomNumberPreliminaryInquiry15.getOneNumber()*ycBomNumberPreliminaryInquiry14.getOneNumber()*ycBomNumberPreliminaryInquiry13.getOneNumber()*ycBomNumberPreliminaryInquiry12.getOneNumber()*ycBomNumberPreliminaryInquiry11.getOneNumber()*ycBomNumberPreliminaryInquiry10.getOneNumber()*ycBomNumberPreliminaryInquiry9.getOneNumber()*ycBomNumberPreliminaryInquiry8.getOneNumber()*ycBomNumberPreliminaryInquiry7.getOneNumber()*ycBomNumberPreliminaryInquiry6.getOneNumber()*ycBomNumberPreliminaryInquiry5.getOneNumber()*ycBomNumberPreliminaryInquiry4.getOneNumber()*ycBomNumberPreliminaryInquiry3.getOneNumber()*ycBomNumberPreliminaryInquiry2.getOneNumber()*ycBomNumberPreliminaryInquiry2.getSumNumber()); + pbt.setSparedOne(ycBomNumberPreliminaryInquiry16.getTypeName()); + pbt.setRemarks(ycBomNumberPreliminaryInquiry16.getRemarks()); + pbt.setDelFlag(0); + //根据图号查询库存数量够不够,如果够就添加有库存标记 + PwInventoryDetail inventoryDetail14 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(ycBomNumberPreliminaryInquiry16.getName(), ycBomNumberPreliminaryInquiry16.getFigureNumber()); + if(null!=inventoryDetail14){ + if(inventoryDetail14.getQuantity()-inventoryDetail14.getLockNumber()>=pbt.getSumNumber()){ + pbt.setSparedTwo("有库存"); + }else{ + if(inventoryDetail14.getQuantity()-inventoryDetail14.getLockNumber()>0){ + pbt.setSparedTwo("可用数量:"+(inventoryDetail14.getQuantity()-inventoryDetail14.getLockNumber())); + } + } + } + //插入数据前根绝令号,型号和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + YcBomNumberTwoPreliminaryInquiry bomNumberTwo14 = ycBomNumberTwoPreliminaryInquiryService.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(ycBomNumberPreliminaryInquiry16.getProductionCode(),ycBomNumberPreliminaryInquiry16.getName(),ycBomNumberPreliminaryInquiry16.getFigureNumber()); + if(null!=bomNumberTwo14){ + //相同令号、型号和图号的累加单台数量,只相同令号、图号不相同型号的累加本批数量 + if(bomNumberTwo14.getProductionCode().equals(pbt.getProductionCode())&&bomNumberTwo14.getSparedOne().equals(pbt.getSparedOne())&&bomNumberTwo14.getFigureNumber().equals(pbt.getFigureNumber())){ + bomNumberTwo14.setOneNumber(bomNumberTwo14.getOneNumber()+pbt.getOneNumber()); + } + bomNumberTwo14.setSumNumber(bomNumberTwo14.getSumNumber()+pbt.getSumNumber()); + ycBomNumberTwoPreliminaryInquiryService.updateYcBomNumberTwoPreliminaryInquiry(bomNumberTwo14); + //合并了数量之后再添加一条本批数量为0的数据 + bomNumberTwo14.setSumNumber(0L); + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(bomNumberTwo14); + }else{ + ycBomNumberTwoPreliminaryInquiryService.insertYcBomNumberTwoPreliminaryInquiry(pbt); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return AjaxResult.success(); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/AllInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/AllInfo.java new file mode 100644 index 0000000..5300573 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/AllInfo.java @@ -0,0 +1,7 @@ +package com.ruoyi.project.management.domain; + +public class AllInfo { + + public static int statusCode = 0; + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/AutoInventoryIssue.java b/evo/src/main/java/com/ruoyi/project/management/domain/AutoInventoryIssue.java new file mode 100644 index 0000000..d22088a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/AutoInventoryIssue.java @@ -0,0 +1,235 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 安全库存出单对象 auto_inventory_issue + * + * @author chenyongjiang + * @date 2024-02-19 + */ +public class AutoInventoryIssue extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String specificationType; + + /** 所属类别 */ + @Excel(name = "所属类别") + private String category; + + /** 采购标记 */ + @Excel(name = "采购标记") + private String purchaseMark; + + /** 材料分类 */ + @Excel(name = "材料分类") + private String materialClassification; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String preferentialOriginName; + + /** 执行数量 */ + @Excel(name = "执行数量") + private Long quantity; + + /** 未税单价(指导价) */ + @Excel(name = "未税单价", readConverterExp = "指=导价") + private Double univalence; + + /** 含税价格 */ + @Excel(name = "含税价格") + private Double unitPrice; + + private String flag; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setSpecificationType(String specificationType) + { + this.specificationType = specificationType; + } + + public String getSpecificationType() + { + return specificationType; + } + public void setCategory(String category) + { + this.category = category; + } + + public String getCategory() + { + return category; + } + public void setPurchaseMark(String purchaseMark) + { + this.purchaseMark = purchaseMark; + } + + public String getPurchaseMark() + { + return purchaseMark; + } + public void setMaterialClassification(String materialClassification) + { + this.materialClassification = materialClassification; + } + + public String getMaterialClassification() + { + return materialClassification; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setPreferentialOriginName(String preferentialOriginName) + { + this.preferentialOriginName = preferentialOriginName; + } + + public String getPreferentialOriginName() + { + return preferentialOriginName; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("figureNumber", getFigureNumber()) + .append("materialName", getMaterialName()) + .append("specificationType", getSpecificationType()) + .append("category", getCategory()) + .append("purchaseMark", getPurchaseMark()) + .append("materialClassification", getMaterialClassification()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("unitOfMeasurementName", getUnit()) + .append("preferentialOriginName", getPreferentialOriginName()) + .append("quantity", getQuantity()) + .append("univalence", getUnivalence()) + .append("unitPrice", getUnitPrice()) + .append("remark", getRemark()) + .append("flag", getFlag()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/BaseQuestion.java b/evo/src/main/java/com/ruoyi/project/management/domain/BaseQuestion.java new file mode 100644 index 0000000..b3100b6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/BaseQuestion.java @@ -0,0 +1,209 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 问题处理对象 base_question + * + * @author zhukangchao + * @date 2023-10-07 + */ +public class BaseQuestion extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 参数主键 */ + private Long questionId; + + /** 问题描述 */ + @Excel(name = "问题描述") + private String questionMark; + + /** 提出人 */ + @Excel(name = "提出人") + private Long questionProposer; + + /** 提出时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "提出时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date questionTime; + + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "提出时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date questionDays; + + /** 紧急程度 0:普通,1:紧急,2:特急 */ + @Excel(name = "紧急程度 0:普通,1:紧急,2:特急") + private String questionUrgency; + + /** 问题状态 0:已解决,1:提出,-1:未解决,2:进行中 */ + @Excel(name = "问题状态 0:已解决,1:提出,-1:未解决,2:进行中") + private String questionStatus; + + /** 负责人 */ + @Excel(name = "负责人") + private Long questionHead; + + /** 协助人 */ + @Excel(name = "协助人") + private Long questionAssist; + + /** 处理时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date questionHandleTime; + + /** 用时 */ + @Excel(name = "用时") + private String questionUsedDays; + + /** 解决方法 */ + @Excel(name = "解决方法") + private String questionMethod; + + private Long auth; + + public Long getAuth() { + return this.auth; + } + + public void setAuth(final Long auth) { + this.auth = auth; + } + + public String getQuestionMethod() { + return this.questionMethod; + } + + public void setQuestionMethod(final String questionMethod) { + this.questionMethod = questionMethod; + } + + public void setQuestionId(Long questionId) + { + this.questionId = questionId; + } + + public Long getQuestionId() + { + return questionId; + } + public void setQuestionMark(String questionMark) + { + this.questionMark = questionMark; + } + + public String getQuestionMark() + { + return questionMark; + } + public void setQuestionProposer(Long questionProposer) + { + this.questionProposer = questionProposer; + } + + public Long getQuestionProposer() + { + return questionProposer; + } + public void setQuestionTime(Date questionTime) + { + this.questionTime = questionTime; + } + + public Date getQuestionTime() + { + return questionTime; + } + + public Date getQuestionDays() { + return this.questionDays; + } + + public void setQuestionDays(final Date questionDays) { + this.questionDays = questionDays; + } + + public void setQuestionUrgency(String questionUrgency) + { + this.questionUrgency = questionUrgency; + } + + public String getQuestionUrgency() + { + return questionUrgency; + } + public void setQuestionStatus(String questionStatus) + { + this.questionStatus = questionStatus; + } + + public String getQuestionStatus() + { + return questionStatus; + } + public void setQuestionHead(Long questionHead) + { + this.questionHead = questionHead; + } + + public Long getQuestionHead() + { + return questionHead; + } + public void setQuestionAssist(Long questionAssist) + { + this.questionAssist = questionAssist; + } + + public Long getQuestionAssist() + { + return questionAssist; + } + public void setQuestionHandleTime(Date questionHandleTime) + { + this.questionHandleTime = questionHandleTime; + } + + public Date getQuestionHandleTime() + { + return questionHandleTime; + } + public void setQuestionUsedDays(String questionUsedDays) + { + this.questionUsedDays = questionUsedDays; + } + + public String getQuestionUsedDays() + { + return questionUsedDays; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("questionId", getQuestionId()) + .append("questionMark", getQuestionMark()) + .append("questionProposer", getQuestionProposer()) + .append("questionTime", getQuestionTime()) + .append("questionDays", getQuestionDays()) + .append("questionUrgency", getQuestionUrgency()) + .append("questionStatus", getQuestionStatus()) + .append("questionHead", getQuestionHead()) + .append("questionAssist", getQuestionAssist()) + .append("questionHandleTime", getQuestionHandleTime()) + .append("questionUsedDays", getQuestionUsedDays()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("questionMethod", getQuestionMethod()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CadMaterialInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CadMaterialInfo.java new file mode 100644 index 0000000..386dbb5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CadMaterialInfo.java @@ -0,0 +1,220 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * CAD物料明细对象 cad_material_info + * + * @author zhukangchao + * @date 2023-06-13 + */ +public class CadMaterialInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 物料图号 */ + @Excel(name = "物料图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 所属类别 */ + @Excel(name = "所属类别") + private String category; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 库存可用数量 */ + @Excel(name = "库存可用数量") + private Long quantity; + + /** 父级名称 */ + @Excel(name = "父级名称") + private String parentLevelName; + + /** 父级图号 */ + @Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setCategory(String category) + { + this.category = category; + } + + public String getCategory() + { + return category; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("category", getCategory()) + .append("remarks", getRemarks()) + .append("quantity", getQuantity()) + .append("parentLevelName", getParentLevelName()) + .append("parentLevelFigureNumber", getParentLevelFigureNumber()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ComparisonExcel.java b/evo/src/main/java/com/ruoyi/project/management/domain/ComparisonExcel.java new file mode 100644 index 0000000..fbb5a44 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ComparisonExcel.java @@ -0,0 +1,59 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +import java.util.Date; + +public class ComparisonExcel { + + @Excel(name = "编号", type = Excel.Type.IMPORT) + private Long id; + @Excel(name = "图号", type = Excel.Type.IMPORT) + private String figureNumber; + @Excel(name = "名称", type = Excel.Type.IMPORT) + private String name; + @Excel(name = "数量", type = Excel.Type.IMPORT) + private int inventoryNum; + + private Date inventoryDate; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getInventoryNum() { + return inventoryNum; + } + + public void setInventoryNum(int inventoryNum) { + this.inventoryNum = inventoryNum; + } + + public Date getInventoryDate() { + return inventoryDate; + } + + public void setInventoryDate(Date inventoryDate) { + this.inventoryDate = inventoryDate; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendance.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendance.java new file mode 100644 index 0000000..0b3f46a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendance.java @@ -0,0 +1,195 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 考勤记录对象 cw_attendance + * + * @author zhukangchao + * @date 2021-11-02 + */ +public class CwAttendance extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 上班时间记录 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上班时间记录", width = 30, dateFormat = "yyyy-MM-dd") + private Date onRecord; + + /** 下班时间记录 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "下班时间记录", width = 30, dateFormat = "yyyy-MM-dd") + private Date downRecord; + + /** 应出勤天数 */ + @Excel(name = "应出勤天数") + private Double shouldBeAttendance; + + /** 实出勤天数 */ + @Excel(name = "实出勤天数") + private Double realAttendance; + + /** 所属日期 */ + @Excel(name = "所属日期") + private String belongsToDate; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sapredFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOnRecord(Date onRecord) + { + this.onRecord = onRecord; + } + + public Date getOnRecord() + { + return onRecord; + } + public void setDownRecord(Date downRecord) + { + this.downRecord = downRecord; + } + + public Date getDownRecord() + { + return downRecord; + } + public void setShouldBeAttendance(Double shouldBeAttendance) + { + this.shouldBeAttendance = shouldBeAttendance; + } + + public Double getShouldBeAttendance() + { + return shouldBeAttendance; + } + public void setRealAttendance(Double realAttendance) + { + this.realAttendance = realAttendance; + } + + public Double getRealAttendance() + { + return realAttendance; + } + public void setBelongsToDate(String belongsToDate) + { + this.belongsToDate = belongsToDate; + } + + public String getBelongsToDate() + { + return belongsToDate; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSapredFour(Long sapredFour) + { + this.sapredFour = sapredFour; + } + + public Long getSapredFour() + { + return sapredFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("onRecord", getOnRecord()) + .append("downRecord", getDownRecord()) + .append("shouldBeAttendance", getShouldBeAttendance()) + .append("realAttendance", getRealAttendance()) + .append("belongsToDate", getBelongsToDate()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sapredThree", getSapredThree()) + .append("sapredFour", getSapredFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetail.java new file mode 100644 index 0000000..df1fe85 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetail.java @@ -0,0 +1,209 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 考勤记录对象 cw_attendance_record_detail + * + * @author zhukangchao + * @date 2022-10-21 + */ +public class CwAttendanceRecordDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String equipmentCode; + + /** 设备识别类型 */ + @Excel(name = "设备识别类型") + private Integer type; + + /** 用户id */ + @Excel(name = "用户id") + private String code; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date dateTime; + + /** 按钮类型 */ + @Excel(name = "按钮类型") + private String buttonType; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 备用字段5 */ + @Excel(name = "备用字段5") + private String sparedFive; + + /** 备用字段6 */ + @Excel(name = "备用字段6") + private String sparedSix; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setEquipmentCode(String equipmentCode) + { + this.equipmentCode = equipmentCode; + } + + public String getEquipmentCode() + { + return equipmentCode; + } + public void setType(Integer type) + { + this.type = type; + } + + public Integer getType() + { + return type; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setDateTime(Date dateTime) + { + this.dateTime = dateTime; + } + + public Date getDateTime() + { + return dateTime; + } + public void setButtonType(String buttonType) + { + this.buttonType = buttonType; + } + + public String getButtonType() + { + return buttonType; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setSparedFive(String sparedFive) + { + this.sparedFive = sparedFive; + } + + public String getSparedFive() + { + return sparedFive; + } + public void setSparedSix(String sparedSix) + { + this.sparedSix = sparedSix; + } + + public String getSparedSix() + { + return sparedSix; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("equipmentCode", getEquipmentCode()) + .append("type", getType()) + .append("code", getCode()) + .append("name", getName()) + .append("dateTime", getDateTime()) + .append("buttonType", getButtonType()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("sparedFive", getSparedFive()) + .append("sparedSix", getSparedSix()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetailData.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetailData.java new file mode 100644 index 0000000..ae3d823 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetailData.java @@ -0,0 +1,20 @@ +package com.ruoyi.project.management.domain; + +public class CwAttendanceRecordDetailData { + + private String button; + + public String getButton() { + return button; + } + + public void setButton(String button) { + this.button = button; + } + + @Override + public String toString() { + return "CwAttendanceRecordDetailData [button=" + button + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetailVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetailVo.java new file mode 100644 index 0000000..578b331 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceRecordDetailVo.java @@ -0,0 +1,31 @@ +package com.ruoyi.project.management.domain; + +public class CwAttendanceRecordDetailVo { + + private int Result; + private String Msg; + private CwAttendanceRecordDetailData Content; + public int getResult() { + return Result; + } + public void setResult(int result) { + Result = result; + } + public String getMsg() { + return Msg; + } + public void setMsg(String msg) { + Msg = msg; + } + public CwAttendanceRecordDetailData getContent() { + return Content; + } + public void setContent(CwAttendanceRecordDetailData content) { + Content = content; + } + @Override + public String toString() { + return "CwAttendanceRecordDetailVo [Result=" + Result + ", Msg=" + Msg + ", Content=" + Content + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUser.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUser.java new file mode 100644 index 0000000..f9d0737 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUser.java @@ -0,0 +1,181 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 员工信息对象 cw_attendance_user + * + * @author zhukangchao + * @date 2022-10-21 + */ +public class CwAttendanceUser extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 手机号 */ + @Excel(name = "手机号") + private String phone; + + /** 别名 */ + @Excel(name = "别名") + private String ttsName; + + /** 员工照片 */ + @Excel(name = "员工照片") + private String faceTemplate; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 备用字段5 */ + @Excel(name = "备用字段5") + private String sparedFive; + + /** 备用字段6 */ + @Excel(name = "备用字段6") + private String sparedSix; + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public String getTtsName() { + return ttsName; + } + + + public void setTtsName(String ttsName) { + this.ttsName = ttsName; + } + + public String getFaceTemplate() { + return faceTemplate; + } + + public void setFaceTemplate(String faceTemplate) { + this.faceTemplate = faceTemplate; + } + + public String getSparedOne() { + return sparedOne; + } + + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + + public String getSparedTwo() { + return sparedTwo; + } + + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + + public Long getSparedThree() { + return sparedThree; + } + + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + + public Long getSparedFour() { + return sparedFour; + } + + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + + public String getSparedFive() { + return sparedFive; + } + + + public void setSparedFive(String sparedFive) { + this.sparedFive = sparedFive; + } + + + public String getSparedSix() { + return sparedSix; + } + + + public void setSparedSix(String sparedSix) { + this.sparedSix = sparedSix; + } + + + public static long getSerialversionuid() { + return serialVersionUID; + } + + + @Override + public String toString() { + return "CwAttendanceUser [id=" + id + ", name=" + name + ", phone=" + phone + ", ttsName=" + ttsName + + ", faceTemplate=" + faceTemplate + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", sparedFive=" + sparedFive + + ", sparedSix=" + sparedSix + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUserData.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUserData.java new file mode 100644 index 0000000..2a64dbf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUserData.java @@ -0,0 +1,116 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +public class CwAttendanceUserData { + + private String cmd; + private String user_id; + private String name; + private String tts_name; + private int edit_mode; + private String face_template; + private String effect_time; + private String id_valid; + private String Ic; + private float confidence_level; + private String phone; + private int mode; + private List valid_cycle; + private int user_type; + + public String getCmd() { + return cmd; + } + public void setCmd(String cmd) { + this.cmd = cmd; + } + public String getUser_id() { + return user_id; + } + public void setUser_id(String user_id) { + this.user_id = user_id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getTts_name() { + return tts_name; + } + public void setTts_name(String tts_name) { + this.tts_name = tts_name; + } + + public int getEdit_mode() { + return edit_mode; + } + public void setEdit_mode(int edit_mode) { + this.edit_mode = edit_mode; + } + public String getFace_template() { + return face_template; + } + public void setFace_template(String face_template) { + this.face_template = face_template; + } + public String getEffect_time() { + return effect_time; + } + public void setEffect_time(String effect_time) { + this.effect_time = effect_time; + } + public String getId_valid() { + return id_valid; + } + public void setId_valid(String id_valid) { + this.id_valid = id_valid; + } + public String getIc() { + return Ic; + } + public void setIc(String ic) { + Ic = ic; + } + public float getConfidence_level() { + return confidence_level; + } + public void setConfidence_level(float confidence_level) { + this.confidence_level = confidence_level; + } + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + public int getMode() { + return mode; + } + public void setMode(int mode) { + this.mode = mode; + } + public List getValid_cycle() { + return valid_cycle; + } + public void setValid_cycle(List valid_cycle) { + this.valid_cycle = valid_cycle; + } + + public int getUser_type() { + return user_type; + } + public void setUser_type(int user_type) { + this.user_type = user_type; + } + @Override + public String toString() { + return "CwAttendanceUserData [cmd=" + cmd + ", user_id=" + user_id + ", name=" + name + ", tts_name=" + tts_name + + ", edit_mode=" + edit_mode + ", face_template=" + face_template + ", effect_time=" + effect_time + + ", id_valid=" + id_valid + ", Ic=" + Ic + ", confidence_level=" + confidence_level + ", phone=" + + phone + ", mode=" + mode + ", valid_cycle=" + valid_cycle + ", user_type=" + user_type + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUserVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUserVo.java new file mode 100644 index 0000000..2eac10d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwAttendanceUserVo.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.management.domain; + +public class CwAttendanceUserVo { + + private String cmd; + private String form; + private String to; + private String extra; + private CwAttendanceUserData data; + public String getCmd() { + return cmd; + } + public void setCmd(String cmd) { + this.cmd = cmd; + } + public String getForm() { + return form; + } + public void setForm(String form) { + this.form = form; + } + public String getTo() { + return to; + } + public void setTo(String to) { + this.to = to; + } + public String getExtra() { + return extra; + } + public void setExtra(String extra) { + this.extra = extra; + } + public CwAttendanceUserData getData() { + return data; + } + public void setData(CwAttendanceUserData data) { + this.data = data; + } + @Override + public String toString() { + return "CwAttendanceUserVo [cmd=" + cmd + ", form=" + form + ", to=" + to + ", extra=" + extra + ", data=" + + data + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwBottonDto.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwBottonDto.java new file mode 100644 index 0000000..fa0d5be --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwBottonDto.java @@ -0,0 +1,19 @@ +package com.ruoyi.project.management.domain; + +public class CwBottonDto { + + private String icon; + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + @Override + public String toString() { + return "CwBottonDto [icon=" + icon + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwButton.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwButton.java new file mode 100644 index 0000000..b45d280 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwButton.java @@ -0,0 +1,150 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 按钮信息对象 cw_button + * + * @author zhukangchao + * @date 2022-10-31 + */ +public class CwButton extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 序号 */ + @Excel(name = "序号") + private Long num; + + /** 按钮名称 */ + @Excel(name = "按钮名称") + private String name; + + /** 图标地址 */ + @Excel(name = "图标地址") + private String image; + + /** 设备号 */ + @Excel(name = "设备号") + private String to; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setNum(Long num) + { + this.num = num; + } + + public Long getNum() + { + return num; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setImage(String image) + { + this.image = image; + } + + public String getImage() + { + return image; + } + public void setTo(String to) + { + this.to = to; + } + + public String getTo() + { + return to; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("num", getNum()) + .append("name", getName()) + .append("image", getImage()) + .append("to", getTo()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwButtonData.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwButtonData.java new file mode 100644 index 0000000..0493df5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwButtonData.java @@ -0,0 +1,26 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +public class CwButtonData { + + private String cmd; + private List value; + public String getCmd() { + return cmd; + } + public void setCmd(String cmd) { + this.cmd = cmd; + } + public List getValue() { + return value; + } + public void setValue(List value) { + this.value = value; + } + @Override + public String toString() { + return "CwButtonData [cmd=" + cmd + ", value=" + value + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwButtonVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwButtonVo.java new file mode 100644 index 0000000..279c20f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwButtonVo.java @@ -0,0 +1,56 @@ +package com.ruoyi.project.management.domain; + +public class CwButtonVo { + + private String cmd; + private String form; + private String to; + private CwButtonData data; + + + public String getCmd() { + return cmd; + } + + + public void setCmd(String cmd) { + this.cmd = cmd; + } + + + public String getForm() { + return form; + } + + + public void setForm(String form) { + this.form = form; + } + + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public CwButtonData getData() { + return data; + } + + + public void setData(CwButtonData data) { + this.data = data; + } + + + @Override + public String toString() { + return "CwButtonVo [cmd=" + cmd + ", form=" + form + ", to=" + to + ", data=" + data + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwCostAnalysis.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwCostAnalysis.java new file mode 100644 index 0000000..a645275 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwCostAnalysis.java @@ -0,0 +1,376 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 成本分析信息对象 cw_cost_analysis + * + * @author zhukangchao + * @date 2023-08-11 + */ +public class CwCostAnalysis extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** uuid */ + private String uuid; + + private Long costStatisticsId; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String code; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String productName; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 制造费用 */ + @Excel(name = "制造费用") + private Double shareExpenses; + + /** 分摊比例 */ + @Excel(name = "权重比例") + private Double proportionOfAllocation; + + /** 工时 */ + @Excel(name = "工时(分钟)") + private Double manHour; + + /** 工时单价 */ + @Excel(name = "工时单价") + private Double manHourUnitPrice; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料图号 */ + @Excel(name = "材料图号") + private String materialsSpecification; + + /** 下料尺寸 */ + @Excel(name = "下料尺寸(mm/mm²)") + private Long measure; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 材料单价 */ + @Excel(name = "材料单价(m/m²)") + private Double materialsUnitPrice; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + //上级id + private String superiorId; + + //工序集合 + private List children; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Long getCostStatisticsId() { + return costStatisticsId; + } + + public void setCostStatisticsId(Long costStatisticsId) { + this.costStatisticsId = costStatisticsId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Long getOneNumber() { + return oneNumber; + } + + public void setOneNumber(Long oneNumber) { + this.oneNumber = oneNumber; + } + + public Long getSumNumber() { + return sumNumber; + } + + public Double getShareExpenses() { + return shareExpenses; + } + + public void setShareExpenses(Double shareExpenses) { + this.shareExpenses = shareExpenses; + } + + public Double getProportionOfAllocation() { + return proportionOfAllocation; + } + + public void setProportionOfAllocation(Double proportionOfAllocation) { + this.proportionOfAllocation = proportionOfAllocation; + } + + public void setSumNumber(Long sumNumber) { + this.sumNumber = sumNumber; + } + + public Double getUnivalence() { + return univalence; + } + + public void setUnivalence(Double univalence) { + this.univalence = univalence; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public Double getManHour() { + return manHour; + } + + public void setManHour(Double manHour) { + this.manHour = manHour; + } + + public Double getManHourUnitPrice() { + return manHourUnitPrice; + } + + public void setManHourUnitPrice(Double manHourUnitPrice) { + this.manHourUnitPrice = manHourUnitPrice; + } + + public String getMaterialsName() { + return materialsName; + } + + public void setMaterialsName(String materialsName) { + this.materialsName = materialsName; + } + + public String getMaterialsSpecification() { + return materialsSpecification; + } + + public void setMaterialsSpecification(String materialsSpecification) { + this.materialsSpecification = materialsSpecification; + } + + public Long getMeasure() { + return measure; + } + + public void setMeasure(Long measure) { + this.measure = measure; + } + + public Long getWorkblank() { + return workblank; + } + + public void setWorkblank(Long workblank) { + this.workblank = workblank; + } + + public Double getMaterialsUnitPrice() { + return materialsUnitPrice; + } + + public void setMaterialsUnitPrice(Double materialsUnitPrice) { + this.materialsUnitPrice = materialsUnitPrice; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public String getSuperiorId() { + return superiorId; + } + + public void setSuperiorId(String superiorId) { + this.superiorId = superiorId; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + @Override + public String toString() { + return "CwCostAnalysis [id=" + id + ", uuid=" + uuid + ", costStatisticsId=" + costStatisticsId + ", code=" + + code + ", productName=" + productName + ", number=" + number + ", materialName=" + materialName + + ", figureNumber=" + figureNumber + ", pieceWeight=" + pieceWeight + ", type=" + type + ", oneNumber=" + + oneNumber + ", sumNumber=" + sumNumber + ", univalence=" + univalence + ", totalPrices=" + totalPrices + + ", shareExpenses=" + shareExpenses + ", proportionOfAllocation=" + proportionOfAllocation + + ", manHour=" + manHour + ", manHourUnitPrice=" + manHourUnitPrice + ", materialsName=" + materialsName + + ", materialsSpecification=" + materialsSpecification + ", measure=" + measure + ", workblank=" + + workblank + ", materialsUnitPrice=" + materialsUnitPrice + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", superiorId=" + + superiorId + ", children=" + children + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwCostStatistics.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwCostStatistics.java new file mode 100644 index 0000000..55cc3bc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwCostStatistics.java @@ -0,0 +1,207 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 成本统计信息对象 cw_cost_statistics + * + * @author zhukangchao + * @date 2023-08-12 + */ +public class CwCostStatistics extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属月份 */ + @Excel(name = "所属月份", width = 30) + private String date; + + /** 厂房折旧费 */ + @Excel(name = "厂房折旧费") + private Double factoryDepreciationCosts; + + /** 设备折旧费 */ + @Excel(name = "设备折旧费") + private Double depreciationCost; + + /** 机物料消耗费用 */ + @Excel(name = "机物料消耗费用") + private Double articleOfConsumption; + + /** 电费 */ + @Excel(name = "电费") + private Double electricCharge; + + /** 人工费 */ + @Excel(name = "人工费") + private Double costOfLabor; + + /** 其他费用 */ + @Excel(name = "其他费用") + private Double otherCharges; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public void setFactoryDepreciationCosts(Double factoryDepreciationCosts) + { + this.factoryDepreciationCosts = factoryDepreciationCosts; + } + + public Double getFactoryDepreciationCosts() + { + return factoryDepreciationCosts; + } + public void setDepreciationCost(Double depreciationCost) + { + this.depreciationCost = depreciationCost; + } + + public Double getDepreciationCost() + { + return depreciationCost; + } + public void setArticleOfConsumption(Double articleOfConsumption) + { + this.articleOfConsumption = articleOfConsumption; + } + + public Double getArticleOfConsumption() + { + return articleOfConsumption; + } + public void setElectricCharge(Double electricCharge) + { + this.electricCharge = electricCharge; + } + + public Double getElectricCharge() + { + return electricCharge; + } + public void setCostOfLabor(Double costOfLabor) + { + this.costOfLabor = costOfLabor; + } + + public Double getCostOfLabor() + { + return costOfLabor; + } + public void setOtherCharges(Double otherCharges) + { + this.otherCharges = otherCharges; + } + + public Double getOtherCharges() + { + return otherCharges; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("date", getDate()) + .append("factoryDepreciationCosts", getFactoryDepreciationCosts()) + .append("depreciationCost", getDepreciationCost()) + .append("articleOfConsumption", getArticleOfConsumption()) + .append("electricCharge", getElectricCharge()) + .append("costOfLabor", getCostOfLabor()) + .append("otherCharges", getOtherCharges()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwDepartment.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwDepartment.java new file mode 100644 index 0000000..8181d65 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwDepartment.java @@ -0,0 +1,135 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 财务部门对象 cw_department + * + * @author zhukangchao + * @date 2021-10-25 + */ +public class CwDepartment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 部门名称 */ + @Excel(name = "部门名称") + private String departmentName; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sapredOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDepartmentName(String departmentName) + { + this.departmentName = departmentName; + } + + public String getDepartmentName() + { + return departmentName; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSapredOne(String sapredOne) + { + this.sapredOne = sapredOne; + } + + public String getSapredOne() + { + return sapredOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("departmentName", getDepartmentName()) + .append("remarks", getRemarks()) + .append("sapredOne", getSapredOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwDimission.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwDimission.java new file mode 100644 index 0000000..102eb9e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwDimission.java @@ -0,0 +1,311 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 员工离职单对象 cw_dimission + * + * @author zhukangchao + * @date 2022-04-09 + */ +public class CwDimission extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 离职原因 */ + @Excel(name = "离职原因") + private String cause; + + /** 离职日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "离职日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date causeDate; + + /** 部门审批 */ + @Excel(name = "部门审批") + private String deptAudit; + + /** 部门审批日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "部门审批日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date deptAuditDate; + + /** 主管审批 */ + @Excel(name = "主管审批") + private String competentDeptAudit; + + /** 主管审批日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "主管审批日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date competentDeptAuditDate; + + /** 人事审批 */ + @Excel(name = "人事审批") + private String personnelAudit; + + /** 人事审批日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "人事审批日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date personnelAuditDate; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadershipAudit; + + /** 总经理审批日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipAuditDate; + + /** 财务审批 */ + @Excel(name = "财务审批") + private String financeAudit; + + /** 财务审批日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "财务审批日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date financeAuditDate; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setCause(String cause) + { + this.cause = cause; + } + + public String getCause() + { + return cause; + } + public void setCauseDate(Date causeDate) + { + this.causeDate = causeDate; + } + + public Date getCauseDate() + { + return causeDate; + } + public void setDeptAudit(String deptAudit) + { + this.deptAudit = deptAudit; + } + + public String getDeptAudit() + { + return deptAudit; + } + public void setDeptAuditDate(Date deptAuditDate) + { + this.deptAuditDate = deptAuditDate; + } + + public Date getDeptAuditDate() + { + return deptAuditDate; + } + public void setCompetentDeptAudit(String competentDeptAudit) + { + this.competentDeptAudit = competentDeptAudit; + } + + public String getCompetentDeptAudit() + { + return competentDeptAudit; + } + public void setCompetentDeptAuditDate(Date competentDeptAuditDate) + { + this.competentDeptAuditDate = competentDeptAuditDate; + } + + public Date getCompetentDeptAuditDate() + { + return competentDeptAuditDate; + } + public void setPersonnelAudit(String personnelAudit) + { + this.personnelAudit = personnelAudit; + } + + public String getPersonnelAudit() + { + return personnelAudit; + } + public void setPersonnelAuditDate(Date personnelAuditDate) + { + this.personnelAuditDate = personnelAuditDate; + } + + public Date getPersonnelAuditDate() + { + return personnelAuditDate; + } + public void setLeadershipAudit(String leadershipAudit) + { + this.leadershipAudit = leadershipAudit; + } + + public String getLeadershipAudit() + { + return leadershipAudit; + } + public void setLeadershipAuditDate(Date leadershipAuditDate) + { + this.leadershipAuditDate = leadershipAuditDate; + } + + public Date getLeadershipAuditDate() + { + return leadershipAuditDate; + } + public void setFinanceAudit(String financeAudit) + { + this.financeAudit = financeAudit; + } + + public String getFinanceAudit() + { + return financeAudit; + } + public void setFinanceAuditDate(Date financeAuditDate) + { + this.financeAuditDate = financeAuditDate; + } + + public Date getFinanceAuditDate() + { + return financeAuditDate; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("cause", getCause()) + .append("causeDate", getCauseDate()) + .append("deptAudit", getDeptAudit()) + .append("deptAuditDate", getDeptAuditDate()) + .append("competentDeptAudit", getCompetentDeptAudit()) + .append("competentDeptAuditDate", getCompetentDeptAuditDate()) + .append("personnelAudit", getPersonnelAudit()) + .append("personnelAuditDate", getPersonnelAuditDate()) + .append("leadershipAudit", getLeadershipAudit()) + .append("leadershipAuditDate", getLeadershipAuditDate()) + .append("financeAudit", getFinanceAudit()) + .append("financeAuditDate", getFinanceAuditDate()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwEmployeeInformation.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwEmployeeInformation.java new file mode 100644 index 0000000..cd33dfe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwEmployeeInformation.java @@ -0,0 +1,481 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 员工信息对象 cw_employee_information + * + * @author zhukangchao + * @date 2021-10-25 + */ +public class CwEmployeeInformation extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String department; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 应出勤天数 */ + @Excel(name = "应出勤天数") + private Long shouldAttendanceNumber; + + /** 月基本工资 */ + @Excel(name = "月基本工资") + private BigDecimal basicMonthlySalary; + + /** 日工资 */ + @Excel(name = "日工资") + private BigDecimal dailyWages; + + /** 补助或奖金 */ + @Excel(name = "补助或奖金") + private BigDecimal subsidyOrBonus; + + /** 计件费 */ + @Excel(name = "计件费") + private BigDecimal incentiveFee; + + /** 交通补助(天) */ + @Excel(name = "交通补助(天)") + private BigDecimal trafficAllowance; + + /** 通讯补助(月) */ + @Excel(name = "通讯补助(月)") + private BigDecimal communicateAllowance; + + /** 住房补助(月) */ + @Excel(name = "住房补助(月)") + private BigDecimal housingAllowance; + + /** 饭补(天) */ + @Excel(name = "饭补(天)") + private BigDecimal mealAllowance; + + /** 是否有公积金 */ + @Excel(name = "是否有公积金") + private Long accumulationFund; + + /** 是否有保险 */ + @Excel(name = "是否有保险") + private Long payInsurance; + + /** 入职日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入职日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date entryDate; + + /** 试用期 */ + @Excel(name = "试用期") + private Long probationPeriod; + + /** 工龄 */ + @Excel(name = "工龄") + private Long seniority; + + /** 养老保险基数 */ + @Excel(name = "养老保险基数") + private BigDecimal endowmentInsurance; + + /** 医疗保险基数 */ + @Excel(name = "医疗保险基数") + private BigDecimal medicalInsurance; + + /** 工伤保险基数 */ + @Excel(name = "工伤保险基数") + private BigDecimal employmentInjuryInsurance; + + /** 生育保险基数 */ + @Excel(name = "生育保险基数") + private BigDecimal maternityInsurance; + + /** 失业保险基数 */ + @Excel(name = "失业保险基数") + private BigDecimal unemploymentInsurance; + + /** 子女教育扣除 */ + @Excel(name = "子女教育扣除") + private BigDecimal childrenEducation; + + /** 赡养老人扣除 */ + @Excel(name = "赡养老人扣除") + private BigDecimal supportTheOld; + + /** 住房贷款扣除 */ + @Excel(name = "住房贷款扣除") + private BigDecimal housingLoans; + + /** 住房租金扣除 */ + @Excel(name = "住房租金扣除") + private BigDecimal housingRents; + + /** 继续教育扣除 */ + @Excel(name = "继续教育扣除") + private BigDecimal adultEducation; + + /** 大病医疗扣除 */ + @Excel(name = "大病医疗扣除") + private BigDecimal treatmentForSeriousDisease; + + /** 本年累计专项扣除 */ + @Excel(name = "本年累计专项扣除") + private BigDecimal specialDeduction; + + /** 本年累计已发工资(元) */ + @Excel(name = "本年累计已发工资(元)") + private BigDecimal totalWages; + + /** 本年累计已缴个税 */ + @Excel(name = "本年累计已缴个税") + private BigDecimal aggregatePersonalIncomeTax; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sapredTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long spreadThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long spreadFour; + + /** 删除标记 */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getShouldAttendanceNumber() { + return shouldAttendanceNumber; + } + + public void setShouldAttendanceNumber(Long shouldAttendanceNumber) { + this.shouldAttendanceNumber = shouldAttendanceNumber; + } + + public BigDecimal getBasicMonthlySalary() { + return basicMonthlySalary; + } + + public void setBasicMonthlySalary(BigDecimal basicMonthlySalary) { + this.basicMonthlySalary = basicMonthlySalary; + } + + public BigDecimal getDailyWages() { + return dailyWages; + } + + public void setDailyWages(BigDecimal dailyWages) { + this.dailyWages = dailyWages; + } + + public BigDecimal getSubsidyOrBonus() { + return subsidyOrBonus; + } + + public void setSubsidyOrBonus(BigDecimal subsidyOrBonus) { + this.subsidyOrBonus = subsidyOrBonus; + } + + public BigDecimal getTrafficAllowance() { + return trafficAllowance; + } + + public void setTrafficAllowance(BigDecimal trafficAllowance) { + this.trafficAllowance = trafficAllowance; + } + + public BigDecimal getCommunicateAllowance() { + return communicateAllowance; + } + + public void setCommunicateAllowance(BigDecimal communicateAllowance) { + this.communicateAllowance = communicateAllowance; + } + + public BigDecimal getHousingAllowance() { + return housingAllowance; + } + + public void setHousingAllowance(BigDecimal housingAllowance) { + this.housingAllowance = housingAllowance; + } + + public BigDecimal getMealAllowance() { + return mealAllowance; + } + + public void setMealAllowance(BigDecimal mealAllowance) { + this.mealAllowance = mealAllowance; + } + + public Long getAccumulationFund() { + return accumulationFund; + } + + public void setAccumulationFund(Long accumulationFund) { + this.accumulationFund = accumulationFund; + } + + public Long getPayInsurance() { + return payInsurance; + } + + public void setPayInsurance(Long payInsurance) { + this.payInsurance = payInsurance; + } + + public Date getEntryDate() { + return entryDate; + } + + public void setEntryDate(Date entryDate) { + this.entryDate = entryDate; + } + + public Long getSeniority() { + return seniority; + } + + public void setSeniority(Long seniority) { + this.seniority = seniority; + } + + public BigDecimal getEndowmentInsurance() { + return endowmentInsurance; + } + + public void setEndowmentInsurance(BigDecimal endowmentInsurance) { + this.endowmentInsurance = endowmentInsurance; + } + + public BigDecimal getMedicalInsurance() { + return medicalInsurance; + } + + public void setMedicalInsurance(BigDecimal medicalInsurance) { + this.medicalInsurance = medicalInsurance; + } + + public BigDecimal getEmploymentInjuryInsurance() { + return employmentInjuryInsurance; + } + + public void setEmploymentInjuryInsurance(BigDecimal employmentInjuryInsurance) { + this.employmentInjuryInsurance = employmentInjuryInsurance; + } + + public BigDecimal getMaternityInsurance() { + return maternityInsurance; + } + + public void setMaternityInsurance(BigDecimal maternityInsurance) { + this.maternityInsurance = maternityInsurance; + } + + public BigDecimal getUnemploymentInsurance() { + return unemploymentInsurance; + } + + public void setUnemploymentInsurance(BigDecimal unemploymentInsurance) { + this.unemploymentInsurance = unemploymentInsurance; + } + + public BigDecimal getChildrenEducation() { + return childrenEducation; + } + + public void setChildrenEducation(BigDecimal childrenEducation) { + this.childrenEducation = childrenEducation; + } + + public BigDecimal getSupportTheOld() { + return supportTheOld; + } + + public void setSupportTheOld(BigDecimal supportTheOld) { + this.supportTheOld = supportTheOld; + } + + public BigDecimal getHousingLoans() { + return housingLoans; + } + + public void setHousingLoans(BigDecimal housingLoans) { + this.housingLoans = housingLoans; + } + + public BigDecimal getHousingRents() { + return housingRents; + } + + public void setHousingRents(BigDecimal housingRents) { + this.housingRents = housingRents; + } + + public BigDecimal getAdultEducation() { + return adultEducation; + } + + public void setAdultEducation(BigDecimal adultEducation) { + this.adultEducation = adultEducation; + } + + public BigDecimal getTreatmentForSeriousDisease() { + return treatmentForSeriousDisease; + } + + public void setTreatmentForSeriousDisease(BigDecimal treatmentForSeriousDisease) { + this.treatmentForSeriousDisease = treatmentForSeriousDisease; + } + + public BigDecimal getSpecialDeduction() { + return specialDeduction; + } + + public void setSpecialDeduction(BigDecimal specialDeduction) { + this.specialDeduction = specialDeduction; + } + + public BigDecimal getTotalWages() { + return totalWages; + } + + public void setTotalWages(BigDecimal totalWages) { + this.totalWages = totalWages; + } + + public BigDecimal getAggregatePersonalIncomeTax() { + return aggregatePersonalIncomeTax; + } + + public void setAggregatePersonalIncomeTax(BigDecimal aggregatePersonalIncomeTax) { + this.aggregatePersonalIncomeTax = aggregatePersonalIncomeTax; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSapredTwo() { + return sapredTwo; + } + + public void setSapredTwo(String sapredTwo) { + this.sapredTwo = sapredTwo; + } + + public Long getSpreadThree() { + return spreadThree; + } + + public void setSpreadThree(Long spreadThree) { + this.spreadThree = spreadThree; + } + + public Long getSpreadFour() { + return spreadFour; + } + + public void setSpreadFour(Long spreadFour) { + this.spreadFour = spreadFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public BigDecimal getIncentiveFee() { + return incentiveFee; + } + + public void setIncentiveFee(BigDecimal incentiveFee) { + this.incentiveFee = incentiveFee; + } + public Long getProbationPeriod() { + return probationPeriod; + } + + public void setProbationPeriod(Long probationPeriod) { + this.probationPeriod = probationPeriod; + } + + @Override + public String toString() { + return "CwEmployeeInformation [id=" + id + ", department=" + department + ", name=" + name + + ", shouldAttendanceNumber=" + shouldAttendanceNumber + ", basicMonthlySalary=" + basicMonthlySalary + + ", dailyWages=" + dailyWages + ", subsidyOrBonus=" + subsidyOrBonus + ", incentiveFee=" + incentiveFee + + ", trafficAllowance=" + trafficAllowance + ", communicateAllowance=" + communicateAllowance + + ", housingAllowance=" + housingAllowance + ", mealAllowance=" + mealAllowance + ", accumulationFund=" + + accumulationFund + ", payInsurance=" + payInsurance + ", entryDate=" + entryDate + + ", probationPeriod=" + probationPeriod + ", seniority=" + seniority + ", endowmentInsurance=" + + endowmentInsurance + ", medicalInsurance=" + medicalInsurance + ", employmentInjuryInsurance=" + + employmentInjuryInsurance + ", maternityInsurance=" + maternityInsurance + ", unemploymentInsurance=" + + unemploymentInsurance + ", childrenEducation=" + childrenEducation + ", supportTheOld=" + + supportTheOld + ", housingLoans=" + housingLoans + ", housingRents=" + housingRents + + ", adultEducation=" + adultEducation + ", treatmentForSeriousDisease=" + treatmentForSeriousDisease + + ", specialDeduction=" + specialDeduction + ", totalWages=" + totalWages + + ", aggregatePersonalIncomeTax=" + aggregatePersonalIncomeTax + ", remarks=" + remarks + ", sparedOne=" + + sparedOne + ", sapredTwo=" + sapredTwo + ", spreadThree=" + spreadThree + ", spreadFour=" + spreadFour + + ", delFlag=" + delFlag + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwEvection.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwEvection.java new file mode 100644 index 0000000..7f6fa0f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwEvection.java @@ -0,0 +1,180 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 出差申请对象 cw_evection + * + * @author zhukangchao + * @date 2021-12-28 + */ +public class CwEvection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 出差日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出差日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date evectionDate; + + /** 出差时长(天) */ + @Excel(name = "出差时长(天)") + private Double evectionNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setEvectionDate(Date evectionDate) + { + this.evectionDate = evectionDate; + } + + public Date getEvectionDate() + { + return evectionDate; + } + public void setEvectionNumber(Double evectionNumber) + { + this.evectionNumber = evectionNumber; + } + + public Double getEvectionNumber() + { + return evectionNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("deptName", getDeptName()) + .append("name", getName()) + .append("evectionDate", getEvectionDate()) + .append("evectionNumber", getEvectionNumber()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwExpenseReimbursement.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwExpenseReimbursement.java new file mode 100644 index 0000000..a9083e0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwExpenseReimbursement.java @@ -0,0 +1,425 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 费用报销信息对象 cw_expense_reimbursement + * + * @author zhukangchao + * @date 2023-11-30 + */ +public class CwExpenseReimbursement extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 申请单编号 */ + @Excel(name = "申请单编号") + private String code; + + /** 报销人姓名 */ + @Excel(name = "报销人姓名") + private String userName; + + /** 申请日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date dateTime; + + /** 部门 */ + @Excel(name = "部门") + private String deptName; + + /** 金额 */ + @Excel(name = "金额") + private Double money; + + /** 报销项目 */ + @Excel(name = "报销项目") + private String product; + + /** 摘要 */ + @Excel(name = "摘要") + private String cause; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 大写金额 */ + @Excel(name = "大写金额") + private String bigMoney; + + /** 是否抵扣借款 */ + private String offsettingDeduction; + + /** 原借款金额 */ + @Excel(name = "原借款金额") + private Double borrowMoney; + + /** 应退(补)款金额 */ + @Excel(name = "应退(补)款金额") + private Double retreatRepairMoney; + + /** 会记主管审批 */ + @Excel(name = "会记主管审批") + private String accountantApprove; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date approveTime; + + /** 复核人 */ + @Excel(name = "复核人") + private String reviewer; + + /** 复核时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "复核时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date reviewerTime; + + /** 出纳审批 */ + @Excel(name = "出纳审批") + private String cashier; + + /** 出纳审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出纳审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cashierTime; + + /** 领导审批 */ + @Excel(name = "领导审批") + private String leadership; + + /** 领导审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "领导审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + /** 未开票金额 */ + @Excel(name = "未开票金额") + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + @Excel(name = "已开票金额") + private BigDecimal invoiceAmount; + + /** 未付款金额 */ + @Excel(name = "未付款金额") + private BigDecimal notProceedsAmount; + + /** 已付款金额 */ + @Excel(name = "已付款金额") + private BigDecimal proceedsAmount; + + /** 结算比例 */ + @Excel(name = "结算比例") + private BigDecimal settlementRatio; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setDateTime(Date dateTime) + { + this.dateTime = dateTime; + } + + public Date getDateTime() + { + return dateTime; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setMoney(Double money) + { + this.money = money; + } + + public Double getMoney() + { + return money; + } + public void setProduct(String product) + { + this.product = product; + } + + public String getProduct() + { + return product; + } + public void setCause(String cause) + { + this.cause = cause; + } + + public String getCause() + { + return cause; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setBigMoney(String bigMoney) + { + this.bigMoney = bigMoney; + } + + public String getBigMoney() + { + return bigMoney; + } + + public String getOffsettingDeduction() { + return offsettingDeduction; + } + + public void setOffsettingDeduction(String offsettingDeduction) { + this.offsettingDeduction = offsettingDeduction; + } + + public void setBorrowMoney(Double borrowMoney) + { + this.borrowMoney = borrowMoney; + } + + public Double getBorrowMoney() + { + return borrowMoney; + } + public void setRetreatRepairMoney(Double retreatRepairMoney) + { + this.retreatRepairMoney = retreatRepairMoney; + } + + public Double getRetreatRepairMoney() + { + return retreatRepairMoney; + } + public void setAccountantApprove(String accountantApprove) + { + this.accountantApprove = accountantApprove; + } + + public String getAccountantApprove() + { + return accountantApprove; + } + public void setApproveTime(Date approveTime) + { + this.approveTime = approveTime; + } + + public Date getApproveTime() + { + return approveTime; + } + public void setReviewer(String reviewer) + { + this.reviewer = reviewer; + } + + public String getReviewer() + { + return reviewer; + } + public void setReviewerTime(Date reviewerTime) + { + this.reviewerTime = reviewerTime; + } + + public Date getReviewerTime() + { + return reviewerTime; + } + public void setCashier(String cashier) + { + this.cashier = cashier; + } + + public String getCashier() + { + return cashier; + } + public void setCashierTime(Date cashierTime) + { + this.cashierTime = cashierTime; + } + + public Date getCashierTime() + { + return cashierTime; + } + public void setLeadership(String leadership) + { + this.leadership = leadership; + } + + public String getLeadership() + { + return leadership; + } + public void setLeadershipTime(Date leadershipTime) + { + this.leadershipTime = leadershipTime; + } + + public Date getLeadershipTime() + { + return leadershipTime; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "CwExpenseReimbursement [id=" + id + ", code=" + code + ", userName=" + userName + ", dateTime=" + + dateTime + ", deptName=" + deptName + ", money=" + money + ", product=" + product + ", cause=" + cause + + ", remarks=" + remarks + ", bigMoney=" + bigMoney + ", offsettingDeduction=" + offsettingDeduction + + ", borrowMoney=" + borrowMoney + ", retreatRepairMoney=" + retreatRepairMoney + ", accountantApprove=" + + accountantApprove + ", approveTime=" + approveTime + ", reviewer=" + reviewer + ", reviewerTime=" + + reviewerTime + ", cashier=" + cashier + ", cashierTime=" + cashierTime + ", leadership=" + leadership + + ", leadershipTime=" + leadershipTime + ", notInvoiceAmount=" + notInvoiceAmount + ", invoiceAmount=" + + invoiceAmount + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + proceedsAmount + + ", settlementRatio=" + settlementRatio + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwJobs.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwJobs.java new file mode 100644 index 0000000..a2e6516 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwJobs.java @@ -0,0 +1,149 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 岗位对象 cw_jobs + * + * @author zhukangchao + * @date 2021-12-16 + */ +public class CwJobs extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 岗位名称 */ + @Excel(name = "岗位名称") + private String jobsName; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 工作时长 */ + @Excel(name = "工作时长") + private Double workHours; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setJobsName(String jobsName) + { + this.jobsName = jobsName; + } + + public String getJobsName() + { + return jobsName; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setWorkHours(Double workHours) + { + this.workHours = workHours; + } + + public Double getWorkHours() + { + return workHours; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("jobsName", getJobsName()) + .append("deptName", getDeptName()) + .append("workHours", getWorkHours()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwLeaveRecord.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwLeaveRecord.java new file mode 100644 index 0000000..df06850 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwLeaveRecord.java @@ -0,0 +1,194 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 请假记录对象 cw_leave_record + * + * @author zhukangchao + * @date 2021-12-22 + */ +public class CwLeaveRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 请假日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "请假日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date leaveDate; + + /** 请假原因 */ + @Excel(name = "请假原因") + private String reasonForLeave; + + /** 请假时长 */ + @Excel(name = "请假时长") + private Double timeNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setLeaveDate(Date leaveDate) + { + this.leaveDate = leaveDate; + } + + public Date getLeaveDate() + { + return leaveDate; + } + public void setReasonForLeave(String reasonForLeave) + { + this.reasonForLeave = reasonForLeave; + } + + public String getReasonForLeave() + { + return reasonForLeave; + } + public void setTimeNumber(Double timeNumber) + { + this.timeNumber = timeNumber; + } + + public Double getTimeNumber() + { + return timeNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("deptName", getDeptName()) + .append("name", getName()) + .append("leaveDate", getLeaveDate()) + .append("reasonForLeave", getReasonForLeave()) + .append("timeNumber", getTimeNumber()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwLevelOfEducation.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwLevelOfEducation.java new file mode 100644 index 0000000..c2faa71 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwLevelOfEducation.java @@ -0,0 +1,151 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 补助对象 cw_level_of_education + * + * @author zhukangchao + * @date 2021-12-17 + */ +public class CwLevelOfEducation extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 补助项名称 */ + @Excel(name = "补助项名称") + private String subsidiesName; + + /** 补助金额 */ + @Excel(name = "补助金额") + private BigDecimal subsidies; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setSubsidiesName(String subsidiesName) + { + this.subsidiesName = subsidiesName; + } + + public String getSubsidiesName() + { + return subsidiesName; + } + + public BigDecimal getSubsidies() { + return subsidies; + } + + public void setSubsidies(BigDecimal subsidies) { + this.subsidies = subsidies; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("subsidiesName", getSubsidiesName()) + .append("subsidies", getSubsidies()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwLogisticsFeesInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwLogisticsFeesInfo.java new file mode 100644 index 0000000..ca3c41d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwLogisticsFeesInfo.java @@ -0,0 +1,394 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物流费用信息对象 cw_logistics_fees_info + * + * @author zhukangchao + * @date 2023-11-30 + */ +public class CwLogisticsFeesInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** id集合 */ + private Long[] ids; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 关联单据编号 */ + @Excel(name = "关联单据编号") + private String relevanceCode; + + /** 关联单据类型 */ + @Excel(name = "关联单据类型") + private String relevanceType; + + /** 申请人 */ + @Excel(name = "申请人") + private String userName; + + /** 部门 */ + @Excel(name = "部门") + private String deptName; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date date; + + /** 金额 */ + @Excel(name = "金额") + private Double money; + + /** 大写金额 */ + @Excel(name = "大写金额") + private String bigMoney; + + /** 事由 */ + @Excel(name = "事由") + private String cause; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 审批人 */ + @Excel(name = "审批人") + private String approver; + + /** 审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date approverTime; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 账号 */ + @Excel(name = "账号") + private String accountNumber; + + /** 开户行 */ + @Excel(name = "开户行") + private String openingBank; + + /** 未开票金额 */ + @Excel(name = "未开票金额") + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + @Excel(name = "已开票金额") + private BigDecimal invoiceAmount; + + /** 未付款金额 */ + @Excel(name = "未付款金额") + private BigDecimal notProceedsAmount; + + /** 已付款金额 */ + @Excel(name = "已付款金额") + private BigDecimal proceedsAmount; + + /** 结算比例 */ + @Excel(name = "结算比例") + private BigDecimal settlementRatio; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + //付款金额 + private Double paymentAmount; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setRelevanceCode(String relevanceCode) + { + this.relevanceCode = relevanceCode; + } + + public String getRelevanceCode() + { + return relevanceCode; + } + public void setRelevanceType(String relevanceType) + { + this.relevanceType = relevanceType; + } + + public String getRelevanceType() + { + return relevanceType; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + public void setMoney(Double money) + { + this.money = money; + } + + public Double getMoney() + { + return money; + } + public void setBigMoney(String bigMoney) + { + this.bigMoney = bigMoney; + } + + public String getBigMoney() + { + return bigMoney; + } + public void setCause(String cause) + { + this.cause = cause; + } + + public String getCause() + { + return cause; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setApprover(String approver) + { + this.approver = approver; + } + + public String getApprover() + { + return approver; + } + public void setApproverTime(Date approverTime) + { + this.approverTime = approverTime; + } + + public Date getApproverTime() + { + return approverTime; + } + public void setPayWay(String payWay) + { + this.payWay = payWay; + } + + public String getPayWay() + { + return payWay; + } + public void setUnitName(String unitName) + { + this.unitName = unitName; + } + + public String getUnitName() + { + return unitName; + } + public void setAccountNumber(String accountNumber) + { + this.accountNumber = accountNumber; + } + + public String getAccountNumber() + { + return accountNumber; + } + public void setOpeningBank(String openingBank) + { + this.openingBank = openingBank; + } + + public String getOpeningBank() + { + return openingBank; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + + @Override + public String toString() { + return "CwLogisticsFeesInfo [id=" + id + ", ids=" + Arrays.toString(ids) + ", code=" + code + ", relevanceCode=" + + relevanceCode + ", relevanceType=" + relevanceType + ", userName=" + userName + ", deptName=" + + deptName + ", date=" + date + ", money=" + money + ", bigMoney=" + bigMoney + ", cause=" + cause + + ", remarks=" + remarks + ", approver=" + approver + ", approverTime=" + approverTime + ", payWay=" + + payWay + ", unitName=" + unitName + ", accountNumber=" + accountNumber + ", openingBank=" + + openingBank + ", notInvoiceAmount=" + notInvoiceAmount + ", invoiceAmount=" + invoiceAmount + + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + proceedsAmount + + ", settlementRatio=" + settlementRatio + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", paymentAmount=" + paymentAmount + + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwLogsotocsFeesMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwLogsotocsFeesMaterial.java new file mode 100644 index 0000000..d4d17d7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwLogsotocsFeesMaterial.java @@ -0,0 +1,220 @@ +package com.ruoyi.project.management.domain; + +import java.util.Arrays; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物流费用和入库单关联对象 cw_logsotocs_fees_material + * + * @author zhukangchao + * @date 2023-12-13 + */ +public class CwLogsotocsFeesMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + //id集合 + private Long[] ids; + + //idTwo集合 + private Long[] idsTwo; + + /** 物流费用单id */ + @Excel(name = "物流费用单id") + private Long logisticsFeesInfoId; + + /** 入库单详情id */ + @Excel(name = "入库单详情id") + private Long productReceiptMaterialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 物料图号 */ + @Excel(name = "物料图号") + private String figureNumber; + + /** 物料单价 */ + @Excel(name = "物料单价") + private Double unitPrice; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 费用占比 */ + @Excel(name = "费用占比") + private Double costProportion; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 备用字段5 */ + @Excel(name = "备用字段5") + private Double sparedFive; + + /** 备用字段6 */ + @Excel(name = "备用字段6") + private Double sapredSix; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Long[] getIdsTwo() { + return idsTwo; + } + + public void setIdsTwo(Long[] idsTwo) { + this.idsTwo = idsTwo; + } + + public Long getLogisticsFeesInfoId() { + return logisticsFeesInfoId; + } + + public void setLogisticsFeesInfoId(Long logisticsFeesInfoId) { + this.logisticsFeesInfoId = logisticsFeesInfoId; + } + + public Long getProductReceiptMaterialId() { + return productReceiptMaterialId; + } + + public void setProductReceiptMaterialId(Long productReceiptMaterialId) { + this.productReceiptMaterialId = productReceiptMaterialId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public Double getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(Double unitPrice) { + this.unitPrice = unitPrice; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Double getCostProportion() { + return costProportion; + } + + public void setCostProportion(Double costProportion) { + this.costProportion = costProportion; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Double getSparedFive() { + return sparedFive; + } + + public void setSparedFive(Double sparedFive) { + this.sparedFive = sparedFive; + } + + public Double getSapredSix() { + return sapredSix; + } + + public void setSapredSix(Double sapredSix) { + this.sapredSix = sapredSix; + } + + @Override + public String toString() { + return "CwLogsotocsFeesMaterial [id=" + id + ", ids=" + Arrays.toString(ids) + ", idsTwo=" + + Arrays.toString(idsTwo) + ", logisticsFeesInfoId=" + logisticsFeesInfoId + + ", productReceiptMaterialId=" + productReceiptMaterialId + ", name=" + name + ", figureNumber=" + + figureNumber + ", unitPrice=" + unitPrice + ", quantity=" + quantity + ", costProportion=" + + costProportion + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + + sparedThree + ", sparedFour=" + sparedFour + ", sparedFive=" + sparedFive + ", sapredSix=" + sapredSix + + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwNewAttendance.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewAttendance.java new file mode 100644 index 0000000..86493dd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewAttendance.java @@ -0,0 +1,321 @@ +package com.ruoyi.project.management.domain; + +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +import net.sf.jsqlparser.expression.DateTimeLiteralExpression.DateTime; + +/** + * 新考勤记录对象 cw_new_attendance + * + * @author zhukangchao + * @date 2021-12-16 + */ +public class CwNewAttendance extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 统计表id */ + private Long statisticalId; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 员工编号 */ + @Excel(name = "员工编号") + private String code; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 考勤规则 */ + @Excel(name = "考勤规则") + private String rules; + + /** 考勤日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "考勤日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date attendanceDate; + + /** 上班时间 */ + @JsonFormat(pattern = "HH:mm:ss") + @Excel(name = "上班时间", width = 30, dateFormat = "HH:mm:ss") + private Date workStartTime; + + /** 下班时间 */ + @JsonFormat(pattern = "HH:mm:ss") + @Excel(name = "下班时间", width = 30, dateFormat = "HH:mm:ss") + private Date workEndTime; + + /** 工作时长 */ + @Excel(name = "工作时长") + private Double workSum; + + /** 迟到次数 */ + @Excel(name = "迟到次数") + private Long lateNumber; + + /** 早退次数 */ + @Excel(name = "早退次数") + private Long leaveEarlyNumber; + + /** 缺勤次数 */ + @Excel(name = "缺勤次数") + private Long absenteeismNumber; + + /** 请假天数 */ + @Excel(name = "请假天数") + private Double leaveDays; + + /** 夜班次数 */ + @Excel(name = "夜班次数") + private Long nightNumber; + + /** 中班次数 */ + @Excel(name = "中班次数") + private Long middleShiftNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getStatisticalId() { + return statisticalId; + } + + public void setStatisticalId(Long statisticalId) { + this.statisticalId = statisticalId; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setAttendanceDate(Date attendanceDate) + { + this.attendanceDate = attendanceDate; + } + + public Date getAttendanceDate() + { + return attendanceDate; + } + + public String getRules() { + return rules; + } + + public void setRules(String rules) { + this.rules = rules; + } + + public void setWorkStartTime(Date workStartTime) + { + this.workStartTime = workStartTime; + } + + public Date getWorkStartTime() + { + return workStartTime; + } + public void setWorkEndTime(Date workEndTime) + { + this.workEndTime = workEndTime; + } + + public Date getWorkEndTime() + { + return workEndTime; + } + public void setWorkSum(Double workSum) + { + this.workSum = workSum; + } + + public Double getWorkSum() + { + return workSum; + } + public void setLateNumber(Long lateNumber) + { + this.lateNumber = lateNumber; + } + + public Long getLateNumber() + { + return lateNumber; + } + public void setLeaveEarlyNumber(Long leaveEarlyNumber) + { + this.leaveEarlyNumber = leaveEarlyNumber; + } + + public Long getLeaveEarlyNumber() + { + return leaveEarlyNumber; + } + public void setAbsenteeismNumber(Long absenteeismNumber) + { + this.absenteeismNumber = absenteeismNumber; + } + + public Long getAbsenteeismNumber() + { + return absenteeismNumber; + } + public void setLeaveDays(Double leaveDays) + { + this.leaveDays = leaveDays; + } + + public Double getLeaveDays() + { + return leaveDays; + } + + public Long getNightNumber() { + return nightNumber; + } + + public void setNightNumber(Long nightNumber) { + this.nightNumber = nightNumber; + } + + public Long getMiddleShiftNumber() { + return middleShiftNumber; + } + + public void setMiddleShiftNumber(Long middleShiftNumber) { + this.middleShiftNumber = middleShiftNumber; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "CwNewAttendance [id=" + id + ", statisticalId=" + statisticalId + ", name=" + name + ", code=" + code + + ", deptName=" + deptName + ", rules=" + rules + ", attendanceDate=" + attendanceDate + + ", workStartTime=" + workStartTime + ", workEndTime=" + workEndTime + ", workSum=" + workSum + + ", lateNumber=" + lateNumber + ", leaveEarlyNumber=" + leaveEarlyNumber + ", absenteeismNumber=" + + absenteeismNumber + ", leaveDays=" + leaveDays + ", nightNumber=" + nightNumber + + ", middleShiftNumber=" + middleShiftNumber + ", remarks=" + remarks + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwNewAttendanceStatistical.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewAttendanceStatistical.java new file mode 100644 index 0000000..c7a6a82 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewAttendanceStatistical.java @@ -0,0 +1,273 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 考勤记录统计对象 cw_new_attendance_statistical + * + * @author zhukangchao + * @date 2022-03-30 + */ +public class CwNewAttendanceStatistical extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属月份 */ + @Excel(name = "所属月份", width = 30, dateFormat = "yyyy-MM-dd") + private String date; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 应出勤(小时) */ + @Excel(name = "应出勤(小时)") + private Long shouldAttendanceNumber; + + /** 实出勤(小时) */ + @Excel(name = "实出勤(小时)") + private Long realAttendance; + + /** 基本出勤(小时) */ + @Excel(name = "基本出勤(小时)") + private Long essentialAttendance; + + /** 加班时长 */ + @Excel(name = "加班时长") + private Long workOvertimeNumber; + + /** 请假时长 */ + @Excel(name = "请假时长") + private Long absenteeism; + + /** 迟到次数 */ + @Excel(name = "迟到次数") + private Long lateNumber; + + /** 早退次数 */ + @Excel(name = "早退次数") + private Long leaveEarly; + + /** 缺卡次数 */ + @Excel(name = "缺卡次数") + private Long lessNumber; + + /** 夜班次数 */ + @Excel(name = "夜班次数") + private Long nightNumber; + + /** 中班次数 */ + @Excel(name = "中班次数") + private Long middleShiftNumber; + + /** 删除标记 */ + private String delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDate(String date) + { + this.date = date; + } + + public String getDate() + { + return date; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setRealAttendance(Long realAttendance) + { + this.realAttendance = realAttendance; + } + + public Long getRealAttendance() + { + return realAttendance; + } + + public Long getEssentialAttendance() { + return essentialAttendance; + } + + public void setEssentialAttendance(Long essentialAttendance) { + this.essentialAttendance = essentialAttendance; + } + + public Long getShouldAttendanceNumber() { + return shouldAttendanceNumber; + } + + public void setShouldAttendanceNumber(Long shouldAttendanceNumber) { + this.shouldAttendanceNumber = shouldAttendanceNumber; + } + + public Long getWorkOvertimeNumber() { + return workOvertimeNumber; + } + + public void setWorkOvertimeNumber(Long workOvertimeNumber) { + this.workOvertimeNumber = workOvertimeNumber; + } + + public Long getAbsenteeism() { + return absenteeism; + } + + public void setAbsenteeism(Long absenteeism) { + this.absenteeism = absenteeism; + } + + public void setLateNumber(Long lateNumber) + { + this.lateNumber = lateNumber; + } + + public Long getLateNumber() + { + return lateNumber; + } + public void setLeaveEarly(Long leaveEarly) + { + this.leaveEarly = leaveEarly; + } + + public Long getLeaveEarly() + { + return leaveEarly; + } + public void setLessNumber(Long lessNumber) + { + this.lessNumber = lessNumber; + } + + public Long getLessNumber() + { + return lessNumber; + } + + public Long getNightNumber() { + return nightNumber; + } + + public void setNightNumber(Long nightNumber) { + this.nightNumber = nightNumber; + } + + public Long getMiddleShiftNumber() { + return middleShiftNumber; + } + + public void setMiddleShiftNumber(Long middleShiftNumber) { + this.middleShiftNumber = middleShiftNumber; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "CwNewAttendanceStatistical [id=" + id + ", date=" + date + ", name=" + name + ", deptName=" + deptName + + ", shouldAttendanceNumber=" + shouldAttendanceNumber + ", realAttendance=" + realAttendance + + ", essentialAttendance=" + essentialAttendance + ", workOvertimeNumber=" + workOvertimeNumber + + ", absenteeism=" + absenteeism + ", lateNumber=" + lateNumber + ", leaveEarly=" + leaveEarly + + ", lessNumber=" + lessNumber + ", nightNumber=" + nightNumber + ", middleShiftNumber=" + + middleShiftNumber + ", delFlag=" + delFlag + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sapredThree=" + sapredThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwNewEmployeeInformation.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewEmployeeInformation.java new file mode 100644 index 0000000..e96ec53 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewEmployeeInformation.java @@ -0,0 +1,741 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 新员工基本信息对象 cw_new_employee_information + * + * @author zhukangchao + * @date 2021-12-16 + */ +public class CwNewEmployeeInformation extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 邮箱 */ + private String email; + + /** 岗位 */ + @Excel(name = "岗位") + private String jobs; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 基本工资 */ + @Excel(name = "基本工资") + private BigDecimal basicSalary; + + /** 岗位工资 */ + @Excel(name = "岗位工资") + private BigDecimal jobsSalary; + + /** 日薪 */ + @Excel(name = "日薪") + private BigDecimal dailyWage; + + /** 时薪 */ + @Excel(name = "时薪") + private BigDecimal hoursSalary; + + /** 班次时长 */ + @Excel(name = "班次时长") + private Double shiftTheLength; + + /** 学历 */ + @Excel(name = "学历") + private String levelOfEducation; + + /** 合同期限 */ + @Excel(name = "合同期限") + private Integer contractYear; + + /** 社保状态 */ + @Excel(name = "社保状态") + private String socialSecurityStatus; + + /** 入职日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入职日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date entryDate; + + /** 工龄 */ + @Excel(name = "工龄") + private Long seniority; + + /** 试用期期限 */ + @Excel(name = "试用期期限") + private Integer probationPeriod; + + /** 学历补助 */ + @Excel(name = "学历补助") + private BigDecimal levelOfEducationSubsidies; + + /** 合同补助 */ + @Excel(name = "合同补助") + private BigDecimal contractSubsidies; + + /** 工龄补助 */ + @Excel(name = "工龄补助") + private BigDecimal senioritySubsidies; + + /** 社保补助 */ + @Excel(name = "社保补助") + private BigDecimal socialSecuritySubsidies; + + /** 全勤奖 */ + @Excel(name = "全勤奖") + private BigDecimal fullFrequentlySubsidies; + + /** 夜班补助 */ + @Excel(name = "夜班补助") + private BigDecimal nightShiftSubsidies; + + /** 夜餐补助 */ + @Excel(name = "夜餐补助") + private BigDecimal dinnerSubsidies; + + /** 固定补助 */ + @Excel(name = "固定补助") + private BigDecimal fixedAllowance; + + /** 其他补助 */ + @Excel(name = "其他补助") + private BigDecimal otherSubsidies; + + /** 其他扣款 */ + @Excel(name = "其他扣款") + private BigDecimal deductions; + + /** 是否有加班费 */ + @Excel(name = "是否有加班费") + private String isOvertimePay; + + /** 虚拟工位(0:真实,1:虚拟) */ + @Excel(name = "虚拟工位(0:真实,1:虚拟)") + private Integer virtualWorkstation; + + /** 养老保险 */ + @Excel(name = "养老保险") + private BigDecimal endowmentInsurance; + + /** 医疗保险 */ + @Excel(name = "医疗保险") + private BigDecimal medicalInsurance; + + /** 工伤保险 */ + @Excel(name = "工伤保险") + private BigDecimal employmentInjuryInsurance; + + /** 生育保险 */ + @Excel(name = "生育保险") + private BigDecimal maternityInsurance; + + /** 失业保险 */ + @Excel(name = "失业保险") + private BigDecimal unemploymentInsurance; + + /** 子女教育 */ + @Excel(name = "子女教育") + private BigDecimal childrenEducation; + + /** 赡养老人 */ + @Excel(name = "赡养老人") + private BigDecimal supportTheOld; + + /** 住房贷款 */ + @Excel(name = "住房贷款") + private BigDecimal housingLoans; + + /** 住房租金 */ + @Excel(name = "住房租金") + private BigDecimal housingRents; + + /** 继续教育 */ + @Excel(name = "继续教育") + private BigDecimal adultEducation; + + /** 大病医疗 */ + @Excel(name = "大病医疗") + private BigDecimal treatmentForSeriousDisease; + + /** 本年累计专项附加扣除 */ + @Excel(name = "本年累计专项附加扣除") + private BigDecimal specialDeduction; + + /** 本年累计已发工资 */ + @Excel(name = "本年累计已发工资") + private BigDecimal totalWages; + + /** 本年累计已缴个税 */ + @Excel(name = "本年累计已缴个税") + private BigDecimal aggregatePersonalIncomeTax; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 离职标记 */ + private Integer dimission; + + /** 离职日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "离职日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date dimissionDate; + + /**离职补助扣款*/ +// @Excel(name = "离职补助扣款") + private BigDecimal subsidyDeductMoney; + + /** 早餐补助 */ + @Excel(name = "早餐补助") + private Double breakfastSubsidy; + + /** 午餐补助 */ + @Excel(name = "午餐补助") + private Double lunchSubsidy; + + /** 晚餐补助 */ + @Excel(name = "晚餐补助") + private Double supperSubsidy; + + /** 账号 */ + @Excel(name = "账号") + private String accountNumber; + + /** 开户行 */ + @Excel(name = "开户行") + private String openingBank; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 备用字段5 */ + @Excel(name = "备用字段5") + private BigDecimal sparedFive; + + /** 备用字段6 */ + @Excel(name = "备用字段6") + private BigDecimal sparedSix; + + /** 删除标记 */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getJobs() { + return jobs; + } + + public void setJobs(String jobs) { + this.jobs = jobs; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public BigDecimal getBasicSalary() { + return basicSalary; + } + + public void setBasicSalary(BigDecimal basicSalary) { + this.basicSalary = basicSalary; + } + + public BigDecimal getJobsSalary() { + return jobsSalary; + } + + public void setJobsSalary(BigDecimal jobsSalary) { + this.jobsSalary = jobsSalary; + } + + public BigDecimal getDailyWage() { + return dailyWage; + } + + public void setDailyWage(BigDecimal dailyWage) { + this.dailyWage = dailyWage; + } + + public BigDecimal getHoursSalary() { + return hoursSalary; + } + + public void setHoursSalary(BigDecimal hoursSalary) { + this.hoursSalary = hoursSalary; + } + + public Double getShiftTheLength() { + return shiftTheLength; + } + + public void setShiftTheLength(Double shiftTheLength) { + this.shiftTheLength = shiftTheLength; + } + + public String getLevelOfEducation() { + return levelOfEducation; + } + + public void setLevelOfEducation(String levelOfEducation) { + this.levelOfEducation = levelOfEducation; + } + + public Integer getContractYear() { + return contractYear; + } + + public void setContractYear(Integer contractYear) { + this.contractYear = contractYear; + } + + public String getSocialSecurityStatus() { + return socialSecurityStatus; + } + + public void setSocialSecurityStatus(String socialSecurityStatus) { + this.socialSecurityStatus = socialSecurityStatus; + } + + public Date getEntryDate() { + return entryDate; + } + + public void setEntryDate(Date entryDate) { + this.entryDate = entryDate; + } + + public Long getSeniority() { + return seniority; + } + + public void setSeniority(Long seniority) { + this.seniority = seniority; + } + + public Integer getProbationPeriod() { + return probationPeriod; + } + + public void setProbationPeriod(Integer probationPeriod) { + this.probationPeriod = probationPeriod; + } + + public BigDecimal getLevelOfEducationSubsidies() { + return levelOfEducationSubsidies; + } + + public void setLevelOfEducationSubsidies(BigDecimal levelOfEducationSubsidies) { + this.levelOfEducationSubsidies = levelOfEducationSubsidies; + } + + public BigDecimal getContractSubsidies() { + return contractSubsidies; + } + + public void setContractSubsidies(BigDecimal contractSubsidies) { + this.contractSubsidies = contractSubsidies; + } + + public BigDecimal getSenioritySubsidies() { + return senioritySubsidies; + } + + public void setSenioritySubsidies(BigDecimal senioritySubsidies) { + this.senioritySubsidies = senioritySubsidies; + } + + public BigDecimal getSocialSecuritySubsidies() { + return socialSecuritySubsidies; + } + + public void setSocialSecuritySubsidies(BigDecimal socialSecuritySubsidies) { + this.socialSecuritySubsidies = socialSecuritySubsidies; + } + + public BigDecimal getFullFrequentlySubsidies() { + return fullFrequentlySubsidies; + } + + public void setFullFrequentlySubsidies(BigDecimal fullFrequentlySubsidies) { + this.fullFrequentlySubsidies = fullFrequentlySubsidies; + } + + public BigDecimal getNightShiftSubsidies() { + return nightShiftSubsidies; + } + + public void setNightShiftSubsidies(BigDecimal nightShiftSubsidies) { + this.nightShiftSubsidies = nightShiftSubsidies; + } + + public BigDecimal getDinnerSubsidies() { + return dinnerSubsidies; + } + + public void setDinnerSubsidies(BigDecimal dinnerSubsidies) { + this.dinnerSubsidies = dinnerSubsidies; + } + + public BigDecimal getOtherSubsidies() { + return otherSubsidies; + } + + public void setOtherSubsidies(BigDecimal otherSubsidies) { + this.otherSubsidies = otherSubsidies; + } + + public Integer getVirtualWorkstation() { + return virtualWorkstation; + } + + public void setVirtualWorkstation(Integer virtualWorkstation) { + this.virtualWorkstation = virtualWorkstation; + } + + public BigDecimal getEndowmentInsurance() { + return endowmentInsurance; + } + + public void setEndowmentInsurance(BigDecimal endowmentInsurance) { + this.endowmentInsurance = endowmentInsurance; + } + + public BigDecimal getMedicalInsurance() { + return medicalInsurance; + } + + public void setMedicalInsurance(BigDecimal medicalInsurance) { + this.medicalInsurance = medicalInsurance; + } + + public BigDecimal getEmploymentInjuryInsurance() { + return employmentInjuryInsurance; + } + + public void setEmploymentInjuryInsurance(BigDecimal employmentInjuryInsurance) { + this.employmentInjuryInsurance = employmentInjuryInsurance; + } + + public BigDecimal getMaternityInsurance() { + return maternityInsurance; + } + + public void setMaternityInsurance(BigDecimal maternityInsurance) { + this.maternityInsurance = maternityInsurance; + } + + public BigDecimal getUnemploymentInsurance() { + return unemploymentInsurance; + } + + public void setUnemploymentInsurance(BigDecimal unemploymentInsurance) { + this.unemploymentInsurance = unemploymentInsurance; + } + + public BigDecimal getChildrenEducation() { + return childrenEducation; + } + + public void setChildrenEducation(BigDecimal childrenEducation) { + this.childrenEducation = childrenEducation; + } + + public BigDecimal getSupportTheOld() { + return supportTheOld; + } + + public void setSupportTheOld(BigDecimal supportTheOld) { + this.supportTheOld = supportTheOld; + } + + public BigDecimal getHousingLoans() { + return housingLoans; + } + + public void setHousingLoans(BigDecimal housingLoans) { + this.housingLoans = housingLoans; + } + + public BigDecimal getHousingRents() { + return housingRents; + } + + public void setHousingRents(BigDecimal housingRents) { + this.housingRents = housingRents; + } + + public BigDecimal getAdultEducation() { + return adultEducation; + } + + public void setAdultEducation(BigDecimal adultEducation) { + this.adultEducation = adultEducation; + } + + public BigDecimal getTreatmentForSeriousDisease() { + return treatmentForSeriousDisease; + } + + public void setTreatmentForSeriousDisease(BigDecimal treatmentForSeriousDisease) { + this.treatmentForSeriousDisease = treatmentForSeriousDisease; + } + + public BigDecimal getSpecialDeduction() { + return specialDeduction; + } + + public void setSpecialDeduction(BigDecimal specialDeduction) { + this.specialDeduction = specialDeduction; + } + + public BigDecimal getTotalWages() { + return totalWages; + } + + public void setTotalWages(BigDecimal totalWages) { + this.totalWages = totalWages; + } + + public BigDecimal getAggregatePersonalIncomeTax() { + return aggregatePersonalIncomeTax; + } + + public void setAggregatePersonalIncomeTax(BigDecimal aggregatePersonalIncomeTax) { + this.aggregatePersonalIncomeTax = aggregatePersonalIncomeTax; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + public Integer getDimission() { + return dimission; + } + + public void setDimission(Integer dimission) { + this.dimission = dimission; + } + + public Date getDimissionDate() { + return dimissionDate; + } + + public void setDimissionDate(Date dimissionDate) { + this.dimissionDate = dimissionDate; + } + public BigDecimal getSubsidyDeductMoney() { + return subsidyDeductMoney; + } + + public void setSubsidyDeductMoney(BigDecimal subsidyDeductMoney) { + this.subsidyDeductMoney = subsidyDeductMoney; + } + + public Double getBreakfastSubsidy() { + return breakfastSubsidy; + } + + public void setBreakfastSubsidy(Double breakfastSubsidy) { + this.breakfastSubsidy = breakfastSubsidy; + } + + public Double getLunchSubsidy() { + return lunchSubsidy; + } + + public void setLunchSubsidy(Double lunchSubsidy) { + this.lunchSubsidy = lunchSubsidy; + } + + public Double getSupperSubsidy() { + return supperSubsidy; + } + + public void setSupperSubsidy(Double supperSubsidy) { + this.supperSubsidy = supperSubsidy; + } + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + public String getOpeningBank() { + return openingBank; + } + + public void setOpeningBank(String openingBank) { + this.openingBank = openingBank; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public BigDecimal getSparedFive() { + return sparedFive; + } + + public void setSparedFive(BigDecimal sparedFive) { + this.sparedFive = sparedFive; + } + + public BigDecimal getSparedSix() { + return sparedSix; + } + + public void setSparedSix(BigDecimal sparedSix) { + this.sparedSix = sparedSix; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public BigDecimal getDeductions() { + return deductions; + } + + public void setDeductions(BigDecimal deductions) { + this.deductions = deductions; + } + + public String getIsOvertimePay() { + return isOvertimePay; + } + + public void setIsOvertimePay(String isOvertimePay) { + this.isOvertimePay = isOvertimePay; + } + + public BigDecimal getFixedAllowance() { + return fixedAllowance; + } + + public void setFixedAllowance(BigDecimal fixedAllowance) { + this.fixedAllowance = fixedAllowance; + } + + @Override + public String toString() { + return "CwNewEmployeeInformation [id=" + id + ", name=" + name + ", email=" + email + ", jobs=" + jobs + + ", deptName=" + deptName + ", basicSalary=" + basicSalary + ", jobsSalary=" + jobsSalary + + ", dailyWage=" + dailyWage + ", hoursSalary=" + hoursSalary + ", shiftTheLength=" + shiftTheLength + + ", levelOfEducation=" + levelOfEducation + ", contractYear=" + contractYear + + ", socialSecurityStatus=" + socialSecurityStatus + ", entryDate=" + entryDate + ", seniority=" + + seniority + ", probationPeriod=" + probationPeriod + ", levelOfEducationSubsidies=" + + levelOfEducationSubsidies + ", contractSubsidies=" + contractSubsidies + ", senioritySubsidies=" + + senioritySubsidies + ", socialSecuritySubsidies=" + socialSecuritySubsidies + + ", fullFrequentlySubsidies=" + fullFrequentlySubsidies + ", nightShiftSubsidies=" + + nightShiftSubsidies + ", dinnerSubsidies=" + dinnerSubsidies + ", fixedAllowance=" + fixedAllowance + + ", otherSubsidies=" + otherSubsidies + ", deductions=" + deductions + ", isOvertimePay=" + + isOvertimePay + ", virtualWorkstation=" + virtualWorkstation + ", endowmentInsurance=" + + endowmentInsurance + ", medicalInsurance=" + medicalInsurance + ", employmentInjuryInsurance=" + + employmentInjuryInsurance + ", maternityInsurance=" + maternityInsurance + ", unemploymentInsurance=" + + unemploymentInsurance + ", childrenEducation=" + childrenEducation + ", supportTheOld=" + + supportTheOld + ", housingLoans=" + housingLoans + ", housingRents=" + housingRents + + ", adultEducation=" + adultEducation + ", treatmentForSeriousDisease=" + treatmentForSeriousDisease + + ", specialDeduction=" + specialDeduction + ", totalWages=" + totalWages + + ", aggregatePersonalIncomeTax=" + aggregatePersonalIncomeTax + ", remarks=" + remarks + ", dimission=" + + dimission + ", dimissionDate=" + dimissionDate + ", subsidyDeductMoney=" + subsidyDeductMoney + + ", breakfastSubsidy=" + breakfastSubsidy + ", lunchSubsidy=" + lunchSubsidy + ", supperSubsidy=" + + supperSubsidy + ", accountNumber=" + accountNumber + ", openingBank=" + openingBank + ", sparedOne=" + + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", sparedFive=" + sparedFive + ", sparedSix=" + sparedSix + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwNewPayroll.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewPayroll.java new file mode 100644 index 0000000..6781579 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwNewPayroll.java @@ -0,0 +1,618 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 新工资单对象 cw_new_payroll + * + * @author zhukangchao + * @date 2021-12-16 + */ +public class CwNewPayroll extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 工资所属月 */ +// @Excel(name = "工资所属月") + private String affiliationMonth; + + /** 部门名称 */ + @Excel(name = "部门名称") + private String departmentName; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 基本工资 */ +// @Excel(name = "基本工资") + private BigDecimal basicSalary; + + /** 岗位工资 */ +// @Excel(name = "岗位工资") + private BigDecimal jobsSalary; + + /** 日薪 */ +// @Excel(name = "日薪") + private BigDecimal dailyWage; + + /** 时薪 */ +// @Excel(name = "时薪") + private BigDecimal hoursSalary; + + /** 月工资 */ + @Excel(name = "月工资") + private BigDecimal basicMonthlySalary; + + /** 应出勤(天) */ + @Excel(name = "应出勤(时)") + private Long shouldAttendanceNumber; + + /** 实出勤(天) */ + @Excel(name = "实出勤(时)") + private Double realAttendanceNumber; + + /** 缺勤工资扣款 */ + @Excel(name = "缺勤工资扣款") + private BigDecimal absenteeismSalary; + + /** 缺勤补助扣款 */ + @Excel(name = "缺勤补助扣款") + private BigDecimal absenteeismSubsidies; + + /** 学历补助 */ +// @Excel(name = "学历补助") + private BigDecimal levelOfEducationSubsidies; + + /** 合同补助 */ +// @Excel(name = "合同补助") + private BigDecimal contractSubsidies; + + /** 工龄补助 */ +// @Excel(name = "工龄补助") + private BigDecimal senioritySalary; + + /** 补助 */ + @Excel(name = "补助") + private BigDecimal subsidies; + + /** 社保补助 */ +// @Excel(name = "社保补助") + private BigDecimal socialSecuritySubsidies; + + /** 全勤奖 */ +// @Excel(name = "全勤奖") + private BigDecimal fullFrequentlySubsidies; + + /** 加班工资 */ + @Excel(name = "加班工资") + private BigDecimal overtimeSalary; + + /** 夜班补助 */ +// @Excel(name = "夜班补助") + private BigDecimal nightShiftSubsidies; + + /** 夜餐补助 */ +// @Excel(name = "夜餐补助") + private BigDecimal dinnerSubsidies; + + /** 其他补助 */ + @Excel(name = "其他补助") + private BigDecimal subsidyOrBonus; + + /** 其他扣款 */ + @Excel(name = "其他扣款") + private BigDecimal deductions; + + /** 餐饮扣款 */ + @Excel(name = "餐饮扣款") + private BigDecimal mealFee; + + /** 应发工资 */ + @Excel(name = "应发工资") + private BigDecimal salary; + + /** 代缴保险 */ + @Excel(name = "代缴保险") + private BigDecimal payInsurance; + + /** 养老保险 */ +// @Excel(name = "养老保险") + private BigDecimal endowmentInsurance; + + /** 医疗保险 */ +// @Excel(name = "医疗保险") + private BigDecimal medicalInsurance; + + /** 工伤保险 */ +// @Excel(name = "工伤保险") + private BigDecimal employmentInjuryInsurance; + + /** 生育保险 */ +// @Excel(name = "生育保险") + private BigDecimal maternityInsurance; + + /** 失业保险 */ +// @Excel(name = "失业保险") + private BigDecimal unemploymentInsurance; + + /** 税前工资 */ + @Excel(name = "税前工资") + private BigDecimal salaryBeforeTax; + + /** 本年累计已发工资 */ + @Excel(name = "本年累计已发工资") + private BigDecimal totalWages; + + /** 年度免征额 */ +// @Excel(name = "年度免征额") + private Long annualExemptionAmount; + + /** 专项附加扣除 */ +// @Excel(name = "专项附加扣除") + private BigDecimal specialDeduction; + + /** 应纳税所得额 */ + @Excel(name = "应纳税所得额") + private BigDecimal taxableIncome; + + /** 税率 */ +// @Excel(name = "税率") + private String taxRate; + + /** 速算扣除数 */ +// @Excel(name = "速算扣除数") + private Long slowDownTheDeduction; + + /** 本年累计已缴税额 */ + @Excel(name = "累计已缴税额") + private BigDecimal aggregatePersonalIncomeTax; + + /** 本月应缴个税 */ + @Excel(name = "本月应缴个税") + private BigDecimal taxPayable; + + /** 实发工资 */ + @Excel(name = "实发工资") + private BigDecimal netPayroll; + + /** 备注 */ +// @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAffiliationMonth() { + return affiliationMonth; + } + + public void setAffiliationMonth(String affiliationMonth) { + this.affiliationMonth = affiliationMonth; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getBasicSalary() { + return basicSalary; + } + + public void setBasicSalary(BigDecimal basicSalary) { + this.basicSalary = basicSalary; + } + + public BigDecimal getJobsSalary() { + return jobsSalary; + } + + public void setJobsSalary(BigDecimal jobsSalary) { + this.jobsSalary = jobsSalary; + } + + public BigDecimal getDailyWage() { + return dailyWage; + } + + public void setDailyWage(BigDecimal dailyWage) { + this.dailyWage = dailyWage; + } + + public BigDecimal getHoursSalary() { + return hoursSalary; + } + + public void setHoursSalary(BigDecimal hoursSalary) { + this.hoursSalary = hoursSalary; + } + + public BigDecimal getBasicMonthlySalary() { + return basicMonthlySalary; + } + + public void setBasicMonthlySalary(BigDecimal basicMonthlySalary) { + this.basicMonthlySalary = basicMonthlySalary; + } + + public Long getShouldAttendanceNumber() { + return shouldAttendanceNumber; + } + + public void setShouldAttendanceNumber(Long shouldAttendanceNumber) { + this.shouldAttendanceNumber = shouldAttendanceNumber; + } + + public Double getRealAttendanceNumber() { + return realAttendanceNumber; + } + + public void setRealAttendanceNumber(Double realAttendanceNumber) { + this.realAttendanceNumber = realAttendanceNumber; + } + + public BigDecimal getAbsenteeismSalary() { + return absenteeismSalary; + } + + public void setAbsenteeismSalary(BigDecimal absenteeismSalary) { + this.absenteeismSalary = absenteeismSalary; + } + + public BigDecimal getAbsenteeismSubsidies() { + return absenteeismSubsidies; + } + + public void setAbsenteeismSubsidies(BigDecimal absenteeismSubsidies) { + this.absenteeismSubsidies = absenteeismSubsidies; + } + + public BigDecimal getLevelOfEducationSubsidies() { + return levelOfEducationSubsidies; + } + + public void setLevelOfEducationSubsidies(BigDecimal levelOfEducationSubsidies) { + this.levelOfEducationSubsidies = levelOfEducationSubsidies; + } + + public BigDecimal getContractSubsidies() { + return contractSubsidies; + } + + public void setContractSubsidies(BigDecimal contractSubsidies) { + this.contractSubsidies = contractSubsidies; + } + + public BigDecimal getSenioritySalary() { + return senioritySalary; + } + + public void setSenioritySalary(BigDecimal senioritySalary) { + this.senioritySalary = senioritySalary; + } + + public BigDecimal getSocialSecuritySubsidies() { + return socialSecuritySubsidies; + } + + public void setSocialSecuritySubsidies(BigDecimal socialSecuritySubsidies) { + this.socialSecuritySubsidies = socialSecuritySubsidies; + } + + public BigDecimal getFullFrequentlySubsidies() { + return fullFrequentlySubsidies; + } + + public void setFullFrequentlySubsidies(BigDecimal fullFrequentlySubsidies) { + this.fullFrequentlySubsidies = fullFrequentlySubsidies; + } + + public BigDecimal getOvertimeSalary() { + return overtimeSalary; + } + + public void setOvertimeSalary(BigDecimal overtimeSalary) { + this.overtimeSalary = overtimeSalary; + } + + public BigDecimal getNightShiftSubsidies() { + return nightShiftSubsidies; + } + + public void setNightShiftSubsidies(BigDecimal nightShiftSubsidies) { + this.nightShiftSubsidies = nightShiftSubsidies; + } + + public BigDecimal getDinnerSubsidies() { + return dinnerSubsidies; + } + + public void setDinnerSubsidies(BigDecimal dinnerSubsidies) { + this.dinnerSubsidies = dinnerSubsidies; + } + + public BigDecimal getSubsidyOrBonus() { + return subsidyOrBonus; + } + + public void setSubsidyOrBonus(BigDecimal subsidyOrBonus) { + this.subsidyOrBonus = subsidyOrBonus; + } + + public BigDecimal getMealFee() { + return mealFee; + } + + public void setMealFee(BigDecimal mealFee) { + this.mealFee = mealFee; + } + + public BigDecimal getSalary() { + return salary; + } + + public void setSalary(BigDecimal salary) { + this.salary = salary; + } + + public BigDecimal getPayInsurance() { + return payInsurance; + } + + public void setPayInsurance(BigDecimal payInsurance) { + this.payInsurance = payInsurance; + } + + public BigDecimal getEndowmentInsurance() { + return endowmentInsurance; + } + + public void setEndowmentInsurance(BigDecimal endowmentInsurance) { + this.endowmentInsurance = endowmentInsurance; + } + + public BigDecimal getMedicalInsurance() { + return medicalInsurance; + } + + public void setMedicalInsurance(BigDecimal medicalInsurance) { + this.medicalInsurance = medicalInsurance; + } + + public BigDecimal getEmploymentInjuryInsurance() { + return employmentInjuryInsurance; + } + + public void setEmploymentInjuryInsurance(BigDecimal employmentInjuryInsurance) { + this.employmentInjuryInsurance = employmentInjuryInsurance; + } + + public BigDecimal getMaternityInsurance() { + return maternityInsurance; + } + + public void setMaternityInsurance(BigDecimal maternityInsurance) { + this.maternityInsurance = maternityInsurance; + } + + public BigDecimal getUnemploymentInsurance() { + return unemploymentInsurance; + } + + public void setUnemploymentInsurance(BigDecimal unemploymentInsurance) { + this.unemploymentInsurance = unemploymentInsurance; + } + + public BigDecimal getSalaryBeforeTax() { + return salaryBeforeTax; + } + + public void setSalaryBeforeTax(BigDecimal salaryBeforeTax) { + this.salaryBeforeTax = salaryBeforeTax; + } + + public BigDecimal getTotalWages() { + return totalWages; + } + + public void setTotalWages(BigDecimal totalWages) { + this.totalWages = totalWages; + } + + public Long getAnnualExemptionAmount() { + return annualExemptionAmount; + } + + public void setAnnualExemptionAmount(Long annualExemptionAmount) { + this.annualExemptionAmount = annualExemptionAmount; + } + + public BigDecimal getSpecialDeduction() { + return specialDeduction; + } + + public void setSpecialDeduction(BigDecimal specialDeduction) { + this.specialDeduction = specialDeduction; + } + + public BigDecimal getTaxableIncome() { + return taxableIncome; + } + + public void setTaxableIncome(BigDecimal taxableIncome) { + this.taxableIncome = taxableIncome; + } + + public String getTaxRate() { + return taxRate; + } + + public void setTaxRate(String taxRate) { + this.taxRate = taxRate; + } + + public Long getSlowDownTheDeduction() { + return slowDownTheDeduction; + } + + public void setSlowDownTheDeduction(Long slowDownTheDeduction) { + this.slowDownTheDeduction = slowDownTheDeduction; + } + + public BigDecimal getAggregatePersonalIncomeTax() { + return aggregatePersonalIncomeTax; + } + + public void setAggregatePersonalIncomeTax(BigDecimal aggregatePersonalIncomeTax) { + this.aggregatePersonalIncomeTax = aggregatePersonalIncomeTax; + } + + public BigDecimal getTaxPayable() { + return taxPayable; + } + + public void setTaxPayable(BigDecimal taxPayable) { + this.taxPayable = taxPayable; + } + + public BigDecimal getNetPayroll() { + return netPayroll; + } + + public void setNetPayroll(BigDecimal netPayroll) { + this.netPayroll = netPayroll; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSapredThree() { + return sapredThree; + } + + public void setSapredThree(Long sapredThree) { + this.sapredThree = sapredThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public BigDecimal getDeductions() { + return deductions; + } + + public void setDeductions(BigDecimal deductions) { + this.deductions = deductions; + } + + public BigDecimal getSubsidies() { + return subsidies; + } + + public void setSubsidies(BigDecimal subsidies) { + this.subsidies = subsidies; + } + + @Override + public String toString() { + return "CwNewPayroll [id=" + id + ", affiliationMonth=" + affiliationMonth + ", departmentName=" + + departmentName + ", name=" + name + ", basicSalary=" + basicSalary + ", jobsSalary=" + jobsSalary + + ", dailyWage=" + dailyWage + ", hoursSalary=" + hoursSalary + ", basicMonthlySalary=" + + basicMonthlySalary + ", shouldAttendanceNumber=" + shouldAttendanceNumber + ", realAttendanceNumber=" + + realAttendanceNumber + ", absenteeismSalary=" + absenteeismSalary + ", absenteeismSubsidies=" + + absenteeismSubsidies + ", levelOfEducationSubsidies=" + levelOfEducationSubsidies + + ", contractSubsidies=" + contractSubsidies + ", senioritySalary=" + senioritySalary + ", subsidies=" + + subsidies + ", socialSecuritySubsidies=" + socialSecuritySubsidies + ", fullFrequentlySubsidies=" + + fullFrequentlySubsidies + ", overtimeSalary=" + overtimeSalary + ", nightShiftSubsidies=" + + nightShiftSubsidies + ", dinnerSubsidies=" + dinnerSubsidies + ", subsidyOrBonus=" + subsidyOrBonus + + ", deductions=" + deductions + ", mealFee=" + mealFee + ", salary=" + salary + ", payInsurance=" + + payInsurance + ", endowmentInsurance=" + endowmentInsurance + ", medicalInsurance=" + medicalInsurance + + ", employmentInjuryInsurance=" + employmentInjuryInsurance + ", maternityInsurance=" + + maternityInsurance + ", unemploymentInsurance=" + unemploymentInsurance + ", salaryBeforeTax=" + + salaryBeforeTax + ", totalWages=" + totalWages + ", annualExemptionAmount=" + annualExemptionAmount + + ", specialDeduction=" + specialDeduction + ", taxableIncome=" + taxableIncome + ", taxRate=" + taxRate + + ", slowDownTheDeduction=" + slowDownTheDeduction + ", aggregatePersonalIncomeTax=" + + aggregatePersonalIncomeTax + ", taxPayable=" + taxPayable + ", netPayroll=" + netPayroll + + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sapredThree=" + + sapredThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwNonbusinessIncome.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwNonbusinessIncome.java new file mode 100644 index 0000000..c1394d0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwNonbusinessIncome.java @@ -0,0 +1,325 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 营业外收入信息对象 cw_nonbusiness_income + * + * @author zhukangchao + * @date 2023-11-30 + */ +public class CwNonbusinessIncome extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 姓名 */ + @Excel(name = "姓名") + private String userName; + + /** 部门 */ + @Excel(name = "部门") + private String deptName; + + /** 类型 */ + @Excel(name = "类型") + private String type; + + /** 收款方式 */ + @Excel(name = "收款方式") + private String payWay; + + /** 金额 */ + @Excel(name = "金额") + private Double money; + + /** 大写金额 */ + @Excel(name = "大写金额") + private String bigMoney; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date date; + + /** 来源 */ + @Excel(name = "来源") + private String source; + + /** 往来单位名称 */ + @Excel(name = "往来单位名称") + private String unitName; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 未开票金额 */ + @Excel(name = "未开票金额") + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + @Excel(name = "已开票金额") + private BigDecimal invoiceAmount; + + /** 未收款金额 */ + @Excel(name = "未收款金额") + private BigDecimal notProceedsAmount; + + /** 已收款金额 */ + @Excel(name = "已收款金额") + private BigDecimal proceedsAmount; + + /** 结算比例 */ + @Excel(name = "结算比例") + private BigDecimal settlementRatio; + + /** 审批 */ + @Excel(name = "审批") + private String leadership; + + /** 审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setMoney(Double money) + { + this.money = money; + } + + public Double getMoney() + { + return money; + } + public void setBigMoney(String bigMoney) + { + this.bigMoney = bigMoney; + } + + public String getBigMoney() + { + return bigMoney; + } + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + public void setSource(String source) + { + this.source = source; + } + + public String getSource() + { + return source; + } + public void setUnitName(String unitName) + { + this.unitName = unitName; + } + + public String getUnitName() + { + return unitName; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "CwNonbusinessIncome [id=" + id + ", code=" + code + ", userName=" + userName + ", deptName=" + deptName + + ", type=" + type + ", payWay=" + payWay + ", money=" + money + ", bigMoney=" + bigMoney + ", date=" + + date + ", source=" + source + ", unitName=" + unitName + ", remarks=" + remarks + + ", notInvoiceAmount=" + notInvoiceAmount + ", invoiceAmount=" + invoiceAmount + ", notProceedsAmount=" + + notProceedsAmount + ", proceedsAmount=" + proceedsAmount + ", settlementRatio=" + settlementRatio + + ", leadership=" + leadership + ", leadershipTime=" + leadershipTime + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwOtherPayment.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwOtherPayment.java new file mode 100644 index 0000000..301d8a7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwOtherPayment.java @@ -0,0 +1,390 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 其他付款申请单对象 cw_other_payment + * + * @author zhukangchao + * @date 2023-11-30 + */ +public class CwOtherPayment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 姓名 */ + @Excel(name = "姓名") + private String userName; + + /** 部门 */ + @Excel(name = "部门") + private String deptName; + + /** 申请日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date dateTime; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + /** 金额 */ + @Excel(name = "金额") + private Double money; + + /** 大写金额 */ + @Excel(name = "大写金额") + private String bigMoney; + + /** 借/付款事由 */ + @Excel(name = "借/付款事由") + private String cause; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 账号 */ + @Excel(name = "账号") + private String accountNumber; + + /** 开户行 */ + @Excel(name = "开户行") + private String openingBank; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadership; + + /** 总经理审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + /** 复核人 */ + @Excel(name = "复核人") + private String reviewer; + + /** 复核时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "复核时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date reviewerTime; + + /** 未开票金额 */ + @Excel(name = "未开票金额") + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + @Excel(name = "已开票金额") + private BigDecimal invoiceAmount; + + /** 未付款金额 */ + @Excel(name = "未付款金额") + private BigDecimal notProceedsAmount; + + /** 已付款金额 */ + @Excel(name = "已付款金额") + private BigDecimal proceedsAmount; + + /** 结算比例 */ + @Excel(name = "结算比例") + private BigDecimal settlementRatio; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long spaerdThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setDateTime(Date dateTime) + { + this.dateTime = dateTime; + } + + public Date getDateTime() + { + return dateTime; + } + public void setPayWay(String payWay) + { + this.payWay = payWay; + } + + public String getPayWay() + { + return payWay; + } + public void setMoney(Double money) + { + this.money = money; + } + + public Double getMoney() + { + return money; + } + public void setBigMoney(String bigMoney) + { + this.bigMoney = bigMoney; + } + + public String getBigMoney() + { + return bigMoney; + } + public void setCause(String cause) + { + this.cause = cause; + } + + public String getCause() + { + return cause; + } + public void setUnitName(String unitName) + { + this.unitName = unitName; + } + + public String getUnitName() + { + return unitName; + } + public void setAccountNumber(String accountNumber) + { + this.accountNumber = accountNumber; + } + + public String getAccountNumber() + { + return accountNumber; + } + public void setOpeningBank(String openingBank) + { + this.openingBank = openingBank; + } + + public String getOpeningBank() + { + return openingBank; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setLeadership(String leadership) + { + this.leadership = leadership; + } + + public String getLeadership() + { + return leadership; + } + public void setLeadershipTime(Date leadershipTime) + { + this.leadershipTime = leadershipTime; + } + + public Date getLeadershipTime() + { + return leadershipTime; + } + public void setReviewer(String reviewer) + { + this.reviewer = reviewer; + } + + public String getReviewer() + { + return reviewer; + } + public void setReviewerTime(Date reviewerTime) + { + this.reviewerTime = reviewerTime; + } + + public Date getReviewerTime() + { + return reviewerTime; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSpaerdThree(Long spaerdThree) + { + this.spaerdThree = spaerdThree; + } + + public Long getSpaerdThree() + { + return spaerdThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("userName", getUserName()) + .append("deptName", getDeptName()) + .append("dateTime", getDateTime()) + .append("payWay", getPayWay()) + .append("money", getMoney()) + .append("bigMoney", getBigMoney()) + .append("cause", getCause()) + .append("unitName", getUnitName()) + .append("accountNumber", getAccountNumber()) + .append("openingBank", getOpeningBank()) + .append("remarks", getRemarks()) + .append("leadership", getLeadership()) + .append("leadershipTime", getLeadershipTime()) + .append("reviewer", getReviewer()) + .append("reviewerTime", getReviewerTime()) + .append("notInvoiceAmount", getNotInvoiceAmount()) + .append("invoiceAmount", getInvoiceAmount()) + .append("notProceedsAmount", getNotProceedsAmount()) + .append("proceedsAmount", getProceedsAmount()) + .append("settlementRatio", getSettlementRatio()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("spaerdThree", getSpaerdThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwOtherPaymentInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwOtherPaymentInfo.java new file mode 100644 index 0000000..9cfaa2c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwOtherPaymentInfo.java @@ -0,0 +1,178 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 付款单合同关联信息对象 cw_other_payment_info + * + * @author zhukangchao + * @date 2023-12-10 + */ +public class CwOtherPaymentInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 付款单id */ + @Excel(name = "付款单id") + private Long otherPaymentId; + + /** 付款单编号 */ + @Excel(name = "付款单编号") + private String otherPaymentCode; + + /** 关联单据编号 */ + @Excel(name = "关联单据编号") + private String code; + + /** 合同金额 */ + @Excel(name = "合同金额") + private Double contractMoney; + + /** 付款比例 */ + @Excel(name = "付款比例") + private Double proportion; + + /** 付款金额 */ + @Excel(name = "付款金额") + private Double paymentAmount; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOtherPaymentId(Long otherPaymentId) + { + this.otherPaymentId = otherPaymentId; + } + + public Long getOtherPaymentId() + { + return otherPaymentId; + } + public void setOtherPaymentCode(String otherPaymentCode) + { + this.otherPaymentCode = otherPaymentCode; + } + + public String getOtherPaymentCode() + { + return otherPaymentCode; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setContractMoney(Double contractMoney) + { + this.contractMoney = contractMoney; + } + + public Double getContractMoney() + { + return contractMoney; + } + public void setProportion(Double proportion) + { + this.proportion = proportion; + } + + public Double getProportion() + { + return proportion; + } + public void setPaymentAmount(Double paymentAmount) + { + this.paymentAmount = paymentAmount; + } + + public Double getPaymentAmount() + { + return paymentAmount; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("otherPaymentId", getOtherPaymentId()) + .append("otherPaymentCode", getOtherPaymentCode()) + .append("code", getCode()) + .append("contractMoney", getContractMoney()) + .append("proportion", getProportion()) + .append("paymentAmount", getPaymentAmount()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwPayroll.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwPayroll.java new file mode 100644 index 0000000..132c22c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwPayroll.java @@ -0,0 +1,442 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 工资单对象 cw_payroll + * + * @author zhukangchao + * @date 2021-10-25 + */ +public class CwPayroll extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 工资所属月 */ +// @Excel(name = "工资所属月") + private String affiliationMonth; + + /** 部门 */ + @Excel(name = "部门名称") + private String departmentName; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 月工资 */ + @Excel(name = "月工资") + private BigDecimal basicMonthlySalary; + + /** 日工资 */ + @Excel(name = "日工资") + private BigDecimal dailyWages; + + /** 应出勤(天) */ +// @Excel(name = "应出勤(天)") + private Long shouldAttendanceNumber; + + /** 实出勤 */ + @Excel(name = "实出勤") + private BigDecimal realAttendanceNumber; + + /** 迟到扣款 */ +// @Excel(name = "迟到扣款") + private Long lateDeductions; + + /** 补助(奖金) */ + @Excel(name = "补助(奖金)") + private BigDecimal subsidyOrBonus; + + /** 计件费 */ + @Excel(name = "计件费") + private BigDecimal incentiveFee; + + /** 工龄工资 */ + @Excel(name = "工龄工资") + private BigDecimal senioritySalary; + + /** 交通补助 */ + @Excel(name = "交通补助") + private BigDecimal trafficAllowance; + + /** 通讯补助(元) */ +// @Excel(name = "通讯补助(元)") + private BigDecimal communicateAllowance; + + /** 住房补助(元) */ +// @Excel(name = "住房补助(元)") + private BigDecimal housingAllowance; + + /** 饭补(元) */ +// @Excel(name = "饭补(元)") + private BigDecimal mealAllowance; + + /** 应发工资 */ + @Excel(name = "应发工资") + private BigDecimal salary; + + /** 保险 */ + @Excel(name = "保险") + private BigDecimal payInsurance; + + /** 税前工资 */ + @Excel(name = "税前工资") + private BigDecimal salaryBeforeTax; + + /** 本年累计已发工资 */ + @Excel(name = "累计已发工资") + private BigDecimal totalWages; + + /** 年度免征额 */ +// @Excel(name = "年度免征额") + private Long annualExemptionAmount; + + /** 专项扣除 */ +// @Excel(name = "专项扣除") + private BigDecimal specialDeduction; + + /** 应纳税所得额 */ + @Excel(name = "应纳税所得额") + private BigDecimal taxableIncome; + + /** 税率 */ +// @Excel(name = "税率") + private String taxRate; + + /** 速算扣除数 */ +// @Excel(name = "速算扣除数") + private Long slowDownTheDeduction; + + /** 本年累计已缴税额 */ + @Excel(name = "累计已缴税额") + private BigDecimal aggregatePersonalIncomeTax; + + /** 本月应缴个税 */ + @Excel(name = "应缴个税") + private BigDecimal taxPayable; + + /** 实发工资 */ + @Excel(name = "实发工资") + private BigDecimal netPayroll; + + /** 备注 */ +// @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAffiliationMonth() { + return affiliationMonth; + } + + public void setAffiliationMonth(String affiliationMonth) { + this.affiliationMonth = affiliationMonth; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getBasicMonthlySalary() { + return basicMonthlySalary; + } + + public void setBasicMonthlySalary(BigDecimal basicMonthlySalary) { + this.basicMonthlySalary = basicMonthlySalary; + } + + public BigDecimal getDailyWages() { + return dailyWages; + } + + public void setDailyWages(BigDecimal dailyWages) { + this.dailyWages = dailyWages; + } + + public Long getShouldAttendanceNumber() { + return shouldAttendanceNumber; + } + + public void setShouldAttendanceNumber(Long shouldAttendanceNumber) { + this.shouldAttendanceNumber = shouldAttendanceNumber; + } + + public BigDecimal getRealAttendanceNumber() { + return realAttendanceNumber; + } + + public void setRealAttendanceNumber(BigDecimal realAttendanceNumber) { + this.realAttendanceNumber = realAttendanceNumber; + } + + public Long getLateDeductions() { + return lateDeductions; + } + + public void setLateDeductions(Long lateDeductions) { + this.lateDeductions = lateDeductions; + } + + public BigDecimal getSubsidyOrBonus() { + return subsidyOrBonus; + } + + public void setSubsidyOrBonus(BigDecimal subsidyOrBonus) { + this.subsidyOrBonus = subsidyOrBonus; + } + + public BigDecimal getSenioritySalary() { + return senioritySalary; + } + + public void setSenioritySalary(BigDecimal senioritySalary) { + this.senioritySalary = senioritySalary; + } + + public BigDecimal getTrafficAllowance() { + return trafficAllowance; + } + + public void setTrafficAllowance(BigDecimal trafficAllowance) { + this.trafficAllowance = trafficAllowance; + } + + public BigDecimal getCommunicateAllowance() { + return communicateAllowance; + } + + public void setCommunicateAllowance(BigDecimal communicateAllowance) { + this.communicateAllowance = communicateAllowance; + } + + public BigDecimal getHousingAllowance() { + return housingAllowance; + } + + public void setHousingAllowance(BigDecimal housingAllowance) { + this.housingAllowance = housingAllowance; + } + + public BigDecimal getMealAllowance() { + return mealAllowance; + } + + public void setMealAllowance(BigDecimal mealAllowance) { + this.mealAllowance = mealAllowance; + } + + public BigDecimal getSalary() { + return salary; + } + + public void setSalary(BigDecimal salary) { + this.salary = salary; + } + + public BigDecimal getPayInsurance() { + return payInsurance; + } + + public void setPayInsurance(BigDecimal payInsurance) { + this.payInsurance = payInsurance; + } + + public BigDecimal getSalaryBeforeTax() { + return salaryBeforeTax; + } + + public void setSalaryBeforeTax(BigDecimal salaryBeforeTax) { + this.salaryBeforeTax = salaryBeforeTax; + } + + public BigDecimal getTotalWages() { + return totalWages; + } + + public void setTotalWages(BigDecimal totalWages) { + this.totalWages = totalWages; + } + + public Long getAnnualExemptionAmount() { + return annualExemptionAmount; + } + + public void setAnnualExemptionAmount(Long annualExemptionAmount) { + this.annualExemptionAmount = annualExemptionAmount; + } + + public BigDecimal getSpecialDeduction() { + return specialDeduction; + } + + public void setSpecialDeduction(BigDecimal specialDeduction) { + this.specialDeduction = specialDeduction; + } + + public BigDecimal getTaxableIncome() { + return taxableIncome; + } + + public void setTaxableIncome(BigDecimal taxableIncome) { + this.taxableIncome = taxableIncome; + } + + public String getTaxRate() { + return taxRate; + } + + public void setTaxRate(String taxRate) { + this.taxRate = taxRate; + } + + public Long getSlowDownTheDeduction() { + return slowDownTheDeduction; + } + + public void setSlowDownTheDeduction(Long slowDownTheDeduction) { + this.slowDownTheDeduction = slowDownTheDeduction; + } + + public BigDecimal getAggregatePersonalIncomeTax() { + return aggregatePersonalIncomeTax; + } + + public void setAggregatePersonalIncomeTax(BigDecimal aggregatePersonalIncomeTax) { + this.aggregatePersonalIncomeTax = aggregatePersonalIncomeTax; + } + + public BigDecimal getTaxPayable() { + return taxPayable; + } + + public void setTaxPayable(BigDecimal taxPayable) { + this.taxPayable = taxPayable; + } + + public BigDecimal getNetPayroll() { + return netPayroll; + } + + public void setNetPayroll(BigDecimal netPayroll) { + this.netPayroll = netPayroll; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSapredThree() { + return sapredThree; + } + + public void setSapredThree(Long sapredThree) { + this.sapredThree = sapredThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + public BigDecimal getIncentiveFee() { + return incentiveFee; + } + + public void setIncentiveFee(BigDecimal incentiveFee) { + this.incentiveFee = incentiveFee; + } + + @Override + public String toString() { + return "CwPayroll [id=" + id + ", affiliationMonth=" + affiliationMonth + ", departmentName=" + departmentName + + ", name=" + name + ", basicMonthlySalary=" + basicMonthlySalary + ", dailyWages=" + dailyWages + + ", shouldAttendanceNumber=" + shouldAttendanceNumber + ", realAttendanceNumber=" + + realAttendanceNumber + ", lateDeductions=" + lateDeductions + ", subsidyOrBonus=" + subsidyOrBonus + + ", incentiveFee=" + incentiveFee + ", senioritySalary=" + senioritySalary + ", trafficAllowance=" + + trafficAllowance + ", communicateAllowance=" + communicateAllowance + ", housingAllowance=" + + housingAllowance + ", mealAllowance=" + mealAllowance + ", salary=" + salary + ", payInsurance=" + + payInsurance + ", salaryBeforeTax=" + salaryBeforeTax + ", totalWages=" + totalWages + + ", annualExemptionAmount=" + annualExemptionAmount + ", specialDeduction=" + specialDeduction + + ", taxableIncome=" + taxableIncome + ", taxRate=" + taxRate + ", slowDownTheDeduction=" + + slowDownTheDeduction + ", aggregatePersonalIncomeTax=" + aggregatePersonalIncomeTax + ", taxPayable=" + + taxPayable + ", netPayroll=" + netPayroll + ", remarks=" + remarks + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sapredThree=" + sapredThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwRules.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwRules.java new file mode 100644 index 0000000..16a74d0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwRules.java @@ -0,0 +1,170 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 排班对象 cw_rules + * + * @author zhukangchao + * @date 2021-12-25 + */ +public class CwRules extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 工作日 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "工作日", width = 30, dateFormat = "yyyy-MM-dd") + private Date workingDays; + + /** 班序 */ + @Excel(name = "班序") + private String sequence; + + /** 员工姓名 */ + @Excel(name = "员工姓名") + private String name; + + /** 排班规则 */ + @Excel(name = "排班规则") + private String rules; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setWorkingDays(Date workingDays) + { + this.workingDays = workingDays; + } + + public Date getWorkingDays() + { + return workingDays; + } + + public String getSequence() { + return sequence; + } + + public void setSequence(String sequence) { + this.sequence = sequence; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setRules(String rules) + { + this.rules = rules; + } + + public String getRules() + { + return rules; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "CwRules [id=" + id + ", workingDays=" + workingDays + ", sequence=" + sequence + ", name=" + name + + ", rules=" + rules + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwSnDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwSnDetail.java new file mode 100644 index 0000000..9da072b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwSnDetail.java @@ -0,0 +1,195 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 考勤设备信息对象 cw_sn_detail + * + * @author zhukangchao + * @date 2022-11-01 + */ +public class CwSnDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 设备号 */ + @Excel(name = "设备号") + private String sn; + + /** 内部版本号 */ + @Excel(name = "内部版本号") + private String versionCode; + + /** 设备页面版本号 */ + @Excel(name = "设备页面版本号") + private String versionName; + + /** 参数名字 */ + @Excel(name = "参数名字") + private String token; + + /** 设备ip */ + @Excel(name = "设备ip") + private String ip; + + /** 设备连接时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "设备连接时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date snTime; + + /** 设备连接状态 */ + @Excel(name = "设备连接状态") + private String type; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setSn(String sn) + { + this.sn = sn; + } + + public String getSn() + { + return sn; + } + public void setVersionCode(String versionCode) + { + this.versionCode = versionCode; + } + + public String getVersionCode() + { + return versionCode; + } + public void setVersionName(String versionName) + { + this.versionName = versionName; + } + + public String getVersionName() + { + return versionName; + } + public void setToken(String token) + { + this.token = token; + } + + public String getToken() + { + return token; + } + public void setIp(String ip) + { + this.ip = ip; + } + + public String getIp() + { + return ip; + } + public void setSnTime(Date snTime) + { + this.snTime = snTime; + } + + public Date getSnTime() + { + return snTime; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("sn", getSn()) + .append("versionCode", getVersionCode()) + .append("versionName", getVersionName()) + .append("token", getToken()) + .append("ip", getIp()) + .append("snTime", getSnTime()) + .append("type", getType()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwTaxRateInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwTaxRateInfo.java new file mode 100644 index 0000000..dc74e8c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwTaxRateInfo.java @@ -0,0 +1,152 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 税率信息对象 cw_tax_rate_info + * + * @author zhukangchao + * @date 2023-12-18 + */ +public class CwTaxRateInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 税率 */ + @Excel(name = "税率") + private Double taxRate; + + /** 是否开增值税发票 */ + @Excel(name = "是否开增值税发票") + private String makeOutAnInvoice; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setTaxRate(Double taxRate) + { + this.taxRate = taxRate; + } + + public Double getTaxRate() + { + return taxRate; + } + + public String setMakeOutAnInvoice(String makeOutAnInvoice) + { + this.makeOutAnInvoice = makeOutAnInvoice; + return makeOutAnInvoice; + } + + public String getMakeOutAnInvoice() + { + return makeOutAnInvoice; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("taxRate", getTaxRate()) + .append("makeOutAnInvoice", getMakeOutAnInvoice()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTime.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTime.java new file mode 100644 index 0000000..f6dffa3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTime.java @@ -0,0 +1,136 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 状态等待时间对象 cw_type_time + * + * @author zhukangchao + * @date 2022-10-31 + */ +public class CwTypeTime extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 类型 */ + @Excel(name = "类型") + private String type; + + /** 时长(毫秒) */ + @Excel(name = "时长", readConverterExp = "毫=秒") + private Long time; + + /** 设备号 */ + @Excel(name = "设备号") + private String to; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setTime(Long time) + { + this.time = time; + } + + public Long getTime() + { + return time; + } + public void setTo(String to) + { + this.to = to; + } + + public String getTo() + { + return to; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("type", getType()) + .append("time", getTime()) + .append("to", getTo()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTimeData.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTimeData.java new file mode 100644 index 0000000..516c502 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTimeData.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.domain; + +public class CwTypeTimeData { + + private String cmd; + private int type_1; + private int type_2; + private int type_3; + private int type_4; + private int type_5; + private int type_6; + private int type_7; + public String getCmd() { + return cmd; + } + public void setCmd(String cmd) { + this.cmd = cmd; + } + public int getType_1() { + return type_1; + } + public void setType_1(int type_1) { + this.type_1 = type_1; + } + public int getType_2() { + return type_2; + } + public void setType_2(int type_2) { + this.type_2 = type_2; + } + public int getType_3() { + return type_3; + } + public void setType_3(int type_3) { + this.type_3 = type_3; + } + public int getType_4() { + return type_4; + } + public void setType_4(int type_4) { + this.type_4 = type_4; + } + public int getType_5() { + return type_5; + } + public void setType_5(int type_5) { + this.type_5 = type_5; + } + public int getType_6() { + return type_6; + } + public void setType_6(int type_6) { + this.type_6 = type_6; + } + public int getType_7() { + return type_7; + } + public void setType_7(int type_7) { + this.type_7 = type_7; + } + + @Override + public String toString() { + return "CwTypeTimeData [cmd=" + cmd + ", type_1=" + type_1 + ", type_2=" + type_2 + ", type_3=" + type_3 + + ", type_4=" + type_4 + ", type_5=" + type_5 + ", type_6=" + type_6 + ", type_7=" + type_7 + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTimeVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTimeVo.java new file mode 100644 index 0000000..2fb9d2f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwTypeTimeVo.java @@ -0,0 +1,39 @@ +package com.ruoyi.project.management.domain; + +public class CwTypeTimeVo { + + private String cmd; + private String form; + private String to; + private CwTypeTimeData data; + public String getCmd() { + return cmd; + } + public void setCmd(String cmd) { + this.cmd = cmd; + } + public String getForm() { + return form; + } + public void setForm(String form) { + this.form = form; + } + public String getTo() { + return to; + } + public void setTo(String to) { + this.to = to; + } + public CwTypeTimeData getData() { + return data; + } + public void setData(CwTypeTimeData data) { + this.data = data; + } + + @Override + public String toString() { + return "CwTypeTimeVo [cmd=" + cmd + ", form=" + form + ", to=" + to + ", data=" + data + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwWageSummary.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwWageSummary.java new file mode 100644 index 0000000..eca90e7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwWageSummary.java @@ -0,0 +1,191 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 工资汇总对象 cw_wage_summary + * + * @author zhukangchao + * @date 2021-12-23 + */ +public class CwWageSummary extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 工资所属月 */ + @Excel(name = "工资所属月") + private String affiliationMonth; + + /** 核算 */ + @Excel(name = "核算") + private String reviewOne; + + /** 核算 */ + @Excel(name = "核算") + private String reviewTwo; + + /** 核算 */ + @Excel(name = "核算") + private String reviewThree; + + /** 核算 */ + @Excel(name = "核算") + private String reviewFour; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sapredOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setAffiliationMonth(String affiliationMonth) + { + this.affiliationMonth = affiliationMonth; + } + + public String getAffiliationMonth() + { + return affiliationMonth; + } + public void setReviewOne(String reviewOne) + { + this.reviewOne = reviewOne; + } + + public String getReviewOne() + { + return reviewOne; + } + public void setReviewTwo(String reviewTwo) + { + this.reviewTwo = reviewTwo; + } + + public String getReviewTwo() + { + return reviewTwo; + } + public void setReviewThree(String reviewThree) + { + this.reviewThree = reviewThree; + } + + public String getReviewThree() + { + return reviewThree; + } + public void setReviewFour(String reviewFour) + { + this.reviewFour = reviewFour; + } + + public String getReviewFour() + { + return reviewFour; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSapredOne(String sapredOne) + { + this.sapredOne = sapredOne; + } + + public String getSapredOne() + { + return sapredOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("affiliationMonth", getAffiliationMonth()) + .append("reviewOne", getReviewOne()) + .append("reviewTwo", getReviewTwo()) + .append("reviewThree", getReviewThree()) + .append("reviewFour", getReviewFour()) + .append("remarks", getRemarks()) + .append("sapredOne", getSapredOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwWorkOvertimeRecord.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwWorkOvertimeRecord.java new file mode 100644 index 0000000..5b61d5a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwWorkOvertimeRecord.java @@ -0,0 +1,180 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 加班申请对象 cw_work_overtime_record + * + * @author zhukangchao + * @date 2021-12-22 + */ +public class CwWorkOvertimeRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 加班日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "加班日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date workOvertimeDate; + + /** 加班时长 */ + @Excel(name = "加班时长") + private Long workOvertimeNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String spreadOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setWorkOvertimeDate(Date workOvertimeDate) + { + this.workOvertimeDate = workOvertimeDate; + } + + public Date getWorkOvertimeDate() + { + return workOvertimeDate; + } + public void setWorkOvertimeNumber(Long workOvertimeNumber) + { + this.workOvertimeNumber = workOvertimeNumber; + } + + public Long getWorkOvertimeNumber() + { + return workOvertimeNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSpreadOne(String spreadOne) + { + this.spreadOne = spreadOne; + } + + public String getSpreadOne() + { + return spreadOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("deptName", getDeptName()) + .append("name", getName()) + .append("workOvertimeDate", getWorkOvertimeDate()) + .append("workOvertimeNumber", getWorkOvertimeNumber()) + .append("remarks", getRemarks()) + .append("spreadOne", getSpreadOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CwWorkingDaysConfiguration.java b/evo/src/main/java/com/ruoyi/project/management/domain/CwWorkingDaysConfiguration.java new file mode 100644 index 0000000..a59dfaf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CwWorkingDaysConfiguration.java @@ -0,0 +1,209 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 工作日配置对象 cw_working_days_configuration + * + * @author zhukangchao + * @date 2021-12-21 + */ +public class CwWorkingDaysConfiguration extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属月份 */ +// @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "所属月份") + private String date; + + /** 办公室工作日 */ + @Excel(name = "办公室工作日") + private Long workingDays; + + /** 后勤工作日 */ + @Excel(name = "后勤工作日") + private Long workingDaysHouqin; + + /** 装配工作日 */ + @Excel(name = "装配工作日") + private Long workingDaysZhuangpei; + + /** 机加工作日 */ + @Excel(name = "机加工作日") + private Long workingDaysJijia; + + /** 质检工作日 */ + @Excel(name = "质检工作日") + private Long workingDaysZhijian; + + /** 扣除岗位工资天数 */ + @Excel(name = "扣除岗位工资天数") + private Long postWage; + + /** 应出勤班次 */ + @Excel(name = "应出勤班次") + private Long shiftDays; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDate(String date) + { + this.date = date; + } + + public String getDate() + { + return date; + } + public void setWorkingDays(Long workingDays) + { + this.workingDays = workingDays; + } + + public Long getWorkingDays() + { + return workingDays; + } + + public Long getWorkingDaysHouqin() { + return workingDaysHouqin; + } + + public void setWorkingDaysHouqin(Long workingDaysHouqin) { + this.workingDaysHouqin = workingDaysHouqin; + } + + public Long getWorkingDaysZhuangpei() { + return workingDaysZhuangpei; + } + + public void setWorkingDaysZhuangpei(Long workingDaysZhuangpei) { + this.workingDaysZhuangpei = workingDaysZhuangpei; + } + + public Long getWorkingDaysJijia() { + return workingDaysJijia; + } + + public void setWorkingDaysJijia(Long workingDaysJijia) { + this.workingDaysJijia = workingDaysJijia; + } + + public Long getWorkingDaysZhijian() { + return workingDaysZhijian; + } + + public void setWorkingDaysZhijian(Long workingDaysZhijian) { + this.workingDaysZhijian = workingDaysZhijian; + } + + public Long getPostWage() { + return postWage; + } + + public void setPostWage(Long postWage) { + this.postWage = postWage; + } + + public Long getShiftDays() { + return shiftDays; + } + + public void setShiftDays(Long shiftDays) { + this.shiftDays = shiftDays; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "CwWorkingDaysConfiguration [id=" + id + ", date=" + date + ", workingDays=" + workingDays + + ", workingDaysHouqin=" + workingDaysHouqin + ", workingDaysZhuangpei=" + workingDaysZhuangpei + + ", workingDaysJijia=" + workingDaysJijia + ", workingDaysZhijian=" + workingDaysZhijian + + ", postWage=" + postWage + ", shiftDays=" + shiftDays + ", remarks=" + remarks + ", sparedOne=" + + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + "]"; + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CyConsumptionInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CyConsumptionInfo.java new file mode 100644 index 0000000..f56d755 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CyConsumptionInfo.java @@ -0,0 +1,373 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 餐饮消费明细对象 cy_consumption_info + * + * @author zhukangchao + * @date 2023-10-05 + */ +public class CyConsumptionInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 月统计id */ + private Long statisticsId; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date dateTime; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 上班卡 */ + @Excel(name = "上班卡") + private String shangBan; + + /** 下班卡 */ + @Excel(name = "下班卡") + private String xiaBan; + + /** 工作时长 */ + @Excel(name = "工作时长") + private Double duration; + + /** 早餐次数 */ + @Excel(name = "早餐次数") + private Long breakfastNumber; + + /** 早餐补助 */ + @Excel(name = "早餐补助") + private Double breakfastSubsidy; + + /** 早餐个人消费 */ + @Excel(name = "早餐个人消费") + private Double breakfastPersonalConsumption; + + /** 早餐总消费 */ + @Excel(name = "早餐总消费") + private Double breakfastSumConsumption; + + /** 午餐次数 */ + @Excel(name = "午餐次数") + private Long lunchNumber; + + /** 午餐补助 */ + @Excel(name = "午餐补助") + private Double lunchSubsidy; + + /** 午餐个人消费 */ + @Excel(name = "午餐个人消费") + private Double lunchPresonalConsumption; + + /** 午餐总消费 */ + @Excel(name = "午餐总消费") + private Double lunchSumConsumption; + + /** 晚餐次数 */ + @Excel(name = "晚餐次数") + private Long supperNumber; + + /** 晚餐补助 */ + @Excel(name = "晚餐补助") + private Double supperSubsidy; + + /** 晚餐个人消费 */ + @Excel(name = "晚餐个人消费") + private Double supperPersonalConsumption; + + /** 晚餐总消费 */ + @Excel(name = "晚餐总消费") + private Double supperSumConsumption; + + /** 总补贴 */ + @Excel(name = "总补贴") + private Double sumSubsidy; + + /** 个人总消费 */ + @Excel(name = "个人总消费") + private Double personalSumConsumption; + + /** 总消费 */ + @Excel(name = "总消费") + private Double sumConsumption; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getStatisticsId() { + return statisticsId; + } + + public void setStatisticsId(Long statisticsId) { + this.statisticsId = statisticsId; + } + + public void setDateTime(Date dateTime) + { + this.dateTime = dateTime; + } + + public Date getDateTime() + { + return dateTime; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setShangBan(String shangBan) + { + this.shangBan = shangBan; + } + + public String getShangBan() + { + return shangBan; + } + public void setXiaBan(String xiaBan) + { + this.xiaBan = xiaBan; + } + + public String getXiaBan() + { + return xiaBan; + } + public void setDuration(Double duration) + { + this.duration = duration; + } + + public Double getDuration() + { + return duration; + } + public void setBreakfastNumber(Long breakfastNumber) + { + this.breakfastNumber = breakfastNumber; + } + + public Long getBreakfastNumber() + { + return breakfastNumber; + } + public void setBreakfastSubsidy(Double breakfastSubsidy) + { + this.breakfastSubsidy = breakfastSubsidy; + } + + public Double getBreakfastSubsidy() + { + return breakfastSubsidy; + } + public void setBreakfastPersonalConsumption(Double breakfastPersonalConsumption) + { + this.breakfastPersonalConsumption = breakfastPersonalConsumption; + } + + public Double getBreakfastPersonalConsumption() + { + return breakfastPersonalConsumption; + } + public void setBreakfastSumConsumption(Double breakfastSumConsumption) + { + this.breakfastSumConsumption = breakfastSumConsumption; + } + + public Double getBreakfastSumConsumption() + { + return breakfastSumConsumption; + } + public void setLunchNumber(Long lunchNumber) + { + this.lunchNumber = lunchNumber; + } + + public Long getLunchNumber() + { + return lunchNumber; + } + public void setLunchSubsidy(Double lunchSubsidy) + { + this.lunchSubsidy = lunchSubsidy; + } + + public Double getLunchSubsidy() + { + return lunchSubsidy; + } + public void setLunchPresonalConsumption(Double lunchPresonalConsumption) + { + this.lunchPresonalConsumption = lunchPresonalConsumption; + } + + public Double getLunchPresonalConsumption() + { + return lunchPresonalConsumption; + } + public void setLunchSumConsumption(Double lunchSumConsumption) + { + this.lunchSumConsumption = lunchSumConsumption; + } + + public Double getLunchSumConsumption() + { + return lunchSumConsumption; + } + public void setSupperNumber(Long supperNumber) + { + this.supperNumber = supperNumber; + } + + public Long getSupperNumber() + { + return supperNumber; + } + public void setSupperSubsidy(Double supperSubsidy) + { + this.supperSubsidy = supperSubsidy; + } + + public Double getSupperSubsidy() + { + return supperSubsidy; + } + public void setSupperPersonalConsumption(Double supperPersonalConsumption) + { + this.supperPersonalConsumption = supperPersonalConsumption; + } + + public Double getSupperPersonalConsumption() + { + return supperPersonalConsumption; + } + public void setSupperSumConsumption(Double supperSumConsumption) + { + this.supperSumConsumption = supperSumConsumption; + } + + public Double getSupperSumConsumption() + { + return supperSumConsumption; + } + public void setSumSubsidy(Double sumSubsidy) + { + this.sumSubsidy = sumSubsidy; + } + + public Double getSumSubsidy() + { + return sumSubsidy; + } + public void setPersonalSumConsumption(Double personalSumConsumption) + { + this.personalSumConsumption = personalSumConsumption; + } + + public Double getPersonalSumConsumption() + { + return personalSumConsumption; + } + public void setSumConsumption(Double sumConsumption) + { + this.sumConsumption = sumConsumption; + } + + public Double getSumConsumption() + { + return sumConsumption; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "CyConsumptionInfo [id=" + id + ", statisticsId=" + statisticsId + ", dateTime=" + dateTime + ", name=" + + name + ", shangBan=" + shangBan + ", xiaBan=" + xiaBan + ", duration=" + duration + + ", breakfastNumber=" + breakfastNumber + ", breakfastSubsidy=" + breakfastSubsidy + + ", breakfastPersonalConsumption=" + breakfastPersonalConsumption + ", breakfastSumConsumption=" + + breakfastSumConsumption + ", lunchNumber=" + lunchNumber + ", lunchSubsidy=" + lunchSubsidy + + ", lunchPresonalConsumption=" + lunchPresonalConsumption + ", lunchSumConsumption=" + + lunchSumConsumption + ", supperNumber=" + supperNumber + ", supperSubsidy=" + supperSubsidy + + ", supperPersonalConsumption=" + supperPersonalConsumption + ", supperSumConsumption=" + + supperSumConsumption + ", sumSubsidy=" + sumSubsidy + ", personalSumConsumption=" + + personalSumConsumption + ", sumConsumption=" + sumConsumption + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfo.java new file mode 100644 index 0000000..23087c3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfo.java @@ -0,0 +1,90 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 餐饮刷脸详情信息对象 cy_face_info + * + * @author zhukangchao + * @date 2023-10-05 + */ +public class CyFaceInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date date; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 刷脸时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "刷脸时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date time; + + /** 标记 */ + @Excel(name = "标记") + private String sign; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setTime(Date time) + { + this.time = time; + } + + public Date getTime() + { + return time; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + @Override + public String toString() { + return "CyFaceInfo [id=" + id + ", date=" + date + ", name=" + name + ", time=" + time + ", sign=" + sign + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfoData.java b/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfoData.java new file mode 100644 index 0000000..c08abd2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfoData.java @@ -0,0 +1,19 @@ +package com.ruoyi.project.management.domain; + +public class CyFaceInfoData { + + private int clock_in_count; + + public int getClock_in_count() { + return clock_in_count; + } + + public void setClock_in_count(int clock_in_count) { + this.clock_in_count = clock_in_count; + } + + @Override + public String toString() { + return "CyFaceInfoData [clock_in_count=" + clock_in_count + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfoVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfoVo.java new file mode 100644 index 0000000..9fe7ef4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CyFaceInfoVo.java @@ -0,0 +1,50 @@ +package com.ruoyi.project.management.domain; + +public class CyFaceInfoVo { + + private int Result; + private String Msg; + private int voice_code; + private String voice_text; + private CyFaceInfoData Content; + + + public int getResult() { + return Result; + } + public void setResult(int result) { + Result = result; + } + public String getMsg() { + return Msg; + } + public void setMsg(String msg) { + Msg = msg; + } + + public int getVoice_code() { + return voice_code; + } + public void setVoice_code(int voice_code) { + this.voice_code = voice_code; + } + public String getVoice_text() { + return voice_text; + } + public void setVoice_text(String voice_text) { + this.voice_text = voice_text; + } + + public CyFaceInfoData getContent() { + return Content; + } + public void setContent(CyFaceInfoData content) { + Content = content; + } + @Override + public String toString() { + return "CyFaceInfoVo [Result=" + Result + ", Msg=" + Msg + ", voice_code=" + voice_code + ", voice_text=" + + voice_text + ", Content=" + Content + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/CyStatisticsInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/CyStatisticsInfo.java new file mode 100644 index 0000000..e5367ce --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/CyStatisticsInfo.java @@ -0,0 +1,358 @@ +package com.ruoyi.project.management.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +import java.util.Date; + +/** + * 餐饮消费统计信息对象 cy_statistics_info + * + * @author zhukangchao + * @date 2023-10-05 + */ +public class CyStatisticsInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 所属月份 */ + @Excel(name = "所属月份") + private String date; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 早餐次数 */ + @Excel(name = "早餐次数") + private Long breakfastNumber; + + /** 早餐补助 */ + @Excel(name = "早餐补助") + private Double breakfastSubsidy; + + /** 早餐个人消费 */ + @Excel(name = "早餐个人消费") + private Double breakfastPersonalConsumption; + + /** 早餐总消费 */ + @Excel(name = "早餐总消费") + private Double breakfastSumConsumption; + + /** 午餐次数 */ + @Excel(name = "午餐次数") + private Long lunchNumber; + + /** 午餐补助 */ + @Excel(name = "午餐补助") + private Double lunchSubsidy; + + /** 午餐个人消费 */ + @Excel(name = "午餐个人消费") + private Double lunchPresonalConsumption; + + /** 午餐总消费 */ + @Excel(name = "午餐总消费") + private Double lunchSumConsumption; + + /** 晚餐次数 */ + @Excel(name = "晚餐次数") + private Long supperNumber; + + /** 晚餐补助 */ + @Excel(name = "晚餐补助") + private Double supperSubsidy; + + /** 晚餐个人消费 */ + @Excel(name = "晚餐个人消费") + private Double supperPersonalConsumption; + + /** 晚餐总消费 */ + @Excel(name = "晚餐总消费") + private Double supperSumConsumption; + + /** 总补贴 */ + @Excel(name = "总补贴") + private Double sumSubsidy; + + /** 个人总消费 */ + @Excel(name = "个人总消费") + private Double personalSumConsumption; + + /** 总消费 */ + @Excel(name = "总消费") + private Double sumConsumption; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 付款所属月份 */ + private String dateTwo; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDate(String date) + { + this.date = date; + } + + public String getDate() + { + return date; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBreakfastNumber(Long breakfastNumber) + { + this.breakfastNumber = breakfastNumber; + } + + public Long getBreakfastNumber() + { + return breakfastNumber; + } + public void setBreakfastSubsidy(Double breakfastSubsidy) + { + this.breakfastSubsidy = breakfastSubsidy; + } + + public Double getBreakfastSubsidy() + { + return breakfastSubsidy; + } + public void setBreakfastPersonalConsumption(Double breakfastPersonalConsumption) + { + this.breakfastPersonalConsumption = breakfastPersonalConsumption; + } + + public Double getBreakfastPersonalConsumption() + { + return breakfastPersonalConsumption; + } + public void setBreakfastSumConsumption(Double breakfastSumConsumption) + { + this.breakfastSumConsumption = breakfastSumConsumption; + } + + public Double getBreakfastSumConsumption() + { + return breakfastSumConsumption; + } + public void setLunchNumber(Long lunchNumber) + { + this.lunchNumber = lunchNumber; + } + + public Long getLunchNumber() + { + return lunchNumber; + } + public void setLunchSubsidy(Double lunchSubsidy) + { + this.lunchSubsidy = lunchSubsidy; + } + + public Double getLunchSubsidy() + { + return lunchSubsidy; + } + public void setLunchPresonalConsumption(Double lunchPresonalConsumption) + { + this.lunchPresonalConsumption = lunchPresonalConsumption; + } + + public Double getLunchPresonalConsumption() + { + return lunchPresonalConsumption; + } + public void setLunchSumConsumption(Double lunchSumConsumption) + { + this.lunchSumConsumption = lunchSumConsumption; + } + + public Double getLunchSumConsumption() + { + return lunchSumConsumption; + } + public void setSupperNumber(Long supperNumber) + { + this.supperNumber = supperNumber; + } + + public Long getSupperNumber() + { + return supperNumber; + } + public void setSupperSubsidy(Double supperSubsidy) + { + this.supperSubsidy = supperSubsidy; + } + + public Double getSupperSubsidy() + { + return supperSubsidy; + } + public void setSupperPersonalConsumption(Double supperPersonalConsumption) + { + this.supperPersonalConsumption = supperPersonalConsumption; + } + + public Double getSupperPersonalConsumption() + { + return supperPersonalConsumption; + } + public void setSupperSumConsumption(Double supperSumConsumption) + { + this.supperSumConsumption = supperSumConsumption; + } + + public Double getSupperSumConsumption() + { + return supperSumConsumption; + } + public void setSumSubsidy(Double sumSubsidy) + { + this.sumSubsidy = sumSubsidy; + } + + public Double getSumSubsidy() + { + return sumSubsidy; + } + public void setPersonalSumConsumption(Double personalSumConsumption) + { + this.personalSumConsumption = personalSumConsumption; + } + + public Double getPersonalSumConsumption() + { + return personalSumConsumption; + } + public void setSumConsumption(Double sumConsumption) + { + this.sumConsumption = sumConsumption; + } + + public Double getSumConsumption() + { + return sumConsumption; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public String getDateTwo() { + return dateTwo; + } + + public void setDateTwo(String dateTwo) { + this.dateTwo = dateTwo; + } + + @Override + public String toString() { + return "CyStatisticsInfo [id=" + id + ", date=" + date + ", name=" + name + ", breakfastNumber=" + + breakfastNumber + ", breakfastSubsidy=" + breakfastSubsidy + ", breakfastPersonalConsumption=" + + breakfastPersonalConsumption + ", breakfastSumConsumption=" + breakfastSumConsumption + + ", lunchNumber=" + lunchNumber + ", lunchSubsidy=" + lunchSubsidy + ", lunchPresonalConsumption=" + + lunchPresonalConsumption + ", lunchSumConsumption=" + lunchSumConsumption + ", supperNumber=" + + supperNumber + ", supperSubsidy=" + supperSubsidy + ", supperPersonalConsumption=" + + supperPersonalConsumption + ", supperSumConsumption=" + supperSumConsumption + ", sumSubsidy=" + + sumSubsidy + ", personalSumConsumption=" + personalSumConsumption + ", sumConsumption=" + + sumConsumption + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", dateTwo=" + dateTwo + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/DataInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/DataInfo.java new file mode 100644 index 0000000..a225df2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/DataInfo.java @@ -0,0 +1,608 @@ +package com.ruoyi.project.management.domain; + +import com.alibaba.fastjson.annotation.JSONField; + +public class DataInfo { + + @JSONField(name = "V1") + private String V1; + @JSONField(name = "V2") + private String V2; + @JSONField(name = "V3") + private String V3; + @JSONField(name = "V4") + private String V4; + @JSONField(name = "V5") + private String V5; + @JSONField(name = "V6") + private String V6; + @JSONField(name = "V7") + private String V7; + @JSONField(name = "V8") + private String V8; + @JSONField(name = "V9") + private String V9; + @JSONField(name = "V10") + private String V10; + @JSONField(name = "V11") + private String V11; + @JSONField(name = "V12") + private String V12; + @JSONField(name = "V13") + private String V13; + @JSONField(name = "V14") + private String V14; + @JSONField(name = "V15") + private String V15; + @JSONField(name = "V16") + private String V16; + @JSONField(name = "V17") + private String V17; + @JSONField(name = "V18") + private String V18; + @JSONField(name = "V19") + private String V19; + @JSONField(name = "V20") + private String V20; + @JSONField(name = "V21") + private String V21; + @JSONField(name = "V22") + private String V22; + @JSONField(name = "V23") + private String V23; + @JSONField(name = "V24") + private String V24; + @JSONField(name = "V25") + private String V25; + @JSONField(name = "V26") + private String V26; + @JSONField(name = "V27") + private String V27; + @JSONField(name = "V28") + private String V28; + @JSONField(name = "V29") + private String V29; + @JSONField(name = "V30") + private String V30; + @JSONField(name = "V31") + private String V31; + @JSONField(name = "V32") + private String V32; + @JSONField(name = "V33") + private String V33; + @JSONField(name = "V34") + private String V34; + @JSONField(name = "V35") + private String V35; + @JSONField(name = "V36") + private String V36; + @JSONField(name = "V37") + private String V37; + @JSONField(name = "V38") + private String V38; + @JSONField(name = "V39") + private String V39; + @JSONField(name = "V40") + private String V40; + @JSONField(name = "V41") + private String V41; + @JSONField(name = "V42") + private String V42; + @JSONField(name = "V43") + private String V43; + @JSONField(name = "V44") + private String V44; + @JSONField(name = "V45") + private String V45; + @JSONField(name = "V46") + private String V46; + @JSONField(name = "V47") + private String V47; + @JSONField(name = "V48") + private String V48; + @JSONField(name = "V49") + private String V49; + @JSONField(name = "V50") + private String V50; + @JSONField(name = "V51") + private String V51; + @JSONField(name = "V52") + private String V52; + @JSONField(name = "V53") + private String V53; + @JSONField(name = "G1") + private String G1; + @JSONField(name = "G2") + private String G2; + @JSONField(name = "G3") + private String G3; + @JSONField(name = "G4") + private String G4; + @JSONField(name = "G5") + private String G5; + @JSONField(name = "G6") + private String G6; + @JSONField(name = "G7") + private String G7; + @JSONField(name = "G8") + private String G8; + @JSONField(name = "G9") + private String G9; + @JSONField(name = "G10") + private String G10; + @JSONField(name = "G11") + private String G11; + @JSONField(name = "G12") + private String G12; + @JSONField(name = "G13") + private String G13; + @JSONField(name = "G14") + private String G14; + @JSONField(name = "G15") + private String G15; + @JSONField(name = "G16") + private String G16; + @JSONField(name = "G17") + private String G17; + @JSONField(name = "G18") + private String G18; + @JSONField(name = "G19") + private String G19; + @JSONField(name = "G20") + private String G20; + public String getV1() { + return V1; + } + public void setV1(String v1) { + V1 = v1; + } + public String getV2() { + return V2; + } + public void setV2(String v2) { + V2 = v2; + } + public String getV3() { + return V3; + } + public void setV3(String v3) { + V3 = v3; + } + public String getV4() { + return V4; + } + public void setV4(String v4) { + V4 = v4; + } + public String getV5() { + return V5; + } + public void setV5(String v5) { + V5 = v5; + } + public String getV6() { + return V6; + } + public void setV6(String v6) { + V6 = v6; + } + public String getV7() { + return V7; + } + public void setV7(String v7) { + V7 = v7; + } + public String getV8() { + return V8; + } + public void setV8(String v8) { + V8 = v8; + } + public String getV9() { + return V9; + } + public void setV9(String v9) { + V9 = v9; + } + public String getV10() { + return V10; + } + public void setV10(String v10) { + V10 = v10; + } + public String getV11() { + return V11; + } + public void setV11(String v11) { + V11 = v11; + } + public String getV12() { + return V12; + } + public void setV12(String v12) { + V12 = v12; + } + public String getV13() { + return V13; + } + public void setV13(String v13) { + V13 = v13; + } + public String getV14() { + return V14; + } + public void setV14(String v14) { + V14 = v14; + } + public String getV15() { + return V15; + } + public void setV15(String v15) { + V15 = v15; + } + public String getV16() { + return V16; + } + public void setV16(String v16) { + V16 = v16; + } + public String getV17() { + return V17; + } + public void setV17(String v17) { + V17 = v17; + } + public String getV18() { + return V18; + } + public void setV18(String v18) { + V18 = v18; + } + public String getV19() { + return V19; + } + public void setV19(String v19) { + V19 = v19; + } + public String getV20() { + return V20; + } + public void setV20(String v20) { + V20 = v20; + } + public String getV21() { + return V21; + } + public void setV21(String v21) { + V21 = v21; + } + public String getV22() { + return V22; + } + public void setV22(String v22) { + V22 = v22; + } + public String getV23() { + return V23; + } + public void setV23(String v23) { + V23 = v23; + } + public String getV24() { + return V24; + } + public void setV24(String v24) { + V24 = v24; + } + public String getV25() { + return V25; + } + public void setV25(String v25) { + V25 = v25; + } + public String getV26() { + return V26; + } + public void setV26(String v26) { + V26 = v26; + } + public String getV27() { + return V27; + } + public void setV27(String v27) { + V27 = v27; + } + public String getV28() { + return V28; + } + public void setV28(String v28) { + V28 = v28; + } + public String getV29() { + return V29; + } + public void setV29(String v29) { + V29 = v29; + } + public String getV30() { + return V30; + } + public void setV30(String v30) { + V30 = v30; + } + public String getV31() { + return V31; + } + public void setV31(String v31) { + V31 = v31; + } + public String getV32() { + return V32; + } + public void setV32(String v32) { + V32 = v32; + } + public String getV33() { + return V33; + } + public void setV33(String v33) { + V33 = v33; + } + public String getV34() { + return V34; + } + public void setV34(String v34) { + V34 = v34; + } + public String getV35() { + return V35; + } + public void setV35(String v35) { + V35 = v35; + } + public String getV36() { + return V36; + } + public void setV36(String v36) { + V36 = v36; + } + public String getV37() { + return V37; + } + public void setV37(String v37) { + V37 = v37; + } + public String getV38() { + return V38; + } + public void setV38(String v38) { + V38 = v38; + } + public String getV39() { + return V39; + } + public void setV39(String v39) { + V39 = v39; + } + public String getV40() { + return V40; + } + public void setV40(String v40) { + V40 = v40; + } + public String getV41() { + return V41; + } + public void setV41(String v41) { + V41 = v41; + } + public String getV42() { + return V42; + } + public void setV42(String v42) { + V42 = v42; + } + public String getV43() { + return V43; + } + public void setV43(String v43) { + V43 = v43; + } + public String getV44() { + return V44; + } + public void setV44(String v44) { + V44 = v44; + } + public String getV45() { + return V45; + } + public void setV45(String v45) { + V45 = v45; + } + public String getV46() { + return V46; + } + public void setV46(String v46) { + V46 = v46; + } + public String getV47() { + return V47; + } + public void setV47(String v47) { + V47 = v47; + } + public String getV48() { + return V48; + } + public void setV48(String v48) { + V48 = v48; + } + public String getV49() { + return V49; + } + public void setV49(String v49) { + V49 = v49; + } + public String getV50() { + return V50; + } + public void setV50(String v50) { + V50 = v50; + } + public String getV51() { + return V51; + } + public void setV51(String v51) { + V51 = v51; + } + public String getV52() { + return V52; + } + public void setV52(String v52) { + V52 = v52; + } + public String getV53() { + return V53; + } + public void setV53(String v53) { + V53 = v53; + } + public String getG1() { + return G1; + } + public void setG1(String g1) { + G1 = g1; + } + public String getG2() { + return G2; + } + public void setG2(String g2) { + G2 = g2; + } + public String getG3() { + return G3; + } + public void setG3(String g3) { + G3 = g3; + } + public String getG4() { + return G4; + } + public void setG4(String g4) { + G4 = g4; + } + public String getG5() { + return G5; + } + public void setG5(String g5) { + G5 = g5; + } + public String getG6() { + return G6; + } + public void setG6(String g6) { + G6 = g6; + } + public String getG7() { + return G7; + } + public void setG7(String g7) { + G7 = g7; + } + public String getG8() { + return G8; + } + public void setG8(String g8) { + G8 = g8; + } + public String getG9() { + return G9; + } + public void setG9(String g9) { + G9 = g9; + } + public String getG10() { + return G10; + } + public void setG10(String g10) { + G10 = g10; + } + public String getG11() { + return G11; + } + public void setG11(String g11) { + G11 = g11; + } + public String getG12() { + return G12; + } + public void setG12(String g12) { + G12 = g12; + } + public String getG13() { + return G13; + } + public void setG13(String g13) { + G13 = g13; + } + public String getG14() { + return G14; + } + public void setG14(String g14) { + G14 = g14; + } + public String getG15() { + return G15; + } + public void setG15(String g15) { + G15 = g15; + } + public String getG16() { + return G16; + } + public void setG16(String g16) { + G16 = g16; + } + public String getG17() { + return G17; + } + public void setG17(String g17) { + G17 = g17; + } + public String getG18() { + return G18; + } + public void setG18(String g18) { + G18 = g18; + } + public String getG19() { + return G19; + } + public void setG19(String g19) { + G19 = g19; + } + public String getG20() { + return G20; + } + public void setG20(String g20) { + G20 = g20; + } + @Override + public String toString() { + return "DataInfo [V1=" + V1 + ", V2=" + V2 + ", V3=" + V3 + ", V4=" + V4 + ", V5=" + V5 + ", V6=" + V6 + ", V7=" + + V7 + ", V8=" + V8 + ", V9=" + V9 + ", V10=" + V10 + ", V11=" + V11 + ", V12=" + V12 + ", V13=" + V13 + + ", V14=" + V14 + ", V15=" + V15 + ", V16=" + V16 + ", V17=" + V17 + ", V18=" + V18 + ", V19=" + V19 + + ", V20=" + V20 + ", V21=" + V21 + ", V22=" + V22 + ", V23=" + V23 + ", V24=" + V24 + ", V25=" + V25 + + ", V26=" + V26 + ", V27=" + V27 + ", V28=" + V28 + ", V29=" + V29 + ", V30=" + V30 + ", V31=" + V31 + + ", V32=" + V32 + ", V33=" + V33 + ", V34=" + V34 + ", V35=" + V35 + ", V36=" + V36 + ", V37=" + V37 + + ", V38=" + V38 + ", V39=" + V39 + ", V40=" + V40 + ", V41=" + V41 + ", V42=" + V42 + ", V43=" + V43 + + ", V44=" + V44 + ", V45=" + V45 + ", V46=" + V46 + ", V47=" + V47 + ", V48=" + V48 + ", V49=" + V49 + + ", V50=" + V50 + ", V51=" + V51 + ", V52=" + V52 + ", V53=" + V53 + ", G1=" + G1 + ", G2=" + G2 + + ", G3=" + G3 + ", G4=" + G4 + ", G5=" + G5 + ", G6=" + G6 + ", G7=" + G7 + ", G8=" + G8 + ", G9=" + G9 + + ", G10=" + G10 + ", G11=" + G11 + ", G12=" + G12 + ", G13=" + G13 + ", G14=" + G14 + ", G15=" + G15 + + ", G16=" + G16 + ", G17=" + G17 + ", G18=" + G18 + ", G19=" + G19 + ", G20=" + G20 + "]"; + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ErpInventory.java b/evo/src/main/java/com/ruoyi/project/management/domain/ErpInventory.java new file mode 100644 index 0000000..8634c2c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ErpInventory.java @@ -0,0 +1,98 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class ErpInventory { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物品名称 */ + @Excel(name = "物品名称") + private String name; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + @Override + public String toString() { + return "ErpInventory [id=" + id + ", name=" + name + ", quantity=" + quantity + ", sparedOne=" + sparedOne + + ", figureNumber=" + figureNumber + ", unit=" + unit + ", sparedTwo=" + sparedTwo + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/EvoInOutStorageManagement.java b/evo/src/main/java/com/ruoyi/project/management/domain/EvoInOutStorageManagement.java new file mode 100644 index 0000000..3808535 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/EvoInOutStorageManagement.java @@ -0,0 +1,269 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物品出入库管理对象 evo_in_out_storage_management + * + * @author chenyongjiang + * @date 2023-12-26 + */ +public class EvoInOutStorageManagement extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 参数主键 */ + private Long id; + + /** 物品名称 */ + @Excel(name = "物品名称") + private String materialName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 用途 */ + @Excel(name = "用途") + private String useTo; + + /** 申请数量 */ + @Excel(name = "申请数量") + private Long quantity; + + /** 合格数量 */ + private Long qualifiedNumber; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 申请人 */ + @Excel(name = "申请人") + private String applicant; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date appliyTime; + + /** 出入库状态标识 */ + @Excel(name = "出入库状态标识") + private String inOutFlag; + + /** 单据状态 */ + @Excel(name = "单据状态") + private String status; + + /** 审批人 */ + @Excel(name = "审批人") + private String approveBy; + + /** 审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date approveTime; + + /** 出/入库人 */ + @Excel(name = "出/入库人") + private String operateBy; + /** 呆滞库和物料标识:0:物料库*/ + private String flag; + /** 质检单ID */ + private Long productId; + + public Long getProductId() { + return productId; + } + + public void setProductId(Long productId) { + this.productId = productId; + } + + public Long getQualifiedNumber() { + return qualifiedNumber; + } + + public void setQualifiedNumber(Long qualifiedNumber) { + this.qualifiedNumber = qualifiedNumber; + } + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + /** 出/入库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "出/入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date operateTime; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setUseTo(String useTo) + { + this.useTo = useTo; + } + + public String getUseTo() + { + return useTo; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setApplicant(String applicant) + { + this.applicant = applicant; + } + + public String getApplicant() + { + return applicant; + } + public void setAppliyTime(Date appliyTime) + { + this.appliyTime = appliyTime; + } + + public Date getAppliyTime() + { + return appliyTime; + } + public void setInOutFlag(String inOutFlag) + { + this.inOutFlag = inOutFlag; + } + + public String getInOutFlag() + { + return inOutFlag; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setApproveBy(String approveBy) + { + this.approveBy = approveBy; + } + + public String getApproveBy() + { + return approveBy; + } + public void setApproveTime(Date approveTime) + { + this.approveTime = approveTime; + } + + public Date getApproveTime() + { + return approveTime; + } + public void setOperateBy(String operateBy) + { + this.operateBy = operateBy; + } + + public String getOperateBy() + { + return operateBy; + } + public void setOperateTime(Date operateTime) + { + this.operateTime = operateTime; + } + + public Date getOperateTime() + { + return operateTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("useTo", getUseTo()) + .append("quantity", getQuantity()) + .append("unit", getUnit()) + .append("applicant", getApplicant()) + .append("appliyTime", getAppliyTime()) + .append("inOutFlag", getInOutFlag()) + .append("status", getStatus()) + .append("approveBy", getApproveBy()) + .append("approveTime", getApproveTime()) + .append("operateBy", getOperateBy()) + .append("operateTime", getOperateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/EvoInvalidLibrary.java b/evo/src/main/java/com/ruoyi/project/management/domain/EvoInvalidLibrary.java new file mode 100644 index 0000000..7123b8e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/EvoInvalidLibrary.java @@ -0,0 +1,224 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 【请填写功能名称】对象 evo_invalid_library + * + * @author zhukangchao + * @date 2024-01-12 + */ +public class EvoInvalidLibrary extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID(自增) */ + private Long id; + + /** 执行令号 */ + @Excel(name = "执行令号") + private String productBillCode; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String itemName; + + /** 工序 */ + @Excel(name = "工序") + private String process; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 报废数量 */ + @Excel(name = "不良品数量") + private Double invalidNumber; + + /** 返修数量 */ + @Excel(name = "返修数量") + private Double repairNumber; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 提交人 */ + @Excel(name = "提交人") + private String operator; + + /** 提交时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date operatorTime; + + /** 质检人 */ + @Excel(name = "质检人") + private String qualityInspector; + + /** 质检时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "质检时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date qualityTime; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductBillCode(String productBillCode) + { + this.productBillCode = productBillCode; + } + + public String getProductBillCode() + { + return productBillCode; + } + public void setItemName(String itemName) + { + this.itemName = itemName; + } + + public String getItemName() + { + return itemName; + } + public void setProcess(String process) + { + this.process = process; + } + + public String getProcess() + { + return process; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setInvalidNumber(Double invalidNumber) + { + this.invalidNumber = invalidNumber; + } + + public Double getInvalidNumber() + { + return invalidNumber; + } + public void setRepairNumber(Double repairNumber) + { + this.repairNumber = repairNumber; + } + + public Double getRepairNumber() + { + return repairNumber; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setOperator(String operator) + { + this.operator = operator; + } + + public String getOperator() + { + return operator; + } + public void setOperatorTime(Date operatorTime) + { + this.operatorTime = operatorTime; + } + + public Date getOperatorTime() + { + return operatorTime; + } + public void setQualityInspector(String qualityInspector) + { + this.qualityInspector = qualityInspector; + } + + public String getQualityInspector() + { + return qualityInspector; + } + public void setQualityTime(Date qualityTime) + { + this.qualityTime = qualityTime; + } + + public Date getQualityTime() + { + return qualityTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("productBillCode", getProductBillCode()) + .append("itemName", getItemName()) + .append("process", getProcess()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("invalidNumber", getInvalidNumber()) + .append("repairNumber", getRepairNumber()) + .append("unit", getUnit()) + .append("operator", getOperator()) + .append("operatorTime", getOperatorTime()) + .append("remark", getRemark()) + .append("qualityInspector", getQualityInspector()) + .append("qualityTime", getQualityTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/EvoOperatorTypeJd.java b/evo/src/main/java/com/ruoyi/project/management/domain/EvoOperatorTypeJd.java new file mode 100644 index 0000000..4cdc226 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/EvoOperatorTypeJd.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 操作员类型对象 evo_operator_type_jd + * + * @author zhukangchao + * @date 2023-12-17 + */ +public class EvoOperatorTypeJd extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 参数主键 */ + private Long id; + + /** 操作员编码 */ + @Excel(name = "操作员编码") + private String operatorCode; + + /** 操作员类型名称 */ + @Excel(name = "操作员类型名称") + private String materialCode; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOperatorCode(String operatorCode) + { + this.operatorCode = operatorCode; + } + + public String getOperatorCode() + { + return operatorCode; + } + public void setMaterialCode(String materialCode) + { + this.materialCode = materialCode; + } + + public String getMaterialCode() + { + return materialCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("operatorCode", getOperatorCode()) + .append("materialCode", getMaterialCode()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/EvoStagnantStorage.java b/evo/src/main/java/com/ruoyi/project/management/domain/EvoStagnantStorage.java new file mode 100644 index 0000000..55d2314 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/EvoStagnantStorage.java @@ -0,0 +1,233 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 呆滞库对象 evo_stagnant_storage + * + * @author zhukangchao + * @date 2023-12-27 + */ +public class EvoStagnantStorage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物品名称 */ + @Excel(name = "物品名称") + private String name; + + /** 规格型号名称 */ + @Excel(name = "规格型号名称") + private String typeName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 所属类别 */ + @Excel(name = "所属类别") + private String type; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 所属型号 */ + @Excel(name = "所属型号") + private String category; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 含税单价 */ + @Excel(name = "含税单价") + private Double univalence; + + /** 未税单价 */ + @Excel(name = "未税单价") + private Double unitPrice; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 锁定库存数量 */ + @Excel(name = "锁定库存数量") + private Long lockNumber; + + /** 可用数量 */ + @Excel(name = "可用数量") + private Long availableNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setCategory(String category) + { + this.category = category; + } + + public String getCategory() + { + return category; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setLockNumber(Long lockNumber) + { + this.lockNumber = lockNumber; + } + + public Long getLockNumber() + { + return lockNumber; + } + public void setAvailableNumber(Long availableNumber) + { + this.availableNumber = availableNumber; + } + + public Long getAvailableNumber() + { + return availableNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("typeName", getTypeName()) + .append("figureNumber", getFigureNumber()) + .append("type", getType()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("category", getCategory()) + .append("unit", getUnit()) + .append("univalence", getUnivalence()) + .append("unitPrice", getUnitPrice()) + .append("quantity", getQuantity()) + .append("lockNumber", getLockNumber()) + .append("availableNumber", getAvailableNumber()) + .append("remarks", getRemarks()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/GxProcessVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/GxProcessVo.java new file mode 100644 index 0000000..3f6c0bc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/GxProcessVo.java @@ -0,0 +1,117 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class GxProcessVo { + + @Excel(name = "序号") + private String num; + @Excel(name = "零件代号") + private String figureNumber; + @Excel(name = "零件名称") + private String name; + @Excel(name = "材质") + private String type; + @Excel(name = "工艺路线") + private String processName; + @Excel(name = "序工时") + private String processTime; + @Excel(name = "金蝶用量(kg)") + private String number1; + @Excel(name = "金蝶用量(m)") + private String number2; + @Excel(name = "物料编码") + private String materialCode; + @Excel(name = "物料名称") + private String materialName; + @Excel(name = "备注") + private String remarks; + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String getNumber1() { + return number1; + } + + public void setNumber1(String number1) { + this.number1 = number1; + } + + public String getNumber2() { + return number2; + } + + public void setNumber2(String number2) { + this.number2 = number2; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getProcessTime() { + return processTime; + } + + public void setProcessTime(String processTime) { + this.processTime = processTime; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImCustomer.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImCustomer.java new file mode 100644 index 0000000..7dee5c6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImCustomer.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.framework.web.domain.BaseEntity; /** * 客户维护对象 im_customer * * @author chenyj * @date 2023-10-26 */ public class ImCustomer extends BaseEntity { private static final long serialVersionUID = 1L; /** 参数主键 */ private Long id; /** 客户名称 */ @Excel(name = "客户名称") private String customerName; /** 客户简称 */ @Excel(name = "客户简称") private String customerToAs; @Excel(name = "客户分组") private String customerGroup; @Excel(name = "客户分组名称") private String customerGroupName; /** 客户所属国家 */ @Excel(name = "客户所属国家") private String country; /** 地址 */ @Excel(name = "地址") private String customerAddress; /** 客户等级 */ @Excel(name = "客户等级") private Long customerLevel; /** 负责人 */ @Excel(name = "负责人") private String customerHead; /** 电话 */ @Excel(name = "电话") private String phone; /** 邮件 */ @Excel(name = "邮件") private String email; /** 开户行 */ @Excel(name = "开户行") private String bank; /** 开户行地址 */ @Excel(name = "开户行地址") private String bankAddress; public String getBankAddress() { return bankAddress; } public void setBankAddress(String bankAddress) { this.bankAddress = bankAddress; } /** 账户 */ @Excel(name = "账户") private String bankNumber; /** 税号 */ @Excel(name = "税号") private String dutyParagraph; /** 客户分类:0:意向客户,1:重点客户 */ @Excel(name = "客户分类:0:意向客户,1:重点客户") private String customerType; /** 合同编号:多个逗号,分隔 */ @Excel(name = "合同编号:多个逗号,分隔") private String contractCode; /** 联行号 */ @Excel(name = "联行号") private String interbankNumber; /** 外汇标记 */ @Excel(name = "外汇标记") private String swiftCode; public String getInterbankNumber() { return interbankNumber; } public void setInterbankNumber(String interbankNumber) { this.interbankNumber = interbankNumber; } public String getSwiftCode() { return swiftCode; } public void setSwiftCode(String swiftCode) { this.swiftCode = swiftCode; } public String getCustomerGroup() { return customerGroup; } public void setCustomerGroup(String customerGroup) { this.customerGroup = customerGroup; } public String getCustomerGroupName() { return customerGroupName; } public void setCustomerGroupName(String customerGroupName) { this.customerGroupName = customerGroupName; } public void setId(Long id) { this.id = id; } public Long getId() { return id; } public void setCustomerName(String customerName) { this.customerName = customerName; } public String getCustomerName() { return customerName; } public void setCustomerToAs(String customerToAs) { this.customerToAs = customerToAs; } public String getCustomerToAs() { return customerToAs; } public void setCustomerAddress(String customerAddress) { this.customerAddress = customerAddress; } public String getCustomerAddress() { return customerAddress; } public void setCustomerLevel(Long customerLevel) { this.customerLevel = customerLevel; } public Long getCustomerLevel() { return customerLevel; } public void setCustomerHead(String customerHead) { this.customerHead = customerHead; } public String getCustomerHead() { return customerHead; } public void setPhone(String phone) { this.phone = phone; } public String getPhone() { return phone; } public void setEmail(String email) { this.email = email; } public String getEmail() { return email; } public void setBank(String bank) { this.bank = bank; } public String getBank() { return bank; } public void setBankNumber(String bankNumber) { this.bankNumber = bankNumber; } public String getBankNumber() { return bankNumber; } public void setDutyParagraph(String dutyParagraph) { this.dutyParagraph = dutyParagraph; } public String getDutyParagraph() { return dutyParagraph; } public void setCustomerType(String customerType) { this.customerType = customerType; } public String getCustomerType() { return customerType; } public void setContractCode(String contractCode) { this.contractCode = contractCode; } public String getContractCode() { return contractCode; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("customerName", getCustomerName()) .append("customerToAs", getCustomerToAs()) .append("customerAddress", getCustomerAddress()) .append("customerLevel", getCustomerLevel()) .append("customerHead", getCustomerHead()) .append("phone", getPhone()) .append("email", getEmail()) .append("bank", getBank()) .append("bankNumber", getBankNumber()) .append("dutyParagraph", getDutyParagraph()) .append("customerType", getCustomerType()) .append("contractCode", getContractCode()) .append("remark", getRemark()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .toString(); } } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImCustomerType.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImCustomerType.java new file mode 100644 index 0000000..b337d7b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImCustomerType.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.framework.web.domain.BaseEntity; /** * 客户类型对象 im_customer_type * * @author zhukangchao * @date 2023-12-04 */ public class ImCustomerType extends BaseEntity { private static final long serialVersionUID = 1L; /** 参数主键 */ private Long id; /** 客户类型名称 */ @Excel(name = "客户类型名称") private String customerGroupName; public String getCustomerGroupName() { return customerGroupName; } public void setCustomerGroupName(String customerGroupName) { this.customerGroupName = customerGroupName; } public void setId(Long id) { this.id = id; } public Long getId() { return id; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("createTime", getCreateTime()) .append("createBy", getCreateBy()) .toString(); } } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImDeliveryUnit.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImDeliveryUnit.java new file mode 100644 index 0000000..b754916 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImDeliveryUnit.java @@ -0,0 +1,178 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 交货单位对象 im_delivery_unit + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImDeliveryUnit extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 部门id */ + @Excel(name = "部门id") + private Long departmentId; + + /** 部门名称 */ + @Excel(name = "部门名称") + private String departmentName; + + /** 单位负责人 */ + @Excel(name = "单位负责人") + private String unitPrincipal; + + /** 单位电话 */ + @Excel(name = "单位电话") + private String unitPhone; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUnitName(String unitName) + { + this.unitName = unitName; + } + + public String getUnitName() + { + return unitName; + } + public void setDepartmentId(Long departmentId) + { + this.departmentId = departmentId; + } + + public Long getDepartmentId() + { + return departmentId; + } + public void setDepartmentName(String departmentName) + { + this.departmentName = departmentName; + } + + public String getDepartmentName() + { + return departmentName; + } + public void setUnitPrincipal(String unitPrincipal) + { + this.unitPrincipal = unitPrincipal; + } + + public String getUnitPrincipal() + { + return unitPrincipal; + } + public void setUnitPhone(String unitPhone) + { + this.unitPhone = unitPhone; + } + + public String getUnitPhone() + { + return unitPhone; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("unitName", getUnitName()) + .append("departmentId", getDepartmentId()) + .append("departmentName", getDepartmentName()) + .append("unitPrincipal", getUnitPrincipal()) + .append("unitPhone", getUnitPhone()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImLogistics.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImLogistics.java new file mode 100644 index 0000000..8727593 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImLogistics.java @@ -0,0 +1,150 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物流对象 im_logistics + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImLogistics extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物流公司名称 */ + @Excel(name = "物流公司名称") + private String logisticsName; + + /** 物流公司负责人 */ + @Excel(name = "物流公司负责人") + private String logisticsPrincipal; + + /** 物流公司电话 */ + @Excel(name = "物流公司电话") + private String logisticsPhone; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setLogisticsName(String logisticsName) + { + this.logisticsName = logisticsName; + } + + public String getLogisticsName() + { + return logisticsName; + } + public void setLogisticsPrincipal(String logisticsPrincipal) + { + this.logisticsPrincipal = logisticsPrincipal; + } + + public String getLogisticsPrincipal() + { + return logisticsPrincipal; + } + public void setLogisticsPhone(String logisticsPhone) + { + this.logisticsPhone = logisticsPhone; + } + + public String getLogisticsPhone() + { + return logisticsPhone; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("logisticsName", getLogisticsName()) + .append("logisticsPrincipal", getLogisticsPrincipal()) + .append("logisticsPhone", getLogisticsPhone()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterial.java new file mode 100644 index 0000000..6142f18 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterial.java @@ -0,0 +1,733 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料(零件)对象 im_material + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + /** 材料名称 */ + @Excel(name = "物料名称") + private String materialName; + + @Excel(name = "物料分组ID") + private String materialGroup; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 规格型号 */ +// @Excel(name = "规格型号") + private String specificationType; + + /** 长度 */ + @Excel(name = "长度") + private Double len; + + /** 宽度 */ + @Excel(name = "宽度") + private Double wid; + + /** b短边宽度 */ + @Excel(name = "短边宽度(b)") + private Double widTwo; + + /** 高度 */ + @Excel(name = "高度") + private Double altitude; + + /** 外直径 */ + @Excel(name = "外直径") + private Double outerDiameter; + + /** 内直径 */ + @Excel(name = "内直径") + private Double internalDiameter; + + /** 厚度t */ + @Excel(name = "厚度(t1)") + private Double thickness; + + /** 厚度 */ + @Excel(name = "厚度(t2)") + private Double thicknessTwo; + + /** 颜色 */ +// @Excel(name = "颜色") + private String colour; + + @Excel(name = "存货类别ID") + private String categoryId; + /** 类别 */ + @Excel(name = "存货类别") + private String category; + @Excel(name = "材料ID") + private String materialsId; + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 材料类型id */ +// @Excel(name = "材料类型id") + private Long materialTypeId; + + /** 材料类型名称 */ + @Excel(name = "材料类型名称") + private String materialTypeName; + @Excel(name = "物料属性ID") + private String purchaseMarkId; + /** */ + @Excel(name = "物料属性") + private String purchaseMark; + + /** 计量单位id */ + @Excel(name = "计量单位id") + private String unitOfMeasurementId; + + /** 计量单位名称 */ + @Excel(name = "计量单位名称") + private String unitOfMeasurementName; + + /** 级别尺寸 */ + private Long rankMeasure; + + /** 残料尺寸 */ + private Long defectiveMaterialMeasure; + + /** 仓库id */ + @Excel(name = "仓库id") + private String warehouseId; + + /** 仓库名称 */ + @Excel(name = "仓库名称") + private String warehouseName; + + /** 优先供应商id */ +// @Excel(name = "优先供应商id") + private Long preferentialSupplierId; + + /** 供应商名称1 */ + @Excel(name = "供应商名称1") + private String preferentialOriginName; + + /** 供应商名称2 */ + @Excel(name = "供应商名称2") + private String preferentialOriginNameTwo; + + /** 供应商名称3 */ + @Excel(name = "供应商名称3") + private String preferentialOriginNameThree; + + /** 是否常用 */ +// @Excel(name = "是否常用") + private Integer common; + + /** 最低库存 */ + @Excel(name = "最低库存") + private Long minimum; + + /** 最高库存 */ + @Excel(name = "最高库存") + private Long highest; + + /** 最高限制数量 */ + @Excel(name = "最高限制数量") + private Long highestNumber; + + /** 图片 */ +// @Excel(name = "图片") + private String picture; + + /** 未税单价 */ + @Excel(name = "未税单价") + private BigDecimal univalence; + + /** 含税单价 */ + @Excel(name = "含税单价") + private BigDecimal unitPrice; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** 是否裁剪 */ + private String tailor; + + /** 最高裁剪尺寸 */ + private Long tailorMeasure; + + /** 最低剩余尺寸 */ + private Long surplusMeasure; + + /** 比例 */ + private Long proportion; + + /** 领用单位 */ + private String stockRequisitionUnit; + + private Long quantity; + + @Excel(name = "允许采购") + private String isBuy; + @Excel(name = "允许销售") + private String isSale; + @Excel(name = "允许库存") + private String isStore; + @Excel(name = "允许生产") + private String isProduct; + @Excel(name = "允许委外") + private String isOut; + @Excel(name = "可为主产品") + private String ismain; + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getMaterialsId() { + return materialsId; + } + + public void setMaterialsId(String materialsId) { + this.materialsId = materialsId; + } + + public String getPurchaseMarkId() { + return purchaseMarkId; + } + + public void setPurchaseMarkId(String purchaseMarkId) { + this.purchaseMarkId = purchaseMarkId; + } + + public String getIsBuy() { + return isBuy; + } + + public void setIsBuy(String isBuy) { + this.isBuy = isBuy; + } + + public String getIsSale() { + return isSale; + } + + public void setIsSale(String isSale) { + this.isSale = isSale; + } + + public String getIsStore() { + return isStore; + } + + public void setIsStore(String isStore) { + this.isStore = isStore; + } + + public String getIsProduct() { + return isProduct; + } + + public void setIsProduct(String isProduct) { + this.isProduct = isProduct; + } + + public String getIsOut() { + return isOut; + } + + public void setIsOut(String isOut) { + this.isOut = isOut; + } + + public String getIsmain() { + return ismain; + } + + public void setIsmain(String ismain) { + this.ismain = ismain; + } + + public String getMaterialGroup() { + return materialGroup; + } + + public void setMaterialGroup(String materialGroup) { + this.materialGroup = materialGroup; + } + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setSpecificationType(String specificationType) + { + this.specificationType = specificationType; + } + + public String getSpecificationType() + { + return specificationType; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public void setMaterialTypeId(Long materialTypeId) + { + this.materialTypeId = materialTypeId; + } + + public Long getMaterialTypeId() + { + return materialTypeId; + } + public void setMaterialTypeName(String materialTypeName) + { + this.materialTypeName = materialTypeName; + } + + public String getMaterialTypeName() + { + return materialTypeName; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public void setUnitOfMeasurementId(String unitOfMeasurementId) + { + this.unitOfMeasurementId = unitOfMeasurementId; + } + + public String getUnitOfMeasurementId() + { + return unitOfMeasurementId; + } + public void setUnitOfMeasurementName(String unitOfMeasurementName) + { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public String getUnitOfMeasurementName() + { + return unitOfMeasurementName; + } + public Long getRankMeasure() { + return rankMeasure; + } + + public void setRankMeasure(Long rankMeasure) { + this.rankMeasure = rankMeasure; + } + + public Long getDefectiveMaterialMeasure() { + return defectiveMaterialMeasure; + } + + public void setDefectiveMaterialMeasure(Long defectiveMaterialMeasure) { + this.defectiveMaterialMeasure = defectiveMaterialMeasure; + } + + public void setWarehouseId(String warehouseId) + { + this.warehouseId = warehouseId; + } + + public String getWarehouseId() + { + return warehouseId; + } + public void setWarehouseName(String warehouseName) + { + this.warehouseName = warehouseName; + } + + public String getWarehouseName() + { + return warehouseName; + } + public void setPreferentialSupplierId(Long preferentialSupplierId) + { + this.preferentialSupplierId = preferentialSupplierId; + } + + public Long getPreferentialSupplierId() + { + return preferentialSupplierId; + } + public void setPreferentialOriginName(String preferentialOriginName) + { + this.preferentialOriginName = preferentialOriginName; + } + + public String getPreferentialOriginName() + { + return preferentialOriginName; + } + + public String getPreferentialOriginNameTwo() { + return preferentialOriginNameTwo; + } + + public void setPreferentialOriginNameTwo(String preferentialOriginNameTwo) { + this.preferentialOriginNameTwo = preferentialOriginNameTwo; + } + + public String getPreferentialOriginNameThree() { + return preferentialOriginNameThree; + } + + public void setPreferentialOriginNameThree(String preferentialOriginNameThree) { + this.preferentialOriginNameThree = preferentialOriginNameThree; + } + + public void setCommon(Integer common) + { + this.common = common; + } + + public Integer getCommon() + { + return common; + } + public void setMinimum(Long minimum) + { + this.minimum = minimum; + } + + public Long getMinimum() + { + return minimum; + } + public void setHighest(Long highest) + { + this.highest = highest; + } + + public Long getHighest() + { + return highest; + } + public Long getHighestNumber() { + return highestNumber; + } + + public void setHighestNumber(Long highestNumber) { + this.highestNumber = highestNumber; + } + + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setUnivalence(BigDecimal univalence) + { + this.univalence = univalence; + } + + public BigDecimal getUnivalence() + { + return univalence; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public Double getLen() { + return len; + } + + public void setLen(Double len) { + this.len = len; + } + + public Double getWid() { + return wid; + } + + public void setWid(Double wid) { + this.wid = wid; + } + + public Double getAltitude() { + return altitude; + } + + public void setAltitude(Double altitude) { + this.altitude = altitude; + } + + public Double getOuterDiameter() { + return outerDiameter; + } + + public void setOuterDiameter(Double outerDiameter) { + this.outerDiameter = outerDiameter; + } + + public Double getInternalDiameter() { + return internalDiameter; + } + + public void setInternalDiameter(Double internalDiameter) { + this.internalDiameter = internalDiameter; + } + + public String getColour() { + return colour; + } + + public void setColour(String colour) { + this.colour = colour; + } + + public Double getWidTwo() { + return widTwo; + } + + public void setWidTwo(Double widTwo) { + this.widTwo = widTwo; + } + + public Double getThickness() { + return thickness; + } + + public void setThickness(Double thickness) { + this.thickness = thickness; + } + + public Double getThicknessTwo() { + return thicknessTwo; + } + + public void setThicknessTwo(Double thicknessTwo) { + this.thicknessTwo = thicknessTwo; + } + public String getTailor() { + return tailor; + } + + public void setTailor(String tailor) { + this.tailor = tailor; + } + + public Long getTailorMeasure() { + return tailorMeasure; + } + + public void setTailorMeasure(Long tailorMeasure) { + this.tailorMeasure = tailorMeasure; + } + + public Long getSurplusMeasure() { + return surplusMeasure; + } + + public void setSurplusMeasure(Long surplusMeasure) { + this.surplusMeasure = surplusMeasure; + } + + public Long getProportion() { + return proportion; + } + + public void setProportion(Long proportion) { + this.proportion = proportion; + } + + public String getStockRequisitionUnit() { + return stockRequisitionUnit; + } + + public void setStockRequisitionUnit(String stockRequisitionUnit) { + this.stockRequisitionUnit = stockRequisitionUnit; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public String getPurchaseMark() { + return purchaseMark; + } + + public void setPurchaseMark(String purchaseMark) { + this.purchaseMark = purchaseMark; + } + + @Override + public String toString() { + return "ImMaterial [id=" + id + ", materialCode=" + materialCode + ", materialName=" + materialName + + ", specificationType=" + specificationType + ", figureNumber=" + figureNumber + ", len=" + len + + ", wid=" + wid + ", widTwo=" + widTwo + ", altitude=" + altitude + ", outerDiameter=" + outerDiameter + + ", internalDiameter=" + internalDiameter + ", thickness=" + thickness + ", thicknessTwo=" + + thicknessTwo + ", colour=" + colour + ", category=" + category + ", materials=" + materials + + ", pieceWeight=" + pieceWeight + ", materialTypeId=" + materialTypeId + ", materialTypeName=" + + materialTypeName + ", purchaseMark=" + purchaseMark + ", unitOfMeasurementId=" + unitOfMeasurementId + + ", unitOfMeasurementName=" + unitOfMeasurementName + ", rankMeasure=" + rankMeasure + + ", defectiveMaterialMeasure=" + defectiveMaterialMeasure + ", warehouseId=" + warehouseId + + ", warehouseName=" + warehouseName + ", preferentialSupplierId=" + preferentialSupplierId + + ", preferentialOriginName=" + preferentialOriginName + ", preferentialOriginNameTwo=" + + preferentialOriginNameTwo + ", preferentialOriginNameThree=" + preferentialOriginNameThree + + ", common=" + common + ", minimum=" + minimum + ", highest=" + highest + ", highestNumber=" + + highestNumber + ", picture=" + picture + ", univalence=" + univalence + ", unitPrice=" + unitPrice + + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", tailor=" + tailor + ", tailorMeasure=" + + tailorMeasure + ", surplusMeasure=" + surplusMeasure + ", proportion=" + proportion + + ", stockRequisitionUnit=" + stockRequisitionUnit + ", quantity=" + quantity + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialData.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialData.java new file mode 100644 index 0000000..9493024 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialData.java @@ -0,0 +1,43 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +/** + * 物料(零件)对象 im_material + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImMaterialData +{ + private String materialName; + private String figureNumber; + private String materials; + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialGroup.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialGroup.java new file mode 100644 index 0000000..19a42e0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialGroup.java @@ -0,0 +1,51 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料分组对象 im_material_group + * + * @author zhukangchao + * @date 2023-12-15 + */ +public class ImMaterialGroup extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 分组名称 */ + @Excel(name = "分组名称") + private String groupName; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setGroupName(String groupName) + { + this.groupName = groupName; + } + + public String getGroupName() + { + return groupName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("groupName", getGroupName()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialType.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialType.java new file mode 100644 index 0000000..7a1c5a7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImMaterialType.java @@ -0,0 +1,135 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料(零件)类型对象 im_material_type + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImMaterialType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 父级id */ + @Excel(name = "父级id") + private Long parentId; + + /** 物料类型名称 */ + @Excel(name = "物料类型名称") + private String materialTypeName; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getParentId() + { + return parentId; + } + public void setMaterialTypeName(String materialTypeName) + { + this.materialTypeName = materialTypeName; + } + + public String getMaterialTypeName() + { + return materialTypeName; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("parentId", getParentId()) + .append("materialTypeName", getMaterialTypeName()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImMeteringUnit.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImMeteringUnit.java new file mode 100644 index 0000000..da40d85 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImMeteringUnit.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 计量单位对象 im_metering_unit + * + * @author zhukangchao + * @date 2020-06-23 + */ +public class ImMeteringUnit extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private String id; + + /** 计量单位名称 */ + @Excel(name = "计量单位名称") + private String unitName; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String spreadOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setUnitName(String unitName) + { + this.unitName = unitName; + } + + public String getUnitName() + { + return unitName; + } + public void setSpreadOne(String spreadOne) + { + this.spreadOne = spreadOne; + } + + public String getSpreadOne() + { + return spreadOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("unitName", getUnitName()) + .append("remark", getRemark()) + .append("spreadOne", getSpreadOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceipt.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceipt.java new file mode 100644 index 0000000..c8240e3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceipt.java @@ -0,0 +1,240 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品(半成品)入库单对象 im_product_receipt + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImProductReceipt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 关联单据 */ + @Excel(name = "关联单据") + private String makeDocumentsCode; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 申请人 */ + @Excel(name = "申请人") + private String proposer; + /** 接收人 */ + @Excel(name = "交货单位") + private String recipient; + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 交货单位id */ + @Excel(name = "交货单位id") + private Long deliveryUnitId; + + /** 交货单位 */ + @Excel(name = "交货单位") + private String deliveryUnit; + + /** 编号 */ + @Excel(name = "编号") + private String code; + + /** 加工单id */ + @Excel(name = "加工单id") + private Long worksheetId; + + /** 加工单单号 */ + @Excel(name = "加工单单号") + private String worksheetCode; + + /** 生产任务id */ + @Excel(name = "生产任务id") + private Long productiveTaskId; + + /** 生产任务编号 */ + @Excel(name = "生产任务编号") + private String productiveTaskCode; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMakeDocumentsCode() { + return makeDocumentsCode; + } + + public void setMakeDocumentsCode(String makeDocumentsCode) { + this.makeDocumentsCode = makeDocumentsCode; + } + + public String getProposer() { + return proposer; + } + + public void setProposer(String proposer) { + this.proposer = proposer; + } + + public String getRecipient() { + return recipient; + } + + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public Long getDeliveryUnitId() { + return deliveryUnitId; + } + + public void setDeliveryUnitId(Long deliveryUnitId) { + this.deliveryUnitId = deliveryUnitId; + } + + public String getDeliveryUnit() { + return deliveryUnit; + } + + public void setDeliveryUnit(String deliveryUnit) { + this.deliveryUnit = deliveryUnit; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Long getWorksheetId() { + return worksheetId; + } + + public void setWorksheetId(Long worksheetId) { + this.worksheetId = worksheetId; + } + + public String getWorksheetCode() { + return worksheetCode; + } + + public void setWorksheetCode(String worksheetCode) { + this.worksheetCode = worksheetCode; + } + + public Long getProductiveTaskId() { + return productiveTaskId; + } + + public void setProductiveTaskId(Long productiveTaskId) { + this.productiveTaskId = productiveTaskId; + } + + public String getProductiveTaskCode() { + return productiveTaskCode; + } + + public void setProductiveTaskCode(String productiveTaskCode) { + this.productiveTaskCode = productiveTaskCode; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + @Override + public String toString() { + return "ImProductReceipt [id=" + id + ", makeDocumentsCode=" + makeDocumentsCode + ", proposer=" + proposer + + ", recipient=" + recipient + ", inventoryStatus=" + inventoryStatus + ", deliveryUnitId=" + + deliveryUnitId + ", deliveryUnit=" + deliveryUnit + ", code=" + code + ", worksheetId=" + worksheetId + + ", worksheetCode=" + worksheetCode + ", productiveTaskId=" + productiveTaskId + + ", productiveTaskCode=" + productiveTaskCode + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceiptMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceiptMaterial.java new file mode 100644 index 0000000..584b8e5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceiptMaterial.java @@ -0,0 +1,481 @@ +package com.ruoyi.project.management.domain; + +import java.util.Arrays; +import java.util.Date; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料产品入库单关联对象 im_product_receipt_material + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImProductReceiptMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 产品入库单id */ +// @Excel(name = "产品入库单id") + private Long productReceiptId; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 执行单code */ + @Excel(name = "关联单据") + private String code; + + /** 物料id */ +// @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** 图号 */ + @Excel(name = "图号") + private String specification; + + /** 材料 */ + @Excel(name = "材料") + private String materialType; + + /** 收货仓库id */ +// @Excel(name = "收货仓库id") + private Long warehouseId; + + /** 收货仓库名称 */ +// @Excel(name = "收货仓库名称") + private String warehouseName; + + /** 供应商名称 */ +// @Excel(name = "供应商名称") + private String preferentialOriginName; + + /** 批号 */ +// @Excel(name = "批号") + private Long batchNumber; + + /** 计量单位 */ + @Excel(name = "单位") + private String unit; + + /** 应收数量 */ + @Excel(name = "应收数量") + private Double receivableQuantity; + + /** 已收数量 */ +// @Excel(name = "数量") + private Double received; + + /** 实收数量 */ + @Excel(name = "数量") + private Double actualQuantity; + + /** 实重 */ + @Excel(name = "重量(Kg)") + private Double practicalNumber; + + /** 未税单价 */ + private Double unitPrice; + + /** 含税单价 */ +// @Excel(name = "单价") + private Double univalence; + + /** 总价 */ +// @Excel(name = "金额") + private Double totalPrices; + + /** 申请人 */ + @Excel(name = "申请人") + private String proposer; + /** 质检员 */ + @Excel(name = "质检员") + private String qualityInspector; + + /** + * 检验时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "检验时间") + private Date checkoutTime; + + /** 接收人 */ + @Excel(name = "接收人") + private String recipient; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 入库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "入库时间") + private Date storageDate; + + /** 查询入库时间 */ +// @JsonFormat(pattern = "yyyy-MM-dd") + private String[] storageDates; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** 合计金额大写 */ + private String amountCapital; + + /** 库存数量 */ +// @Excel(name = "实发数量") + private Long inventoryQuantity; + + //起始时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date start; + //结束时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date end; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getProductReceiptId() { + return productReceiptId; + } + + public void setProductReceiptId(Long productReceiptId) { + this.productReceiptId = productReceiptId; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public Long getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(Long warehouseId) { + this.warehouseId = warehouseId; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + + public Long getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(Long batchNumber) { + this.batchNumber = batchNumber; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Double getReceivableQuantity() { + return receivableQuantity; + } + + public void setReceivableQuantity(Double receivableQuantity) { + this.receivableQuantity = receivableQuantity; + } + + public Double getReceived() { + return received; + } + + public void setReceived(Double received) { + this.received = received; + } + + public Double getActualQuantity() { + return actualQuantity; + } + + public void setActualQuantity(Double actualQuantity) { + this.actualQuantity = actualQuantity; + } + + public Double getPracticalNumber() { + return practicalNumber; + } + + public void setPracticalNumber(Double practicalNumber) { + this.practicalNumber = practicalNumber; + } + + public Double getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(Double unitPrice) { + this.unitPrice = unitPrice; + } + + public Double getUnivalence() { + return univalence; + } + + public void setUnivalence(Double univalence) { + this.univalence = univalence; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public Date getStorageDate() { + return storageDate; + } + + public void setStorageDate(Date storageDate) { + this.storageDate = storageDate; + } + + public String[] getStorageDates() { + return storageDates; + } + + public void setStorageDates(String[] storageDates) { + this.storageDates = storageDates; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public String getProposer() { + return proposer; + } + + public void setProposer(String proposer) { + this.proposer = proposer; + } + + public String getRecipient() { + return recipient; + } + + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + public String getAmountCapital() { + return amountCapital; + } + + public void setAmountCapital(String amountCapital) { + this.amountCapital = amountCapital; + } + + public String getQualityInspector() { + return qualityInspector; + } + + public void setQualityInspector(String qualityInspector) { + this.qualityInspector = qualityInspector; + } + + public Long getInventoryQuantity() { + return inventoryQuantity; + } + + public void setInventoryQuantity(Long inventoryQuantity) { + this.inventoryQuantity = inventoryQuantity; + } + public Date getStart() { + return start; + } + + public void setStart(Date start) { + this.start = start; + } + + public Date getEnd() { + return end; + } + + public void setEnd(Date end) { + this.end = end; + } + + public Date getCheckoutTime() { + return checkoutTime; + } + + public void setCheckoutTime(Date checkoutTime) { + this.checkoutTime = checkoutTime; + } + + @Override + public String toString() { + return "ImProductReceiptMaterial [id=" + id + ", productReceiptId=" + productReceiptId + ", serialNumber=" + + serialNumber + ", code=" + code + ", materialId=" + materialId + ", materialName=" + materialName + + ", specification=" + specification + ", materialType=" + materialType + ", warehouseId=" + warehouseId + + ", warehouseName=" + warehouseName + ", preferentialOriginName=" + preferentialOriginName + + ", batchNumber=" + batchNumber + ", unit=" + unit + ", receivableQuantity=" + receivableQuantity + + ", received=" + received + ", actualQuantity=" + actualQuantity + ", practicalNumber=" + + practicalNumber + ", unitPrice=" + unitPrice + ", univalence=" + univalence + ", totalPrices=" + + totalPrices + ", proposer=" + proposer + ", qualityInspector=" + qualityInspector + ", checkoutTime=" + + checkoutTime + ", recipient=" + recipient + ", inventoryStatus=" + inventoryStatus + ", storageDate=" + + storageDate + ", storageDates=" + Arrays.toString(storageDates) + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + ", amountCapital=" + amountCapital + ", inventoryQuantity=" + + inventoryQuantity + ", start=" + start + ", end=" + end + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceiptMaterialTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceiptMaterialTwo.java new file mode 100644 index 0000000..7f47274 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductReceiptMaterialTwo.java @@ -0,0 +1,458 @@ +package com.ruoyi.project.management.domain; + +import java.util.Arrays; +import java.util.Date; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料产品入库单关联对象 im_product_receipt_material + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImProductReceiptMaterialTwo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 产品入库单id */ +// @Excel(name = "产品入库单id") + private Long productReceiptId; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 执行单code */ + @Excel(name = "关联单据") + private String code; + + /** 物料id */ +// @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 图号 */ + @Excel(name = "图号") + private String specification; + + /** 材料 */ + @Excel(name = "材料") + private String materialType; + + /** 收货仓库id */ +// @Excel(name = "收货仓库id") + private Long warehouseId; + + /** 收货仓库名称 */ +// @Excel(name = "收货仓库名称") + private String warehouseName; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String preferentialOriginName; + + /** 批号 */ +// @Excel(name = "批号") + private Long batchNumber; + + /** 计量单位 */ + @Excel(name = "单位") + private String unit; + + /** 应收数量 */ + @Excel(name = "应收数量") + private Double receivableQuantity; + + /** 已收数量 */ +// @Excel(name = "数量") + private Double received; + + /** 实收数量 */ + @Excel(name = "数量") + private Double actualQuantity; + + /** 实重 */ + @Excel(name = "重量(Kg)") + private Double practicalNumber; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "金额") + private Double totalPrices; + + /** 申请人 */ + @Excel(name = "申请人") + private String proposer; + /** 质检员 */ + @Excel(name = "质检员") + private String qualityInspector; + + /** + * 检验时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "检验时间") + private Date checkoutTime; + + /** 接收人 */ + @Excel(name = "接收人") + private String recipient; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 入库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入库时间") + private Date storageDate; + + /** 查询入库时间 */ +// @JsonFormat(pattern = "yyyy-MM-dd") + private String[] storageDates; + + /** 备用字段1 */ +// @Excel(name = "入库时间") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** 合计金额大写 */ + private String amountCapital; + + /** 库存数量 */ +// @Excel(name = "实发数量") + private Long inventoryQuantity; + + //起始时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date start; + //结束时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date end; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getProductReceiptId() { + return productReceiptId; + } + + public void setProductReceiptId(Long productReceiptId) { + this.productReceiptId = productReceiptId; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public Long getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(Long warehouseId) { + this.warehouseId = warehouseId; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + + public Long getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(Long batchNumber) { + this.batchNumber = batchNumber; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Double getReceivableQuantity() { + return receivableQuantity; + } + + public void setReceivableQuantity(Double receivableQuantity) { + this.receivableQuantity = receivableQuantity; + } + + public Double getReceived() { + return received; + } + + public void setReceived(Double received) { + this.received = received; + } + + public Double getActualQuantity() { + return actualQuantity; + } + + public void setActualQuantity(Double actualQuantity) { + this.actualQuantity = actualQuantity; + } + + public Double getPracticalNumber() { + return practicalNumber; + } + + public void setPracticalNumber(Double practicalNumber) { + this.practicalNumber = practicalNumber; + } + + public Double getUnivalence() { + return univalence; + } + + public void setUnivalence(Double univalence) { + this.univalence = univalence; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public Date getStorageDate() { + return storageDate; + } + + public void setStorageDate(Date storageDate) { + this.storageDate = storageDate; + } + + public String[] getStorageDates() { + return storageDates; + } + + public void setStorageDates(String[] storageDates) { + this.storageDates = storageDates; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public String getProposer() { + return proposer; + } + + public void setProposer(String proposer) { + this.proposer = proposer; + } + + public String getRecipient() { + return recipient; + } + + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + public String getAmountCapital() { + return amountCapital; + } + + public void setAmountCapital(String amountCapital) { + this.amountCapital = amountCapital; + } + + public String getQualityInspector() { + return qualityInspector; + } + + public void setQualityInspector(String qualityInspector) { + this.qualityInspector = qualityInspector; + } + + public Long getInventoryQuantity() { + return inventoryQuantity; + } + + public void setInventoryQuantity(Long inventoryQuantity) { + this.inventoryQuantity = inventoryQuantity; + } + public Date getStart() { + return start; + } + + public void setStart(Date start) { + this.start = start; + } + + public Date getEnd() { + return end; + } + + public void setEnd(Date end) { + this.end = end; + } + + public Date getCheckoutTime() { + return checkoutTime; + } + + public void setCheckoutTime(Date checkoutTime) { + this.checkoutTime = checkoutTime; + } + + @Override + public String toString() { + return "ImProductReceiptMaterialTwo [id=" + id + ", productReceiptId=" + productReceiptId + ", serialNumber=" + + serialNumber + ", code=" + code + ", materialId=" + materialId + ", materialName=" + materialName + + ", specification=" + specification + ", materialType=" + materialType + ", warehouseId=" + warehouseId + + ", warehouseName=" + warehouseName + ", preferentialOriginName=" + preferentialOriginName + + ", batchNumber=" + batchNumber + ", unit=" + unit + ", receivableQuantity=" + receivableQuantity + + ", received=" + received + ", actualQuantity=" + actualQuantity + ", practicalNumber=" + + practicalNumber + ", univalence=" + univalence + ", totalPrices=" + totalPrices + ", proposer=" + + proposer + ", qualityInspector=" + qualityInspector + ", checkoutTime=" + checkoutTime + + ", recipient=" + recipient + ", inventoryStatus=" + inventoryStatus + ", storageDate=" + storageDate + + ", storageDates=" + Arrays.toString(storageDates) + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + + ", amountCapital=" + amountCapital + ", inventoryQuantity=" + inventoryQuantity + ", start=" + start + + ", end=" + end + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImProductStockRequistion.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductStockRequistion.java new file mode 100644 index 0000000..9e16deb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductStockRequistion.java @@ -0,0 +1,248 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 销售出库单对象 im_product_stock_requistion + * + * @author zhukangchao + * @date 2020-06-23 + */ +public class ImProductStockRequistion extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 客户id */ + @Excel(name = "客户id") + private Long customerId; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String customerName; + + /** 编号 */ + @Excel(name = "编号") + private String code; + + /** 合同id */ + @Excel(name = "合同id") + private Long contractId; + + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractCode; + + /** 物流公司id */ + @Excel(name = "物流公司id") + private Long logisticsId; + + /** 物流公司名称 */ + @Excel(name = "物流公司名称") + private String logisticsName; + + /** 物流单号 */ + @Excel(name = "物流单号") + private String trackingNumber; + + /** 收货地址 */ + @Excel(name = "收货地址") + private String shippingAddress; + + /** 仓库管理员 */ + @Excel(name = "仓库管理员") + private String warehouseKeeper; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCustomerId(Long customerId) + { + this.customerId = customerId; + } + + public Long getCustomerId() + { + return customerId; + } + public void setCustomerName(String customerName) + { + this.customerName = customerName; + } + + public String getCustomerName() + { + return customerName; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setContractId(Long contractId) + { + this.contractId = contractId; + } + + public Long getContractId() + { + return contractId; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setLogisticsId(Long logisticsId) + { + this.logisticsId = logisticsId; + } + + public Long getLogisticsId() + { + return logisticsId; + } + public void setLogisticsName(String logisticsName) + { + this.logisticsName = logisticsName; + } + + public String getLogisticsName() + { + return logisticsName; + } + public void setTrackingNumber(String trackingNumber) + { + this.trackingNumber = trackingNumber; + } + + public String getTrackingNumber() + { + return trackingNumber; + } + public void setShippingAddress(String shippingAddress) + { + this.shippingAddress = shippingAddress; + } + + public String getShippingAddress() + { + return shippingAddress; + } + public void setWarehouseKeeper(String warehouseKeeper) + { + this.warehouseKeeper = warehouseKeeper; + } + + public String getWarehouseKeeper() + { + return warehouseKeeper; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("customerId", getCustomerId()) + .append("customerName", getCustomerName()) + .append("code", getCode()) + .append("contractId", getContractId()) + .append("contractCode", getContractCode()) + .append("logisticsId", getLogisticsId()) + .append("logisticsName", getLogisticsName()) + .append("trackingNumber", getTrackingNumber()) + .append("shippingAddress", getShippingAddress()) + .append("warehouseKeeper", getWarehouseKeeper()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImProductStockRequistionProduct.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductStockRequistionProduct.java new file mode 100644 index 0000000..8bfa582 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImProductStockRequistionProduct.java @@ -0,0 +1,220 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品和产品出库单关联对象 im_product_stock_requistion_product + * + * @author zhukangchao + * @date 2020-06-23 + */ +public class ImProductStockRequistionProduct extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 产品出库单id */ + @Excel(name = "产品出库单id") + private Long productStockRequistionId; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String productType; + + /** 发货仓库id */ + @Excel(name = "发货仓库id") + private Long deliveryWarehouseId; + + /** 发货仓库名称 */ + @Excel(name = "发货仓库名称") + private String deliveryWarehouseName; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 实发数量 */ + @Excel(name = "实发数量") + private Long actualQuantityIssued; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setProductStockRequistionId(Long productStockRequistionId) + { + this.productStockRequistionId = productStockRequistionId; + } + + public Long getProductStockRequistionId() + { + return productStockRequistionId; + } + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + public void setDeliveryWarehouseId(Long deliveryWarehouseId) + { + this.deliveryWarehouseId = deliveryWarehouseId; + } + + public Long getDeliveryWarehouseId() + { + return deliveryWarehouseId; + } + public void setDeliveryWarehouseName(String deliveryWarehouseName) + { + this.deliveryWarehouseName = deliveryWarehouseName; + } + + public String getDeliveryWarehouseName() + { + return deliveryWarehouseName; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setActualQuantityIssued(Long actualQuantityIssued) + { + this.actualQuantityIssued = actualQuantityIssued; + } + + public Long getActualQuantityIssued() + { + return actualQuantityIssued; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("productStockRequistionId", getProductStockRequistionId()) + .append("productType", getProductType()) + .append("deliveryWarehouseId", getDeliveryWarehouseId()) + .append("deliveryWarehouseName", getDeliveryWarehouseName()) + .append("unit", getUnit()) + .append("actualQuantityIssued", getActualQuantityIssued()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImPurchaseReceipt.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImPurchaseReceipt.java new file mode 100644 index 0000000..a41234e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImPurchaseReceipt.java @@ -0,0 +1,192 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 采购入库单对象 im_purchase_receipt + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImPurchaseReceipt extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 供应商id */ + @Excel(name = "供应商id") + private Long supplierId; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String supplierName; + + /** 编号 */ + @Excel(name = "编号") + private String code; + + /** 采购合同id */ + @Excel(name = "采购合同id") + private Long contractId; + + /** 采购合同编号 */ + @Excel(name = "采购合同编号") + private String contractCode; + + /** 采购单编号 */ + @Excel(name = "采购单编号") + private String buyingRequisitionCode; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setSupplierId(Long supplierId) + { + this.supplierId = supplierId; + } + + public Long getSupplierId() + { + return supplierId; + } + public void setSupplierName(String supplierName) + { + this.supplierName = supplierName; + } + + public String getSupplierName() + { + return supplierName; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setContractId(Long contractId) + { + this.contractId = contractId; + } + + public Long getContractId() + { + return contractId; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + + public String getBuyingRequisitionCode() { + return buyingRequisitionCode; + } + + public void setBuyingRequisitionCode(String buyingRequisitionCode) { + this.buyingRequisitionCode = buyingRequisitionCode; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("supplierId", getSupplierId()) + .append("supplierName", getSupplierName()) + .append("code", getCode()) + .append("contractId", getContractId()) + .append("contractCode", getContractCode()) + .append("buyingRequisitionCode", getBuyingRequisitionCode()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImPurchaseReceiptMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImPurchaseReceiptMaterial.java new file mode 100644 index 0000000..ded3433 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImPurchaseReceiptMaterial.java @@ -0,0 +1,261 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料采购入库单关联对象 im_purchase_receipt_material + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImPurchaseReceiptMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 采购合同id */ + @Excel(name = "采购入库单id") + private Long purchaseReceiptId; + + /** 物料id */ + @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String specification; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 收货仓库id */ + @Excel(name = "收货仓库id") + private Long warehouseId; + + /** 收货仓库名称 */ + @Excel(name = "收货仓库名称") + private String warehouseName; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 应收数量 */ + @Excel(name = "应收数量") + private Long receivableQuantity; + + /** 实收数量 */ + @Excel(name = "实收数量") + private Long actualQuantity; + + /** 入库状态(0:未入库,1:正在入库,2:入库完成) */ + private Integer inventoryStatus; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setPurchaseReceiptId(Long purchaseReceiptId) + { + this.purchaseReceiptId = purchaseReceiptId; + } + + public Long getPurchaseReceiptId() + { + return purchaseReceiptId; + } + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public void setWarehouseId(Long warehouseId) + { + this.warehouseId = warehouseId; + } + + public Long getWarehouseId() + { + return warehouseId; + } + public void setWarehouseName(String warehouseName) + { + this.warehouseName = warehouseName; + } + + public String getWarehouseName() + { + return warehouseName; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setReceivableQuantity(Long receivableQuantity) + { + this.receivableQuantity = receivableQuantity; + } + + public Long getReceivableQuantity() + { + return receivableQuantity; + } + public void setActualQuantity(Long actualQuantity) + { + this.actualQuantity = actualQuantity; + } + + public Long getActualQuantity() + { + return actualQuantity; + } + + public Integer getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(Integer inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("purchaseReceiptId", getPurchaseReceiptId()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("specification", getSpecification()) + .append("figureNumber", getFigureNumber()) + .append("warehouseId", getWarehouseId()) + .append("warehouseName", getWarehouseName()) + .append("unit", getUnit()) + .append("receivableQuantity", getReceivableQuantity()) + .append("actualQuantity", getActualQuantity()) + .append("inventoryStatus", getInventoryStatus()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisition.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisition.java new file mode 100644 index 0000000..f250308 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisition.java @@ -0,0 +1,229 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 领料单对象 im_stock_requisition + * + * @author zhukangchao + * @date 2020-06-23 + */ +public class ImStockRequisition extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 关联单据 */ + @Excel(name = "关联单据") + private String code; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String typeName; + + /** 领料状态 */ + @Excel(name = "领料状态") + private String getStatus; + + /** 领料部门id */ + @Excel(name = "领料部门id") + private Long unitId; + + /** 领料部门名称 */ + @Excel(name = "领料部门名称") + private String unitName; + + /** 领料用途 */ + @Excel(name = "领料用途") + private String purpose; + + /** 领料人id */ + @Excel(name = "领料人id") + private Long materialHandlerId; + + /** 领料人姓名 */ + @Excel(name = "领料人姓名") + private String materialHandlerName; + + /** 发料人id */ + @Excel(name = "发料人id") + private Long sendingPeopleId; + + /** 发料人姓名 */ + @Excel(name = "发料人姓名") + private String sendingPeopleName; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getGetStatus() { + return getStatus; + } + + public void setGetStatus(String getStatus) { + this.getStatus = getStatus; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public Long getMaterialHandlerId() { + return materialHandlerId; + } + + public void setMaterialHandlerId(Long materialHandlerId) { + this.materialHandlerId = materialHandlerId; + } + + public String getMaterialHandlerName() { + return materialHandlerName; + } + + public void setMaterialHandlerName(String materialHandlerName) { + this.materialHandlerName = materialHandlerName; + } + + public Long getSendingPeopleId() { + return sendingPeopleId; + } + + public void setSendingPeopleId(Long sendingPeopleId) { + this.sendingPeopleId = sendingPeopleId; + } + + public String getSendingPeopleName() { + return sendingPeopleName; + } + + public void setSendingPeopleName(String sendingPeopleName) { + this.sendingPeopleName = sendingPeopleName; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + @Override + public String toString() { + return "ImStockRequisition [id=" + id + ", code=" + code + ", typeName=" + typeName + ", getStatus=" + getStatus + + ", unitId=" + unitId + ", unitName=" + unitName + ", purpose=" + purpose + ", materialHandlerId=" + + materialHandlerId + ", materialHandlerName=" + materialHandlerName + ", sendingPeopleId=" + + sendingPeopleId + ", sendingPeopleName=" + sendingPeopleName + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisitionMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisitionMaterial.java new file mode 100644 index 0000000..99dafa4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisitionMaterial.java @@ -0,0 +1,421 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料和物料出库单关联对象 im_stock_requisition_material + * + * @author zhukangchao + * @date 2020-06-23 + */ +/** + * @author 13323659953@163.com + * + */ +public class ImStockRequisitionMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 领料单id */ +// @Excel(name = "领料单id") + private Long stockRequisitionId; + + /** 物料id */ +// @Excel(name = "物料id") + private Long materialId; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 关联单据 */ + @Excel(name = "关联单据") + private String code; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 规格型号 */ +// @Excel(name = "规格型号") + private String specification; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 发料仓库id */ +// @Excel(name = "发料仓库id") + private Long materialIssuingWarehouseId; + + /** 发料仓库名称 */ + @Excel(name = "发料库") + private String materialIssuingWarehouseName; + + /** 计量单位 */ + @Excel(name = "单位") + private String unit; + + /** 申请人 */ +// @Excel(name = "申请人") + private String materialHandlerName; + + /** 发料人 */ +// @Excel(name = "发料人") + private String sendingPeopleName; + + /** 应发数量 */ +// @Excel(name = "应发数量") + private Long salaryQuantity; + + /** 申请数量 */ +// @Excel(name = "数量") + private Long applyForQuantity; + + /** 已发数量 */ +// @Excel(name = "数量") + private Long alreadyQuantity; + + /** 实发数量 */ + @Excel(name = "数量") + private Long actualQuantityIssued; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 出库状态 */ +// @Excel(name = "出库状态") + private String getStatus; + + /** 入库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date outboundDate; + + /** 库存数量 */ +// @Excel(name = "实发数量") + private Long inventoryQuantity; + + /** 数量 */ +// @Excel(name = "数量") + private Long quantity; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + //起始时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date start; + //结束时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date end; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getStockRequisitionId() { + return stockRequisitionId; + } + + public void setStockRequisitionId(Long stockRequisitionId) { + this.stockRequisitionId = stockRequisitionId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public Long getMaterialIssuingWarehouseId() { + return materialIssuingWarehouseId; + } + + public void setMaterialIssuingWarehouseId(Long materialIssuingWarehouseId) { + this.materialIssuingWarehouseId = materialIssuingWarehouseId; + } + + public String getMaterialIssuingWarehouseName() { + return materialIssuingWarehouseName; + } + + public void setMaterialIssuingWarehouseName(String materialIssuingWarehouseName) { + this.materialIssuingWarehouseName = materialIssuingWarehouseName; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getMaterialHandlerName() { + return materialHandlerName; + } + + public void setMaterialHandlerName(String materialHandlerName) { + this.materialHandlerName = materialHandlerName; + } + + public String getSendingPeopleName() { + return sendingPeopleName; + } + + public void setSendingPeopleName(String sendingPeopleName) { + this.sendingPeopleName = sendingPeopleName; + } + + public Long getSalaryQuantity() { + return salaryQuantity; + } + + public void setSalaryQuantity(Long salaryQuantity) { + this.salaryQuantity = salaryQuantity; + } + + public Long getApplyForQuantity() { + return applyForQuantity; + } + + public void setApplyForQuantity(Long applyForQuantity) { + this.applyForQuantity = applyForQuantity; + } + + public Long getAlreadyQuantity() { + return alreadyQuantity; + } + + public void setAlreadyQuantity(Long alreadyQuantity) { + this.alreadyQuantity = alreadyQuantity; + } + + public Long getActualQuantityIssued() { + return actualQuantityIssued; + } + + public void setActualQuantityIssued(Long actualQuantityIssued) { + this.actualQuantityIssued = actualQuantityIssued; + } + + public Double getUnivalence() { + return univalence; + } + + public void setUnivalence(Double univalence) { + this.univalence = univalence; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public String getGetStatus() { + return getStatus; + } + + public void setGetStatus(String getStatus) { + this.getStatus = getStatus; + } + + public Date getOutboundDate() { + return outboundDate; + } + + public void setOutboundDate(Date outboundDate) { + this.outboundDate = outboundDate; + } + + public Long getInventoryQuantity() { + return inventoryQuantity; + } + + public void setInventoryQuantity(Long inventoryQuantity) { + this.inventoryQuantity = inventoryQuantity; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + public Date getStart() { + return start; + } + + public void setStart(Date start) { + this.start = start; + } + + public Date getEnd() { + return end; + } + + public void setEnd(Date end) { + this.end = end; + } + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + @Override + public String toString() { + return "ImStockRequisitionMaterial [id=" + id + ", stockRequisitionId=" + stockRequisitionId + ", materialId=" + + materialId + ", serialNumber=" + serialNumber + ", code=" + code + ", materialName=" + materialName + + ", specification=" + specification + ", figureNumber=" + figureNumber + ", materials=" + materials + + ", pieceWeight=" + pieceWeight + ", materialIssuingWarehouseId=" + materialIssuingWarehouseId + + ", materialIssuingWarehouseName=" + materialIssuingWarehouseName + ", unit=" + unit + + ", materialHandlerName=" + materialHandlerName + ", sendingPeopleName=" + sendingPeopleName + + ", salaryQuantity=" + salaryQuantity + ", applyForQuantity=" + applyForQuantity + ", alreadyQuantity=" + + alreadyQuantity + ", actualQuantityIssued=" + actualQuantityIssued + ", univalence=" + univalence + + ", totalPrices=" + totalPrices + ", getStatus=" + getStatus + ", outboundDate=" + outboundDate + + ", inventoryQuantity=" + inventoryQuantity + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", start=" + + start + ", end=" + end + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisitionMaterialTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisitionMaterialTwo.java new file mode 100644 index 0000000..58e44a4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImStockRequisitionMaterialTwo.java @@ -0,0 +1,387 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料和物料出库单关联对象 im_stock_requisition_material + * + * @author zhukangchao + * @date 2020-06-23 + */ +/** + * @author 13323659953@163.com + * + */ +public class ImStockRequisitionMaterialTwo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 领料单id */ +// @Excel(name = "领料单id") + private Long stockRequisitionId; + + /** 物料id */ +// @Excel(name = "物料id") + private Long materialId; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 关联单据 */ + @Excel(name = "关联单据") + private String code; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 规格型号 */ +// @Excel(name = "规格型号") + private String specification; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 发料仓库id */ +// @Excel(name = "发料仓库id") + private Long materialIssuingWarehouseId; + + /** 发料仓库名称 */ + @Excel(name = "发料库") + private String materialIssuingWarehouseName; + + /** 计量单位 */ + @Excel(name = "单位") + private String unit; + + /** 申请人 */ + @Excel(name = "申请人") + private String materialHandlerName; + + /** 发料人 */ + @Excel(name = "发料人") + private String sendingPeopleName; + + /** 应发数量 */ + @Excel(name = "应发数量") + private Long salaryQuantity; + + /** 申请数量 */ +// @Excel(name = "数量") + private Long applyForQuantity; + + /** 已发数量 */ + @Excel(name = "数量") + private Long alreadyQuantity; + + /** 实发数量 */ +// @Excel(name = "数量") + private Long actualQuantityIssued; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 出库状态 */ + @Excel(name = "出库状态") + private String getStatus; + + /** 出库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date outboundDate; + + /** 库存数量 */ +// @Excel(name = "实发数量") + private Long inventoryQuantity; + + /** 备用字段1 */ + @Excel(name = "出库时间") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getStockRequisitionId() { + return stockRequisitionId; + } + + public void setStockRequisitionId(Long stockRequisitionId) { + this.stockRequisitionId = stockRequisitionId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public Long getMaterialIssuingWarehouseId() { + return materialIssuingWarehouseId; + } + + public void setMaterialIssuingWarehouseId(Long materialIssuingWarehouseId) { + this.materialIssuingWarehouseId = materialIssuingWarehouseId; + } + + public String getMaterialIssuingWarehouseName() { + return materialIssuingWarehouseName; + } + + public void setMaterialIssuingWarehouseName(String materialIssuingWarehouseName) { + this.materialIssuingWarehouseName = materialIssuingWarehouseName; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getMaterialHandlerName() { + return materialHandlerName; + } + + public void setMaterialHandlerName(String materialHandlerName) { + this.materialHandlerName = materialHandlerName; + } + + public String getSendingPeopleName() { + return sendingPeopleName; + } + + public void setSendingPeopleName(String sendingPeopleName) { + this.sendingPeopleName = sendingPeopleName; + } + + public Long getSalaryQuantity() { + return salaryQuantity; + } + + public void setSalaryQuantity(Long salaryQuantity) { + this.salaryQuantity = salaryQuantity; + } + + public Long getApplyForQuantity() { + return applyForQuantity; + } + + public void setApplyForQuantity(Long applyForQuantity) { + this.applyForQuantity = applyForQuantity; + } + + public Long getAlreadyQuantity() { + return alreadyQuantity; + } + + public void setAlreadyQuantity(Long alreadyQuantity) { + this.alreadyQuantity = alreadyQuantity; + } + + public Long getActualQuantityIssued() { + return actualQuantityIssued; + } + + public void setActualQuantityIssued(Long actualQuantityIssued) { + this.actualQuantityIssued = actualQuantityIssued; + } + + public Double getUnivalence() { + return univalence; + } + + public void setUnivalence(Double univalence) { + this.univalence = univalence; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public String getGetStatus() { + return getStatus; + } + + public void setGetStatus(String getStatus) { + this.getStatus = getStatus; + } + + public Date getOutboundDate() { + return outboundDate; + } + + public void setOutboundDate(Date outboundDate) { + this.outboundDate = outboundDate; + } + + public Long getInventoryQuantity() { + return inventoryQuantity; + } + + public void setInventoryQuantity(Long inventoryQuantity) { + this.inventoryQuantity = inventoryQuantity; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + @Override + public String toString() { + return "ImStockRequisitionMaterial [id=" + id + ", stockRequisitionId=" + stockRequisitionId + ", materialId=" + + materialId + ", serialNumber=" + serialNumber + ", code=" + code + ", materialName=" + materialName + + ", specification=" + specification + ", figureNumber=" + figureNumber + ", materials=" + materials + + ", pieceWeight=" + pieceWeight + ", materialIssuingWarehouseId=" + materialIssuingWarehouseId + + ", materialIssuingWarehouseName=" + materialIssuingWarehouseName + ", unit=" + unit + + ", materialHandlerName=" + materialHandlerName + ", sendingPeopleName=" + sendingPeopleName + + ", salaryQuantity=" + salaryQuantity + ", applyForQuantity=" + applyForQuantity + ", alreadyQuantity=" + + alreadyQuantity + ", actualQuantityIssued=" + actualQuantityIssued + ", univalence=" + univalence + + ", totalPrices=" + totalPrices + ", getStatus=" + getStatus + ", outboundDate=" + outboundDate + + ", inventoryQuantity=" + inventoryQuantity + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImSupplier.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImSupplier.java new file mode 100644 index 0000000..e12d15e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImSupplier.java @@ -0,0 +1,311 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 供应商对象 im_supplier + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImSupplier extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String supplierName; + + /** 供应商类型id */ + @Excel(name = "供应商类型id") + private Long supplierTypeId; + + /** 供应商类型名称 */ + @Excel(name = "供应商类型名称") + private String supplierTypeName; + + /** 供应商电话 */ + @Excel(name = "供应商电话") + private String supplierPhone; + + /** 供应商地址 */ + @Excel(name = "供应商地址") + private String supplierAddress; + + /** 负责人 */ + @Excel(name = "负责人") + private String contacts; + + /** 传真 */ + @Excel(name = "传真") + private String fax; + + /** 邮编 */ + @Excel(name = "邮编") + private String zipCode; + + /** 邮件地址 */ + @Excel(name = "邮件地址") + private String emailAddress; + + /** 账号 */ + @Excel(name = "账号") + private String accountNumber; + + /** 税号 */ + @Excel(name = "税号") + private String dutyParagraph; + + /** 开户行 */ + @Excel(name = "开户行") + private String openingBank; + + /** 开户行地址 */ + @Excel(name = "开户行地址") + private String bankAddress; + + public String getBankAddress() { + return bankAddress; + } + + public void setBankAddress(String bankAddress) { + this.bankAddress = bankAddress; + } + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** 联行号 */ + @Excel(name = "联行号") + private String interbankNumber; + + /** 外汇标记 */ + @Excel(name = "外汇标记") + private String swiftCode; + + public String getInterbankNumber() { + return interbankNumber; + } + + public void setInterbankNumber(String interbankNumber) { + this.interbankNumber = interbankNumber; + } + + public String getSwiftCode() { + return swiftCode; + } + + public void setSwiftCode(String swiftCode) { + this.swiftCode = swiftCode; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setSupplierName(String supplierName) + { + this.supplierName = supplierName; + } + + public String getSupplierName() + { + return supplierName; + } + + public Long getSupplierTypeId() { + return supplierTypeId; + } + + public void setSupplierTypeId(Long supplierTypeId) { + this.supplierTypeId = supplierTypeId; + } + + public String getSupplierTypeName() { + return supplierTypeName; + } + + public void setSupplierTypeName(String supplierTypeName) { + this.supplierTypeName = supplierTypeName; + } + + public void setSupplierPhone(String supplierPhone) + { + this.supplierPhone = supplierPhone; + } + + public String getSupplierPhone() + { + return supplierPhone; + } + public void setSupplierAddress(String supplierAddress) + { + this.supplierAddress = supplierAddress; + } + + public String getSupplierAddress() + { + return supplierAddress; + } + public void setContacts(String contacts) + { + this.contacts = contacts; + } + + public String getContacts() + { + return contacts; + } + public void setFax(String fax) + { + this.fax = fax; + } + + public String getFax() + { + return fax; + } + public void setZipCode(String zipCode) + { + this.zipCode = zipCode; + } + + public String getZipCode() + { + return zipCode; + } + public void setEmailAddress(String emailAddress) + { + this.emailAddress = emailAddress; + } + + public String getEmailAddress() + { + return emailAddress; + } + public void setAccountNumber(String accountNumber) + { + this.accountNumber = accountNumber; + } + + public String getAccountNumber() + { + return accountNumber; + } + public void setDutyParagraph(String dutyParagraph) + { + this.dutyParagraph = dutyParagraph; + } + + public String getDutyParagraph() + { + return dutyParagraph; + } + public void setOpeningBank(String openingBank) + { + this.openingBank = openingBank; + } + + public String getOpeningBank() + { + return openingBank; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("supplierName", getSupplierName()) + .append("supplierTypeId", getSupplierTypeId()) + .append("supplierTypeName", getSupplierTypeName()) + .append("supplierPhone", getSupplierPhone()) + .append("supplierAddress", getSupplierAddress()) + .append("contacts", getContacts()) + .append("fax", getFax()) + .append("zipCode", getZipCode()) + .append("emailAddress", getEmailAddress()) + .append("accountNumber", getAccountNumber()) + .append("dutyParagraph", getDutyParagraph()) + .append("openingBank", getOpeningBank()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImSupplierType.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImSupplierType.java new file mode 100644 index 0000000..2ad36c3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImSupplierType.java @@ -0,0 +1,135 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 供应商类型对象 im_supplier_type + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImSupplierType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 父级id */ + @Excel(name = "父级id") + private Long parentId; + + /** 供应商类型名称 */ + @Excel(name = "供应商类型名称") + private String supplierTypeName; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getParentId() + { + return parentId; + } + public void setSupplierTypeName(String supplierTypeName) + { + this.supplierTypeName = supplierTypeName; + } + + public String getSupplierTypeName() + { + return supplierTypeName; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("parentId", getParentId()) + .append("supplierTypeName", getSupplierTypeName()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ImWarehouse.java b/evo/src/main/java/com/ruoyi/project/management/domain/ImWarehouse.java new file mode 100644 index 0000000..8ff2a87 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ImWarehouse.java @@ -0,0 +1,168 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 仓库对象 im_warehouse + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class ImWarehouse extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 仓库代码 */ + @Excel(name = "仓库代码") + private String code; + + /** 仓库名称 */ + @Excel(name = "仓库名称") + private String warehouseName; + + /** 仓库管理员 */ + @Excel(name = "仓库管理员") + private String warehouseAdmin; + + /** 仓库地址 */ + @Excel(name = "仓库地址") + private String warehouseAddress; + + /** 仓库电话 */ + @Excel(name = "仓库电话") + private String warehousePhone; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public void setWarehouseName(String warehouseName) + { + this.warehouseName = warehouseName; + } + + public String getWarehouseName() + { + return warehouseName; + } + public void setWarehouseAdmin(String warehouseAdmin) + { + this.warehouseAdmin = warehouseAdmin; + } + + public String getWarehouseAdmin() + { + return warehouseAdmin; + } + public void setWarehouseAddress(String warehouseAddress) + { + this.warehouseAddress = warehouseAddress; + } + + public String getWarehouseAddress() + { + return warehouseAddress; + } + public void setWarehousePhone(String warehousePhone) + { + this.warehousePhone = warehousePhone; + } + + public String getWarehousePhone() + { + return warehousePhone; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "ImWarehouse [id=" + id + ", code=" + code + ", warehouseName=" + warehouseName + ", warehouseAdmin=" + + warehouseAdmin + ", warehouseAddress=" + warehouseAddress + ", warehousePhone=" + warehousePhone + + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JDInvertoryVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/JDInvertoryVo.java new file mode 100644 index 0000000..06aa6e6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JDInvertoryVo.java @@ -0,0 +1,24 @@ +package com.ruoyi.project.management.domain; + +public class JDInvertoryVo { + //图号 + private String fnumber; + //数量 + private String baseQty; + + public String getFnumber() { + return fnumber; + } + + public void setFnumber(String fnumber) { + this.fnumber = fnumber; + } + + public String getBaseQty() { + return baseQty; + } + + public void setBaseQty(String baseQty) { + this.baseQty = baseQty; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdBomMaterialls.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdBomMaterialls.java new file mode 100644 index 0000000..2ce1ed2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdBomMaterialls.java @@ -0,0 +1,191 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 金蝶BOM物料信息对象 jd_bom_materialls + * + * @author chenyongjiang + * @date 2024-05-17 + */ +public class JdBomMaterialls extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** ERP执行单号 */ + @Excel(name = "ERP执行单号") + private String productCode; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String name; + + /** 需求数量 */ + @Excel(name = "需求数量") + private Long number; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long storeNumber; + + /** 完工时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完工时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completiondate; + + /** 父级图号 */ + @Excel(name = "父级图号") + private String parentFigureNumber; + + /** 父级名称 */ + @Excel(name = "父级名称") + private String parentName; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + private List children; + + /** 删除状态 */ + private String delFlag; + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductCode(String productCode) + { + this.productCode = productCode; + } + + public String getProductCode() + { + return productCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setStoreNumber(Long storeNumber) + { + this.storeNumber = storeNumber; + } + + public Long getStoreNumber() + { + return storeNumber; + } + public void setCompletiondate(Date completiondate) + { + this.completiondate = completiondate; + } + + public Date getCompletiondate() + { + return completiondate; + } + public void setParentFigureNumber(String parentFigureNumber) + { + this.parentFigureNumber = parentFigureNumber; + } + + public String getParentFigureNumber() + { + return parentFigureNumber; + } + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public String getParentName() + { + return parentName; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("productCode", getProductCode()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("number", getNumber()) + .append("storeNumber", getStoreNumber()) + .append("completiondate", getCompletiondate()) + .append("parentFigureNumber", getParentFigureNumber()) + .append("parentName", getParentName()) + .append("remarks", getRemarks()) + .append("delFlag", getDelFlag()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdBomNumber.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdBomNumber.java new file mode 100644 index 0000000..b87af51 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdBomNumber.java @@ -0,0 +1,205 @@ +package com.ruoyi.project.management.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 金蝶临时存储对象 jd_bom_number + * + * @author chenyongjiang + * @date 2024-03-14 + */ +public class JdBomNumber +{ + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productionCode; + + /** 型号 */ + @Excel(name = "型号") + private String typeName; + + /** 序号 */ + @Excel(name = "序号") + private String num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 工段 */ + @Excel(name = "工段") + private String workshopSection; + + /** 工时 */ + @Excel(name = "工时") + private double xuTime; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setNum(String num) + { + this.num = num; + } + + public String getNum() + { + return num; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setWorkshopSection(String workshopSection) + { + this.workshopSection = workshopSection; + } + + public String getWorkshopSection() + { + return workshopSection; + } + public void setXuTime(double xuTime) + { + this.xuTime = xuTime; + } + + public double getXuTime() + { + return xuTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionCode", getProductionCode()) + .append("typeName", getTypeName()) + .append("num", getNum()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("oneNumber", getOneNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("unit", getUnit()) + .append("workshopSection", getWorkshopSection()) + .append("xuTime", getXuTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdBomRecord.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdBomRecord.java new file mode 100644 index 0000000..5df2281 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdBomRecord.java @@ -0,0 +1,173 @@ +package com.ruoyi.project.management.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import java.util.Date; + +/** + * 金蝶BOM记录对象 jd_bom_record + * + * @author chenyongjiang + * @date 2024-04-24 + */ +public class JdBomRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 金蝶生成单号 */ + @Excel(name = "金蝶生成单号") + private String jdCode; + + /** ERP执行单号 */ + @Excel(name = "ERP执行单号") + private String productCode; + + /** 产品编码 */ + @Excel(name = "产品编码") + private String figureNumber; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + @Excel(name = "物料属性") + private String purchaseMark; + + @Excel(name = "个数") + private String number; + + @Excel(name = "审核状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + //订单生产数量 + private Long quantity; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date completeDate; //完成时间 + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Date getCompleteDate() { + return completeDate; + } + + public void setCompleteDate(Date completeDate) { + this.completeDate = completeDate; + } + + private String delFlag; //删除状态 + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getPurchaseMark() { + return purchaseMark; + } + + public void setPurchaseMark(String purchaseMark) { + this.purchaseMark = purchaseMark; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setJdCode(String jdCode) + { + this.jdCode = jdCode; + } + + public String getJdCode() + { + return jdCode; + } + public void setProductCode(String productCode) + { + this.productCode = productCode; + } + + public String getProductCode() + { + return productCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("jdCode", getJdCode()) + .append("productCode", getProductCode()) + .append("figureNumber", getFigureNumber()) + .append("productName", getProductName()) + .append("remarks", getRemarks()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdCurrency.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdCurrency.java new file mode 100644 index 0000000..7891128 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdCurrency.java @@ -0,0 +1,147 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 币别对象 jd_currency + * + * @author zhukangchao + * @date 2023-12-15 + */ +public class JdCurrency extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 编码 + */ + @Excel(name = "编码") + private String code; + + /** + * 名称 + */ + @Excel(name = "名称") + private String currencyName; + + /** + * 货币代码 + */ + @Excel(name = "货币代码") + private String currencyCode; + + /** + * 单价精度 + */ + @Excel(name = "单价精度") + private Long unitPricePrecision; + + /** + * 金额精度 + */ + @Excel(name = "金额精度") + private Long amountPrecision; + + + /** + * 创建日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdDate; + + /** + * 修改日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date updatedDate; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setCurrencyName(String currencyName) { + this.currencyName = currencyName; + } + + public String getCurrencyName() { + return currencyName; + } + + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public void setUnitPricePrecision(Long unitPricePrecision) { + this.unitPricePrecision = unitPricePrecision; + } + + public Long getUnitPricePrecision() { + return unitPricePrecision; + } + + public void setAmountPrecision(Long amountPrecision) { + this.amountPrecision = amountPrecision; + } + + public Long getAmountPrecision() { + return amountPrecision; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setUpdatedDate(Date updatedDate) { + this.updatedDate = updatedDate; + } + + public Date getUpdatedDate() { + return updatedDate; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("currencyName", getCurrencyName()) + .append("currencyCode", getCurrencyCode()) + .append("unitPricePrecision", getUnitPricePrecision()) + .append("amountPrecision", getAmountPrecision()) + .append("createdDate", getCreatedDate()) + .append("updatedDate", getUpdatedDate()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdErrorMessage.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdErrorMessage.java new file mode 100644 index 0000000..7ae9833 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdErrorMessage.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 金蝶接口错误信息对象 jd_error_message + * + * @author evo + * @date 2024-04-29 + */ +public class JdErrorMessage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + private Long id; + + /** 信息ID */ + private String messageId; + + /** 板块 */ + @Excel(name = "板块") + private String messageType; + + /** 操作类型 */ + @Excel(name = "操作类型") + private String messageOpt; + + /** 报错信息 */ + @Excel(name = "报错信息") + private String messageContent; + + /** 是否处理(0正常 1关闭) */ + @Excel(name = "是否处理", readConverterExp = "0=正常,1=关闭") + private String status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public void setMessageId(String messageId) + { + this.messageId = messageId; + } + + public String getMessageId() + { + return messageId; + } + public void setMessageType(String messageType) + { + this.messageType = messageType; + } + + public String getMessageType() + { + return messageType; + } + public void setMessageOpt(String messageOpt) + { + this.messageOpt = messageOpt; + } + + public String getMessageOpt() + { + return messageOpt; + } + public void setMessageContent(String messageContent) + { + this.messageContent = messageContent; + } + + public String getMessageContent() + { + return messageContent; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("messageId", getMessageId()) + .append("messageType", getMessageType()) + .append("messageOpt", getMessageOpt()) + .append("messageContent", getMessageContent()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdExpenseItems.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdExpenseItems.java new file mode 100644 index 0000000..083d28f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdExpenseItems.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 费用项目对象 jd_expense_items + * + * @author zhukangchao + * @date 2023-12-16 + */ +public class JdExpenseItems extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private Long id; + + + /** + * 名称 + */ + @Excel(name = "名称") + private String name; + + + /** + * 描述 + */ + @Excel(name = "描述") + private String description; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("description", getDescription()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFace.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFace.java new file mode 100644 index 0000000..ccc7d17 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFace.java @@ -0,0 +1,125 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +public class JdInterFace { + + private String FName; //BOM名称 + private String FMaterialNumber; //图号 + private String FMaterialName; //名称 + private String FMaterialGroup; //分组 + private String FErpClsName; //属性 + private String FBaseUnitName; //基本单位 + private String F_SVRI_Assistant; //材料 + private String FDepName; //派工部门 + private String F_UCHN_BZGS; //工时 + private String F_UCHN_DZ; //单重 + private String F_UCHN_SCDDH; //生产单号 + private String FGroupNumber; //BOM分组 + + public String getFGroupNumber() { + return FGroupNumber; + } + + public void setFGroupNumber(String FGroupNumber) { + this.FGroupNumber = FGroupNumber; + } + + private List FTreeEntity; //直接子集 + + public String getFName() { + return FName; + } + + public void setFName(String FName) { + this.FName = FName; + } + + public String getFMaterialNumber() { + return FMaterialNumber; + } + + public void setFMaterialNumber(String FMaterialNumber) { + this.FMaterialNumber = FMaterialNumber; + } + + public String getFMaterialName() { + return FMaterialName; + } + + public void setFMaterialName(String FMaterialName) { + this.FMaterialName = FMaterialName; + } + + public String getFMaterialGroup() { + return FMaterialGroup; + } + + public void setFMaterialGroup(String FMaterialGroup) { + this.FMaterialGroup = FMaterialGroup; + } + + public String getFErpClsName() { + return FErpClsName; + } + + public void setFErpClsName(String FErpClsName) { + this.FErpClsName = FErpClsName; + } + + public String getFBaseUnitName() { + return FBaseUnitName; + } + + public void setFBaseUnitName(String FBaseUnitName) { + this.FBaseUnitName = FBaseUnitName; + } + + public String getF_SVRI_Assistant() { + return F_SVRI_Assistant; + } + + public void setF_SVRI_Assistant(String f_SVRI_Assistant) { + F_SVRI_Assistant = f_SVRI_Assistant; + } + + public String getFDepName() { + return FDepName; + } + + public void setFDepName(String FDepName) { + this.FDepName = FDepName; + } + + public String getF_UCHN_BZGS() { + return F_UCHN_BZGS; + } + + public void setF_UCHN_BZGS(String f_UCHN_BZGS) { + F_UCHN_BZGS = f_UCHN_BZGS; + } + + public String getF_UCHN_DZ() { + return F_UCHN_DZ; + } + + public void setF_UCHN_DZ(String f_UCHN_DZ) { + F_UCHN_DZ = f_UCHN_DZ; + } + + public String getF_UCHN_SCDDH() { + return F_UCHN_SCDDH; + } + + public void setF_UCHN_SCDDH(String f_UCHN_SCDDH) { + F_UCHN_SCDDH = f_UCHN_SCDDH; + } + + public List getFTreeEntity() { + return FTreeEntity; + } + + public void setFTreeEntity(List FTreeEntity) { + this.FTreeEntity = FTreeEntity; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFaceDto.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFaceDto.java new file mode 100644 index 0000000..e8af01b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFaceDto.java @@ -0,0 +1,97 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +public class JdInterFaceDto { + + private String FMaterialNumber; //图号 + private String FMaterialName; //名称 + private String FMaterialGroup; //分组 + private String FErpClsName; //属性 + private String FBaseUnitName; //基本单位 + private String F_SVRI_Assistant; //材料 + private String F_UCHN_BZGS; //工时 + private String F_UCHN_DZ; //单重 + private String FNUMERATOR; //单台数量 + private String FDENOMINATOR; //单台数量 + + public String getFDENOMINATOR() { + return FDENOMINATOR; + } + + public void setFDENOMINATOR(String FDENOMINATOR) { + this.FDENOMINATOR = FDENOMINATOR; + } + + public String getFNUMERATOR() { + return FNUMERATOR; + } + + public void setFNUMERATOR(String FNUMERATOR) { + this.FNUMERATOR = FNUMERATOR; + } + + public String getFMaterialNumber() { + return FMaterialNumber; + } + + public void setFMaterialNumber(String FMaterialNumber) { + this.FMaterialNumber = FMaterialNumber; + } + + public String getFMaterialName() { + return FMaterialName; + } + + public void setFMaterialName(String FMaterialName) { + this.FMaterialName = FMaterialName; + } + + public String getFMaterialGroup() { + return FMaterialGroup; + } + + public void setFMaterialGroup(String FMaterialGroup) { + this.FMaterialGroup = FMaterialGroup; + } + + public String getFErpClsName() { + return FErpClsName; + } + + public void setFErpClsName(String FErpClsName) { + this.FErpClsName = FErpClsName; + } + + public String getFBaseUnitName() { + return FBaseUnitName; + } + + public void setFBaseUnitName(String FBaseUnitName) { + this.FBaseUnitName = FBaseUnitName; + } + + public String getF_SVRI_Assistant() { + return F_SVRI_Assistant; + } + + public void setF_SVRI_Assistant(String f_SVRI_Assistant) { + F_SVRI_Assistant = f_SVRI_Assistant; + } + + public String getF_UCHN_BZGS() { + return F_UCHN_BZGS; + } + + public void setF_UCHN_BZGS(String f_UCHN_BZGS) { + F_UCHN_BZGS = f_UCHN_BZGS; + } + + public String getF_UCHN_DZ() { + return F_UCHN_DZ; + } + + public void setF_UCHN_DZ(String f_UCHN_DZ) { + F_UCHN_DZ = f_UCHN_DZ; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFaceVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFaceVo.java new file mode 100644 index 0000000..921a4c7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdInterFaceVo.java @@ -0,0 +1,147 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class JdInterFaceVo { + @Excel(name = "父级图号") + private String parentFigureNumber; + @Excel(name = "物料编码") + private String materialCode; + @Excel(name = "物料名称") + private String materialName; + @Excel(name = "物料属性") + private String purchaseMark; + /** 材料 */ + @Excel(name = "材料") + private String materials; + @Excel(name = "计量单位名称") + private String unitOfMeasurementName; + @Excel(name = "单台数量") + private String oneNumber; + //@Excel(name = "派工部门") + private String deptName; + //@Excel(name = "工时") + private String xuTime; + @Excel(name = "单重") + private String weight; + @Excel(name = "ERP执行单号") + private String productCode; + @Excel(name = "金蝶生产单号") + private String jdCode; + + /** 物料分组 */ + private String materialGroup; + private String materialType; + + public String getJdCode() { + return jdCode; + } + + public void setJdCode(String jdCode) { + this.jdCode = jdCode; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public String getMaterialGroup() { + return materialGroup; + } + + public void setMaterialGroup(String materialGroup) { + this.materialGroup = materialGroup; + } + + public String getOneNumber() { + return oneNumber; + } + + public void setOneNumber(String oneNumber) { + this.oneNumber = oneNumber; + } + + public String getParentFigureNumber() { + return parentFigureNumber; + } + + public void setParentFigureNumber(String parentFigureNumber) { + this.parentFigureNumber = parentFigureNumber; + } + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getPurchaseMark() { + return purchaseMark; + } + + public void setPurchaseMark(String purchaseMark) { + this.purchaseMark = purchaseMark; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public String getUnitOfMeasurementName() { + return unitOfMeasurementName; + } + + public void setUnitOfMeasurementName(String unitOfMeasurementName) { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getXuTime() { + return xuTime; + } + + public void setXuTime(String xuTime) { + this.xuTime = xuTime; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdMaterialVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdMaterialVo.java new file mode 100644 index 0000000..15080f6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdMaterialVo.java @@ -0,0 +1,224 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 金蝶物料(零件)对象 im_material + * + * @author zhukangchao + * @date 2020-06-22 + */ +public class JdMaterialVo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + /** 材料名称 */ + @Excel(name = "物料名称") + private String materialName; + + @Excel(name = "物料分组ID") + private String materialGroup; + + @Excel(name = "存货类别ID") + private String categoryId; + /** 类别 */ + @Excel(name = "存货类别") + private String category; + @Excel(name = "材料ID") + private String materialsId; + /** 材料 */ + @Excel(name = "材料") + private String materials; + + @Excel(name = "物料属性ID") + private String purchaseMarkId; + /** */ + @Excel(name = "物料属性") + private String purchaseMark; + + /** 计量单位id */ + @Excel(name = "计量单位id") + private String unitOfMeasurementId; + + /** 计量单位名称 */ + @Excel(name = "计量单位名称") + private String unitOfMeasurementName; + + /** 仓库id */ + @Excel(name = "仓库id") + private Long warehouseId; + + /** 仓库名称 */ + @Excel(name = "仓库名称") + private String warehouseName; + + @Excel(name = "允许采购") + private String isBuy; + @Excel(name = "允许销售") + private String isSale; + @Excel(name = "允许库存") + private String isStore; + @Excel(name = "允许生产") + private String isProduct; + @Excel(name = "允许委外") + private String isOut; + @Excel(name = "可为主产品") + private String ismain; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialGroup() { + return materialGroup; + } + + public void setMaterialGroup(String materialGroup) { + this.materialGroup = materialGroup; + } + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getMaterialsId() { + return materialsId; + } + + public void setMaterialsId(String materialsId) { + this.materialsId = materialsId; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public String getPurchaseMarkId() { + return purchaseMarkId; + } + + public void setPurchaseMarkId(String purchaseMarkId) { + this.purchaseMarkId = purchaseMarkId; + } + + public String getPurchaseMark() { + return purchaseMark; + } + + public void setPurchaseMark(String purchaseMark) { + this.purchaseMark = purchaseMark; + } + + public String getUnitOfMeasurementId() { + return unitOfMeasurementId; + } + + public void setUnitOfMeasurementId(String unitOfMeasurementId) { + this.unitOfMeasurementId = unitOfMeasurementId; + } + + public String getUnitOfMeasurementName() { + return unitOfMeasurementName; + } + + public void setUnitOfMeasurementName(String unitOfMeasurementName) { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public Long getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(Long warehouseId) { + this.warehouseId = warehouseId; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public String getIsBuy() { + return isBuy; + } + + public void setIsBuy(String isBuy) { + this.isBuy = isBuy; + } + + public String getIsSale() { + return isSale; + } + + public void setIsSale(String isSale) { + this.isSale = isSale; + } + + public String getIsStore() { + return isStore; + } + + public void setIsStore(String isStore) { + this.isStore = isStore; + } + + public String getIsProduct() { + return isProduct; + } + + public void setIsProduct(String isProduct) { + this.isProduct = isProduct; + } + + public String getIsOut() { + return isOut; + } + + public void setIsOut(String isOut) { + this.isOut = isOut; + } + + public String getIsmain() { + return ismain; + } + + public void setIsmain(String ismain) { + this.ismain = ismain; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdProcessBom.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdProcessBom.java new file mode 100644 index 0000000..e4d74bb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdProcessBom.java @@ -0,0 +1,242 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import java.util.List; + +/** + * 金蝶工序BOM记录对象 jd_process_bom + * + * @author chenyongjiang + * @date 2024-05-07 + */ +public class JdProcessBom extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** ERP生产令号 */ + @Excel(name = "ERP生产令号") + private String productCode; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private String weight; + + /** 工艺图号 */ + @Excel(name = "工艺图号") + private String parentFigureNumber; + + /** 工艺名称 */ + @Excel(name = "工艺名称") + private String parentProductName; + + private List children; + + /** 审核状态 */ + @Excel(name = "审核状态") + private String status; + + private String purchaseMark; //属性 + + private Long recordId; //bom记录 + + private String pushStatus; //推送状态 + /** 备注 */ + @Excel(name = "备注") + private String remarks; + private int xuTime; //序工时 + private String flag; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + private String processName; //工序名称 + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + private Long parentId; //序工时 + + public int getXuTime() { + return xuTime; + } + + public void setXuTime(int xuTime) { + this.xuTime = xuTime; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getPushStatus() { + return pushStatus; + } + + public void setPushStatus(String pushStatus) { + this.pushStatus = pushStatus; + } + + public Long getRecordId() { + return recordId; + } + + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + public String getPurchaseMark() { + return purchaseMark; + } + + public void setPurchaseMark(String purchaseMark) { + this.purchaseMark = purchaseMark; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductCode(String productCode) + { + this.productCode = productCode; + } + + public String getProductCode() + { + return productCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setWeight(String weight) + { + this.weight = weight; + } + + public String getWeight() + { + return weight; + } + public void setParentFigureNumber(String parentFigureNumber) + { + this.parentFigureNumber = parentFigureNumber; + } + + public String getParentFigureNumber() + { + return parentFigureNumber; + } + public void setParentProductName(String parentProductName) + { + this.parentProductName = parentProductName; + } + + public String getParentProductName() + { + return parentProductName; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("productCode", getProductCode()) + .append("figureNumber", getFigureNumber()) + .append("productName", getProductName()) + .append("materials", getMaterials()) + .append("weight", getWeight()) + .append("parentFigureNumber", getParentFigureNumber()) + .append("parentProductName", getParentProductName()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdProcessBomRecord.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdProcessBomRecord.java new file mode 100644 index 0000000..ad2147f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdProcessBomRecord.java @@ -0,0 +1,35 @@ +package com.ruoyi.project.management.domain; + +public class JdProcessBomRecord { + + /** 主键 */ + private Long id; + /** 记录ID */ + private Long recordId; + /** 主键 */ + private Long processId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRecordId() { + return recordId; + } + + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + public Long getProcessId() { + return processId; + } + + public void setProcessId(Long processId) { + this.processId = processId; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/JdReceiptsDataInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/JdReceiptsDataInfo.java new file mode 100644 index 0000000..10ce690 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/JdReceiptsDataInfo.java @@ -0,0 +1,195 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 财务系统数据信息对象 jd_receipts_data_info + * + * @author zhukangchao + * @date 2023-11-27 + */ +public class JdReceiptsDataInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 关联单据编号 */ + @Excel(name = "关联单据编号") + private String contractCode; + + /** 单据类型 */ + @Excel(name = "单据类型") + private String type; + + /** 操作类型标记(新增、删除) */ + @Excel(name = "标记(新增、删除)") + private String sign; + + /** 业务类型标记(款、票) */ + @Excel(name = "业务类型标记(款、票)") + private String businessSign; + + /** 金额 */ + @Excel(name = "金额") + private Double money; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 备用字段5 */ + @Excel(name = "备用字段5") + private Double sparedFive; + + /** 备用字段6 */ + @Excel(name = "备用字段6") + private Double sparedSix; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setSign(String sign) + { + this.sign = sign; + } + + public String getSign() + { + return sign; + } + + public String getBusinessSign() { + return businessSign; + } + + public void setBusinessSign(String businessSign) { + this.businessSign = businessSign; + } + + public void setMoney(Double money) + { + this.money = money; + } + + public Double getMoney() + { + return money; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setSparedFive(Double sparedFive) + { + this.sparedFive = sparedFive; + } + + public Double getSparedFive() + { + return sparedFive; + } + public void setSparedSix(Double sparedSix) + { + this.sparedSix = sparedSix; + } + + public Double getSparedSix() + { + return sparedSix; + } + + @Override + public String toString() { + return "JdReceiptsDataInfo [id=" + id + ", code=" + code + ", contractCode=" + contractCode + ", type=" + type + + ", sign=" + sign + ", businessSign=" + businessSign + ", money=" + money + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", sparedFive=" + sparedFive + ", sparedSix=" + sparedSix + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/LinShiDaoChu.java b/evo/src/main/java/com/ruoyi/project/management/domain/LinShiDaoChu.java new file mode 100644 index 0000000..83df81b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/LinShiDaoChu.java @@ -0,0 +1,98 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class LinShiDaoChu { + + /** 生产令号 */ + @Excel(name = "令号") + private String productionCode; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 本批数量 */ + @Excel(name = "下单数量") + private Long sumNumber; + + /** 入库数量 */ + @Excel(name = "入库数量") + private Long ruKuNumber; + + /** 在途数量 */ + @Excel(name = "在途数量") + private Long zaituNumber; + + /** 派工部门 */ + @Excel(name = "派工部门") + private String deptName; + + public String getProductionCode() { + return productionCode; + } + + public void setProductionCode(String productionCode) { + this.productionCode = productionCode; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getSumNumber() { + return sumNumber; + } + + public void setSumNumber(Long sumNumber) { + this.sumNumber = sumNumber; + } + + public Long getRuKuNumber() { + return ruKuNumber; + } + + public void setRuKuNumber(Long ruKuNumber) { + this.ruKuNumber = ruKuNumber; + } + + public Long getZaituNumber() { + return zaituNumber; + } + + public void setZaituNumber(Long zaituNumber) { + this.zaituNumber = zaituNumber; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + @Override + public String toString() { + return "LinShiDaoChu [productionCode=" + productionCode + ", figureNumber=" + figureNumber + ", name=" + name + + ", sumNumber=" + sumNumber + ", ruKuNumber=" + ruKuNumber + ", zaituNumber=" + zaituNumber + + ", deptName=" + deptName + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/MaterialSecure.java b/evo/src/main/java/com/ruoyi/project/management/domain/MaterialSecure.java new file mode 100644 index 0000000..48315d7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/MaterialSecure.java @@ -0,0 +1,238 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 安全库存设置对象 material_secure + * + * @author chenyongjiang + * @date 2024-02-19 + */ +public class MaterialSecure extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String specificationType; + + /** 所属类别 */ + @Excel(name = "所属类别") + private String category; + + /** 采购标记 */ + @Excel(name = "采购标记") + private String purchaseMark; + + /** 材料分类 */ + @Excel(name = "材料分类") + private String materialClassification; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String preferentialOriginName; + + /** 最低库存 */ + @Excel(name = "最低库存") + private Long minimum; + + /** 最高库存 */ + @Excel(name = "最高库存") + private Long highest; + + /** 未税单价(指导价) */ + @Excel(name = "未税单价", readConverterExp = "指=导价") + private Double univalence; + + /** 含税价格 */ + @Excel(name = "含税价格") + private Double unitPrice; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setSpecificationType(String specificationType) + { + this.specificationType = specificationType; + } + + public String getSpecificationType() + { + return specificationType; + } + public void setCategory(String category) + { + this.category = category; + } + + public String getCategory() + { + return category; + } + public void setPurchaseMark(String purchaseMark) + { + this.purchaseMark = purchaseMark; + } + + public String getPurchaseMark() + { + return purchaseMark; + } + public void setMaterialClassification(String materialClassification) + { + this.materialClassification = materialClassification; + } + + public String getMaterialClassification() + { + return materialClassification; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setPreferentialOriginName(String preferentialOriginName) + { + this.preferentialOriginName = preferentialOriginName; + } + + public String getPreferentialOriginName() + { + return preferentialOriginName; + } + public void setMinimum(Long minimum) + { + this.minimum = minimum; + } + + public Long getMinimum() + { + return minimum; + } + public void setHighest(Long highest) + { + this.highest = highest; + } + + public Long getHighest() + { + return highest; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("figureNumber", getFigureNumber()) + .append("materialName", getMaterialName()) + .append("specificationType", getSpecificationType()) + .append("category", getCategory()) + .append("purchaseMark", getPurchaseMark()) + .append("materialClassification", getMaterialClassification()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("unit", getUnit()) + .append("preferentialOriginName", getPreferentialOriginName()) + .append("minimum", getMinimum()) + .append("highest", getHighest()) + .append("univalence", getUnivalence()) + .append("unitPrice", getUnitPrice()) + .append("remark", getRemark()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcCurtainMachine.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcCurtainMachine.java new file mode 100644 index 0000000..d8d95f5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcCurtainMachine.java @@ -0,0 +1,304 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 大幕机型号对象 pc_curtain_machine + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcCurtainMachine extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 单边行程 */ + @Excel(name = "单边行程") + private Double unilateralStroke; + + /** 重叠长度 */ + @Excel(name = "重叠长度") + private Double overlapLength; + + /** 驱动负载 */ + @Excel(name = "驱动负载") + private Long driveTheLoad; + + /** 对开速度 */ + @Excel(name = "对开速度") + private Long divideSpeed; + + /** 幕架总长 */ + @Excel(name = "幕架总长") + private Long chassisTotalLenght; + + /** 台口尺寸 */ + @Excel(name = "台口尺寸") + private Long entablatureMeasure; + + /** 吊点数量 */ + @Excel(name = "吊点数量") + private Long suspensionCentreNumber; + + /** 吊点间距 */ + @Excel(name = "吊点间距") + private Long suspensionCentreInterval; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setUnilateralStroke(Double unilateralStroke) + { + this.unilateralStroke = unilateralStroke; + } + + public Double getUnilateralStroke() + { + return unilateralStroke; + } + public void setOverlapLength(Double overlapLength) + { + this.overlapLength = overlapLength; + } + + public Double getOverlapLength() + { + return overlapLength; + } + public void setDriveTheLoad(Long driveTheLoad) + { + this.driveTheLoad = driveTheLoad; + } + + public Long getDriveTheLoad() + { + return driveTheLoad; + } + public void setDivideSpeed(Long divideSpeed) + { + this.divideSpeed = divideSpeed; + } + + public Long getDivideSpeed() + { + return divideSpeed; + } + public void setChassisTotalLenght(Long chassisTotalLenght) + { + this.chassisTotalLenght = chassisTotalLenght; + } + + public Long getChassisTotalLenght() + { + return chassisTotalLenght; + } + public void setEntablatureMeasure(Long entablatureMeasure) + { + this.entablatureMeasure = entablatureMeasure; + } + + public Long getEntablatureMeasure() + { + return entablatureMeasure; + } + public void setSuspensionCentreNumber(Long suspensionCentreNumber) + { + this.suspensionCentreNumber = suspensionCentreNumber; + } + + public Long getSuspensionCentreNumber() + { + return suspensionCentreNumber; + } + public void setSuspensionCentreInterval(Long suspensionCentreInterval) + { + this.suspensionCentreInterval = suspensionCentreInterval; + } + + public Long getSuspensionCentreInterval() + { + return suspensionCentreInterval; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("unilateralStroke", getUnilateralStroke()) + .append("overlapLength", getOverlapLength()) + .append("driveTheLoad", getDriveTheLoad()) + .append("divideSpeed", getDivideSpeed()) + .append("chassisTotalLenght", getChassisTotalLenght()) + .append("entablatureMeasure", getEntablatureMeasure()) + .append("suspensionCentreNumber", getSuspensionCentreNumber()) + .append("suspensionCentreInterval", getSuspensionCentreInterval()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcDetent.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcDetent.java new file mode 100644 index 0000000..3c7cb6d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcDetent.java @@ -0,0 +1,276 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 制动器型号对象 pc_detent + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcDetent extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 额定制动力矩(Nm) */ + @Excel(name = "额定制动力矩", readConverterExp = "N=m") + private Long ratedBrakingMoment; + + /** 制动轮直径(mm) */ + @Excel(name = "制动轮直径", readConverterExp = "m=m") + private Long brakeWheelDiameter; + + /** 重量(kg) */ + @Excel(name = "重量", readConverterExp = "k=g") + private Long weight; + + /** 中心高度h1 */ + @Excel(name = "中心高度h1") + private Long centerHeightHOne; + + /** 总高H */ + @Excel(name = "总高H") + private Long overallHeightH; + + /** 厚度b */ + @Excel(name = "厚度b") + private Long thicknessB; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setRatedBrakingMoment(Long ratedBrakingMoment) + { + this.ratedBrakingMoment = ratedBrakingMoment; + } + + public Long getRatedBrakingMoment() + { + return ratedBrakingMoment; + } + public void setBrakeWheelDiameter(Long brakeWheelDiameter) + { + this.brakeWheelDiameter = brakeWheelDiameter; + } + + public Long getBrakeWheelDiameter() + { + return brakeWheelDiameter; + } + public void setWeight(Long weight) + { + this.weight = weight; + } + + public Long getWeight() + { + return weight; + } + public void setCenterHeightHOne(Long centerHeightHOne) + { + this.centerHeightHOne = centerHeightHOne; + } + + public Long getCenterHeightHOne() + { + return centerHeightHOne; + } + public void setOverallHeightH(Long overallHeightH) + { + this.overallHeightH = overallHeightH; + } + + public Long getOverallHeightH() + { + return overallHeightH; + } + public void setThicknessB(Long thicknessB) + { + this.thicknessB = thicknessB; + } + + public Long getThicknessB() + { + return thicknessB; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("ratedBrakingMoment", getRatedBrakingMoment()) + .append("brakeWheelDiameter", getBrakeWheelDiameter()) + .append("weight", getWeight()) + .append("centerHeightHOne", getCenterHeightHOne()) + .append("overallHeightH", getOverallHeightH()) + .append("thicknessB", getThicknessB()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcElectricalMachineryAc.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcElectricalMachineryAc.java new file mode 100644 index 0000000..12fedf7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcElectricalMachineryAc.java @@ -0,0 +1,346 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 电机AC型号对象 pc_electrical_machinery_ac + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcElectricalMachineryAc extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 功率(KW) */ + @Excel(name = "功率", readConverterExp = "K=W") + private Double power; + + /** 直径ac */ + @Excel(name = "直径ac") + private Long diameterAc; + + /** 单制动长度 */ + @Excel(name = "单制动长度") + private Long oneBrakingLength; + + /** 双制动+尾轴 */ + @Excel(name = "双制动+尾轴") + private Double twoBrakingTailshaft; + + /** 额定转速 */ + @Excel(name = "额定转速") + private Long ratedSpeed; + + /** 额定扭矩 */ + @Excel(name = "额定扭矩") + private Double ratedTorque; + + /** 制动力矩 */ + @Excel(name = "制动力矩") + private Long retardingTorque; + + /** 重量 */ + @Excel(name = "重量") + private Long weight; + + /** 电源电压 */ + @Excel(name = "电源电压") + private String supplyVoltage; + + /** 制动电压 */ + @Excel(name = "制动电压") + private String brakeVoltage; + + /** 频率 */ + @Excel(name = "频率") + private Long frequency; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setPower(Double power) + { + this.power = power; + } + + public Double getPower() + { + return power; + } + public void setDiameterAc(Long diameterAc) + { + this.diameterAc = diameterAc; + } + + public Long getDiameterAc() + { + return diameterAc; + } + public void setOneBrakingLength(Long oneBrakingLength) + { + this.oneBrakingLength = oneBrakingLength; + } + + public Long getOneBrakingLength() + { + return oneBrakingLength; + } + public void setTwoBrakingTailshaft(Double twoBrakingTailshaft) + { + this.twoBrakingTailshaft = twoBrakingTailshaft; + } + + public Double getTwoBrakingTailshaft() + { + return twoBrakingTailshaft; + } + public void setRatedSpeed(Long ratedSpeed) + { + this.ratedSpeed = ratedSpeed; + } + + public Long getRatedSpeed() + { + return ratedSpeed; + } + public void setRatedTorque(Double ratedTorque) + { + this.ratedTorque = ratedTorque; + } + + public Double getRatedTorque() + { + return ratedTorque; + } + public void setRetardingTorque(Long retardingTorque) + { + this.retardingTorque = retardingTorque; + } + + public Long getRetardingTorque() + { + return retardingTorque; + } + public void setWeight(Long weight) + { + this.weight = weight; + } + + public Long getWeight() + { + return weight; + } + public void setSupplyVoltage(String supplyVoltage) + { + this.supplyVoltage = supplyVoltage; + } + + public String getSupplyVoltage() + { + return supplyVoltage; + } + public void setBrakeVoltage(String brakeVoltage) + { + this.brakeVoltage = brakeVoltage; + } + + public String getBrakeVoltage() + { + return brakeVoltage; + } + public void setFrequency(Long frequency) + { + this.frequency = frequency; + } + + public Long getFrequency() + { + return frequency; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("power", getPower()) + .append("diameterAc", getDiameterAc()) + .append("oneBrakingLength", getOneBrakingLength()) + .append("twoBrakingTailshaft", getTwoBrakingTailshaft()) + .append("ratedSpeed", getRatedSpeed()) + .append("ratedTorque", getRatedTorque()) + .append("retardingTorque", getRetardingTorque()) + .append("weight", getWeight()) + .append("supplyVoltage", getSupplyVoltage()) + .append("brakeVoltage", getBrakeVoltage()) + .append("frequency", getFrequency()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcFTypeReducer.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcFTypeReducer.java new file mode 100644 index 0000000..17aa4d4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcFTypeReducer.java @@ -0,0 +1,318 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * F型减速机型号对象 pc_f_type_reducer + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcFTypeReducer extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 功率(kW) */ + @Excel(name = "功率", readConverterExp = "k=W") + private Double power; + + /** 速比 */ + @Excel(name = "速比") + private Double speedRatio; + + /** 输出转速 */ + @Excel(name = "输出转速") + private Long outputSpeed; + + /** 输出扭矩(Nm) */ + @Excel(name = "输出扭矩", readConverterExp = "N=m") + private Long outputTorque; + + /** 电机制动扭矩(Nm) */ + @Excel(name = "电机制动扭矩", readConverterExp = "N=m") + private Long motorBrakingTorque; + + /** 电源电压 */ + @Excel(name = "电源电压") + private String supplyVoltage; + + /** 制动电压 */ + @Excel(name = "制动电压") + private String brakeVoltage; + + /** 尾轴尺寸 */ + @Excel(name = "尾轴尺寸") + private String shaftSize; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 厂家 */ + @Excel(name = "厂家") + private String manufacturers; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setPower(Double power) + { + this.power = power; + } + + public Double getPower() + { + return power; + } + public void setSpeedRatio(Double speedRatio) + { + this.speedRatio = speedRatio; + } + + public Double getSpeedRatio() + { + return speedRatio; + } + public void setOutputSpeed(Long outputSpeed) + { + this.outputSpeed = outputSpeed; + } + + public Long getOutputSpeed() + { + return outputSpeed; + } + public void setOutputTorque(Long outputTorque) + { + this.outputTorque = outputTorque; + } + + public Long getOutputTorque() + { + return outputTorque; + } + public void setMotorBrakingTorque(Long motorBrakingTorque) + { + this.motorBrakingTorque = motorBrakingTorque; + } + + public Long getMotorBrakingTorque() + { + return motorBrakingTorque; + } + public void setSupplyVoltage(String supplyVoltage) + { + this.supplyVoltage = supplyVoltage; + } + + public String getSupplyVoltage() + { + return supplyVoltage; + } + public void setBrakeVoltage(String brakeVoltage) + { + this.brakeVoltage = brakeVoltage; + } + + public String getBrakeVoltage() + { + return brakeVoltage; + } + public void setShaftSize(String shaftSize) + { + this.shaftSize = shaftSize; + } + + public String getShaftSize() + { + return shaftSize; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setManufacturers(String manufacturers) + { + this.manufacturers = manufacturers; + } + + public String getManufacturers() + { + return manufacturers; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("power", getPower()) + .append("speedRatio", getSpeedRatio()) + .append("outputSpeed", getOutputSpeed()) + .append("outputTorque", getOutputTorque()) + .append("motorBrakingTorque", getMotorBrakingTorque()) + .append("supplyVoltage", getSupplyVoltage()) + .append("brakeVoltage", getBrakeVoltage()) + .append("shaftSize", getShaftSize()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("manufacturers", getManufacturers()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcFireCurtainDampingDrive.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcFireCurtainDampingDrive.java new file mode 100644 index 0000000..5eae4c7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcFireCurtainDampingDrive.java @@ -0,0 +1,206 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 防火隔离幕阻尼驱动型号对象 pc_fire_curtain_damping_drive + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcFireCurtainDampingDrive extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 单边行程 */ + @Excel(name = "单边行程") + private Long unilateralStroke; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setUnilateralStroke(Long unilateralStroke) + { + this.unilateralStroke = unilateralStroke; + } + + public Long getUnilateralStroke() + { + return unilateralStroke; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("unilateralStroke", getUnilateralStroke()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcHooksCoupling.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcHooksCoupling.java new file mode 100644 index 0000000..f358a3d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcHooksCoupling.java @@ -0,0 +1,234 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 万向连轴器型号对象 pc_hooks_coupling + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcHooksCoupling extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 类型名称 */ + @Excel(name = "类型名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 公称扭矩(Nm) */ + @Excel(name = "公称扭矩", readConverterExp = "N=m") + private Long nominalTorque; + + /** 疲劳扭矩(Nm) */ + @Excel(name = "疲劳扭矩", readConverterExp = "N=m") + private Long fatigueTorque; + + /** 长度 */ + @Excel(name = "长度") + private Long length; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setNominalTorque(Long nominalTorque) + { + this.nominalTorque = nominalTorque; + } + + public Long getNominalTorque() + { + return nominalTorque; + } + public void setFatigueTorque(Long fatigueTorque) + { + this.fatigueTorque = fatigueTorque; + } + + public Long getFatigueTorque() + { + return fatigueTorque; + } + public void setLength(Long length) + { + this.length = length; + } + + public Long getLength() + { + return length; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("nominalTorque", getNominalTorque()) + .append("fatigueTorque", getFatigueTorque()) + .append("length", getLength()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcRigidChain.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcRigidChain.java new file mode 100644 index 0000000..bfca877 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcRigidChain.java @@ -0,0 +1,1550 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 销齿链型号对象 pc_rigid_chain + * + * @author zhukangchao + * @date 2020-10-22 + */ +public class PcRigidChain extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 类型 */ + @Excel(name = "类型") + private String type; + + /** 型号全称 */ + @Excel(name = "型号") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** 轴向 */ + @Excel(name = "轴向") + private String axialDirection; + + /** 箱体 */ + @Excel(name = "箱体") + private String box; + + /** 行程(mm) */ + @Excel(name = "行程", readConverterExp = "m=m") + private Long journey; + + /** 标记号 */ + @Excel(name = "标记号") + private String lableNumber; + + /** L1(mm) */ + @Excel(name = "L1", readConverterExp = "m=m") + private Long lOne; + + /** L2(mm) */ + @Excel(name = "L2", readConverterExp = "m=m") + private Long lTwo; + + /** L3(mm) */ + @Excel(name = "L3", readConverterExp = "m=m") + private Long lThree; + + /** 总重量 */ + @Excel(name = "总重量") + private Long sumWeight; + + /** 链条自重 */ + @Excel(name = "链条自重") + private Long chainWeight; + + /** 动载荷(KN) */ + @Excel(name = "动载荷", readConverterExp = "K=N") + private Long dynamicLoad; + + /** 静载荷(KN) */ + @Excel(name = "静载荷", readConverterExp = "K=N") + private Long deadLoad; + + /** 每转上升高度(mm) */ + @Excel(name = "每转上升高度", readConverterExp = "m=m") + private Long riseInHeightPerRevolution; + + /** 速度(mm/s) */ + @Excel(name = "速度", readConverterExp = "m=m/s") + private Double speed; + + /** 系统效率(%) */ + @Excel(name = "系统效率", readConverterExp = "%=") + private Long efficiency; + + /** 链条节距(mm) */ + @Excel(name = "链条节距", readConverterExp = "m=m") + private Long chainPitch; + + /** 节圆半径(mm) */ + @Excel(name = "节圆半径", readConverterExp = "m=m") + private Long pitchRadius; + + /** 最低高度(mm) */ + @Excel(name = "最低高度", readConverterExp = "m=m") + private Long minimumAltitude; + + /** 一米链条自重(Kg/m) */ + @Excel(name = "一米链条自重", readConverterExp = "K=g/m") + private Double singleMeterChainWeight; + + /** 驱动箱重量(Kg) */ + @Excel(name = "驱动箱重量", readConverterExp = "K=g") + private Long drivingBoxWeight; + + /** 链箱重量(Kg/m) */ + @Excel(name = "链箱重量", readConverterExp = "K=g/m") + private Double chainBoxWeight; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Long delFlag; + + /** 行程 */ + @Excel(name = "行程") + private Long vOne; + + /** 设备总长 */ + @Excel(name = "设备总长") + private Long vTwo; + + /** 地脚位置1 */ + @Excel(name = "地脚位置1") + private Long vThree; + + /** 地脚位置2 */ + @Excel(name = "地脚位置2") + private Long vFour; + + /** 箱体装配长度 */ + @Excel(name = "箱体装配长度") + private Long vFive; + + /** 箱体地脚位置1 */ + @Excel(name = "箱体地脚位置1") + private Long vSix; + + /** 箱体地脚位置2 */ + @Excel(name = "箱体地脚位置2") + private Long vSeven; + + /** 铝箱长度1 */ + @Excel(name = "铝箱长度1") + private Long vEight; + + /** 铝箱长度2 */ + @Excel(name = "铝箱长度2") + private Long vNine; + + /** 导向条长度1 */ + @Excel(name = "导向条长度1") + private Long vTen; + + /** 导向条长度1数量 */ + @Excel(name = "导向条长度1数量") + private Long vEleven; + + /** 导向条长度2 */ + @Excel(name = "导向条长度2") + private Long vTwelve; + + /** 导向条长度2数量 */ + @Excel(name = "导向条长度2数量") + private Long vThirteen; + + /** 导向条长度3 */ + @Excel(name = "导向条长度3") + private Long vFourteen; + + /** 导向条长度3数量 */ + @Excel(name = "导向条长度3数量") + private Long vFifteen; + + /** 孔位总长1 */ + @Excel(name = "孔位总长1") + private Long vSixteen; + + /** 间隔数量1 */ + @Excel(name = "间隔数量1") + private Long vSeveteen; + + /** 孔位总长2 */ + @Excel(name = "孔位总长2") + private Long vEighteen; + + /** 间隔数量2 */ + @Excel(name = "间隔数量2") + private Long vNineteen; + + /** 铆钉数量 */ + @Excel(name = "铆钉数量") + private Long vTwenty; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentyOne; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentyTwo; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentyThree; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentyFour; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentyFive; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentySix; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentySeven; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentyEight; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vTwentyNine; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirty; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtyOne; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtyTwo; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtyThree; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtyFour; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtyFive; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtySix; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtySeven; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtyEight; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vThirtyNine; + + /** 待定义 */ + // @Excel(name = "待定义") + private Long vForty; + + /** X1 */ + @Excel(name = "X1") + private Long vFortyOne; + + /** X2 */ + @Excel(name = "X2") + private Long vFortyTwo; + + /** X3 */ + @Excel(name = "X3") + private Long vFortyThree; + + /** X4 */ + @Excel(name = "X4") + private Long vFortyFour; + + /** X5 */ + @Excel(name = "X5") + private Long vFortyFive; + + /** X6 */ + @Excel(name = "X6") + private Long vFortySix; + + /** X7 */ + @Excel(name = "X7") + private Long vFortySeven; + + /** X8 */ + @Excel(name = "X8") + private Long vFortyEight; + + /** X9 */ + @Excel(name = "X9") + private Long vFortyNine; + + /** X10 */ + @Excel(name = "X10") + private Long vFifty; + + /** X11 */ + @Excel(name = "X11") + private Long vFiftyOne; + + /** X12 */ + @Excel(name = "X12") + private Long vFiftyTwo; + + /** X13 */ + @Excel(name = "X13") + private Long vFiftyThree; + + /** 重量 */ + // @Excel(name = "重量") + private Double gOne; + + /** 重量 */ + // @Excel(name = "重量") + private Double gTwo; + + /** 重量 */ + // @Excel(name = "重量") + private Double gThree; + + /** 重量 */ + // @Excel(name = "重量") + private Double gFour; + + /** 重量 */ + // @Excel(name = "重量") + private Double gFive; + + /** 重量 */ + // @Excel(name = "重量") + private Double gSix; + + /** 重量 */ + // @Excel(name = "重量") + private Double gSeven; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gEight; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gNine; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gTen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gEleven; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gTwelve; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gThirteen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gFourteen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gFifteen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gSixteen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gSeveteen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gEighteen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gNineteen; + + /** 重量 */ +// // @Excel(name = "重量") + private Double gTwenty; + + private Double vipLevel; + private String spline; + private Long number; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setAxialDirection(String axialDirection) + { + this.axialDirection = axialDirection; + } + + public String getAxialDirection() + { + return axialDirection; + } + public void setBox(String box) + { + this.box = box; + } + + public String getBox() + { + return box; + } + public void setJourney(Long journey) + { + this.journey = journey; + } + + public Long getJourney() + { + return journey; + } + + public String getLableNumber() { + return lableNumber; + } + + public void setLableNumber(String lableNumber) { + this.lableNumber = lableNumber; + } + + public void setlOne(Long lOne) + { + this.lOne = lOne; + } + + public Long getlOne() + { + return lOne; + } + public void setlTwo(Long lTwo) + { + this.lTwo = lTwo; + } + + public Long getlTwo() + { + return lTwo; + } + public void setlThree(Long lThree) + { + this.lThree = lThree; + } + + public Long getlThree() + { + return lThree; + } + public void setSumWeight(Long sumWeight) + { + this.sumWeight = sumWeight; + } + + public Long getSumWeight() + { + return sumWeight; + } + public void setChainWeight(Long chainWeight) + { + this.chainWeight = chainWeight; + } + + public Long getChainWeight() + { + return chainWeight; + } + public void setDynamicLoad(Long dynamicLoad) + { + this.dynamicLoad = dynamicLoad; + } + + public Long getDynamicLoad() + { + return dynamicLoad; + } + public void setDeadLoad(Long deadLoad) + { + this.deadLoad = deadLoad; + } + + public Long getDeadLoad() + { + return deadLoad; + } + public void setRiseInHeightPerRevolution(Long riseInHeightPerRevolution) + { + this.riseInHeightPerRevolution = riseInHeightPerRevolution; + } + + public Long getRiseInHeightPerRevolution() + { + return riseInHeightPerRevolution; + } + public void setSpeed(Double speed) + { + this.speed = speed; + } + + public Double getSpeed() + { + return speed; + } + public void setEfficiency(Long efficiency) + { + this.efficiency = efficiency; + } + + public Long getEfficiency() + { + return efficiency; + } + public void setChainPitch(Long chainPitch) + { + this.chainPitch = chainPitch; + } + + public Long getChainPitch() + { + return chainPitch; + } + public void setPitchRadius(Long pitchRadius) + { + this.pitchRadius = pitchRadius; + } + + public Long getPitchRadius() + { + return pitchRadius; + } + public void setMinimumAltitude(Long minimumAltitude) + { + this.minimumAltitude = minimumAltitude; + } + + public Long getMinimumAltitude() + { + return minimumAltitude; + } + public void setSingleMeterChainWeight(Double singleMeterChainWeight) + { + this.singleMeterChainWeight = singleMeterChainWeight; + } + + public Double getSingleMeterChainWeight() + { + return singleMeterChainWeight; + } + public void setDrivingBoxWeight(Long drivingBoxWeight) + { + this.drivingBoxWeight = drivingBoxWeight; + } + + public Long getDrivingBoxWeight() + { + return drivingBoxWeight; + } + public void setChainBoxWeight(Double chainBoxWeight) + { + this.chainBoxWeight = chainBoxWeight; + } + + public Double getChainBoxWeight() + { + return chainBoxWeight; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Long delFlag) + { + this.delFlag = delFlag; + } + + public Long getDelFlag() + { + return delFlag; + } + public void setvOne(Long vOne) + { + this.vOne = vOne; + } + + public Long getvOne() + { + return vOne; + } + public void setvTwo(Long vTwo) + { + this.vTwo = vTwo; + } + + public Long getvTwo() + { + return vTwo; + } + public void setvThree(Long vThree) + { + this.vThree = vThree; + } + + public Long getvThree() + { + return vThree; + } + public void setvFour(Long vFour) + { + this.vFour = vFour; + } + + public Long getvFour() + { + return vFour; + } + public void setvFive(Long vFive) + { + this.vFive = vFive; + } + + public Long getvFive() + { + return vFive; + } + public void setvSix(Long vSix) + { + this.vSix = vSix; + } + + public Long getvSix() + { + return vSix; + } + public void setvSeven(Long vSeven) + { + this.vSeven = vSeven; + } + + public Long getvSeven() + { + return vSeven; + } + public void setvEight(Long vEight) + { + this.vEight = vEight; + } + + public Long getvEight() + { + return vEight; + } + public void setvNine(Long vNine) + { + this.vNine = vNine; + } + + public Long getvNine() + { + return vNine; + } + public void setvTen(Long vTen) + { + this.vTen = vTen; + } + + public Long getvTen() + { + return vTen; + } + public void setvEleven(Long vEleven) + { + this.vEleven = vEleven; + } + + public Long getvEleven() + { + return vEleven; + } + public void setvTwelve(Long vTwelve) + { + this.vTwelve = vTwelve; + } + + public Long getvTwelve() + { + return vTwelve; + } + public void setvThirteen(Long vThirteen) + { + this.vThirteen = vThirteen; + } + + public Long getvThirteen() + { + return vThirteen; + } + public void setvFourteen(Long vFourteen) + { + this.vFourteen = vFourteen; + } + + public Long getvFourteen() + { + return vFourteen; + } + public void setvFifteen(Long vFifteen) + { + this.vFifteen = vFifteen; + } + + public Long getvFifteen() + { + return vFifteen; + } + public void setvSixteen(Long vSixteen) + { + this.vSixteen = vSixteen; + } + + public Long getvSixteen() + { + return vSixteen; + } + public void setvSeveteen(Long vSeveteen) + { + this.vSeveteen = vSeveteen; + } + + public Long getvSeveteen() + { + return vSeveteen; + } + public void setvEighteen(Long vEighteen) + { + this.vEighteen = vEighteen; + } + + public Long getvEighteen() + { + return vEighteen; + } + public void setvNineteen(Long vNineteen) + { + this.vNineteen = vNineteen; + } + + public Long getvNineteen() + { + return vNineteen; + } + public void setvTwenty(Long vTwenty) + { + this.vTwenty = vTwenty; + } + + public Long getvTwenty() + { + return vTwenty; + } + public void setvTwentyOne(Long vTwentyOne) + { + this.vTwentyOne = vTwentyOne; + } + + public Long getvTwentyOne() + { + return vTwentyOne; + } + public void setvTwentyTwo(Long vTwentyTwo) + { + this.vTwentyTwo = vTwentyTwo; + } + + public Long getvTwentyTwo() + { + return vTwentyTwo; + } + public void setvTwentyThree(Long vTwentyThree) + { + this.vTwentyThree = vTwentyThree; + } + + public Long getvTwentyThree() + { + return vTwentyThree; + } + public void setvTwentyFour(Long vTwentyFour) + { + this.vTwentyFour = vTwentyFour; + } + + public Long getvTwentyFour() + { + return vTwentyFour; + } + public void setvTwentyFive(Long vTwentyFive) + { + this.vTwentyFive = vTwentyFive; + } + + public Long getvTwentyFive() + { + return vTwentyFive; + } + public void setvTwentySix(Long vTwentySix) + { + this.vTwentySix = vTwentySix; + } + + public Long getvTwentySix() + { + return vTwentySix; + } + public void setvTwentySeven(Long vTwentySeven) + { + this.vTwentySeven = vTwentySeven; + } + + public Long getvTwentySeven() + { + return vTwentySeven; + } + public void setvTwentyEight(Long vTwentyEight) + { + this.vTwentyEight = vTwentyEight; + } + + public Long getvTwentyEight() + { + return vTwentyEight; + } + public void setvTwentyNine(Long vTwentyNine) + { + this.vTwentyNine = vTwentyNine; + } + + public Long getvTwentyNine() + { + return vTwentyNine; + } + public void setvThirty(Long vThirty) + { + this.vThirty = vThirty; + } + + public Long getvThirty() + { + return vThirty; + } + public void setvThirtyOne(Long vThirtyOne) + { + this.vThirtyOne = vThirtyOne; + } + + public Long getvThirtyOne() + { + return vThirtyOne; + } + public void setvThirtyTwo(Long vThirtyTwo) + { + this.vThirtyTwo = vThirtyTwo; + } + + public Long getvThirtyTwo() + { + return vThirtyTwo; + } + public void setvThirtyThree(Long vThirtyThree) + { + this.vThirtyThree = vThirtyThree; + } + + public Long getvThirtyThree() + { + return vThirtyThree; + } + public void setvThirtyFour(Long vThirtyFour) + { + this.vThirtyFour = vThirtyFour; + } + + public Long getvThirtyFour() + { + return vThirtyFour; + } + public void setvThirtyFive(Long vThirtyFive) + { + this.vThirtyFive = vThirtyFive; + } + + public Long getvThirtyFive() + { + return vThirtyFive; + } + public void setvThirtySix(Long vThirtySix) + { + this.vThirtySix = vThirtySix; + } + + public Long getvThirtySix() + { + return vThirtySix; + } + public void setvThirtySeven(Long vThirtySeven) + { + this.vThirtySeven = vThirtySeven; + } + + public Long getvThirtySeven() + { + return vThirtySeven; + } + public void setvThirtyEight(Long vThirtyEight) + { + this.vThirtyEight = vThirtyEight; + } + + public Long getvThirtyEight() + { + return vThirtyEight; + } + public void setvThirtyNine(Long vThirtyNine) + { + this.vThirtyNine = vThirtyNine; + } + + public Long getvThirtyNine() + { + return vThirtyNine; + } + public void setvForty(Long vForty) + { + this.vForty = vForty; + } + + public Long getvForty() + { + return vForty; + } + public void setvFortyOne(Long vFortyOne) + { + this.vFortyOne = vFortyOne; + } + + public Long getvFortyOne() + { + return vFortyOne; + } + public void setvFortyTwo(Long vFortyTwo) + { + this.vFortyTwo = vFortyTwo; + } + + public Long getvFortyTwo() + { + return vFortyTwo; + } + public void setvFortyThree(Long vFortyThree) + { + this.vFortyThree = vFortyThree; + } + + public Long getvFortyThree() + { + return vFortyThree; + } + public void setvFortyFour(Long vFortyFour) + { + this.vFortyFour = vFortyFour; + } + + public Long getvFortyFour() + { + return vFortyFour; + } + public void setvFortyFive(Long vFortyFive) + { + this.vFortyFive = vFortyFive; + } + + public Long getvFortyFive() + { + return vFortyFive; + } + public void setvFortySix(Long vFortySix) + { + this.vFortySix = vFortySix; + } + + public Long getvFortySix() + { + return vFortySix; + } + public void setvFortySeven(Long vFortySeven) + { + this.vFortySeven = vFortySeven; + } + + public Long getvFortySeven() + { + return vFortySeven; + } + public void setvFortyEight(Long vFortyEight) + { + this.vFortyEight = vFortyEight; + } + + public Long getvFortyEight() + { + return vFortyEight; + } + public void setvFortyNine(Long vFortyNine) + { + this.vFortyNine = vFortyNine; + } + + public Long getvFortyNine() + { + return vFortyNine; + } + public void setvFifty(Long vFifty) + { + this.vFifty = vFifty; + } + + public Long getvFifty() + { + return vFifty; + } + public void setvFiftyOne(Long vFiftyOne) + { + this.vFiftyOne = vFiftyOne; + } + + public Long getvFiftyOne() + { + return vFiftyOne; + } + + public Long getvFiftyTwo() { + return vFiftyTwo; + } + + public void setvFiftyTwo(Long vFiftyTwo) { + this.vFiftyTwo = vFiftyTwo; + } + + public Long getvFiftyThree() { + return vFiftyThree; + } + + public void setvFiftyThree(Long vFiftyThree) { + this.vFiftyThree = vFiftyThree; + } + + public void setgOne(Double gOne) + { + this.gOne = gOne; + } + + public Double getgOne() + { + return gOne; + } + public void setgTwo(Double gTwo) + { + this.gTwo = gTwo; + } + + public Double getgTwo() + { + return gTwo; + } + public void setgThree(Double gThree) + { + this.gThree = gThree; + } + + public Double getgThree() + { + return gThree; + } + public void setgFour(Double gFour) + { + this.gFour = gFour; + } + + public Double getgFour() + { + return gFour; + } + public void setgFive(Double gFive) + { + this.gFive = gFive; + } + + public Double getgFive() + { + return gFive; + } + public void setgSix(Double gSix) + { + this.gSix = gSix; + } + + public Double getgSix() + { + return gSix; + } + public void setgSeven(Double gSeven) + { + this.gSeven = gSeven; + } + + public Double getgSeven() + { + return gSeven; + } + public void setgEight(Double gEight) + { + this.gEight = gEight; + } + + public Double getgEight() + { + return gEight; + } + public void setgNine(Double gNine) + { + this.gNine = gNine; + } + + public Double getgNine() + { + return gNine; + } + public void setgTen(Double gTen) + { + this.gTen = gTen; + } + + public Double getgTen() + { + return gTen; + } + public void setgEleven(Double gEleven) + { + this.gEleven = gEleven; + } + + public Double getgEleven() + { + return gEleven; + } + public void setgTwelve(Double gTwelve) + { + this.gTwelve = gTwelve; + } + + public Double getgTwelve() + { + return gTwelve; + } + public void setgThirteen(Double gThirteen) + { + this.gThirteen = gThirteen; + } + + public Double getgThirteen() + { + return gThirteen; + } + public void setgFourteen(Double gFourteen) + { + this.gFourteen = gFourteen; + } + + public Double getgFourteen() + { + return gFourteen; + } + public void setgFifteen(Double gFifteen) + { + this.gFifteen = gFifteen; + } + + public Double getgFifteen() + { + return gFifteen; + } + public void setgSixteen(Double gSixteen) + { + this.gSixteen = gSixteen; + } + + public Double getgSixteen() + { + return gSixteen; + } + public void setgSeveteen(Double gSeveteen) + { + this.gSeveteen = gSeveteen; + } + + public Double getgSeveteen() + { + return gSeveteen; + } + public void setgEighteen(Double gEighteen) + { + this.gEighteen = gEighteen; + } + + public Double getgEighteen() + { + return gEighteen; + } + public void setgNineteen(Double gNineteen) + { + this.gNineteen = gNineteen; + } + + public Double getgNineteen() + { + return gNineteen; + } + public void setgTwenty(Double gTwenty) + { + this.gTwenty = gTwenty; + } + + public Double getgTwenty() + { + return gTwenty; + } + + public Double getVipLevel() { + return vipLevel; + } + + public void setVipLevel(Double vipLevel) { + this.vipLevel = vipLevel; + } + + public String getSpline() { + return spline; + } + + public void setSpline(String spline) { + this.spline = spline; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("type", getType()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("axialDirection", getAxialDirection()) + .append("box", getBox()) + .append("journey", getJourney()) + .append("lableNumber", getLableNumber()) + .append("lOne", getlOne()) + .append("lTwo", getlTwo()) + .append("lThree", getlThree()) + .append("sumWeight", getSumWeight()) + .append("chainWeight", getChainWeight()) + .append("dynamicLoad", getDynamicLoad()) + .append("deadLoad", getDeadLoad()) + .append("riseInHeightPerRevolution", getRiseInHeightPerRevolution()) + .append("speed", getSpeed()) + .append("efficiency", getEfficiency()) + .append("chainPitch", getChainPitch()) + .append("pitchRadius", getPitchRadius()) + .append("minimumAltitude", getMinimumAltitude()) + .append("singleMeterChainWeight", getSingleMeterChainWeight()) + .append("drivingBoxWeight", getDrivingBoxWeight()) + .append("chainBoxWeight", getChainBoxWeight()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .append("vOne", getvOne()) + .append("vTwo", getvTwo()) + .append("vThree", getvThree()) + .append("vFour", getvFour()) + .append("vFive", getvFive()) + .append("vSix", getvSix()) + .append("vSeven", getvSeven()) + .append("vEight", getvEight()) + .append("vNine", getvNine()) + .append("vTen", getvTen()) + .append("vEleven", getvEleven()) + .append("vTwelve", getvTwelve()) + .append("vThirteen", getvThirteen()) + .append("vFourteen", getvFourteen()) + .append("vFifteen", getvFifteen()) + .append("vSixteen", getvSixteen()) + .append("vSeveteen", getvSeveteen()) + .append("vEighteen", getvEighteen()) + .append("vNineteen", getvNineteen()) + .append("vTwenty", getvTwenty()) + .append("vTwentyOne", getvTwentyOne()) + .append("vTwentyTwo", getvTwentyTwo()) + .append("vTwentyThree", getvTwentyThree()) + .append("vTwentyFour", getvTwentyFour()) + .append("vTwentyFive", getvTwentyFive()) + .append("vTwentySix", getvTwentySix()) + .append("vTwentySeven", getvTwentySeven()) + .append("vTwentyEight", getvTwentyEight()) + .append("vTwentyNine", getvTwentyNine()) + .append("vThirty", getvThirty()) + .append("vThirtyOne", getvThirtyOne()) + .append("vThirtyTwo", getvThirtyTwo()) + .append("vThirtyThree", getvThirtyThree()) + .append("vThirtyFour", getvThirtyFour()) + .append("vThirtyFive", getvThirtyFive()) + .append("vThirtySix", getvThirtySix()) + .append("vThirtySeven", getvThirtySeven()) + .append("vThirtyEight", getvThirtyEight()) + .append("vThirtyNine", getvThirtyNine()) + .append("vForty", getvForty()) + .append("vFortyOne", getvFortyOne()) + .append("vFortyTwo", getvFortyTwo()) + .append("vFortyThree", getvFortyThree()) + .append("vFortyFour", getvFortyFour()) + .append("vFortyFive", getvFortyFive()) + .append("vFortySix", getvFortySix()) + .append("vFortySeven", getvFortySeven()) + .append("vFortyEight", getvFortyEight()) + .append("vFortyNine", getvFortyNine()) + .append("vFifty", getvFifty()) + .append("vFiftyOne", getvFiftyOne()) + .append("vFiftyTwo", getvFiftyTwo()) + .append("vFiftyThree", getvFiftyThree()) + .append("gOne", getgOne()) + .append("gTwo", getgTwo()) + .append("gThree", getgThree()) + .append("gFour", getgFour()) + .append("gFive", getgFive()) + .append("gSix", getgSix()) + .append("gSeven", getgSeven()) + .append("gEight", getgEight()) + .append("gNine", getgNine()) + .append("gTen", getgTen()) + .append("gEleven", getgEleven()) + .append("gTwelve", getgTwelve()) + .append("gThirteen", getgThirteen()) + .append("gFourteen", getgFourteen()) + .append("gFifteen", getgFifteen()) + .append("gSixteen", getgSixteen()) + .append("gSeveteen", getgSeveteen()) + .append("gEighteen", getgEighteen()) + .append("gNineteen", getgNineteen()) + .append("gTwenty", getgTwenty()) + .append("vipLevel", getVipLevel()) + .append("spline", getSpline()) + .append("number", getNumber()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcStrokeMeasurement.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcStrokeMeasurement.java new file mode 100644 index 0000000..3e027df --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcStrokeMeasurement.java @@ -0,0 +1,232 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 行程检测型号对象 pc_stroke_measurement + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcStrokeMeasurement extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** 速比 */ + @Excel(name = "速比") + private Double speedRatio; + + /** 触点数 */ + @Excel(name = "触点数") + private Long contactNumber; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setSpeedRatio(Double speedRatio) + { + this.speedRatio = speedRatio; + } + + public Double getSpeedRatio() + { + return speedRatio; + } + public void setContactNumber(Long contactNumber) + { + this.contactNumber = contactNumber; + } + + public Long getContactNumber() + { + return contactNumber; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("speedRatio", getSpeedRatio()) + .append("contactNumber", getContactNumber()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcToothedCoupling.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcToothedCoupling.java new file mode 100644 index 0000000..f2af49c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcToothedCoupling.java @@ -0,0 +1,290 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 齿形连轴器型号对象 pc_toothed_coupling + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcToothedCoupling extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 扭矩(Nm) */ + @Excel(name = "扭矩", readConverterExp = "N=m") + private Double torque; + + /** 孔径(mm) */ + @Excel(name = "孔径", readConverterExp = "m=m") + private Long boreDiameter; + + /** Y型长轴孔(mm) */ + @Excel(name = "Y型长轴孔", readConverterExp = "m=m") + private Long yLongShaftHole; + + /** J1型短轴孔(mm) */ + @Excel(name = "J1型短轴孔", readConverterExp = "m=m") + private Long jOneShortShaftHole; + + /** 长度间隙(mm) */ + @Excel(name = "长度间隙", readConverterExp = "m=m") + private Double lengthGap; + + /** 两法兰面最小距离(mm) */ + @Excel(name = "两法兰面最小距离", readConverterExp = "m=m") + private Long flangeFaceMinimumDistance; + + /** 联轴器最小总长度 */ + @Excel(name = "联轴器最小总长度") + private Long minimumTotalLengthCoupling; + + /** 单价(元) */ + @Excel(name = "单价", readConverterExp = "元=") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:已删除,1:未删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setTorque(Double torque) + { + this.torque = torque; + } + + public Double getTorque() + { + return torque; + } + public void setBoreDiameter(Long boreDiameter) + { + this.boreDiameter = boreDiameter; + } + + public Long getBoreDiameter() + { + return boreDiameter; + } + public void setyLongShaftHole(Long yLongShaftHole) + { + this.yLongShaftHole = yLongShaftHole; + } + + public Long getyLongShaftHole() + { + return yLongShaftHole; + } + public void setjOneShortShaftHole(Long jOneShortShaftHole) + { + this.jOneShortShaftHole = jOneShortShaftHole; + } + + public Long getjOneShortShaftHole() + { + return jOneShortShaftHole; + } + public void setLengthGap(Double lengthGap) + { + this.lengthGap = lengthGap; + } + + public Double getLengthGap() + { + return lengthGap; + } + public void setFlangeFaceMinimumDistance(Long flangeFaceMinimumDistance) + { + this.flangeFaceMinimumDistance = flangeFaceMinimumDistance; + } + + public Long getFlangeFaceMinimumDistance() + { + return flangeFaceMinimumDistance; + } + public void setMinimumTotalLengthCoupling(Long minimumTotalLengthCoupling) + { + this.minimumTotalLengthCoupling = minimumTotalLengthCoupling; + } + + public Long getMinimumTotalLengthCoupling() + { + return minimumTotalLengthCoupling; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("torque", getTorque()) + .append("boreDiameter", getBoreDiameter()) + .append("yLongShaftHole", getyLongShaftHole()) + .append("jOneShortShaftHole", getjOneShortShaftHole()) + .append("lengthGap", getLengthGap()) + .append("flangeFaceMinimumDistance", getFlangeFaceMinimumDistance()) + .append("minimumTotalLengthCoupling", getMinimumTotalLengthCoupling()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcTravelSwitch.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcTravelSwitch.java new file mode 100644 index 0000000..af88e7b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcTravelSwitch.java @@ -0,0 +1,206 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 行程开关型号对象 pc_travel_switch + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcTravelSwitch extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 说明 */ + @Excel(name = "说明") + private String illustrate; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setIllustrate(String illustrate) + { + this.illustrate = illustrate; + } + + public String getIllustrate() + { + return illustrate; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("illustrate", getIllustrate()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcTwoStageReductionGear.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcTwoStageReductionGear.java new file mode 100644 index 0000000..3e628f3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcTwoStageReductionGear.java @@ -0,0 +1,318 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 二级减速器型号对象 pc_two_stage_reduction_gear + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcTwoStageReductionGear extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 速比 */ + @Excel(name = "速比") + private Double velocityRatio; + + /** 扭矩(kNm) */ + @Excel(name = "扭矩", readConverterExp = "k=Nm") + private Double torque; + + /** 输入轴直径d1 */ + @Excel(name = "输入轴直径d1") + private Long inputShaftDiameterDOne; + + /** 输入轴长度E1 */ + @Excel(name = "输入轴长度E1") + private Long inputShaftLengthEOne; + + /** 输入轴距离G1 */ + @Excel(name = "输入轴距离G1") + private Long inputShaftDistanceGOne; + + /** 输出轴直径d */ + @Excel(name = "输出轴直径d") + private Long outputShaftDiameterD; + + /** 输出轴高度E */ + @Excel(name = "输出轴高度E") + private Long outputShaftLengthE; + + /** 输出轴距离G2 */ + @Excel(name = "输出轴距离G2") + private Long outputShaftDistanceGTwo; + + /** 输入输出中心高h */ + @Excel(name = "输入输出中心高h") + private Long inOutHeightOfCenterH; + + /** 单价(元) */ + @Excel(name = "单价", readConverterExp = "元=") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setVelocityRatio(Double velocityRatio) + { + this.velocityRatio = velocityRatio; + } + + public Double getVelocityRatio() + { + return velocityRatio; + } + public void setTorque(Double torque) + { + this.torque = torque; + } + + public Double getTorque() + { + return torque; + } + public void setInputShaftDiameterDOne(Long inputShaftDiameterDOne) + { + this.inputShaftDiameterDOne = inputShaftDiameterDOne; + } + + public Long getInputShaftDiameterDOne() + { + return inputShaftDiameterDOne; + } + public void setInputShaftLengthEOne(Long inputShaftLengthEOne) + { + this.inputShaftLengthEOne = inputShaftLengthEOne; + } + + public Long getInputShaftLengthEOne() + { + return inputShaftLengthEOne; + } + public void setInputShaftDistanceGOne(Long inputShaftDistanceGOne) + { + this.inputShaftDistanceGOne = inputShaftDistanceGOne; + } + + public Long getInputShaftDistanceGOne() + { + return inputShaftDistanceGOne; + } + public void setOutputShaftDiameterD(Long outputShaftDiameterD) + { + this.outputShaftDiameterD = outputShaftDiameterD; + } + + public Long getOutputShaftDiameterD() + { + return outputShaftDiameterD; + } + public void setOutputShaftLengthE(Long outputShaftLengthE) + { + this.outputShaftLengthE = outputShaftLengthE; + } + + public Long getOutputShaftLengthE() + { + return outputShaftLengthE; + } + public void setOutputShaftDistanceGTwo(Long outputShaftDistanceGTwo) + { + this.outputShaftDistanceGTwo = outputShaftDistanceGTwo; + } + + public Long getOutputShaftDistanceGTwo() + { + return outputShaftDistanceGTwo; + } + public void setInOutHeightOfCenterH(Long inOutHeightOfCenterH) + { + this.inOutHeightOfCenterH = inOutHeightOfCenterH; + } + + public Long getInOutHeightOfCenterH() + { + return inOutHeightOfCenterH; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("typeName", getTypeName()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("velocityRatio", getVelocityRatio()) + .append("torque", getTorque()) + .append("inputShaftDiameterDOne", getInputShaftDiameterDOne()) + .append("inputShaftLengthEOne", getInputShaftLengthEOne()) + .append("inputShaftDistanceGOne", getInputShaftDistanceGOne()) + .append("outputShaftDiameterD", getOutputShaftDiameterD()) + .append("outputShaftLengthE", getOutputShaftLengthE()) + .append("outputShaftDistanceGTwo", getOutputShaftDistanceGTwo()) + .append("inOutHeightOfCenterH", getInOutHeightOfCenterH()) + .append("univalence", getUnivalence()) + .append("picture", getPicture()) + .append("partId", getPartId()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PcWindlass.java b/evo/src/main/java/com/ruoyi/project/management/domain/PcWindlass.java new file mode 100644 index 0000000..20c3afc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PcWindlass.java @@ -0,0 +1,294 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 卷扬机型号对象 pc_windlass + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PcWindlass extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 材质 */ + @Excel(name = "材质") + private String texture; + + /** 卷筒直径 */ + @Excel(name = "卷筒直径") + private Long diameter; + + /** 行程 */ + @Excel(name = "行程") + private Double journey; + + /** 载重量 */ + @Excel(name = "载重量") + private Long loadCapacity; + + /** 速度 */ + @Excel(name = "速度") + private Double speed; + + /** 钢丝绳直径 */ + @Excel(name = "钢丝绳直径") + private Long diameterOfWireRope; + + /** 吊点数量 */ + @Excel(name = "吊点数量") + private Long suspensionCentreNumber; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 部件id集合 */ + @Excel(name = "部件id集合") + private String partId; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + private Double vipLevel; + private Long number; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setTexture(String texture) + { + this.texture = texture; + } + + public String getTexture() + { + return texture; + } + public void setDiameter(Long diameter) + { + this.diameter = diameter; + } + + public Long getDiameter() + { + return diameter; + } + public void setJourney(Double journey) + { + this.journey = journey; + } + + public Double getJourney() + { + return journey; + } + public void setLoadCapacity(Long loadCapacity) + { + this.loadCapacity = loadCapacity; + } + + public Long getLoadCapacity() + { + return loadCapacity; + } + public void setSpeed(Double speed) + { + this.speed = speed; + } + + public Double getSpeed() + { + return speed; + } + public void setDiameterOfWireRope(Long diameterOfWireRope) + { + this.diameterOfWireRope = diameterOfWireRope; + } + + public Long getDiameterOfWireRope() + { + return diameterOfWireRope; + } + public void setSuspensionCentreNumber(Long suspensionCentreNumber) + { + this.suspensionCentreNumber = suspensionCentreNumber; + } + + public Long getSuspensionCentreNumber() + { + return suspensionCentreNumber; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setPartId(String partId) + { + this.partId = partId; + } + + public String getPartId() + { + return partId; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public Double getVipLevel() { + return vipLevel; + } + + public void setVipLevel(Double vipLevel) { + this.vipLevel = vipLevel; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + @Override + public String toString() { + return "PcWindlass [id=" + id + ", typeName=" + typeName + ", productId=" + productId + ", productName=" + + productName + ", texture=" + texture + ", diameter=" + diameter + ", journey=" + journey + + ", loadCapacity=" + loadCapacity + ", speed=" + speed + ", diameterOfWireRope=" + diameterOfWireRope + + ", suspensionCentreNumber=" + suspensionCentreNumber + ", univalence=" + univalence + ", picture=" + + picture + ", partId=" + partId + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", vipLevel=" + + vipLevel + ", number=" + number + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrder.java b/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrder.java new file mode 100644 index 0000000..371400c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrder.java @@ -0,0 +1,89 @@ +package com.ruoyi.project.management.domain; + +import java.util.ArrayList; +import java.util.List; + +public class PlannedOrder { + + private String orderNumber; //订单编号 + private String billNumber; //单据编号 + private String parentCode; //父物料编码 + private String parentName; //父物料名称 + private Double parentNum; //父级数量 + private String sonCode; //子物料编码 + private String sonName; //子物料名称 + private Double sonNum; //子数量 + private String orderStatus; //单据状态 + + public String getBillNumber() { + return billNumber; + } + + public void setBillNumber(String billNumber) { + this.billNumber = billNumber; + } + + public String getOrderNumber() { + return orderNumber; + } + + public void setOrderNumber(String orderNumber) { + this.orderNumber = orderNumber; + } + + public String getParentCode() { + return parentCode; + } + + public void setParentCode(String parentCode) { + this.parentCode = parentCode; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } + + public Double getParentNum() { + return parentNum; + } + + public void setParentNum(Double parentNum) { + this.parentNum = parentNum; + } + + public String getSonCode() { + return sonCode; + } + + public void setSonCode(String sonCode) { + this.sonCode = sonCode; + } + + public String getSonName() { + return sonName; + } + + public void setSonName(String sonName) { + this.sonName = sonName; + } + + public Double getSonNum() { + return sonNum; + } + + public void setSonNum(Double sonNum) { + this.sonNum = sonNum; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrderParent.java b/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrderParent.java new file mode 100644 index 0000000..c32c17a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrderParent.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class PlannedOrderParent { + private String orderNumber; //订单编号 + private String billNumber; //单据编号 + private String parentCode; //父物料编码 + private String parentName; //父物料名称 + private BigDecimal parentNum; //父级数量 + private String orderStatus; //单据状态 + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + private List sonList = new ArrayList(); + + public String getOrderNumber() { + return orderNumber; + } + + public void setOrderNumber(String orderNumber) { + this.orderNumber = orderNumber; + } + + public String getBillNumber() { + return billNumber; + } + + public void setBillNumber(String billNumber) { + this.billNumber = billNumber; + } + + public String getParentCode() { + return parentCode; + } + + public void setParentCode(String parentCode) { + this.parentCode = parentCode; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } + + public BigDecimal getParentNum() { + return parentNum; + } + + public void setParentNum(BigDecimal parentNum) { + this.parentNum = parentNum; + } + + public List getSonList() { + return sonList; + } + + public void setSonList(List sonList) { + this.sonList = sonList; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrderSon.java b/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrderSon.java new file mode 100644 index 0000000..ba7c590 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PlannedOrderSon.java @@ -0,0 +1,33 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +public class PlannedOrderSon { + private String sonCode; //子物料编码 + private String sonName; //子物料名称 + private BigDecimal sonNum; //子数量 + + public String getSonCode() { + return sonCode; + } + + public void setSonCode(String sonCode) { + this.sonCode = sonCode; + } + + public String getSonName() { + return sonName; + } + + public void setSonName(String sonName) { + this.sonName = sonName; + } + + public BigDecimal getSonNum() { + return sonNum; + } + + public void setSonNum(BigDecimal sonNum) { + this.sonNum = sonNum; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PreliminaryInventoryInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PreliminaryInventoryInfo.java new file mode 100644 index 0000000..5f6c496 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PreliminaryInventoryInfo.java @@ -0,0 +1,112 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class PreliminaryInventoryInfo { + private static final long serialVersionUID = 1L; + + /** 库存制作单编号 */ + @Excel(name = "令号") + private String code; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材质 */ + @Excel(name = "材质") + private String materialType; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 已入库数量 */ + private Long usableQuantity; + + /** 在途数量 */ + private Long preliminaryInventory; + + /** 备注 */ + private String remarks; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Long getUsableQuantity() { + return usableQuantity; + } + + public void setUsableQuantity(Long usableQuantity) { + this.usableQuantity = usableQuantity; + } + + public Long getPreliminaryInventory() { + return preliminaryInventory; + } + + public void setPreliminaryInventory(Long preliminaryInventory) { + this.preliminaryInventory = preliminaryInventory; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + @Override + public String toString() { + return "PreliminaryInventoryInfo [code=" + code + ", name=" + name + ", figureNumber=" + figureNumber + + ", materialType=" + materialType + ", quantity=" + quantity + ", usableQuantity=" + usableQuantity + + ", preliminaryInventory=" + preliminaryInventory + ", remarks=" + remarks + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ProdictBillBom.java b/evo/src/main/java/com/ruoyi/project/management/domain/ProdictBillBom.java new file mode 100644 index 0000000..a2fd8ff --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ProdictBillBom.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.management.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class ProdictBillBom { + + @Excel(name = "生产令号") + private String code; //生成令号 + @Excel(name = "序号") + private String num; + /* @Excel(name = "类别") + private String 类别;*/ + /** 图号 */ + @Excel(name = "物料编码") + private String figureNumber; + /** 名称 */ + @Excel(name = "物料名称") + private String name; + @Excel(name = "型号") + private String specification; + /** 材料 */ + @Excel(name = "材质") + private String type; + @Excel(name = "品牌") + private String typeName; + /** 单台数量 */ + @Excel(name = "单台数量") + private int oneNumber; + /** 单位 */ + @Excel(name = "单位") + private String unit; + @Excel(name = "备注") + private String remarks; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public int getOneNumber() { + return oneNumber; + } + + public void setOneNumber(int oneNumber) { + this.oneNumber = oneNumber; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ProductBillBomTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/ProductBillBomTwo.java new file mode 100644 index 0000000..4bdb2dd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ProductBillBomTwo.java @@ -0,0 +1,239 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class ProductBillBomTwo { + + /** 生产令号 */ + @Excel(name = "生产令号") + private String code; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String productType; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重(KG) */ + @Excel(name = "单重", readConverterExp = "K=G") + private Double pieceWeight; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 派工部门 */ + @Excel(name = "派工部门") + private String departmentName; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 是否有库存 */ + @Excel(name = "是否有库存") + private String sparedTwo; + + /** 材料采购日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date materialsDate; + + /** 已入库数量 */ + @Excel(name = "已入库数量") + private Long rukuNumber; + + /** 已出库数量 */ + @Excel(name = "已出库数量") + private Long chukuNumber; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductType() { + return productType; + } + + public void setProductType(String productType) { + this.productType = productType; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getOneNumber() { + return oneNumber; + } + + public void setOneNumber(Long oneNumber) { + this.oneNumber = oneNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public Long getSumNumber() { + return sumNumber; + } + + public void setSumNumber(Long sumNumber) { + this.sumNumber = sumNumber; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public Date getCompletionDate() { + return completionDate; + } + + public void setCompletionDate(Date completionDate) { + this.completionDate = completionDate; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Date getMaterialsDate() { + return materialsDate; + } + + public void setMaterialsDate(Date materialsDate) { + this.materialsDate = materialsDate; + } + + public Long getRukuNumber() { + return rukuNumber; + } + + public void setRukuNumber(Long rukuNumber) { + this.rukuNumber = rukuNumber; + } + + public Long getChukuNumber() { + return chukuNumber; + } + + public void setChukuNumber(Long chukuNumber) { + this.chukuNumber = chukuNumber; + } + + @Override + public String toString() { + return "ProductBillBomTwo [code=" + code + ", productName=" + productName + ", productType=" + productType + + ", quantity=" + quantity + ", figureNumber=" + figureNumber + ", name=" + name + ", oneNumber=" + + oneNumber + ", type=" + type + ", pieceWeight=" + pieceWeight + ", sumNumber=" + sumNumber + + ", remarks=" + remarks + ", processName=" + processName + ", departmentName=" + departmentName + + ", completionDate=" + completionDate + ", sparedTwo=" + sparedTwo + ", materialsDate=" + materialsDate + + ", rukuNumber=" + rukuNumber + ", chukuNumber=" + chukuNumber + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/ProductInfoNew.java b/evo/src/main/java/com/ruoyi/project/management/domain/ProductInfoNew.java new file mode 100644 index 0000000..8159eeb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/ProductInfoNew.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +public class ProductInfoNew { + + //型号名称 + private String assembledrawing; + //图纸文件路径 + private String sourcefile; + //数量 + private String number; + //企标单图号集合 + private List subparts; + + //变量信息 + private DataInfo vars; + + public String getAssembledrawing() { + return assembledrawing; + } + + public void setAssembledrawing(String assembledrawing) { + this.assembledrawing = assembledrawing; + } + + public String getSourcefile() { + return sourcefile; + } + + public void setSourcefile(String sourcefile) { + this.sourcefile = sourcefile; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public List getSubparts() { + return subparts; + } + + public void setSubparts(List subparts) { + this.subparts = subparts; + } + + public DataInfo getVars() { + return vars; + } + + public void setVars(DataInfo vars) { + this.vars = vars; + } + + @Override + public String toString() { + return "ProductInfoNew [assembledrawing=" + assembledrawing + ", sourcefile=" + sourcefile + ", number=" + + number + ", subparts=" + subparts + ", vars=" + vars + "]"; + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwAlteration.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwAlteration.java new file mode 100644 index 0000000..7c01a36 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwAlteration.java @@ -0,0 +1,222 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 变更单对象 pw_alteration + * + * @author zhukangchao + * @date 2022-04-14 + */ +public class PwAlteration extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 项目令号 */ + @Excel(name = "项目令号") + private String code; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String name; + + /** 变更原因 */ + @Excel(name = "变更原因") + private String cause; + + /** 变更时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "变更时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date causeDate; + + /** 设计人 */ + @Excel(name = "设计人") + private String designer; + + /** 处理方法 */ + @Excel(name = "处理方法") + private String handlingMethod; + + /** 审核状态 */ + @Excel(name = "审核状态") + private String audit; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sapredTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setCause(String cause) + { + this.cause = cause; + } + + public String getCause() + { + return cause; + } + public void setCauseDate(Date causeDate) + { + this.causeDate = causeDate; + } + + public Date getCauseDate() + { + return causeDate; + } + public void setDesigner(String designer) + { + this.designer = designer; + } + + public String getDesigner() + { + return designer; + } + public void setHandlingMethod(String handlingMethod) + { + this.handlingMethod = handlingMethod; + } + + public String getHandlingMethod() + { + return handlingMethod; + } + public void setAudit(String audit) + { + this.audit = audit; + } + + public String getAudit() + { + return audit; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSapredTwo(String sapredTwo) + { + this.sapredTwo = sapredTwo; + } + + public String getSapredTwo() + { + return sapredTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("name", getName()) + .append("cause", getCause()) + .append("causeDate", getCauseDate()) + .append("designer", getDesigner()) + .append("handlingMethod", getHandlingMethod()) + .append("audit", getAudit()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sapredTwo", getSapredTwo()) + .append("sapredThree", getSapredThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwAlterationDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwAlterationDetail.java new file mode 100644 index 0000000..3439957 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwAlterationDetail.java @@ -0,0 +1,379 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 变更单详情对象 pw_alteration_detail + * + * @author zhukangchao + * @date 2022-04-14 + */ +public class PwAlterationDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 变更单id */ + @Excel(name = "变更单id") + private Long alterationId; + + /** 关联令号 */ + @Excel(name = "关联令号") + private String code; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 物料id*/ + private Long oldId; + + /** 父级物料id*/ + private Long oldParentLevelId; + + /** 原名称 */ + @Excel(name = "原名称") + private String oldName; + + /** 原图号 */ + @Excel(name = "原图号") + private String oldFigureNumber; + + /** 原单台数量 */ + @Excel(name = "原单台数量") + private Long oldOneNumber; + + /** 原材料 */ + @Excel(name = "原材料") + private String oldType; + + /** 原单重 */ + @Excel(name = "原单重") + private Double oldPieceWeight; + + /** 原本批数量 */ + @Excel(name = "原本批数量") + private Long oldSumNumber; + + /** 新名称 */ + @Excel(name = "新名称") + private String newName; + + /** 新图号 */ + @Excel(name = "新图号") + private String newFigureNumber; + + /** 新单台数量 */ + @Excel(name = "新单台数量") + private Long newOneNumber; + + /** 新材料 */ + @Excel(name = "新材料") + private String newType; + + /** 新单重 */ + @Excel(name = "新单重") + private Double newPieceWeight; + + /** 新本批数量 */ + @Excel(name = "新本批数量") + private Long newSumNumber; + + /** 父级名称 */ + @Excel(name = "父级名称") + private String newParentLevelName; + + /**父级图号*/ + @Excel(name = "父级图号") + private String newParentLevelFigureNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setAlterationId(Long alterationId) + { + this.alterationId = alterationId; + } + + public Long getOldParentLevelId() { + return oldParentLevelId; + } + + public void setOldParentLevelId(Long oldParentLevelId) { + this.oldParentLevelId = oldParentLevelId; + } + + public Long getAlterationId() + { + return alterationId; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + + public Long getOldId() { + return oldId; + } + + public void setOldId(Long oldId) { + this.oldId = oldId; + } + + public void setProjectName(String projectName) + { + this.projectName = projectName; + } + + public String getProjectName() + { + return projectName; + } + public void setOldName(String oldName) + { + this.oldName = oldName; + } + + public String getOldName() + { + return oldName; + } + public void setOldFigureNumber(String oldFigureNumber) + { + this.oldFigureNumber = oldFigureNumber; + } + + public String getOldFigureNumber() + { + return oldFigureNumber; + } + public void setOldOneNumber(Long oldOneNumber) + { + this.oldOneNumber = oldOneNumber; + } + + public Long getOldOneNumber() + { + return oldOneNumber; + } + public void setOldType(String oldType) + { + this.oldType = oldType; + } + + public String getOldType() + { + return oldType; + } + public void setOldPieceWeight(Double oldPieceWeight) + { + this.oldPieceWeight = oldPieceWeight; + } + + public Double getOldPieceWeight() + { + return oldPieceWeight; + } + public void setOldSumNumber(Long oldSumNumber) + { + this.oldSumNumber = oldSumNumber; + } + + public Long getOldSumNumber() + { + return oldSumNumber; + } + public void setNewName(String newName) + { + this.newName = newName; + } + + public String getNewName() + { + return newName; + } + public void setNewFigureNumber(String newFigureNumber) + { + this.newFigureNumber = newFigureNumber; + } + + public String getNewFigureNumber() + { + return newFigureNumber; + } + public void setNewOneNumber(Long newOneNumber) + { + this.newOneNumber = newOneNumber; + } + + public Long getNewOneNumber() + { + return newOneNumber; + } + public void setNewType(String newType) + { + this.newType = newType; + } + + public String getNewType() + { + return newType; + } + public void setNewPieceWeight(Double newPieceWeight) + { + this.newPieceWeight = newPieceWeight; + } + + public Double getNewPieceWeight() + { + return newPieceWeight; + } + public void setNewSumNumber(Long newSumNumber) + { + this.newSumNumber = newSumNumber; + } + + public Long getNewSumNumber() + { + return newSumNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + public String getNewParentLevelName() { + return newParentLevelName; + } + + public void setNewParentLevelName(String newParentLevelName) { + this.newParentLevelName = newParentLevelName; + } + + public String getNewParentLevelFigureNumber() { + return newParentLevelFigureNumber; + } + + public void setNewParentLevelFigureNumber(String newParentLevelFigureNumber) { + this.newParentLevelFigureNumber = newParentLevelFigureNumber; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("alterationId", getAlterationId()) + .append("code", getCode()) + .append("projectName", getProjectName()) + .append("oldName", getOldName()) + .append("oldFigureNumber", getOldFigureNumber()) + .append("oldOneNumber", getOldOneNumber()) + .append("oldType", getOldType()) + .append("oldPieceWeight", getOldPieceWeight()) + .append("oldSumNumber", getOldSumNumber()) + .append("newName", getNewName()) + .append("newFigureNumber", getNewFigureNumber()) + .append("newOneNumber", getNewOneNumber()) + .append("newType", getNewType()) + .append("newPieceWeight", getNewPieceWeight()) + .append("newSumNumber", getNewSumNumber()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBacklog.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBacklog.java new file mode 100644 index 0000000..d1a3013 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBacklog.java @@ -0,0 +1,293 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 待办事项对象 pw_backlog + * + * @author zhukangchao + * @date 2023-02-05 + */ +public class PwBacklog extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 事项名称 */ + @Excel(name = "事项名称") + private String matterName; + + /** 关联令号 */ + @Excel(name = "关联令号") + private String code; + + /** 关联名称 */ + @Excel(name = "关联名称") + private String materialName; + + /** 关联图号 */ + @Excel(name = "关联图号") + private String figureNumber; + + /** 推送人 */ + @Excel(name = "推送人") + private String pushName; + + /** 推送时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "推送时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date pushTime; + + /** 办理人 */ + @Excel(name = "办理人") + private String recipientName; + + /** 办理时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "办理时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date recipientTime; + + /** 办理方式 */ + @Excel(name = "办理方式") + private String processMode; + + /** 是否完成 */ + @Excel(name = "是否完成") + private String schedule; + + /** 模块名称 */ + @Excel(name = "模块名称") + private String moduleName; + + /** 路由地址 */ + @Excel(name = "路由地址") + private String address; + + /** 是否已阅 */ + @Excel(name = "是否已阅") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setMatterName(String matterName) + { + this.matterName = matterName; + } + + public String getMatterName() + { + return matterName; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public void setPushName(String pushName) + { + this.pushName = pushName; + } + + public String getPushName() + { + return pushName; + } + public void setPushTime(Date pushTime) + { + this.pushTime = pushTime; + } + + public Date getPushTime() + { + return pushTime; + } + public void setRecipientName(String recipientName) + { + this.recipientName = recipientName; + } + + public String getRecipientName() + { + return recipientName; + } + public void setRecipientTime(Date recipientTime) + { + this.recipientTime = recipientTime; + } + + public Date getRecipientTime() + { + return recipientTime; + } + public void setProcessMode(String processMode) + { + this.processMode = processMode; + } + + public String getProcessMode() + { + return processMode; + } + public void setSchedule(String schedule) + { + this.schedule = schedule; + } + + public String getSchedule() + { + return schedule; + } + public void setModuleName(String moduleName) + { + this.moduleName = moduleName; + } + + public String getModuleName() + { + return moduleName; + } + public void setAddress(String address) + { + this.address = address; + } + + public String getAddress() + { + return address; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("matterName", getMatterName()) + .append("code", getCode()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("pushName", getPushName()) + .append("pushTime", getPushTime()) + .append("recipientName", getRecipientName()) + .append("recipientTime", getRecipientTime()) + .append("processMode", getProcessMode()) + .append("schedule", getSchedule()) + .append("moduleName", getModuleName()) + .append("address", getAddress()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBom.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBom.java new file mode 100644 index 0000000..3f02090 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBom.java @@ -0,0 +1,247 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * bom对象 pw_bom + * + * @author zhukangchao + * @date 2020-08-11 + */ +public class PwBom extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long singleQuantity; + + /** 材料类型 */ + @Excel(name = "材料类型") + private String type; + + /** 单重(KG) */ + @Excel(name = "单重", readConverterExp = "K=G") + private Double pieceWeight; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long totalQuantity; + + /** 父级图号 */ +// @Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 父级名称 */ +// @Excel(name = "父级名称") + private String parentLevelName; + + /** 型号全称 */ +// @Excel(name = "型号全称") + private String typeName; + + /** 令号 */ +// @Excel(name = "型号全称") + private String code; + + /** 备用字段1 */ +// @Excel(name = "所属项目") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setSingleQuantity(Long singleQuantity) + { + this.singleQuantity = singleQuantity; + } + + public Long getSingleQuantity() + { + return singleQuantity; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setTotalQuantity(Long totalQuantity) + { + this.totalQuantity = totalQuantity; + } + + public Long getTotalQuantity() + { + return totalQuantity; + } + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("singleQuantity", getSingleQuantity()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("totalQuantity", getTotalQuantity()) + .append("parentLevelFigureNumber", getParentLevelFigureNumber()) + .append("parentLevelName", getParentLevelName()) + .append("typeName", getTypeName()) + .append("code", getCode()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumber.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumber.java new file mode 100644 index 0000000..742d821 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumber.java @@ -0,0 +1,279 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 数量计算对象 pw_bom_number + * + * @author zhukangchao + * @date 2021-03-22 + */ +public class PwBomNumber extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productionCode; + + /** 型号 */ + @Excel(name = "型号") + private String typeName; + + /** 序号 */ + @Excel(name = "序号") + private String num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重(KG) */ + @Excel(name = "单重", readConverterExp = "K=G") + private Double pieceWeight; + + /** 父级图号 */ + @Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 父级名称 */ + @Excel(name = "父级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用1 */ + ////@Excel(name = "备用1") + private String sparedOne; + + /** 备用2 */ + //@Excel(name = "备用2") + private String sparedTwo; + + /** 备用3 */ + //@Excel(name = "备用3") + private Long sparedThree; + + /** 备用4 */ + //@Excel(name = "备用4") + private Long sparedFour; + //物料分组 + private String materialGroup; + //物料属性 + private String purchaseMark; + + public String getPurchaseMark() { + return purchaseMark; + } + + public void setPurchaseMark(String purchaseMark) { + this.purchaseMark = purchaseMark; + } + + public String getMaterialGroup() { + return materialGroup; + } + + public void setMaterialGroup(String materialGroup) { + this.materialGroup = materialGroup; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getProductionCode() + { + return productionCode; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionCode", getProductionCode()) + .append("typeName", getTypeName()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("oneNumber", getOneNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("parentLevelFigureNumber", getParentLevelFigureNumber()) + .append("parentLevelName", getParentLevelName()) + .append("sumNumber", getSumNumber()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwo.java new file mode 100644 index 0000000..f6af0f0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwo.java @@ -0,0 +1,1023 @@ +package com.ruoyi.project.management.domain; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 数量保存对象 pw_bom_number_two + * + * @author zhukangchao + * @date 2021-03-30 + */ +public class PwBomNumberTwo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + //@Excel(name = "单据ID") + private Long id; + + /** 物料id */ + private Long materialId; + + /** 主键集合 */ + private String[] ids; + + /** 生产令号 */ + // @Excel(name = "生产令号") + private String productionCode; + + /** 序号 */ + @Excel(name = "序号") + private String num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 下料规格 */ + @Excel(name = "规格型号") + private String specification; + + /** 单重(KG) */ + @Excel(name = "单重", readConverterExp = "K=G") + private Double pieceWeight; + + /** 父级图号 */ + //@Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 父级名称 */ + //@Excel(name = "父级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 备用1 */ + @Excel(name = "库存数量") + private String sparedOne; + + /** 备用2 */ + @Excel(name = "缺料数量") + private String sparedTwo; + + /** 工序名称 */ + @Excel(name = "需求时间") + private String processName; + + /** 工序名称集合 */ +// @Excel(name = "工序名称") + private String[] processNames; + + /** 入库状态 */ + //@Excel(name = "入库状态") + private String godownEntry; + + /** 入库状态 */ +// @Excel(name = "入库状态") + private String inventoryStatus; + + /** 上级id */ +// @Excel(name = "上级id") + private Long superiorId; + + /** 物料图片 */ +// @Excel(name = "物料图片") + private String picture; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备注2 */ +// @Excel(name = "备注2") + private String remarksTwo; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 完成时间集合 */ +// @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private String[] completionDates; + + /** 加工部门 */ + // @Excel(name = "加工部门") + private String departmentName; + + /** 加工部门集合 */ +// @Excel(name = "加工部门") + private String[] departmentNames; + + /** 材料名称 */ + // @Excel(name = "材料名称") + private String materialsName; + + /** 材料规格 */ + // @Excel(name = "材料规格") + private String materialsSpecification; + /** 下料尺寸长度 */ + //@Excel(name = "长") + private Long len; + /** 下料尺寸宽度 */ + //@Excel(name = "宽") + private Long wid; + private Long height; //厚度 + private Double weight; //重量 + + public Long getHeight() { + return height; + } + + public void setHeight(Long height) { + this.height = height; + } + + public Double getWeight() { + return weight; + } + + public void setWeight(Double weight) { + this.weight = weight; + } + + /** 下料尺寸 */ + private String measure; + + /** 毛坯数量 */ + private Long workblank; + + /** 成品数量 */ + private Long finished; + + /** + * 领料数量 + */ + private Long receiveNumber; + + /** 材料采购日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + //@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date materialsDate; + + /** + * 序描述 + */ + @Excel(name = "序描述") + private String xuDescribe; + + /** + * 工期描述 + */ + private String dateDescribe; + + /** + * 序工时 + */ + // @Excel(name = "序工时") + private Double xuTime; + + private String theoretical; + + /** 备用3 */ +// @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4 */ +// @Excel(name = "备用4") + private Long sparedFour; + + /** 成品标记 */ + private Long sparedFive; + + /** 删除标记 */ + private int delFlag; + + private Long shuliang; + + //申请入库数量 + private Long number; + + //单价 + private Double unitPrice; + + //子集集合 + private List children; + + private String attribute; + + //申请领料数量 + private Long lingliaoNumber; + + /** 供应商名称 */ +// @Excel(name = "供应商名称") + private String preferentialOriginName; + + //查询数据类型 + private String materialType; + /** + * 第二套材料信息 + * @param id + */ + /** 物料id */ + private Long materialIdTwo; + + /** 材料名称 */ + private String materialsNameTwo; + + /** 材料规格 */ + private String materialsSpecificationTwo; + + /** 下料尺寸 */ + private String measureTwo; + + /** 下料尺寸长度 */ + private Long lenTwo; + + /** 下料尺寸宽度 */ + private Long widTwo; + + /** 下料规格 */ + private String specificationTwo; + + /** 毛坯数量 */ + private Long workblankTwo; + + /** 成品数量 */ + private Long finishedTwo; + + /** 当前状态 */ +// @Excel(name = "当前状态") + private String status; + + /** 状态日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "状态日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date statusDate; + + /** + * 是否超时 + */ + private String overTime; + + /** + * 外协合同标记 + */ + private String outsourceContratDetailId; + + private String qrCodeUrl; + + private String qrCodeUrlTwo; + + private String qrCodeUrlThree; + + private String qrCodeUrlFour; + + private String qrCodeUrlFive; + + private String qrCodeUrlSix; + + //审核标记 + private String biaoji; + + //是否可执行的 + private String performable; + + //子集物料 + private List pwBomNumberTwoList; + + private Long preliminaryInventory; + //退料数量 + private Long returnNumber; + //是否工艺 + private String processFlag; + //是否隐藏 + private String jdFlag; + //物料分组 + private String materialGroup; + + private String tableData; //工序集合 + + private String tableSon; + + public String getTableSon() { + return tableSon; + } + + public void setTableSon(String tableSon) { + this.tableSon = tableSon; + } + + public String getTableData() { + return tableData; + } + + public void setTableData(String tableData) { + this.tableData = tableData; + } + public String getMaterialGroup() { + return materialGroup; + } + + public void setMaterialGroup(String materialGroup) { + this.materialGroup = materialGroup; + } + + public String getJdFlag() { + return jdFlag; + } + + public void setJdFlag(String jdFlag) { + this.jdFlag = jdFlag; + } + + public String getProcessFlag() { + return processFlag; + } + + public void setProcessFlag(String processFlag) { + this.processFlag = processFlag; + } + + public Long getReturnNumber() { + return returnNumber; + } + + public void setReturnNumber(Long returnNumber) { + this.returnNumber = returnNumber; + } + + public String getOverTime() { + return overTime; + } + + public void setOverTime(String overTime) { + this.overTime = overTime; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getStatusDate() { + return statusDate; + } + + public void setStatusDate(Date statusDate) { + this.statusDate = statusDate; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String[] getIds() { + return ids; + } + + public void setIds(String[] ids) { + this.ids = ids; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String[] getProcessNames() { + return processNames; + } + + public void setProcessNames(String[] processNames) { + this.processNames = processNames; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public String getGodownEntry() { + return godownEntry; + } + + public void setGodownEntry(String godownEntry) { + this.godownEntry = godownEntry; + } + + public Long getSuperiorId() { + return superiorId; + } + + public void setSuperiorId(Long superiorId) { + this.superiorId = superiorId; + } + + public String getPicture() { + return picture; + } + + public void setPicture(String picture) { + this.picture = picture; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public Date getCompletionDate() { + return completionDate; + } + + public void setCompletionDate(Date completionDate) { + this.completionDate = completionDate; + } + public String[] getCompletionDates() { + return completionDates; + } + + public void setCompletionDates(String[] completionDates) { + this.completionDates = completionDates; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public String[] getDepartmentNames() { + return departmentNames; + } + + public void setDepartmentNames(String[] departmentNames) { + this.departmentNames = departmentNames; + } + + public String getMaterialsName() { + return materialsName; + } + + public void setMaterialsName(String materialsName) { + this.materialsName = materialsName; + } + + public String getMaterialsSpecification() { + return materialsSpecification; + } + + public void setMaterialsSpecification(String materialsSpecification) { + this.materialsSpecification = materialsSpecification; + } + + public String getMeasure() { + return measure; + } + + public void setMeasure(String measure) { + this.measure = measure; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public Long getWorkblank() { + return workblank; + } + + public void setWorkblank(Long workblank) { + this.workblank = workblank; + } + + public Long getFinished() { + return finished; + } + + public void setFinished(Long finished) { + this.finished = finished; + } + + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Long getShuliang() { + return shuliang; + } + + public void setShuliang(Long shuliang) { + this.shuliang = shuliang; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public Double getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(Double unitPrice) { + this.unitPrice = unitPrice; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + + public Long getLingliaoNumber() { + return lingliaoNumber; + } + + public void setLingliaoNumber(Long lingliaoNumber) { + this.lingliaoNumber = lingliaoNumber; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public Long getLen() { + return len; + } + + public void setLen(Long len) { + this.len = len; + } + + public Long getWid() { + return wid; + } + + public void setWid(Long wid) { + this.wid = wid; + } + + public Long getMaterialIdTwo() { + return materialIdTwo; + } + + public void setMaterialIdTwo(Long materialIdTwo) { + this.materialIdTwo = materialIdTwo; + } + + public String getMaterialsNameTwo() { + return materialsNameTwo; + } + + public void setMaterialsNameTwo(String materialsNameTwo) { + this.materialsNameTwo = materialsNameTwo; + } + + public String getMaterialsSpecificationTwo() { + return materialsSpecificationTwo; + } + + public void setMaterialsSpecificationTwo(String materialsSpecificationTwo) { + this.materialsSpecificationTwo = materialsSpecificationTwo; + } + + public String getMeasureTwo() { + return measureTwo; + } + + public void setMeasureTwo(String measureTwo) { + this.measureTwo = measureTwo; + } + + public Long getLenTwo() { + return lenTwo; + } + + public void setLenTwo(Long lenTwo) { + this.lenTwo = lenTwo; + } + + public Long getWidTwo() { + return widTwo; + } + + public void setWidTwo(Long widTwo) { + this.widTwo = widTwo; + } + + public String getSpecificationTwo() { + return specificationTwo; + } + + public void setSpecificationTwo(String specificationTwo) { + this.specificationTwo = specificationTwo; + } + + public Long getWorkblankTwo() { + return workblankTwo; + } + + public void setWorkblankTwo(Long workblankTwo) { + this.workblankTwo = workblankTwo; + } + + public Long getFinishedTwo() { + return finishedTwo; + } + + public void setFinishedTwo(Long finishedTwo) { + this.finishedTwo = finishedTwo; + } + + public Long getReceiveNumber() { + return receiveNumber; + } + + public void setReceiveNumber(Long receiveNumber) { + this.receiveNumber = receiveNumber; + } + public String getXuDescribe() { + return xuDescribe; + } + + public void setXuDescribe(String xuDescribe) { + this.xuDescribe = xuDescribe; + } + + public String getTheoretical() { + return theoretical; + } + + public void setTheoretical(String theoretical) { + this.theoretical = theoretical; + } + + public String getRemarksTwo() { + return remarksTwo; + } + + public void setRemarksTwo(String remarksTwo) { + this.remarksTwo = remarksTwo; + } + + + public String getOutsourceContratDetailId() { + return outsourceContratDetailId; + } + + public void setOutsourceContratDetailId(String outsourceContratDetailId) { + this.outsourceContratDetailId = outsourceContratDetailId; + } + + public String getQrCodeUrl() { + return qrCodeUrl; + } + + public void setQrCodeUrl(String qrCodeUrl) { + this.qrCodeUrl = qrCodeUrl; + } + + public String getQrCodeUrlTwo() { + return qrCodeUrlTwo; + } + + public void setQrCodeUrlTwo(String qrCodeUrlTwo) { + this.qrCodeUrlTwo = qrCodeUrlTwo; + } + + public String getQrCodeUrlThree() { + return qrCodeUrlThree; + } + + public void setQrCodeUrlThree(String qrCodeUrlThree) { + this.qrCodeUrlThree = qrCodeUrlThree; + } + + public String getQrCodeUrlFour() { + return qrCodeUrlFour; + } + + public void setQrCodeUrlFour(String qrCodeUrlFour) { + this.qrCodeUrlFour = qrCodeUrlFour; + } + + public String getQrCodeUrlFive() { + return qrCodeUrlFive; + } + + public void setQrCodeUrlFive(String qrCodeUrlFive) { + this.qrCodeUrlFive = qrCodeUrlFive; + } + + public String getQrCodeUrlSix() { + return qrCodeUrlSix; + } + + public void setQrCodeUrlSix(String qrCodeUrlSix) { + this.qrCodeUrlSix = qrCodeUrlSix; + } + + public String getBiaoji() { + return biaoji; + } + + public void setBiaoji(String biaoji) { + this.biaoji = biaoji; + } + + public String getPerformable() { + return performable; + } + + public void setPerformable(String performable) { + this.performable = performable; + } + + public Date getMaterialsDate() { + return materialsDate; + } + + public void setMaterialsDate(Date materialsDate) { + this.materialsDate = materialsDate; + } + + public String getDateDescribe() { + return dateDescribe; + } + + public void setDateDescribe(String dateDescribe) { + this.dateDescribe = dateDescribe; + } + public List getPwBomNumberTwoList() { + return pwBomNumberTwoList; + } + + public void setPwBomNumberTwoList(List pwBomNumberTwoList) { + this.pwBomNumberTwoList = pwBomNumberTwoList; + } + + public Long getSparedFive() { + return sparedFive; + } + + public void setSparedFive(Long sparedFive) { + this.sparedFive = sparedFive; + } + + public Long getPreliminaryInventory() { + return preliminaryInventory; + } + + public void setPreliminaryInventory(Long preliminaryInventory) { + this.preliminaryInventory = preliminaryInventory; + } + + public Double getXuTime() { + return xuTime; + } + + public void setXuTime(Double xuTime) { + this.xuTime = xuTime; + } + + @Override + public String toString() { + return "PwBomNumberTwo [id=" + id + ", materialId=" + materialId + ", ids=" + Arrays.toString(ids) + + ", productionCode=" + productionCode + ", num=" + num + ", figureNumber=" + figureNumber + ", name=" + + name + ", oneNumber=" + oneNumber + ", type=" + type + ", pieceWeight=" + pieceWeight + + ", parentLevelFigureNumber=" + parentLevelFigureNumber + ", parentLevelName=" + parentLevelName + + ", sumNumber=" + sumNumber + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", processName=" + processName + ", processNames=" + Arrays.toString(processNames) + ", godownEntry=" + + godownEntry + ", inventoryStatus=" + inventoryStatus + ", superiorId=" + superiorId + ", picture=" + + picture + ", remarks=" + remarks + ", remarksTwo=" + remarksTwo + ", completionDate=" + completionDate + + ", completionDates=" + Arrays.toString(completionDates) + ", departmentName=" + departmentName + + ", departmentNames=" + Arrays.toString(departmentNames) + ", materialsName=" + materialsName + + ", materialsSpecification=" + materialsSpecification + ", measure=" + measure + ", specification=" + + specification + ", workblank=" + workblank + ", finished=" + finished + ", receiveNumber=" + + receiveNumber + ", materialsDate=" + materialsDate + ", xuDescribe=" + xuDescribe + ", dateDescribe=" + + dateDescribe + ", xuTime=" + xuTime + ", theoretical=" + theoretical + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", sparedFive=" + sparedFive + ", delFlag=" + delFlag + ", shuliang=" + + shuliang + ", number=" + number + ", unitPrice=" + unitPrice + ", children=" + children + + ", attribute=" + attribute + ", lingliaoNumber=" + lingliaoNumber + ", preferentialOriginName=" + + preferentialOriginName + ", materialType=" + materialType + ", len=" + len + ", wid=" + wid + + ", materialIdTwo=" + materialIdTwo + ", materialsNameTwo=" + materialsNameTwo + + ", materialsSpecificationTwo=" + materialsSpecificationTwo + ", measureTwo=" + measureTwo + + ", lenTwo=" + lenTwo + ", widTwo=" + widTwo + ", specificationTwo=" + specificationTwo + + ", workblankTwo=" + workblankTwo + ", finishedTwo=" + finishedTwo + ", status=" + status + + ", statusDate=" + statusDate + ", overTime=" + overTime + ", outsourceContratDetailId=" + + outsourceContratDetailId + ", qrCodeUrl=" + qrCodeUrl + ", qrCodeUrlTwo=" + qrCodeUrlTwo + + ", qrCodeUrlThree=" + qrCodeUrlThree + ", qrCodeUrlFour=" + qrCodeUrlFour + ", qrCodeUrlFive=" + + qrCodeUrlFive + ", qrCodeUrlSix=" + qrCodeUrlSix + ", biaoji=" + biaoji + ", performable=" + + performable + ", pwBomNumberTwoList=" + pwBomNumberTwoList + ", preliminaryInventory=" + + preliminaryInventory + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoFu.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoFu.java new file mode 100644 index 0000000..7346f94 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoFu.java @@ -0,0 +1,860 @@ +package com.ruoyi.project.management.domain; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 副Bom对象 pw_bom_number_two_fu + * + * @author zhukangchao + * @date 2023-04-17 + */ +public class PwBomNumberTwoFu extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料id */ + private Long materialId; + + /** 主键集合 */ + private String[] ids; + + /** 生产令号 */ +// @Excel(name = "生产令号") + private String productionCode; + + /** 序号 */ + @Excel(name = "序号") + private String num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重(KG) */ + @Excel(name = "单重", readConverterExp = "K=G") + private Double pieceWeight; + + /** 父级图号 */ +// @Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 父级名称 */ +// @Excel(name = "父级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 备用1 */ +// @Excel(name = "备用1") + private String sparedOne; + + /** 备用2 */ + @Excel(name = "是否有库存") + private String sparedTwo; + + /** 工序名称 */ +// @Excel(name = "工序名称") + private String processName; + + /** 工序名称集合 */ +// @Excel(name = "工序名称") + private String[] processNames; + + /** 入库状态 */ +// @Excel(name = "入库状态") + private String godownEntry; + + /** 入库状态 */ +// @Excel(name = "入库状态") + private String inventoryStatus; + + /** 上级id */ +// @Excel(name = "上级id") + private Long superiorId; + + /** 物料图片 */ +// @Excel(name = "物料图片") + private String picture; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备注2 */ +// @Excel(name = "备注2") + private String remarksTwo; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 完成时间集合 */ +// @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private String[] completionDates; + + /** 加工部门 */ +// @Excel(name = "加工部门") + private String departmentName; + + /** 加工部门集合 */ +// @Excel(name = "加工部门") + private String[] departmentNames; + + /** 材料名称 */ + private String materialsName; + + /** 材料规格 */ + private String materialsSpecification; + + /** 下料尺寸 */ + private String measure; + + /** 下料规格 */ + private String specification; + + /** 毛坯数量 */ + private Long workblank; + + /** 成品数量 */ + private Long finished; + + /** + * 领料数量 + */ + private Long receiveNumber; + + /** + * 序描述 + */ + private String xuDescribe; + + private String theoretical; + + /** 备用3 */ +// @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4 */ +// @Excel(name = "备用4") + private Long sparedFour; + + /** 删除标记 */ + private int delFlag; + + private Long shuliang; + + //申请入库数量 + private Long number; + + //单价 + private Double unitPrice; + + //子集集合 + private List children; + + private String attribute; + + //申请领料数量 + private Long lingliaoNumber; + + /** 供应商名称 */ +// @Excel(name = "供应商名称") + private String preferentialOriginName; + + //查询数据类型 + private String materialType; + + /** 下料尺寸长度 */ + private Long len; + /** 下料尺寸宽度 */ + private Long wid; + + /** + * 第二套材料信息 + * @param id + */ + /** 物料id */ + private Long materialIdTwo; + + /** 材料名称 */ + private String materialsNameTwo; + + /** 材料规格 */ + private String materialsSpecificationTwo; + + /** 下料尺寸 */ + private String measureTwo; + + /** 下料尺寸长度 */ + private Long lenTwo; + + /** 下料尺寸宽度 */ + private Long widTwo; + + /** 下料规格 */ + private String specificationTwo; + + /** 毛坯数量 */ + private Long workblankTwo; + + /** 成品数量 */ + private Long finishedTwo; + + /** 当前状态 */ +// @Excel(name = "当前状态") + private String status; + + /** 状态日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "状态日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date statusDate; + + private String qrCodeUrl; + + private String qrCodeUrlTwo; + + private String qrCodeUrlThree; + + private String qrCodeUrlFour; + + private String qrCodeUrlFive; + + private String qrCodeUrlSix; + + /** + * 是否超时 + */ + private String overTime; + + /** + * 外协合同标记 + */ + private String outsourceContratDetailId; + + //子集物料 + private List pwBomNumberTwoList; + + public String getOverTime() { + return overTime; + } + + public void setOverTime(String overTime) { + this.overTime = overTime; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getStatusDate() { + return statusDate; + } + + public void setStatusDate(Date statusDate) { + this.statusDate = statusDate; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String[] getIds() { + return ids; + } + + public void setIds(String[] ids) { + this.ids = ids; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String[] getProcessNames() { + return processNames; + } + + public void setProcessNames(String[] processNames) { + this.processNames = processNames; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public String getGodownEntry() { + return godownEntry; + } + + public void setGodownEntry(String godownEntry) { + this.godownEntry = godownEntry; + } + + public Long getSuperiorId() { + return superiorId; + } + + public void setSuperiorId(Long superiorId) { + this.superiorId = superiorId; + } + + public String getPicture() { + return picture; + } + + public void setPicture(String picture) { + this.picture = picture; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public Date getCompletionDate() { + return completionDate; + } + + public void setCompletionDate(Date completionDate) { + this.completionDate = completionDate; + } + public String[] getCompletionDates() { + return completionDates; + } + + public void setCompletionDates(String[] completionDates) { + this.completionDates = completionDates; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public String[] getDepartmentNames() { + return departmentNames; + } + + public void setDepartmentNames(String[] departmentNames) { + this.departmentNames = departmentNames; + } + + public String getMaterialsName() { + return materialsName; + } + + public void setMaterialsName(String materialsName) { + this.materialsName = materialsName; + } + + public String getMaterialsSpecification() { + return materialsSpecification; + } + + public void setMaterialsSpecification(String materialsSpecification) { + this.materialsSpecification = materialsSpecification; + } + + public String getMeasure() { + return measure; + } + + public void setMeasure(String measure) { + this.measure = measure; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public Long getWorkblank() { + return workblank; + } + + public void setWorkblank(Long workblank) { + this.workblank = workblank; + } + + public Long getFinished() { + return finished; + } + + public void setFinished(Long finished) { + this.finished = finished; + } + + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Long getShuliang() { + return shuliang; + } + + public void setShuliang(Long shuliang) { + this.shuliang = shuliang; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public Double getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(Double unitPrice) { + this.unitPrice = unitPrice; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + + public Long getLingliaoNumber() { + return lingliaoNumber; + } + + public void setLingliaoNumber(Long lingliaoNumber) { + this.lingliaoNumber = lingliaoNumber; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public Long getLen() { + return len; + } + + public void setLen(Long len) { + this.len = len; + } + + public Long getWid() { + return wid; + } + + public void setWid(Long wid) { + this.wid = wid; + } + + public Long getMaterialIdTwo() { + return materialIdTwo; + } + + public void setMaterialIdTwo(Long materialIdTwo) { + this.materialIdTwo = materialIdTwo; + } + + public String getMaterialsNameTwo() { + return materialsNameTwo; + } + + public void setMaterialsNameTwo(String materialsNameTwo) { + this.materialsNameTwo = materialsNameTwo; + } + + public String getMaterialsSpecificationTwo() { + return materialsSpecificationTwo; + } + + public void setMaterialsSpecificationTwo(String materialsSpecificationTwo) { + this.materialsSpecificationTwo = materialsSpecificationTwo; + } + + public String getMeasureTwo() { + return measureTwo; + } + + public void setMeasureTwo(String measureTwo) { + this.measureTwo = measureTwo; + } + + public Long getLenTwo() { + return lenTwo; + } + + public void setLenTwo(Long lenTwo) { + this.lenTwo = lenTwo; + } + + public Long getWidTwo() { + return widTwo; + } + + public void setWidTwo(Long widTwo) { + this.widTwo = widTwo; + } + + public String getSpecificationTwo() { + return specificationTwo; + } + + public void setSpecificationTwo(String specificationTwo) { + this.specificationTwo = specificationTwo; + } + + public Long getWorkblankTwo() { + return workblankTwo; + } + + public void setWorkblankTwo(Long workblankTwo) { + this.workblankTwo = workblankTwo; + } + + public Long getFinishedTwo() { + return finishedTwo; + } + + public void setFinishedTwo(Long finishedTwo) { + this.finishedTwo = finishedTwo; + } + + public Long getReceiveNumber() { + return receiveNumber; + } + + public void setReceiveNumber(Long receiveNumber) { + this.receiveNumber = receiveNumber; + } + public String getXuDescribe() { + return xuDescribe; + } + + public void setXuDescribe(String xuDescribe) { + this.xuDescribe = xuDescribe; + } + + public String getTheoretical() { + return theoretical; + } + + public void setTheoretical(String theoretical) { + this.theoretical = theoretical; + } + + public String getRemarksTwo() { + return remarksTwo; + } + + public void setRemarksTwo(String remarksTwo) { + this.remarksTwo = remarksTwo; + } + + + public String getOutsourceContratDetailId() { + return outsourceContratDetailId; + } + + public void setOutsourceContratDetailId(String outsourceContratDetailId) { + this.outsourceContratDetailId = outsourceContratDetailId; + } + + public String getQrCodeUrl() { + return qrCodeUrl; + } + + public void setQrCodeUrl(String qrCodeUrl) { + this.qrCodeUrl = qrCodeUrl; + } + + public String getQrCodeUrlTwo() { + return qrCodeUrlTwo; + } + + public void setQrCodeUrlTwo(String qrCodeUrlTwo) { + this.qrCodeUrlTwo = qrCodeUrlTwo; + } + + public String getQrCodeUrlThree() { + return qrCodeUrlThree; + } + + public void setQrCodeUrlThree(String qrCodeUrlThree) { + this.qrCodeUrlThree = qrCodeUrlThree; + } + + public String getQrCodeUrlFour() { + return qrCodeUrlFour; + } + + public void setQrCodeUrlFour(String qrCodeUrlFour) { + this.qrCodeUrlFour = qrCodeUrlFour; + } + + public String getQrCodeUrlFive() { + return qrCodeUrlFive; + } + + public void setQrCodeUrlFive(String qrCodeUrlFive) { + this.qrCodeUrlFive = qrCodeUrlFive; + } + + public String getQrCodeUrlSix() { + return qrCodeUrlSix; + } + + public void setQrCodeUrlSix(String qrCodeUrlSix) { + this.qrCodeUrlSix = qrCodeUrlSix; + } + + public List getPwBomNumberTwoList() { + return pwBomNumberTwoList; + } + + public void setPwBomNumberTwoList(List pwBomNumberTwoList) { + this.pwBomNumberTwoList = pwBomNumberTwoList; + } + + @Override + public String toString() { + return "PwBomNumberTwoFu [id=" + id + ", materialId=" + materialId + ", ids=" + Arrays.toString(ids) + + ", productionCode=" + productionCode + ", num=" + num + ", figureNumber=" + figureNumber + ", name=" + + name + ", oneNumber=" + oneNumber + ", type=" + type + ", pieceWeight=" + pieceWeight + + ", parentLevelFigureNumber=" + parentLevelFigureNumber + ", parentLevelName=" + parentLevelName + + ", sumNumber=" + sumNumber + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", processName=" + processName + ", processNames=" + Arrays.toString(processNames) + ", godownEntry=" + + godownEntry + ", inventoryStatus=" + inventoryStatus + ", superiorId=" + superiorId + ", picture=" + + picture + ", remarks=" + remarks + ", remarksTwo=" + remarksTwo + ", completionDate=" + completionDate + + ", completionDates=" + Arrays.toString(completionDates) + ", departmentName=" + departmentName + + ", departmentNames=" + Arrays.toString(departmentNames) + ", materialsName=" + materialsName + + ", materialsSpecification=" + materialsSpecification + ", measure=" + measure + ", specification=" + + specification + ", workblank=" + workblank + ", finished=" + finished + ", receiveNumber=" + + receiveNumber + ", xuDescribe=" + xuDescribe + ", theoretical=" + theoretical + ", sparedThree=" + + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", shuliang=" + shuliang + + ", number=" + number + ", unitPrice=" + unitPrice + ", children=" + children + ", attribute=" + + attribute + ", lingliaoNumber=" + lingliaoNumber + ", preferentialOriginName=" + + preferentialOriginName + ", materialType=" + materialType + ", len=" + len + ", wid=" + wid + + ", materialIdTwo=" + materialIdTwo + ", materialsNameTwo=" + materialsNameTwo + + ", materialsSpecificationTwo=" + materialsSpecificationTwo + ", measureTwo=" + measureTwo + + ", lenTwo=" + lenTwo + ", widTwo=" + widTwo + ", specificationTwo=" + specificationTwo + + ", workblankTwo=" + workblankTwo + ", finishedTwo=" + finishedTwo + ", status=" + status + + ", statusDate=" + statusDate + ", qrCodeUrl=" + qrCodeUrl + ", qrCodeUrlTwo=" + qrCodeUrlTwo + + ", qrCodeUrlThree=" + qrCodeUrlThree + ", qrCodeUrlFour=" + qrCodeUrlFour + ", qrCodeUrlFive=" + + qrCodeUrlFive + ", qrCodeUrlSix=" + qrCodeUrlSix + ", overTime=" + overTime + + ", outsourceContratDetailId=" + outsourceContratDetailId + ", pwBomNumberTwoList=" + + pwBomNumberTwoList + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoGongxu.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoGongxu.java new file mode 100644 index 0000000..27c20c9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoGongxu.java @@ -0,0 +1,727 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * BOM工序引用对象 pw_bom_number_two_gongxu + * + * @author zhukangchao + * @date 2023-09-24 + */ +public class PwBomNumberTwoGongxu extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productionCode; + + /** 序号 */ + @Excel(name = "序号") + private String num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 上级图号 */ + @Excel(name = "上级图号") + private String parentLevelFigureNumber; + + /** 上级名称 */ + @Excel(name = "上级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 所属型号 */ + @Excel(name = "所属型号") + private String sparedOne; + + /** 有无库存 */ + @Excel(name = "有无库存") + private String sparedTwo; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 入库标识 */ + @Excel(name = "入库标识") + private String godownEntry; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 上级id */ + @Excel(name = "上级id") + private Long superiorId; + + /** 图纸路径 */ + @Excel(name = "图纸路径") + private String picture; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 加工部门 */ + @Excel(name = "加工部门") + private String departmentName; + + /** 原材料id */ + @Excel(name = "原材料id") + private Long materialId; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料规格 */ + @Excel(name = "材料规格") + private String materialsSpecification; + + /** 下料尺寸 */ + @Excel(name = "下料尺寸") + private String measure; + + /** 长度 */ + @Excel(name = "长度") + private Long len; + + /** 宽度 */ + @Excel(name = "宽度") + private Long wid; + + /** 规格 */ + @Excel(name = "规格") + private String specification; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 出成品数量 */ + @Excel(name = "出成品数量") + private Long finished; + + /** 领料数量 */ + @Excel(name = "领料数量") + private Long receiveNumber; + + /** 材料采购工期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "材料采购工期", width = 30, dateFormat = "yyyy-MM-dd") + private Date materialsDate; + + /** 序描述 */ + @Excel(name = "序描述") + private String xuDescribe; + + /** 工期描述 */ + @Excel(name = "工期描述") + private String dateDescribe; + + /** 序工时(分钟) */ + @Excel(name = "序工时(分钟)") + private Double xuTime; + + /** 原材料id2 */ + @Excel(name = "原材料id2") + private Long materialIdTwo; + + /** 材料名称2 */ + @Excel(name = "材料名称2") + private String materialsNameTwo; + + /** 材料规格2 */ + @Excel(name = "材料规格2") + private String materialsSpecificationTwo; + + /** 下料尺寸2 */ + @Excel(name = "下料尺寸2") + private String measureTwo; + + /** 长度2 */ + @Excel(name = "长度2") + private Long lenTwo; + + /** 宽度2 */ + @Excel(name = "宽度2") + private Long widTwo; + + /** 规格2 */ + @Excel(name = "规格2") + private String specificationTwo; + + /** 毛坯数量2 */ + @Excel(name = "毛坯数量2") + private Long workblankTwo; + + /** 成品数量2 */ + @Excel(name = "成品数量2") + private Long finishedTwo; + + /** 是否虚拟 */ + @Excel(name = "是否虚拟") + private String theoretical; + + /** 外协合同标记 */ + @Excel(name = "外协合同标记") + private String outsourceContratDetailId; + + /** 备用3 */ + @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4(即时库存数量) */ + @Excel(name = "备用4", readConverterExp = "即=时库存数量") + private Long sparedFour; + + /** 成品标记 */ + @Excel(name = "成品标记") + private Long sparedFive; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setNum(String num) + { + this.num = num; + } + + public String getNum() + { + return num; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setGodownEntry(String godownEntry) + { + this.godownEntry = godownEntry; + } + + public String getGodownEntry() + { + return godownEntry; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setSuperiorId(Long superiorId) + { + this.superiorId = superiorId; + } + + public Long getSuperiorId() + { + return superiorId; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setCompletionDate(Date completionDate) + { + this.completionDate = completionDate; + } + + public Date getCompletionDate() + { + return completionDate; + } + public void setDepartmentName(String departmentName) + { + this.departmentName = departmentName; + } + + public String getDepartmentName() + { + return departmentName; + } + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + public void setMaterialsName(String materialsName) + { + this.materialsName = materialsName; + } + + public String getMaterialsName() + { + return materialsName; + } + public void setMaterialsSpecification(String materialsSpecification) + { + this.materialsSpecification = materialsSpecification; + } + + public String getMaterialsSpecification() + { + return materialsSpecification; + } + public void setMeasure(String measure) + { + this.measure = measure; + } + + public String getMeasure() + { + return measure; + } + public void setLen(Long len) + { + this.len = len; + } + + public Long getLen() + { + return len; + } + public void setWid(Long wid) + { + this.wid = wid; + } + + public Long getWid() + { + return wid; + } + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + public void setWorkblank(Long workblank) + { + this.workblank = workblank; + } + + public Long getWorkblank() + { + return workblank; + } + public void setFinished(Long finished) + { + this.finished = finished; + } + + public Long getFinished() + { + return finished; + } + public void setReceiveNumber(Long receiveNumber) + { + this.receiveNumber = receiveNumber; + } + + public Long getReceiveNumber() + { + return receiveNumber; + } + public void setMaterialsDate(Date materialsDate) + { + this.materialsDate = materialsDate; + } + + public Date getMaterialsDate() + { + return materialsDate; + } + public void setXuDescribe(String xuDescribe) + { + this.xuDescribe = xuDescribe; + } + + public String getXuDescribe() + { + return xuDescribe; + } + public void setDateDescribe(String dateDescribe) + { + this.dateDescribe = dateDescribe; + } + + public String getDateDescribe() + { + return dateDescribe; + } + public void setXuTime(Double xuTime) + { + this.xuTime = xuTime; + } + + public Double getXuTime() + { + return xuTime; + } + public void setMaterialIdTwo(Long materialIdTwo) + { + this.materialIdTwo = materialIdTwo; + } + + public Long getMaterialIdTwo() + { + return materialIdTwo; + } + public void setMaterialsNameTwo(String materialsNameTwo) + { + this.materialsNameTwo = materialsNameTwo; + } + + public String getMaterialsNameTwo() + { + return materialsNameTwo; + } + public void setMaterialsSpecificationTwo(String materialsSpecificationTwo) + { + this.materialsSpecificationTwo = materialsSpecificationTwo; + } + + public String getMaterialsSpecificationTwo() + { + return materialsSpecificationTwo; + } + public void setMeasureTwo(String measureTwo) + { + this.measureTwo = measureTwo; + } + + public String getMeasureTwo() + { + return measureTwo; + } + public void setLenTwo(Long lenTwo) + { + this.lenTwo = lenTwo; + } + + public Long getLenTwo() + { + return lenTwo; + } + public void setWidTwo(Long widTwo) + { + this.widTwo = widTwo; + } + + public Long getWidTwo() + { + return widTwo; + } + public void setSpecificationTwo(String specificationTwo) + { + this.specificationTwo = specificationTwo; + } + + public String getSpecificationTwo() + { + return specificationTwo; + } + public void setWorkblankTwo(Long workblankTwo) + { + this.workblankTwo = workblankTwo; + } + + public Long getWorkblankTwo() + { + return workblankTwo; + } + public void setFinishedTwo(Long finishedTwo) + { + this.finishedTwo = finishedTwo; + } + + public Long getFinishedTwo() + { + return finishedTwo; + } + public void setTheoretical(String theoretical) + { + this.theoretical = theoretical; + } + + public String getTheoretical() + { + return theoretical; + } + public void setOutsourceContratDetailId(String outsourceContratDetailId) + { + this.outsourceContratDetailId = outsourceContratDetailId; + } + + public String getOutsourceContratDetailId() + { + return outsourceContratDetailId; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setSparedFive(Long sparedFive) + { + this.sparedFive = sparedFive; + } + + public Long getSparedFive() + { + return sparedFive; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionCode", getProductionCode()) + .append("num", getNum()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("oneNumber", getOneNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("parentLevelFigureNumber", getParentLevelFigureNumber()) + .append("parentLevelName", getParentLevelName()) + .append("sumNumber", getSumNumber()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("processName", getProcessName()) + .append("godownEntry", getGodownEntry()) + .append("inventoryStatus", getInventoryStatus()) + .append("superiorId", getSuperiorId()) + .append("picture", getPicture()) + .append("remarks", getRemarks()) + .append("completionDate", getCompletionDate()) + .append("departmentName", getDepartmentName()) + .append("materialId", getMaterialId()) + .append("materialsName", getMaterialsName()) + .append("materialsSpecification", getMaterialsSpecification()) + .append("measure", getMeasure()) + .append("len", getLen()) + .append("wid", getWid()) + .append("specification", getSpecification()) + .append("workblank", getWorkblank()) + .append("finished", getFinished()) + .append("receiveNumber", getReceiveNumber()) + .append("materialsDate", getMaterialsDate()) + .append("xuDescribe", getXuDescribe()) + .append("dateDescribe", getDateDescribe()) + .append("xuTime", getXuTime()) + .append("materialIdTwo", getMaterialIdTwo()) + .append("materialsNameTwo", getMaterialsNameTwo()) + .append("materialsSpecificationTwo", getMaterialsSpecificationTwo()) + .append("measureTwo", getMeasureTwo()) + .append("lenTwo", getLenTwo()) + .append("widTwo", getWidTwo()) + .append("specificationTwo", getSpecificationTwo()) + .append("workblankTwo", getWorkblankTwo()) + .append("finishedTwo", getFinishedTwo()) + .append("theoretical", getTheoretical()) + .append("outsourceContratDetailId", getOutsourceContratDetailId()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("sparedFive", getSparedFive()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoLingliao.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoLingliao.java new file mode 100644 index 0000000..834973c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoLingliao.java @@ -0,0 +1,408 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 领料专用bom对象 pw_bom_number_two_lingliao + * + * @author zhukangchao + * @date 2022-02-23 + */ +public class PwBomNumberTwoLingliao extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productionCode; + + /** 序号 */ + @Excel(name = "序号") + private String num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 上级图号 */ + @Excel(name = "上级图号") + private String parentLevelFigureNumber; + + /** 上级名称 */ + @Excel(name = "上级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 所属型号 */ + @Excel(name = "所属型号") + private String sparedOne; + + /** 有无库存 */ + @Excel(name = "有无库存") + private String sparedTwo; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 上级id */ + @Excel(name = "上级id") + private Long superiorId; + + /** 图纸路径 */ + @Excel(name = "图纸路径") + private String picture; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 加工部门 */ + @Excel(name = "加工部门") + private String departmentName; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料规格 */ + @Excel(name = "材料规格") + private String materialsSpecification; + + /** 下料尺寸 */ + @Excel(name = "下料尺寸") + private String measure; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 出成品数量 */ + @Excel(name = "出成品数量") + private Long finished; + + private String theoretical; + + /** 备用3 */ + @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4(即时库存数量) */ + @Excel(name = "备用4", readConverterExp = "即=时库存数量") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setNum(String num) + { + this.num = num; + } + + public String getNum() + { + return num; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setSuperiorId(Long superiorId) + { + this.superiorId = superiorId; + } + + public Long getSuperiorId() + { + return superiorId; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setCompletionDate(Date completionDate) + { + this.completionDate = completionDate; + } + + public Date getCompletionDate() + { + return completionDate; + } + public void setDepartmentName(String departmentName) + { + this.departmentName = departmentName; + } + + public String getDepartmentName() + { + return departmentName; + } + public void setMaterialsName(String materialsName) + { + this.materialsName = materialsName; + } + + public String getMaterialsName() + { + return materialsName; + } + public void setMaterialsSpecification(String materialsSpecification) + { + this.materialsSpecification = materialsSpecification; + } + + public String getMaterialsSpecification() + { + return materialsSpecification; + } + public void setMeasure(String measure) + { + this.measure = measure; + } + + public String getMeasure() + { + return measure; + } + public void setWorkblank(Long workblank) + { + this.workblank = workblank; + } + + public Long getWorkblank() + { + return workblank; + } + public void setFinished(Long finished) + { + this.finished = finished; + } + + public Long getFinished() + { + return finished; + } + public String getTheoretical() { + return theoretical; + } + + public void setTheoretical(String theoretical) { + this.theoretical = theoretical; + } + + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "PwBomNumberTwoLingliao [id=" + id + ", productionCode=" + productionCode + ", num=" + num + + ", figureNumber=" + figureNumber + ", name=" + name + ", oneNumber=" + oneNumber + ", type=" + type + + ", pieceWeight=" + pieceWeight + ", parentLevelFigureNumber=" + parentLevelFigureNumber + + ", parentLevelName=" + parentLevelName + ", sumNumber=" + sumNumber + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", processName=" + processName + ", inventoryStatus=" + inventoryStatus + + ", superiorId=" + superiorId + ", picture=" + picture + ", remarks=" + remarks + ", completionDate=" + + completionDate + ", departmentName=" + departmentName + ", materialsName=" + materialsName + + ", materialsSpecification=" + materialsSpecification + ", measure=" + measure + ", workblank=" + + workblank + ", finished=" + finished + ", theoretical=" + theoretical + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoVo.java new file mode 100644 index 0000000..855a0c4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBomNumberTwoVo.java @@ -0,0 +1,696 @@ +package com.ruoyi.project.management.domain; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 数量保存对象 pw_bom_number_two + * + * @author zhukangchao + * @date 2021-03-30 + */ +public class PwBomNumberTwoVo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料id */ + private Long materialId; + + /** 主键集合 */ + private String[] ids; + + /** 生产令号 */ +// @Excel(name = "生产令号") + private String productionCode; + + /** 序号 */ + @Excel(name = "序号") + private String num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重(KG) */ + @Excel(name = "单重", readConverterExp = "K=G") + private Double pieceWeight; + + /** 父级图号 */ +// @Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 父级名称 */ +// @Excel(name = "父级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 图纸发放 */ + @Excel(name = "派工部门") + private String departmentName; + + /** 是否入库 */ + @Excel(name = "是否入库") + private String godownEntry; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 备用1 */ +// @Excel(name = "备用1") + private String sparedOne; + + /** 备用2 */ + @Excel(name = "是否有库存") + private String sparedTwo; + + /** 工序名称 */ +// @Excel(name = "工序名称") + private String processName; + + /** 工序名称集合 */ +// @Excel(name = "工序名称") + private String[] processNames; + + /** 入库状态 */ +// @Excel(name = "入库状态") + private String inventoryStatus; + + /** 上级id */ +// @Excel(name = "上级id") + private Long superiorId; + + /** 物料图片 */ +// @Excel(name = "物料图片") + private String picture; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** + * 序工时 + */ + private Double xuTime; + + /** 完成时间集合 */ +// @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private String[] completionDates; + + /** 加工部门集合 */ +// @Excel(name = "加工部门") + private String[] departmentNames; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料规格 */ + @Excel(name = "材料图号") + private String materialsSpecification; + + /** 下料尺寸 */ +// @Excel(name = "下料尺寸") + private String measure; + + /** 下料规格 */ + @Excel(name = "下料尺寸") + private String specification; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 成品数量 */ + @Excel(name = "成品数量") + private Long finished; + + /** 备用3 */ +// @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4 */ +// @Excel(name = "备用4") + private Long sparedFour; + + /** 删除标记 */ + private int delFlag; + + private Long shuliang; + + //申请入库数量 + private Long number; + + //单价 + private Double unitPrice; + + //子集集合 + private List children; + + private String attribute; + + //申请领料数量 + private Long lingliaoNumber; + + /** 供应商名称 */ +// @Excel(name = "供应商名称") + private String preferentialOriginName; + + //查询数据类型 + private String materialType; + + + /** 下料尺寸长度 */ + private Long len; + /** 下料尺寸宽度 */ + private Long wid; + + private Long receiveNumber; + + /** 材料采购日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date materialsDate; + + /** + * 序描述 + */ + @Excel(name = "序描述") + private String xuDescribe; + + /** + * 工期描述 + */ + private String dateDescribe; + + private String theoretical; + + /** + * 是否超时 + */ + private String overTime; + + /** + * 外协合同标记 + */ + private String outsourceContratDetailId; + + private Long sparedFive; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String[] getIds() { + return ids; + } + + public void setIds(String[] ids) { + this.ids = ids; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String[] getProcessNames() { + return processNames; + } + + public void setProcessNames(String[] processNames) { + this.processNames = processNames; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public String getGodownEntry() { + return godownEntry; + } + + public void setGodownEntry(String godownEntry) { + this.godownEntry = godownEntry; + } + + public Long getSuperiorId() { + return superiorId; + } + + public void setSuperiorId(Long superiorId) { + this.superiorId = superiorId; + } + + public String getPicture() { + return picture; + } + + public void setPicture(String picture) { + this.picture = picture; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public Date getCompletionDate() { + return completionDate; + } + + public void setCompletionDate(Date completionDate) { + this.completionDate = completionDate; + } + public String[] getCompletionDates() { + return completionDates; + } + + public void setCompletionDates(String[] completionDates) { + this.completionDates = completionDates; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public String[] getDepartmentNames() { + return departmentNames; + } + + public void setDepartmentNames(String[] departmentNames) { + this.departmentNames = departmentNames; + } + + public String getMaterialsName() { + return materialsName; + } + + public void setMaterialsName(String materialsName) { + this.materialsName = materialsName; + } + + public String getMaterialsSpecification() { + return materialsSpecification; + } + + public void setMaterialsSpecification(String materialsSpecification) { + this.materialsSpecification = materialsSpecification; + } + + public String getMeasure() { + return measure; + } + + public void setMeasure(String measure) { + this.measure = measure; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public Long getWorkblank() { + return workblank; + } + + public void setWorkblank(Long workblank) { + this.workblank = workblank; + } + + public Long getFinished() { + return finished; + } + + public void setFinished(Long finished) { + this.finished = finished; + } + + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public int getDelFlag() { + return delFlag; + } + + public void setDelFlag(int delFlag) { + this.delFlag = delFlag; + } + + public Long getShuliang() { + return shuliang; + } + + public void setShuliang(Long shuliang) { + this.shuliang = shuliang; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public Double getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(Double unitPrice) { + this.unitPrice = unitPrice; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + + public Long getLingliaoNumber() { + return lingliaoNumber; + } + + public void setLingliaoNumber(Long lingliaoNumber) { + this.lingliaoNumber = lingliaoNumber; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public Long getLen() { + return len; + } + + public void setLen(Long len) { + this.len = len; + } + + public Long getWid() { + return wid; + } + + public void setWid(Long wid) { + this.wid = wid; + } + + public Long getReceiveNumber() { + return receiveNumber; + } + + public void setReceiveNumber(Long receiveNumber) { + this.receiveNumber = receiveNumber; + } + + public String getXuDescribe() { + return xuDescribe; + } + + public void setXuDescribe(String xuDescribe) { + this.xuDescribe = xuDescribe; + } + public Date getMaterialsDate() { + return materialsDate; + } + + public void setMaterialsDate(Date materialsDate) { + this.materialsDate = materialsDate; + } + + public String getDateDescribe() { + return dateDescribe; + } + + public void setDateDescribe(String dateDescribe) { + this.dateDescribe = dateDescribe; + } + + public String getTheoretical() { + return theoretical; + } + + public void setTheoretical(String theoretical) { + this.theoretical = theoretical; + } + + public String getOverTime() { + return overTime; + } + + public void setOverTime(String overTime) { + this.overTime = overTime; + } + + public String getOutsourceContratDetailId() { + return outsourceContratDetailId; + } + + public void setOutsourceContratDetailId(String outsourceContratDetailId) { + this.outsourceContratDetailId = outsourceContratDetailId; + } + public Long getSparedFive() { + return sparedFive; + } + + public void setSparedFive(Long sparedFive) { + this.sparedFive = sparedFive; + } + + public Double getXuTime() { + return xuTime; + } + + public void setXuTime(Double xuTime) { + this.xuTime = xuTime; + } + + @Override + public String toString() { + return "PwBomNumberTwoVo [id=" + id + ", materialId=" + materialId + ", ids=" + Arrays.toString(ids) + + ", productionCode=" + productionCode + ", num=" + num + ", figureNumber=" + figureNumber + ", name=" + + name + ", oneNumber=" + oneNumber + ", type=" + type + ", pieceWeight=" + pieceWeight + + ", parentLevelFigureNumber=" + parentLevelFigureNumber + ", parentLevelName=" + parentLevelName + + ", sumNumber=" + sumNumber + ", departmentName=" + departmentName + ", godownEntry=" + godownEntry + + ", completionDate=" + completionDate + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", processName=" + processName + ", processNames=" + Arrays.toString(processNames) + + ", inventoryStatus=" + inventoryStatus + ", superiorId=" + superiorId + ", picture=" + picture + + ", remarks=" + remarks + ", xuTime=" + xuTime + ", completionDates=" + + Arrays.toString(completionDates) + ", departmentNames=" + Arrays.toString(departmentNames) + + ", materialsName=" + materialsName + ", materialsSpecification=" + materialsSpecification + + ", measure=" + measure + ", specification=" + specification + ", workblank=" + workblank + + ", finished=" + finished + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + ", shuliang=" + shuliang + ", number=" + number + ", unitPrice=" + unitPrice + + ", children=" + children + ", attribute=" + attribute + ", lingliaoNumber=" + lingliaoNumber + + ", preferentialOriginName=" + preferentialOriginName + ", materialType=" + materialType + ", len=" + + len + ", wid=" + wid + ", receiveNumber=" + receiveNumber + ", materialsDate=" + materialsDate + + ", xuDescribe=" + xuDescribe + ", dateDescribe=" + dateDescribe + ", theoretical=" + theoretical + + ", overTime=" + overTime + ", outsourceContratDetailId=" + outsourceContratDetailId + ", sparedFive=" + + sparedFive + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisition.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisition.java new file mode 100644 index 0000000..9b6f942 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisition.java @@ -0,0 +1,496 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 采购申请单对象 pw_buying_requisition + * + * @author zhukangchao + * @date 2020-08-31 + */ +public class PwBuyingRequisition extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** id集合 */ + private Long[] ids; + + /** 单号 */ + @Excel(name = "单号") + private String code; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 用途 */ + @Excel(name = "用途") + private String purpose; + + /** 总价(元) */ + @Excel(name = "总价", readConverterExp = "元") + private Double totalPrices; + + /** 未开票金额 */ + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + private BigDecimal invoiceAmount; + + /** 未收款金额 */ + private BigDecimal notProceedsAmount; + + /** 已收款金额 */ + private BigDecimal proceedsAmount; + + /** 结算比例 */ + private BigDecimal settlementRatio; + + /** 供应商 */ + @Excel(name = "供应商") + private String sellerName; + + /** 合同签订时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同签订时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date appointTime; + + /** 总价(大写) */ + @Excel(name = "总价(大写)") + private String bigTotalPrices; + + /** 合同协议 */ + @Excel(name = "合同协议") + private String agreement; + + /** 税率 */ + @Excel(name = "税率") + private Long taxRate; + + /** 交货方式 */ + @Excel(name = "交货方式") + private String deliveryType; + + /** 运费支付方 */ + @Excel(name = "运费支付方") + private String payer; + + /** 货款支付方式 */ + @Excel(name = "货款支付方式") + private String modeOfPayment; + + /** 扣款金额 */ + @Excel(name = "扣款金额") + private Double withhold; + + /** 是否开票 */ + @Excel(name = "是否开票") + private String billingInformation; + + /** 需求日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date demandDate; + + /** 申请人 */ + @Excel(name = "申请人") + private String proposer; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 申请单状态(1:未审核,2:已审核,3:已完成) */ + @Excel(name = "申请单状态", readConverterExp = "1:未审核,2:已审核,3:已完成") + private Integer status; + + /** 是否超时 */ + @Excel(name = "是否超时") + private String overtime; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadership; + + /** 总经理审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + private String materialsName; + + //付款金额 + private Double paymentAmount; + + //物流费用 + private Double money; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + //合同路径 + private String contractPath; + + public String getContractPath() { + return contractPath; + } + + public void setContractPath(String contractPath) { + this.contractPath = contractPath; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public String getSellerName() { + return sellerName; + } + + public void setSellerName(String sellerName) { + this.sellerName = sellerName; + } + + public Date getAppointTime() { + return appointTime; + } + + public void setAppointTime(Date appointTime) { + this.appointTime = appointTime; + } + + public String getBigTotalPrices() { + return bigTotalPrices; + } + + public void setBigTotalPrices(String bigTotalPrices) { + this.bigTotalPrices = bigTotalPrices; + } + + public String getAgreement() { + return agreement; + } + + public void setAgreement(String agreement) { + this.agreement = agreement; + } + + public Long getTaxRate() { + return taxRate; + } + + public void setTaxRate(Long taxRate) { + this.taxRate = taxRate; + } + + public String getDeliveryType() { + return deliveryType; + } + + public void setDeliveryType(String deliveryType) { + this.deliveryType = deliveryType; + } + + public String getPayer() { + return payer; + } + + public void setPayer(String payer) { + this.payer = payer; + } + + public String getModeOfPayment() { + return modeOfPayment; + } + + public void setModeOfPayment(String modeOfPayment) { + this.modeOfPayment = modeOfPayment; + } + + public Double getWithhold() { + return withhold; + } + + public void setWithhold(Double withhold) { + this.withhold = withhold; + } + + public String getBillingInformation() { + return billingInformation; + } + + public void setBillingInformation(String billingInformation) { + this.billingInformation = billingInformation; + } + + public Date getDemandDate() { + return demandDate; + } + + public void setDemandDate(Date demandDate) { + this.demandDate = demandDate; + } + + public String getProposer() { + return proposer; + } + + public void setProposer(String proposer) { + this.proposer = proposer; + } + + public String getAuditor() { + return auditor; + } + + public void setAuditor(String auditor) { + this.auditor = auditor; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getOvertime() { + return overtime; + } + + public void setOvertime(String overtime) { + this.overtime = overtime; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public String getMaterialsName() { + return materialsName; + } + + public void setMaterialsName(String materialsName) { + this.materialsName = materialsName; + } + + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + @Override + public String toString() { + return "PwBuyingRequisition [id=" + id + ", ids=" + Arrays.toString(ids) + ", code=" + code + ", name=" + name + + ", purpose=" + purpose + ", totalPrices=" + totalPrices + ", notInvoiceAmount=" + notInvoiceAmount + + ", invoiceAmount=" + invoiceAmount + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + + proceedsAmount + ", settlementRatio=" + settlementRatio + ", sellerName=" + sellerName + + ", appointTime=" + appointTime + ", bigTotalPrices=" + bigTotalPrices + ", agreement=" + agreement + + ", taxRate=" + taxRate + ", deliveryType=" + deliveryType + ", payer=" + payer + ", modeOfPayment=" + + modeOfPayment + ", withhold=" + withhold + ", billingInformation=" + billingInformation + + ", demandDate=" + demandDate + ", proposer=" + proposer + ", auditor=" + auditor + ", status=" + + status + ", overtime=" + overtime + ", leadership=" + leadership + ", leadershipTime=" + + leadershipTime + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", materialsName=" + + materialsName + ", paymentAmount=" + paymentAmount + ", money=" + money + ", unitName=" + unitName + + ", payWay=" + payWay + ", contractPath=" + contractPath + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionJj.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionJj.java new file mode 100644 index 0000000..8e14a85 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionJj.java @@ -0,0 +1,223 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 基建请购申请单对象 pw_buying_requisition_jj + * + * @author zhukangchao + * @date 2022-06-28 + */ +public class PwBuyingRequisitionJj extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 令号 */ + @Excel(name = "令号") + private String code; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 用途 */ + @Excel(name = "用途") + private String purpose; + + /** 总价(元) */ + @Excel(name = "总价", readConverterExp = "元=") + private Double totalPrices; + + /** 需求日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date demandDate; + + /** 申请人 */ + @Excel(name = "申请人") + private String proposer; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 申请单状态(1:未审核,2:已审核,3:已完成) */ + @Excel(name = "申请单状态", readConverterExp = "1=:未审核,2:已审核,3:已完成") + private Integer status; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setPurpose(String purpose) + { + this.purpose = purpose; + } + + public String getPurpose() + { + return purpose; + } + public void setTotalPrices(Double totalPrices) + { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() + { + return totalPrices; + } + public void setDemandDate(Date demandDate) + { + this.demandDate = demandDate; + } + + public Date getDemandDate() + { + return demandDate; + } + public void setProposer(String proposer) + { + this.proposer = proposer; + } + + public String getProposer() + { + return proposer; + } + public void setAuditor(String auditor) + { + this.auditor = auditor; + } + + public String getAuditor() + { + return auditor; + } + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("name", getName()) + .append("purpose", getPurpose()) + .append("totalPrices", getTotalPrices()) + .append("demandDate", getDemandDate()) + .append("proposer", getProposer()) + .append("auditor", getAuditor()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterial.java new file mode 100644 index 0000000..a6d0b13 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterial.java @@ -0,0 +1,369 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 请购单物料详情对象 pw_buying_requisition_material + * + * @author zhukangchao + * @date 2021-10-18 + */ +public class PwBuyingRequisitionMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 序号*/ + @Excel(name = "序号") + private Long serialNumber; + + /** 项目令号 */ + @Excel(name = "项目令号") + private String code; + + /** 请购单id */ +// @Excel(name = "请购单id") + private Long buyingRequisitionId; + + /** 物料id */ + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ +// @Excel(name = "单重") + private Double pieceWeight; + + /** 数量 */ + @Excel(name = "数量") + private Double number; + + /** 已申请数量 */ + @Excel(name = "已申请数量") + private Double sumNumber; + + /** 单位 */ + @Excel(name = "单位") + private String unitOfMeasurementName; + /** 单位ID */ + private String unitOfMeasurementId; + + public String getUnitOfMeasurementId() { + return unitOfMeasurementId; + } + + public void setUnitOfMeasurementId(String unitOfMeasurementId) { + this.unitOfMeasurementId = unitOfMeasurementId; + } + + /** 单价 */ +// @Excel(name = "单价") + private Double univalence; + + /** 总价 */ +// @Excel(name = "总价") + private Double totalprice; + + /** 参考重量 */ +// @Excel(name = "参考重量") + private Double referenceNumber; + + /** 实际重量 */ +// @Excel(name = "实际重量") + private Double practicalNumber; + + /** 入库状态 */ +// @Excel(name = "入库状态") + private String inventoryStatus; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0未删除,1已删除) */ + private Integer delFlag; + + /** 供应商 */ +// @Excel(name = "供应商") + private String preferentialOriginName; + + /** 申请数量 */ + private Double quantity; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setBuyingRequisitionId(Long buyingRequisitionId) + { + this.buyingRequisitionId = buyingRequisitionId; + } + + public Long getBuyingRequisitionId() + { + return buyingRequisitionId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnitOfMeasurementName(String unitOfMeasurementName) + { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public String getUnitOfMeasurementName() + { + return unitOfMeasurementName; + } + public void setNumber(Double number) + { + this.number = number; + } + + public Double getNumber() + { + return number; + } + + public Double getSumNumber() { + return sumNumber; + } + + public void setSumNumber(Double sumNumber) { + this.sumNumber = sumNumber; + } + + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setTotalprice(Double totalprice) + { + this.totalprice = totalprice; + } + + public Double getTotalprice() + { + return totalprice; + } + + public Double getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(Double referenceNumber) { + this.referenceNumber = referenceNumber; + } + + public Double getPracticalNumber() { + return practicalNumber; + } + + public void setPracticalNumber(Double practicalNumber) { + this.practicalNumber = practicalNumber; + } + + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Double getQuantity() { + return quantity; + } + + public void setQuantity(Double quantity) { + this.quantity = quantity; + } + + @Override + public String toString() { + return "PwBuyingRequisitionMaterial [id=" + id + ", serialNumber=" + serialNumber + ", code=" + code + + ", buyingRequisitionId=" + buyingRequisitionId + ", materialId=" + materialId + ", figureNumber=" + + figureNumber + ", materialName=" + materialName + ", materials=" + materials + ", pieceWeight=" + + pieceWeight + ", number=" + number + ", unitOfMeasurementName=" + unitOfMeasurementName + + ", univalence=" + univalence + ", totalprice=" + totalprice + ", referenceNumber=" + referenceNumber + + ", practicalNumber=" + practicalNumber + ", inventoryStatus=" + inventoryStatus + ", remarks=" + + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", preferentialOriginName=" + + preferentialOriginName + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterialJj.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterialJj.java new file mode 100644 index 0000000..dff4127 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterialJj.java @@ -0,0 +1,328 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 基建请购单详情对象 pw_buying_requisition_material_jj + * + * @author zhukangchao + * @date 2022-06-28 + */ +public class PwBuyingRequisitionMaterialJj extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 请购单id */ +// @Excel(name = "请购单id") + private Long buyingRequisitionId; + + /** 物料id */ + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ +// @Excel(name = "材料") + private String materials; + + /** 单重 */ +// @Excel(name = "单重") + private Double pieceWeight; + + /** 单位 */ + @Excel(name = "单位") + private String unitOfMeasurementName; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalprice; + + /** 参考重量(Kg) */ +// @Excel(name = "参考重量", readConverterExp = "K=g") + private Double referenceNumber; + + /** 实际重量(Kg) */ +// @Excel(name = "实际重量", readConverterExp = "K=g") + private Double practicalNumber; + + /** 供应商 */ + @Excel(name = "供应商") + private String preferentialOriginName; + + /** 入库状态 */ +// @Excel(name = "入库状态") + private String inventoryStatus; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0未删除,1已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public void setBuyingRequisitionId(Long buyingRequisitionId) + { + this.buyingRequisitionId = buyingRequisitionId; + } + + public Long getBuyingRequisitionId() + { + return buyingRequisitionId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnitOfMeasurementName(String unitOfMeasurementName) + { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public String getUnitOfMeasurementName() + { + return unitOfMeasurementName; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setTotalprice(Double totalprice) + { + this.totalprice = totalprice; + } + + public Double getTotalprice() + { + return totalprice; + } + public void setReferenceNumber(Double referenceNumber) + { + this.referenceNumber = referenceNumber; + } + + public Double getReferenceNumber() + { + return referenceNumber; + } + public void setPracticalNumber(Double practicalNumber) + { + this.practicalNumber = practicalNumber; + } + + public Double getPracticalNumber() + { + return practicalNumber; + } + public void setPreferentialOriginName(String preferentialOriginName) + { + this.preferentialOriginName = preferentialOriginName; + } + + public String getPreferentialOriginName() + { + return preferentialOriginName; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("buyingRequisitionId", getBuyingRequisitionId()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("unitOfMeasurementName", getUnitOfMeasurementName()) + .append("number", getNumber()) + .append("univalence", getUnivalence()) + .append("totalprice", getTotalprice()) + .append("referenceNumber", getReferenceNumber()) + .append("practicalNumber", getPracticalNumber()) + .append("preferentialOriginName", getPreferentialOriginName()) + .append("inventoryStatus", getInventoryStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterialTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterialTwo.java new file mode 100644 index 0000000..05b2b36 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionMaterialTwo.java @@ -0,0 +1,338 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 易耗品请购单详情对象 pw_buying_requisition_material_two + * + * @author zhukangchao + * @date 2022-07-05 + */ +public class PwBuyingRequisitionMaterialTwo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + /** 序号 */ + private int num; + + /** 请购单id */ + @Excel(name = "请购单id") + private Long buyingRequisitionId; + + /** 物料id */ + @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + @Excel(name = "物料编码") + private String materialCode; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 单位 */ + @Excel(name = "单位") + private String unitOfMeasurementName; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalprice; + + /** 参考重量(Kg) */ + @Excel(name = "参考重量", readConverterExp = "K=g") + private Double referenceNumber; + + /** 实际重量(Kg) */ + @Excel(name = "实际重量", readConverterExp = "K=g") + private Double practicalNumber; + + /** 供应商 */ + @Excel(name = "供应商") + private String preferentialOriginName; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0未删除,1已删除) */ + private Integer delFlag; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setBuyingRequisitionId(Long buyingRequisitionId) + { + this.buyingRequisitionId = buyingRequisitionId; + } + + public Long getBuyingRequisitionId() + { + return buyingRequisitionId; + } + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnitOfMeasurementName(String unitOfMeasurementName) + { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public String getUnitOfMeasurementName() + { + return unitOfMeasurementName; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setTotalprice(Double totalprice) + { + this.totalprice = totalprice; + } + + public Double getTotalprice() + { + return totalprice; + } + public void setReferenceNumber(Double referenceNumber) + { + this.referenceNumber = referenceNumber; + } + + public Double getReferenceNumber() + { + return referenceNumber; + } + public void setPracticalNumber(Double practicalNumber) + { + this.practicalNumber = practicalNumber; + } + + public Double getPracticalNumber() + { + return practicalNumber; + } + public void setPreferentialOriginName(String preferentialOriginName) + { + this.preferentialOriginName = preferentialOriginName; + } + + public String getPreferentialOriginName() + { + return preferentialOriginName; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("buyingRequisitionId", getBuyingRequisitionId()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("unitOfMeasurementName", getUnitOfMeasurementName()) + .append("number", getNumber()) + .append("univalence", getUnivalence()) + .append("totalprice", getTotalprice()) + .append("referenceNumber", getReferenceNumber()) + .append("practicalNumber", getPracticalNumber()) + .append("preferentialOriginName", getPreferentialOriginName()) + .append("inventoryStatus", getInventoryStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionTwo.java new file mode 100644 index 0000000..a1066a8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwBuyingRequisitionTwo.java @@ -0,0 +1,565 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 易耗品请购单对象 pw_buying_requisition_two + * + * @author zhukangchao + * @date 2022-07-05 + */ +public class PwBuyingRequisitionTwo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * id集合 + */ + private Long[] ids; + + /** + * 令号 + */ + @Excel(name = "令号") + private String code; + + /** + * 名称 + */ + @Excel(name = "名称") + private String name; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + /** + * 用途 + */ + @Excel(name = "用途") + private String purpose; + + /** + * 总价(元) + */ + @Excel(name = "总价", readConverterExp = "元=") + private Double totalPrices; + + /** + * 需求日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date demandDate; + + /** + * 申请人 + */ + @Excel(name = "申请人") + private String proposer; + + /** + * 审核人 + */ + @Excel(name = "审核人") + private String auditor; + + /** + * 申请单状态(1:未审核,2:已审核,3:已完成) + */ + @Excel(name = "申请单状态", readConverterExp = "1=:未审核,2:已审核,3:已完成") + private Integer status; + + /** + * 未开票金额 + */ + private BigDecimal notInvoiceAmount; + + /** + * 已开票金额 + */ + private BigDecimal invoiceAmount; + + /** + * 未收款金额 + */ + private BigDecimal notProceedsAmount; + + /** + * 已收款金额 + */ + private BigDecimal proceedsAmount; + + /** + * 结算比例 + */ + private BigDecimal settlementRatio; + + /** + * 备用字段1 + */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** + * 备用字段2 + */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** + * 备用字段3 + */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** + * 备用字段4 + */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** + * 删除标记(0:未删除,1:已删除) + */ + private Integer delFlag; + + /** + * 供应商 + */ + @Excel(name = "供应商") + private String sellerName; + + /** + * 合同签订时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同签订时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date appointTime; + + /** + * 总价(大写) + */ + @Excel(name = "总价(大写)") + private String bigTotalPrices; + + /** + * 合同协议 + */ + @Excel(name = "合同协议") + private String agreement; + + /** + * 合同状态(1:进行中,2:已完成) + */ + @Excel(name = "合同状态", readConverterExp = "1=:进行中,2:已完成") + private Long contractStatus; + + /** + * 税率 + */ + @Excel(name = "税率") + private Long taxRate; + + /** + * 交货方式 + */ + @Excel(name = "交货方式") + private String deliveryType; + + /** + * 运费支付方 + */ + @Excel(name = "运费支付方") + private String payer; + + /** + * 货款支付方式 + */ + @Excel(name = "货款支付方式") + private String modeOfPayment; + + /** + * 扣款金额 + */ + @Excel(name = "扣款金额") + private Double withhold; + + /** + * 是否开票 + */ + @Excel(name = "是否开票") + private String billingInformation; + + /** + * 总经理审批 + */ + @Excel(name = "总经理审批") + private String leadership; + + /** + * 总经理审批时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + //付款金额 + private Double paymentAmount; + + //物流费用 + private Double money; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + //合同路径 + private String contractPath; + + public String getContractPath() { + return contractPath; + } + + public void setContractPath(String contractPath) { + this.contractPath = contractPath; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getPurpose() { + return purpose; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setDemandDate(Date demandDate) { + this.demandDate = demandDate; + } + + public Date getDemandDate() { + return demandDate; + } + + public void setProposer(String proposer) { + this.proposer = proposer; + } + + public String getProposer() { + return proposer; + } + + public void setAuditor(String auditor) { + this.auditor = auditor; + } + + public String getAuditor() { + return auditor; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getStatus() { + return status; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public Integer getDelFlag() { + return delFlag; + } + + public String getSellerName() { + return sellerName; + } + + public void setSellerName(String sellerName) { + this.sellerName = sellerName; + } + + public Date getAppointTime() { + return appointTime; + } + + public void setAppointTime(Date appointTime) { + this.appointTime = appointTime; + } + + public String getBigTotalPrices() { + return bigTotalPrices; + } + + public void setBigTotalPrices(String bigTotalPrices) { + this.bigTotalPrices = bigTotalPrices; + } + + public String getAgreement() { + return agreement; + } + + public void setAgreement(String agreement) { + this.agreement = agreement; + } + + public Long getContractStatus() { + return contractStatus; + } + + public void setContractStatus(Long contractStatus) { + this.contractStatus = contractStatus; + } + + public Long getTaxRate() { + return taxRate; + } + + public void setTaxRate(Long taxRate) { + this.taxRate = taxRate; + } + + public String getDeliveryType() { + return deliveryType; + } + + public void setDeliveryType(String deliveryType) { + this.deliveryType = deliveryType; + } + + public String getPayer() { + return payer; + } + + public void setPayer(String payer) { + this.payer = payer; + } + + public String getModeOfPayment() { + return modeOfPayment; + } + + public void setModeOfPayment(String modeOfPayment) { + this.modeOfPayment = modeOfPayment; + } + + public Double getWithhold() { + return withhold; + } + + public void setWithhold(Double withhold) { + this.withhold = withhold; + } + + public String getBillingInformation() { + return billingInformation; + } + + public void setBillingInformation(String billingInformation) { + this.billingInformation = billingInformation; + } + + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + @Override + public String toString() { + return "PwBuyingRequisitionTwo [id=" + id + ", ids=" + Arrays.toString(ids) + ", code=" + code + ", name=" + + name + ", materialName=" + materialName + ", purpose=" + purpose + ", totalPrices=" + totalPrices + + ", demandDate=" + demandDate + ", proposer=" + proposer + ", auditor=" + auditor + ", status=" + + status + ", notInvoiceAmount=" + notInvoiceAmount + ", invoiceAmount=" + invoiceAmount + + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + proceedsAmount + + ", settlementRatio=" + settlementRatio + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + + ", sellerName=" + sellerName + ", appointTime=" + appointTime + ", bigTotalPrices=" + bigTotalPrices + + ", agreement=" + agreement + ", contractStatus=" + contractStatus + ", taxRate=" + taxRate + + ", deliveryType=" + deliveryType + ", payer=" + payer + ", modeOfPayment=" + modeOfPayment + + ", withhold=" + withhold + ", billingInformation=" + billingInformation + ", leadership=" + leadership + + ", leadershipTime=" + leadershipTime + ", paymentAmount=" + paymentAmount + ", money=" + money + + ", unitName=" + unitName + ", payWay=" + payWay + ", contractPath=" + contractPath + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCompletionNotice.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCompletionNotice.java new file mode 100644 index 0000000..ae8a56d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCompletionNotice.java @@ -0,0 +1,222 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 完工通知单对象 pw_completion_notice + * + * @author zhukangchao + * @date 2020-07-20 + */ +public class PwCompletionNotice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productionCode; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 发单日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "发单日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date billDate; + + /** 生产部审核(0:未审核,1:已审核) */ + @Excel(name = "生产部审核", readConverterExp = "0=:未审核,1:已审核") + private Integer pdAudit; + + /** 生产部审核员 */ + @Excel(name = "生产部审核员") + private String pdAuditUser; + + /** 质检部审核(0:未审核,1;已审核) */ + @Excel(name = "质检部审核", readConverterExp = "0=:未审核,1;已审核") + private Integer qualityInspectorAudit; + + /** 质检部审核员 */ + @Excel(name = "质检部审核员") + private String qualityInspectorAuditUser; + + /** 编制人员 */ + @Excel(name = "编制人员") + private String authorizedStrengthUser; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setProjectName(String projectName) + { + this.projectName = projectName; + } + + public String getProjectName() + { + return projectName; + } + public void setBillDate(Date billDate) + { + this.billDate = billDate; + } + + public Date getBillDate() + { + return billDate; + } + public void setPdAudit(Integer pdAudit) + { + this.pdAudit = pdAudit; + } + + public Integer getPdAudit() + { + return pdAudit; + } + public void setPdAuditUser(String pdAuditUser) + { + this.pdAuditUser = pdAuditUser; + } + + public String getPdAuditUser() + { + return pdAuditUser; + } + public void setQualityInspectorAudit(Integer qualityInspectorAudit) + { + this.qualityInspectorAudit = qualityInspectorAudit; + } + + public Integer getQualityInspectorAudit() + { + return qualityInspectorAudit; + } + public void setQualityInspectorAuditUser(String qualityInspectorAuditUser) + { + this.qualityInspectorAuditUser = qualityInspectorAuditUser; + } + + public String getQualityInspectorAuditUser() + { + return qualityInspectorAuditUser; + } + public void setAuthorizedStrengthUser(String authorizedStrengthUser) + { + this.authorizedStrengthUser = authorizedStrengthUser; + } + + public String getAuthorizedStrengthUser() + { + return authorizedStrengthUser; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionCode", getProductionCode()) + .append("projectName", getProjectName()) + .append("billDate", getBillDate()) + .append("pdAudit", getPdAudit()) + .append("pdAuditUser", getPdAuditUser()) + .append("qualityInspectorAudit", getQualityInspectorAudit()) + .append("qualityInspectorAuditUser", getQualityInspectorAuditUser()) + .append("authorizedStrengthUser", getAuthorizedStrengthUser()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCompletionNoticeProduct.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCompletionNoticeProduct.java new file mode 100644 index 0000000..b132262 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCompletionNoticeProduct.java @@ -0,0 +1,460 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品完工通知单关联对象 pw_completion_notice_product + * + * @author zhukangchao + * @date 2020-07-20 + */ +public class PwCompletionNoticeProduct extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + private Date time; + + /** 序号 */ +// @Excel(name = "序号") + private Long serialNumber; + + /** 完工通知单id */ +// @Excel(name = "完工通知单id") + private Long completionNoticeId; + + /** 入库单详情id */ +// @Excel(name = "入库单详情id") + private Long productReceiptMaterialId; + + /** 执行单令号 */ + @Excel(name = "关联单据") + private String code; + + /** 名称 */ + @Excel(name = "物料名称") + private String productName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 图片 */ + private String picture; + + /** 应检数量 */ + @Excel(name = "应检数量") + private Double receivableQuantity; + + /** 合格数量 */ + @Excel(name = "合格数量") + private Double quantity; + + /** 待检数量 */ +// @Excel(name = "实检数量") + private Double actualQuantity; + + + /** 让步接收数量 */ + @Excel(name = "让步接收数量") + private Double concessionQuantity; + + /** 返修数量 */ + @Excel(name = "返修数量") + private Double repairQuantity; + + /** 重制数量 */ + @Excel(name = "重制数量") + private Double remakeQuantity; + + /** 不良品数量 */ + private Double invailed; + + public Double getInvailed() { + return invailed; + } + + public void setInvailed(Double invailed) { + this.invailed = invailed; + } + + //合格率 + @Excel(name = "合格率") + private String retio; + + /** 是否入库 */ +// @Excel(name = "是否入库") + private String godownEntry; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String preferentialOriginName; + + /** 交检部门 */ +// @Excel(name = "交检部门") + private String deptName; + /** 交检部门 */ + @Excel(name = "交检部门") + private String sparedOne; + + /** 申请人 */ + @Excel(name = "申请人") + private String userName; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "申请时间 ", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 检验状态 */ + @Excel(name = "检验状态") + private String checkoutStatus; + + /** 检验员 */ + @Excel(name = "检验员") + private String inspector; + + /** 检验日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "检验日期", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date checkoutDate; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + //起始时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date start; + //结束时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date end; + + //起始时间2 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startTwo; + //结束时间2 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endTwo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public Long getCompletionNoticeId() { + return completionNoticeId; + } + + public void setCompletionNoticeId(Long completionNoticeId) { + this.completionNoticeId = completionNoticeId; + } + + public Long getProductReceiptMaterialId() { + return productReceiptMaterialId; + } + + public void setProductReceiptMaterialId(Long productReceiptMaterialId) { + this.productReceiptMaterialId = productReceiptMaterialId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public String getPicture() { + return picture; + } + + public void setPicture(String picture) { + this.picture = picture; + } + + public Double getReceivableQuantity() { + return receivableQuantity; + } + + public void setReceivableQuantity(Double receivableQuantity) { + this.receivableQuantity = receivableQuantity; + } + + public Double getQuantity() { + return quantity; + } + + public void setQuantity(Double quantity) { + this.quantity = quantity; + } + public Double getConcessionQuantity() { + return concessionQuantity; + } + + public void setConcessionQuantity(Double concessionQuantity) { + this.concessionQuantity = concessionQuantity; + } + + public Double getActualQuantity() { + return actualQuantity; + } + + public void setActualQuantity(Double actualQuantity) { + this.actualQuantity = actualQuantity; + } + + public String getGodownEntry() { + return godownEntry; + } + + public void setGodownEntry(String godownEntry) { + this.godownEntry = godownEntry; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getCheckoutStatus() { + return checkoutStatus; + } + + public void setCheckoutStatus(String checkoutStatus) { + this.checkoutStatus = checkoutStatus; + } + + public String getInspector() { + return inspector; + } + + public void setInspector(String inspector) { + this.inspector = inspector; + } + + public Date getCheckoutDate() { + return checkoutDate; + } + + public void setCheckoutDate(Date checkoutDate) { + this.checkoutDate = checkoutDate; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public String getRetio() { + return retio; + } + + public void setRetio(String retio) { + this.retio = retio; + } + + public Double getRepairQuantity() { + return repairQuantity; + } + + public void setRepairQuantity(Double repairQuantity) { + this.repairQuantity = repairQuantity; + } + + public Double getRemakeQuantity() { + return remakeQuantity; + } + + public void setRemakeQuantity(Double remakeQuantity) { + this.remakeQuantity = remakeQuantity; + } + + public Date getStart() { + return start; + } + + public void setStart(Date start) { + this.start = start; + } + + public Date getEnd() { + return end; + } + + public void setEnd(Date end) { + this.end = end; + } + + public Date getStartTwo() { + return startTwo; + } + + public void setStartTwo(Date startTwo) { + this.startTwo = startTwo; + } + + public Date getEndTwo() { + return endTwo; + } + + public void setEndTwo(Date endTwo) { + this.endTwo = endTwo; + } + + @Override + public String toString() { + return "PwCompletionNoticeProduct [id=" + id + ", time=" + time + ", serialNumber=" + serialNumber + + ", completionNoticeId=" + completionNoticeId + ", productReceiptMaterialId=" + + productReceiptMaterialId + ", code=" + code + ", productName=" + productName + ", figureNumber=" + + figureNumber + ", materials=" + materials + ", pieceWeight=" + pieceWeight + ", picture=" + picture + + ", receivableQuantity=" + receivableQuantity + ", quantity=" + quantity + ", actualQuantity=" + + actualQuantity + ", concessionQuantity=" + concessionQuantity + ", retio=" + retio + + ", repairQuantity=" + repairQuantity + ", remakeQuantity=" + remakeQuantity + ", godownEntry=" + + godownEntry + ", preferentialOriginName=" + preferentialOriginName + ", deptName=" + deptName + + ", userName=" + userName + ", createTime=" + createTime + ", checkoutStatus=" + checkoutStatus + + ", inspector=" + inspector + ", checkoutDate=" + checkoutDate + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + ", start=" + start + ", end=" + end + ", startTwo=" + startTwo + ", endTwo=" + + endTwo + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwContract.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwContract.java new file mode 100644 index 0000000..ec6c839 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwContract.java @@ -0,0 +1,644 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 合同对象 pw_contract + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PwContract extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** id集合 */ + private Long[] ids; + + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractCode; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String itemName; + + /** 买方名称 */ + @Excel(name = "买方名称") + private String purchaser; + + /** 卖方名称 */ + @Excel(name = "卖方名称") + private String seller; + + /** 报价单id集合 */ + @Excel(name = "报价单id集合") + private String quotationId; + + /** 交货地点 */ + @Excel(name = "交货地点") + private String deliveryPoints; + + /** 收货人 */ + @Excel(name = "收货人") + private String consignee; + + /** 交货时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交货时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date deliveryTime; + + /** 付款方式 */ + @Excel(name = "付款方式") + private String paymentMethod; + + /** 运费支付方 */ + @Excel(name = "运费支付方") + private String freightPayer; + + /** 合同协议 */ + @Excel(name = "合同协议") + private String contractAgreement; + + /** 买方地址 */ + @Excel(name = "买方地址") + private String purchaserAddress; + + /** 买方电话 */ + @Excel(name = "买方电话") + private String purchaserPhone; + + /** 买方传真 */ + @Excel(name = "买方传真") + private String purchaserFax; + + /** 买方纳税识别号 */ + @Excel(name = "买方纳税识别号") + private String purchaserTln; + + /** 买方开户行 */ + @Excel(name = "买方开户行") + private String purchaserOpeningBank; + + /** 买方账号 */ + @Excel(name = "买方账号") + private String purchaserAccountNumber; + + /** 卖方地址 */ + @Excel(name = "卖方地址") + private String sellerAddress; + + /** 卖方电话 */ + @Excel(name = "卖方电话") + private String sellerPhone; + + /** 卖方传真 */ + @Excel(name = "卖方传真") + private String sellerFax; + + /** 卖方纳税识别号 */ + @Excel(name = "卖方纳税识别号") + private String sellerTln; + + /** 卖方开户行 */ + @Excel(name = "卖方开户行") + private String sellerOpeningBank; + + /** 卖方账号 */ + @Excel(name = "卖方账号") + private String sellerAcctountNumber; + + /** 审核状态(0:未审核,1:已审核) */ + @Excel(name = "审核状态", readConverterExp = "0=:未审核,1:已审核") + private Integer auditStatus; + + /** 合同状态(1=:未完成,2:已完成) */ + @Excel(name = "合同状态", readConverterExp = "1=:未完成,2:已完成") + private Integer contractStatus; + + /** + * 合同额 + */ + private Double money; + + /** 未开票金额 */ + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + private BigDecimal invoiceAmount; + + /** 未收款金额 */ + private BigDecimal notProceedsAmount; + + /** 已收款金额 */ + private BigDecimal proceedsAmount; + + /** 结算比例 */ + private BigDecimal settlementRatio; + + private Long userId; + + /** + * 相关业务员 + */ + private String salesman; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadership; + + /** 总经理审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + /** + * 合同路径 + */ + private String contractPath; + //物流费用 + private Double moneyTwo; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + /** + * 币别 + */ + @Excel(name = "币别") + private String currencyName; + + /** + * 税率 + */ + @Excel(name = "税率") + private double taxRate; + + public double getTaxRate() { + return taxRate; + } + + public void setTaxRate(double taxRate) { + this.taxRate = taxRate; + } + + public String getCurrencyName() { + return currencyName; + } + + public void setCurrencyName(String currencyName) { + this.currencyName = currencyName; + } + + public String getContractPath() { + return contractPath; + } + + public void setContractPath(String contractPath) { + this.contractPath = contractPath; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setItemName(String itemName) + { + this.itemName = itemName; + } + + public String getItemName() + { + return itemName; + } + public void setPurchaser(String purchaser) + { + this.purchaser = purchaser; + } + + public String getPurchaser() + { + return purchaser; + } + public void setSeller(String seller) + { + this.seller = seller; + } + + public String getSeller() + { + return seller; + } + public void setQuotationId(String quotationId) + { + this.quotationId = quotationId; + } + + public String getQuotationId() + { + return quotationId; + } + public void setDeliveryPoints(String deliveryPoints) + { + this.deliveryPoints = deliveryPoints; + } + + public String getDeliveryPoints() + { + return deliveryPoints; + } + public void setConsignee(String consignee) + { + this.consignee = consignee; + } + + public String getConsignee() + { + return consignee; + } + public void setDeliveryTime(Date deliveryTime) + { + this.deliveryTime = deliveryTime; + } + + public Date getDeliveryTime() + { + return deliveryTime; + } + public void setPaymentMethod(String paymentMethod) + { + this.paymentMethod = paymentMethod; + } + + public String getPaymentMethod() + { + return paymentMethod; + } + public void setContractAgreement(String contractAgreement) + { + this.contractAgreement = contractAgreement; + } + + public String getContractAgreement() + { + return contractAgreement; + } + public void setPurchaserAddress(String purchaserAddress) + { + this.purchaserAddress = purchaserAddress; + } + + public String getPurchaserAddress() + { + return purchaserAddress; + } + public void setPurchaserPhone(String purchaserPhone) + { + this.purchaserPhone = purchaserPhone; + } + + public String getPurchaserPhone() + { + return purchaserPhone; + } + public void setPurchaserFax(String purchaserFax) + { + this.purchaserFax = purchaserFax; + } + + public String getPurchaserFax() + { + return purchaserFax; + } + public void setPurchaserTln(String purchaserTln) + { + this.purchaserTln = purchaserTln; + } + + public String getPurchaserTln() + { + return purchaserTln; + } + public void setPurchaserOpeningBank(String purchaserOpeningBank) + { + this.purchaserOpeningBank = purchaserOpeningBank; + } + + public String getPurchaserOpeningBank() + { + return purchaserOpeningBank; + } + public void setPurchaserAccountNumber(String purchaserAccountNumber) + { + this.purchaserAccountNumber = purchaserAccountNumber; + } + + public String getPurchaserAccountNumber() + { + return purchaserAccountNumber; + } + public void setSellerAddress(String sellerAddress) + { + this.sellerAddress = sellerAddress; + } + + public String getSellerAddress() + { + return sellerAddress; + } + public void setSellerPhone(String sellerPhone) + { + this.sellerPhone = sellerPhone; + } + + public String getSellerPhone() + { + return sellerPhone; + } + public void setSellerFax(String sellerFax) + { + this.sellerFax = sellerFax; + } + + public String getSellerFax() + { + return sellerFax; + } + public void setSellerTln(String sellerTln) + { + this.sellerTln = sellerTln; + } + + public String getSellerTln() + { + return sellerTln; + } + public void setSellerOpeningBank(String sellerOpeningBank) + { + this.sellerOpeningBank = sellerOpeningBank; + } + + public String getSellerOpeningBank() + { + return sellerOpeningBank; + } + public void setSellerAcctountNumber(String sellerAcctountNumber) + { + this.sellerAcctountNumber = sellerAcctountNumber; + } + + public String getSellerAcctountNumber() + { + return sellerAcctountNumber; + } + public void setAuditStatus(Integer auditStatus) + { + this.auditStatus = auditStatus; + } + + public Integer getAuditStatus() + { + return auditStatus; + } + + public Integer getContractStatus() { + return contractStatus; + } + + public void setContractStatus(Integer contractStatus) { + this.contractStatus = contractStatus; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public String getFreightPayer() { + return freightPayer; + } + + public void setFreightPayer(String freightPayer) { + this.freightPayer = freightPayer; + } + public String getSalesman() { + return salesman; + } + + public void setSalesman(String salesman) { + this.salesman = salesman; + } + + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Double getMoneyTwo() { + return moneyTwo; + } + + public void setMoneyTwo(Double moneyTwo) { + this.moneyTwo = moneyTwo; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + @Override + public String toString() { + return "PwContract [id=" + id + ", ids=" + Arrays.toString(ids) + ", contractCode=" + contractCode + + ", itemName=" + itemName + ", purchaser=" + purchaser + ", seller=" + seller + ", quotationId=" + + quotationId + ", deliveryPoints=" + deliveryPoints + ", consignee=" + consignee + ", deliveryTime=" + + deliveryTime + ", paymentMethod=" + paymentMethod + ", freightPayer=" + freightPayer + + ", contractAgreement=" + contractAgreement + ", purchaserAddress=" + purchaserAddress + + ", purchaserPhone=" + purchaserPhone + ", purchaserFax=" + purchaserFax + ", purchaserTln=" + + purchaserTln + ", purchaserOpeningBank=" + purchaserOpeningBank + ", purchaserAccountNumber=" + + purchaserAccountNumber + ", sellerAddress=" + sellerAddress + ", sellerPhone=" + sellerPhone + + ", sellerFax=" + sellerFax + ", sellerTln=" + sellerTln + ", sellerOpeningBank=" + sellerOpeningBank + + ", sellerAcctountNumber=" + sellerAcctountNumber + ", auditStatus=" + auditStatus + + ", contractStatus=" + contractStatus + ", money=" + money + ", notInvoiceAmount=" + notInvoiceAmount + + ", invoiceAmount=" + invoiceAmount + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + + proceedsAmount + ", settlementRatio=" + settlementRatio + ", userId=" + userId + ", salesman=" + + salesman + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", leadership=" + leadership + + ", leadershipTime=" + leadershipTime + ", moneyTwo=" + moneyTwo + ", unitName=" + unitName + + ", payWay=" + payWay + ", contractPath=" + contractPath + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwContractInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwContractInfo.java new file mode 100644 index 0000000..a4b0c47 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwContractInfo.java @@ -0,0 +1,288 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 合同信息明细对象 pw_contract_info + * + * @author zhukangchao + * @date 2023-12-06 + */ +public class PwContractInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 合同id */ + @Excel(name = "合同id") + private Long contractId; + + /** 产品类型 */ + @Excel(name = "产品类型") + private String productType; + + /** 型号类型 */ + @Excel(name = "型号类型") + private String productClassify; + + /** 所属产品名称 */ + @Excel(name = "所属产品名称") + private String productName; + + /** 所属型号名称 */ + @Excel(name = "所属型号名称") + private String typeName; + + /** 物料图号 */ + @Excel(name = "物料图号") + private String figureNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 合计 */ + @Excel(name = "合计") + private Double total; + + /** 是否已生成订单 */ + @Excel(name = "是否已生成订单") + private String productionOrder; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setContractId(Long contractId) + { + this.contractId = contractId; + } + + public Long getContractId() + { + return contractId; + } + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + public void setProductClassify(String productClassify) + { + this.productClassify = productClassify; + } + + public String getProductClassify() + { + return productClassify; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setTotal(Double total) + { + this.total = total; + } + + public Double getTotal() + { + return total; + } + public void setProductionOrder(String productionOrder) + { + this.productionOrder = productionOrder; + } + + public String getProductionOrder() + { + return productionOrder; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("contractId", getContractId()) + .append("productType", getProductType()) + .append("productClassify", getProductClassify()) + .append("productName", getProductName()) + .append("typeName", getTypeName()) + .append("figureNumber", getFigureNumber()) + .append("materialName", getMaterialName()) + .append("unit", getUnit()) + .append("number", getNumber()) + .append("univalence", getUnivalence()) + .append("total", getTotal()) + .append("productionOrder", getProductionOrder()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingTool.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingTool.java new file mode 100644 index 0000000..11a7bea --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingTool.java @@ -0,0 +1,366 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Date; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具对象 pw_cutting_tool + * + * @author zhukangchao + * @date 2022-01-27 + */ +public class PwCuttingTool extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 默认仓库 */ + @Excel(name = "默认仓库") + private String warehouseName; + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal unitPrice; + + /** 未税单价 */ + @Excel(name = "未税单价") + private BigDecimal untaxedPrice; + + /** 物料MD5加密码 */ + @Excel(name = "物料MD5加密码") + private String materialCode; + + /** 最低库存 */ + @Excel(name = "最低库存") + private Long minimumNumber; + + /** 最高库存 */ + @Excel(name = "最高库存") + private Long heightNumber; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂家 */ + @Excel(name = "生产厂家") + private String manufacturer; + + /** 使用设备 */ + @Excel(name = "使用设备") + private String useTheEquipment; + + /** 加工产品 */ + @Excel(name = "加工产品") + private String processedProducts; + + /** 检验日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检验日期") + private Date expirationDate; + + /** 检验周期 */ + @Excel(name = "检验周期") + private Long period; + + /** 最小维修数量 */ + @Excel(name = "维修数量") + private Long maintainNumber; + + /** 黑名单标记 */ + private Integer blacklist; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 数量 */ +// @Excel(name = "数量") + private Long quantity; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public BigDecimal getUntaxedPrice() { + return untaxedPrice; + } + + public void setUntaxedPrice(BigDecimal untaxedPrice) { + this.untaxedPrice = untaxedPrice; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public void setMinimumNumber(Long minimumNumber) + { + this.minimumNumber = minimumNumber; + } + + public Long getMinimumNumber() + { + return minimumNumber; + } + public void setHeightNumber(Long heightNumber) + { + this.heightNumber = heightNumber; + } + + public Long getHeightNumber() + { + return heightNumber; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setUseTheEquipment(String useTheEquipment) + { + this.useTheEquipment = useTheEquipment; + } + + public String getUseTheEquipment() + { + return useTheEquipment; + } + public void setProcessedProducts(String processedProducts) + { + this.processedProducts = processedProducts; + } + + public String getProcessedProducts() + { + return processedProducts; + } + + public Date getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(Date expirationDate) { + this.expirationDate = expirationDate; + } + + public Long getPeriod() { + return period; + } + + public void setPeriod(Long period) { + this.period = period; + } + + public Long getMaintainNumber() { + return maintainNumber; + } + + public void setMaintainNumber(Long maintainNumber) { + this.maintainNumber = maintainNumber; + } + + public Integer getBlacklist() { + return blacklist; + } + + public void setBlacklist(Integer blacklist) { + this.blacklist = blacklist; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "PwCuttingTool [id=" + id + ", name=" + name + ", brand=" + brand + ", type=" + type + ", unit=" + unit + + ", warehouseName=" + warehouseName + ", unitPrice=" + unitPrice + ", minimumNumber=" + minimumNumber + + ", heightNumber=" + heightNumber + ", supplier=" + supplier + ", manufacturer=" + manufacturer + + ", useTheEquipment=" + useTheEquipment + ", processedProducts=" + processedProducts + + ", expirationDate=" + expirationDate + ", period=" + period + ", maintainNumber=" + maintainNumber + + ", blacklist=" + blacklist + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolApply.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolApply.java new file mode 100644 index 0000000..071a44f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolApply.java @@ -0,0 +1,253 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具领用申请单对象 pw_cutting_tool_apply + * + * @author zhukangchao + * @date 2022-03-09 + */ +public class PwCuttingToolApply extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 数据创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "数据创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cerateTime; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 申领人 */ + @Excel(name = "申领人") + private String userName; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date applyDate; + + /** 申请状态 */ + @Excel(name = "申请状态") + private String applyStatus; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 刀具名称 */ + private String name; + + /** 刀具品牌 */ + private String brand; + + /** 规格型号 */ + private String type; + + //起始时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date start; + //结束时间 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date end; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCerateTime(Date cerateTime) + { + this.cerateTime = cerateTime; + } + + public Date getCerateTime() + { + return cerateTime; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + + public String getAuditor() { + return auditor; + } + + public void setAuditor(String auditor) { + this.auditor = auditor; + } + + public void setApplyDate(Date applyDate) + { + this.applyDate = applyDate; + } + + public Date getApplyDate() + { + return applyDate; + } + public void setApplyStatus(String applyStatus) + { + this.applyStatus = applyStatus; + } + + public String getApplyStatus() + { + return applyStatus; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + public Date getStart() { + return start; + } + + public void setStart(Date start) { + this.start = start; + } + + public Date getEnd() { + return end; + } + + public void setEnd(Date end) { + this.end = end; + } + + @Override + public String toString() { + return "PwCuttingToolApply [id=" + id + ", cerateTime=" + cerateTime + ", code=" + code + ", userName=" + + userName + ", auditor=" + auditor + ", applyDate=" + applyDate + ", applyStatus=" + applyStatus + + ", remarks=" + remarks + ", delFlag=" + delFlag + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", name=" + name + + ", brand=" + brand + ", type=" + type + ", start=" + start + ", end=" + end + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolApplyDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolApplyDetail.java new file mode 100644 index 0000000..c67795a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolApplyDetail.java @@ -0,0 +1,272 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具领用申请单详情对象 pw_cutting_tool_apply_detail + * + * @author zhukangchao + * @date 2022-03-09 + */ +public class PwCuttingToolApplyDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 申请领用单id */ +// @Excel(name = "申请领用单id") + private Long applyId; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂商 */ +// @Excel(name = "生产厂商") + private String manufacturer; + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal unitPrice; + + /** 总价 */ + @Excel(name = "总价") + private BigDecimal totalPrices; + + /** 申请数量 */ + @Excel(name = "申请数量") + private Long quantity; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sapredTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 刀具id */ + private Long cuttingToolId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setApplyId(Long applyId) + { + this.applyId = applyId; + } + + public Long getApplyId() + { + return applyId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public BigDecimal getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(BigDecimal totalPrices) { + this.totalPrices = totalPrices; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSapredTwo(String sapredTwo) + { + this.sapredTwo = sapredTwo; + } + + public String getSapredTwo() + { + return sapredTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public Long getCuttingToolId() { + return cuttingToolId; + } + + public void setCuttingToolId(Long cuttingToolId) { + this.cuttingToolId = cuttingToolId; + } + + @Override + public String toString() { + return "PwCuttingToolApplyDetail [id=" + id + ", applyId=" + applyId + ", name=" + name + ", brand=" + brand + + ", type=" + type + ", unit=" + unit + ", supplier=" + supplier + ", manufacturer=" + manufacturer + + ", unitPrice=" + unitPrice + ", totalPrices=" + totalPrices + ", quantity=" + quantity + ", status=" + + status + ", remarks=" + remarks + ", delFlag=" + delFlag + ", sparedOne=" + sparedOne + ", sapredTwo=" + + sapredTwo + ", sapredThree=" + sapredThree + ", sparedFour=" + sparedFour + ", cuttingToolId=" + + cuttingToolId + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolDelivery.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolDelivery.java new file mode 100644 index 0000000..1a72a55 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolDelivery.java @@ -0,0 +1,162 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具出库单对象 pw_cutting_tool_delivery + * + * @author zhukangchao + * @date 2022-03-09 + */ +public class PwCuttingToolDelivery extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 领料单code */ + @Excel(name = "领料单code") + private String code; + + /** 申请人 */ + @Excel(name = "申请人") + private String userName; + + /** 出库状态 */ + @Excel(name = "出库状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + private String name; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "PwCuttingToolDelivery [id=" + id + ", code=" + code + ", userName=" + userName + ", status=" + status + + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", name=" + name + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolDeliveryDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolDeliveryDetail.java new file mode 100644 index 0000000..20fbb2e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolDeliveryDetail.java @@ -0,0 +1,291 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具出库单详情对象 pw_cutting_tool_delivery_detail + * + * @author zhukangchao + * @date 2022-03-09 + */ +public class PwCuttingToolDeliveryDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 出库单id */ + @Excel(name = "出库单id") + private Long deliveryId; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂商 */ + @Excel(name = "生产厂商") + private String manufacturer; + + /** 单价 */ + @Excel(name = "单价") + private Double unitPrice; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 申请数量 */ + @Excel(name = "申请数量") + private Long quantity; + + /** 申请人 */ + @Excel(name = "申请人") + private String userName; + + /** 出库状态 */ + @Excel(name = "出库状态") + private String deliveryStatus; + + /** 出库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date deliveryDate; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sapredOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDeliveryId(Long deliveryId) + { + this.deliveryId = deliveryId; + } + + public Long getDeliveryId() + { + return deliveryId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setDeliveryStatus(String deliveryStatus) + { + this.deliveryStatus = deliveryStatus; + } + + public String getDeliveryStatus() + { + return deliveryStatus; + } + public void setDeliveryDate(Date deliveryDate) + { + this.deliveryDate = deliveryDate; + } + + public Date getDeliveryDate() + { + return deliveryDate; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSapredOne(String sapredOne) + { + this.sapredOne = sapredOne; + } + + public String getSapredOne() + { + return sapredOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "PwCuttingToolDeliveryDetail [id=" + id + ", deliveryId=" + deliveryId + ", name=" + name + ", brand=" + + brand + ", type=" + type + ", unit=" + unit + ", supplier=" + supplier + ", manufacturer=" + + manufacturer + ", unitPrice=" + unitPrice + ", totalPrices=" + totalPrices + ", quantity=" + quantity + + ", userName=" + userName + ", deliveryStatus=" + deliveryStatus + ", deliveryDate=" + deliveryDate + + ", remarks=" + remarks + ", delFlag=" + delFlag + ", sapredOne=" + sapredOne + ", sparedTwo=" + + sparedTwo + ", sapredThree=" + sapredThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolGodownEntry.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolGodownEntry.java new file mode 100644 index 0000000..291ccf5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolGodownEntry.java @@ -0,0 +1,180 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具入库单对象 pw_cutting_tool_godown_entry + * + * @author zhukangchao + * @date 2022-03-09 + */ +public class PwCuttingToolGodownEntry extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 数据创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "数据创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cerateTime; + + /** 关联合同 */ + @Excel(name = "关联合同") + private String contractCode; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String seller; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sapredFour; + + private String name; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCerateTime(Date cerateTime) + { + this.cerateTime = cerateTime; + } + + public Date getCerateTime() + { + return cerateTime; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setSeller(String seller) + { + this.seller = seller; + } + + public String getSeller() + { + return seller; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSapredFour(Long sapredFour) + { + this.sapredFour = sapredFour; + } + + public Long getSapredFour() + { + return sapredFour; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "PwCuttingToolGodownEntry [id=" + id + ", cerateTime=" + cerateTime + ", contractCode=" + contractCode + + ", seller=" + seller + ", inventoryStatus=" + inventoryStatus + ", remarks=" + remarks + ", delFlag=" + + delFlag + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sapredFour=" + sapredFour + ", name=" + name + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolGodownEntryDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolGodownEntryDetail.java new file mode 100644 index 0000000..856ee1b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolGodownEntryDetail.java @@ -0,0 +1,318 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具入库详情对象 pw_cutting_tool_godown_entry_detail + * + * @author zhukangchao + * @date 2022-03-09 + */ +public class PwCuttingToolGodownEntryDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 刀具入库单id */ +// @Excel(name = "刀具入库单id") + private Long gosownEntryId; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂商 */ +// @Excel(name = "生产厂商") + private String manufacturer; + + /** 单价 */ + @Excel(name = "单价") + private Double unitPrice; + + /** 申请数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrice; + + /** 入库人 */ +// @Excel(name = "入库人") + private String userName; + + /** 入库状态 */ +// @Excel(name = "入库状态") + private String godownEntryStatus; + + /** 入库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") +// @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date godownEntryDate; + + /** 备注 */ +// @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setGosownEntryId(Long gosownEntryId) + { + this.gosownEntryId = gosownEntryId; + } + + public Long getGosownEntryId() + { + return gosownEntryId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setTotalPrice(Double totalPrice) + { + this.totalPrice = totalPrice; + } + + public Double getTotalPrice() + { + return totalPrice; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setGodownEntryStatus(String godownEntryStatus) + { + this.godownEntryStatus = godownEntryStatus; + } + + public String getGodownEntryStatus() + { + return godownEntryStatus; + } + public void setGodownEntryDate(Date godownEntryDate) + { + this.godownEntryDate = godownEntryDate; + } + + public Date getGodownEntryDate() + { + return godownEntryDate; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("gosownEntryId", getGosownEntryId()) + .append("name", getName()) + .append("brand", getBrand()) + .append("type", getType()) + .append("unit", getUnit()) + .append("supplier", getSupplier()) + .append("manufacturer", getManufacturer()) + .append("unitPrice", getUnitPrice()) + .append("quantity", getQuantity()) + .append("totalPrice", getTotalPrice()) + .append("userName", getUserName()) + .append("godownEntryStatus", getGodownEntryStatus()) + .append("godownEntryDate", getGodownEntryDate()) + .append("remarks", getRemarks()) + .append("delFlag", getDelFlag()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolInventoryDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolInventoryDetail.java new file mode 100644 index 0000000..b989d15 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolInventoryDetail.java @@ -0,0 +1,298 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具库存对象 pw_cutting_tool_inventory_detail + * + * @author zhukangchao + * @date 2022-01-27 + */ +public class PwCuttingToolInventoryDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 默认仓库 */ + @Excel(name = "默认仓库") + private String warehouseName; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂家 */ + @Excel(name = "生产厂家") + private String manufacturer; + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal unitPrice; + + /** 未税单价 */ + @Excel(name = "未税单价") + private BigDecimal untaxedPrice; + + /** 数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 待修 */ + @Excel(name = "待修数量") + private Long number; + + /** 在途数量 */ + @Excel(name = "在途数量") + private Long onPassage; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 维修标记 */ +// @Excel(name = "维修标记") + private String maintain; + + /** 报废标记 */ +// @Excel(name = "报废标记") + private String scrap; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public BigDecimal getUntaxedPrice() { + return untaxedPrice; + } + + public void setUntaxedPrice(BigDecimal untaxedPrice) { + this.untaxedPrice = untaxedPrice; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setUnitPrice(BigDecimal unitPrice) + { + this.unitPrice = unitPrice; + } + + public BigDecimal getUnitPrice() + { + return unitPrice; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public void setOnPassage(Long onPassage) + { + this.onPassage = onPassage; + } + + public Long getOnPassage() + { + return onPassage; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setMaintain(String maintain) + { + this.maintain = maintain; + } + + public String getMaintain() + { + return maintain; + } + public void setScrap(String scrap) + { + this.scrap = scrap; + } + + public String getScrap() + { + return scrap; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "PwCuttingToolInventoryDetail [id=" + id + ", name=" + name + ", brand=" + brand + ", type=" + type + + ", unit=" + unit + ", warehouseName=" + warehouseName + ", supplier=" + supplier + ", manufacturer=" + + manufacturer + ", unitPrice=" + unitPrice + ", quantity=" + quantity + ", number=" + number + + ", onPassage=" + onPassage + ", remarks=" + remarks + ", maintain=" + maintain + ", scrap=" + scrap + + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolMaintain.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolMaintain.java new file mode 100644 index 0000000..7d71cf3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolMaintain.java @@ -0,0 +1,208 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具维修申请单对象 pw_cutting_tool_maintain + * + * @author zhukangchao + * @date 2022-03-21 + */ +public class PwCuttingToolMaintain extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date date; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 申请人 */ + @Excel(name = "申请人") + private String userName; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 状态(未申请,未审核,未入库,已入库) */ + @Excel(name = "状态", readConverterExp = "未=申请,未审核,未入库,已入库") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sapredTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + public void setTotalPrices(Double totalPrices) + { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() + { + return totalPrices; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setAuditor(String auditor) + { + this.auditor = auditor; + } + + public String getAuditor() + { + return auditor; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSapredTwo(String sapredTwo) + { + this.sapredTwo = sapredTwo; + } + + public String getSapredTwo() + { + return sapredTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("date", getDate()) + .append("totalPrices", getTotalPrices()) + .append("userName", getUserName()) + .append("auditor", getAuditor()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("delFlag", getDelFlag()) + .append("sparedOne", getSparedOne()) + .append("sapredTwo", getSapredTwo()) + .append("sapredThree", getSapredThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolMaintainDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolMaintainDetail.java new file mode 100644 index 0000000..c1b72c8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolMaintainDetail.java @@ -0,0 +1,310 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具维修申请单详情对象 pw_cutting_tool_maintain_detail + * + * @author zhukangchao + * @date 2022-03-21 + */ +public class PwCuttingToolMaintainDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 维修单id */ + @Excel(name = "维修单id") + private Long maintainId; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 新刀具名称 */ + @Excel(name = "新刀具名称") + private String newName; + + /** 新刀具品牌 */ + @Excel(name = "新刀具品牌") + private String newBrand; + + /** 新刀具编号 */ + @Excel(name = "新刀具编号") + private String newType; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂商 */ + @Excel(name = "生产厂商") + private String manufacturer; + + /** 单价 */ + @Excel(name = "单价") + private Double unitPrice; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrice; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Long delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 刀具id */ + private Long cuttingToolId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setMaintainId(Long maintainId) + { + this.maintainId = maintainId; + } + + public Long getMaintainId() + { + return maintainId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + + public String getNewName() { + return newName; + } + + public void setNewName(String newName) { + this.newName = newName; + } + + public String getNewBrand() { + return newBrand; + } + + public void setNewBrand(String newBrand) { + this.newBrand = newBrand; + } + + public String getNewType() { + return newType; + } + + public void setNewType(String newType) { + this.newType = newType; + } + + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setTotalPrice(Double totalPrice) + { + this.totalPrice = totalPrice; + } + + public Double getTotalPrice() + { + return totalPrice; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Long delFlag) + { + this.delFlag = delFlag; + } + + public Long getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public Long getCuttingToolId() { + return cuttingToolId; + } + + public void setCuttingToolId(Long cuttingToolId) { + this.cuttingToolId = cuttingToolId; + } + + @Override + public String toString() { + return "PwCuttingToolMaintainDetail [id=" + id + ", maintainId=" + maintainId + ", name=" + name + ", brand=" + + brand + ", type=" + type + ", newName=" + newName + ", newType=" + newType + ", unit=" + unit + + ", supplier=" + supplier + ", manufacturer=" + manufacturer + ", unitPrice=" + unitPrice + + ", quantity=" + quantity + ", totalPrice=" + totalPrice + ", status=" + status + ", remarks=" + + remarks + ", delFlag=" + delFlag + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", cuttingToolId=" + cuttingToolId + + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolPurchase.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolPurchase.java new file mode 100644 index 0000000..e4b1a1c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolPurchase.java @@ -0,0 +1,493 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具采购申请单对象 pw_cutting_tool_purchase + * + * @author zhukangchao + * @date 2022-03-10 + */ +public class PwCuttingToolPurchase extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** id集合 */ + private Long[] ids; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 总价(元) */ + @Excel(name = "总价", readConverterExp = "元") + private Double totalPrices; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date date; + + /** 申请人 */ + @Excel(name = "申请人") + private String userName; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 状态(未申请,未审核,未入库,已入库) */ + @Excel(name = "状态", readConverterExp = "未申请,未审核,未入库,已入库") + private String status; + + /** 未开票金额 */ + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + private BigDecimal invoiceAmount; + + /** 未收款金额 */ + private BigDecimal notProceedsAmount; + + /** 已收款金额 */ + private BigDecimal proceedsAmount; + + /** 结算比例 */ + private BigDecimal settlementRatio; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sapredTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + private String name; + + /** 供应商 */ + @Excel(name = "供应商") + private String sellerName; + + /** 合同签订时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同签订时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date appointTime; + + /** 总价(大写) */ + @Excel(name = "总价(大写)") + private String bigTotalPrices; + + /** 合同协议 */ + @Excel(name = "合同协议") + private String agreement; + + /** 合同状态(1:进行中,2:已完成) */ + @Excel(name = "合同状态", readConverterExp = "1=:进行中,2:已完成") + private Long contractStatus; + + /** 税率 */ + @Excel(name = "税率") + private Long taxRate; + + /** 交货方式 */ + @Excel(name = "交货方式") + private String deliveryType; + + /** 运费支付方 */ + @Excel(name = "运费支付方") + private String payer; + + /** 货款支付方式 */ + @Excel(name = "货款支付方式") + private String modeOfPayment; + + /** 扣款金额 */ + @Excel(name = "扣款金额") + private Double withhold; + + /** 是否开票 */ + @Excel(name = "是否开票") + private String billingInformation; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadership; + + /** 总经理审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + //付款金额 + private Double paymentAmount; + + //物流费用 + private Double money; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + //合同路径 + private String contractPath; + + public String getContractPath() { + return contractPath; + } + + public void setContractPath(String contractPath) { + this.contractPath = contractPath; + } + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSapredTwo(String sapredTwo) + { + this.sapredTwo = sapredTwo; + } + + public String getSapredTwo() + { + return sapredTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public String getAuditor() { + return auditor; + } + + public void setAuditor(String auditor) { + this.auditor = auditor; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSellerName() { + return sellerName; + } + + public void setSellerName(String sellerName) { + this.sellerName = sellerName; + } + + public Date getAppointTime() { + return appointTime; + } + + public void setAppointTime(Date appointTime) { + this.appointTime = appointTime; + } + + public String getBigTotalPrices() { + return bigTotalPrices; + } + + public void setBigTotalPrices(String bigTotalPrices) { + this.bigTotalPrices = bigTotalPrices; + } + + public String getAgreement() { + return agreement; + } + + public void setAgreement(String agreement) { + this.agreement = agreement; + } + + public Long getContractStatus() { + return contractStatus; + } + + public void setContractStatus(Long contractStatus) { + this.contractStatus = contractStatus; + } + + public Long getTaxRate() { + return taxRate; + } + + public void setTaxRate(Long taxRate) { + this.taxRate = taxRate; + } + + public String getDeliveryType() { + return deliveryType; + } + + public void setDeliveryType(String deliveryType) { + this.deliveryType = deliveryType; + } + + public String getPayer() { + return payer; + } + + public void setPayer(String payer) { + this.payer = payer; + } + + public String getModeOfPayment() { + return modeOfPayment; + } + + public void setModeOfPayment(String modeOfPayment) { + this.modeOfPayment = modeOfPayment; + } + + public Double getWithhold() { + return withhold; + } + + public void setWithhold(Double withhold) { + this.withhold = withhold; + } + + public String getBillingInformation() { + return billingInformation; + } + + public void setBillingInformation(String billingInformation) { + this.billingInformation = billingInformation; + } + + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + @Override + public String toString() { + return "PwCuttingToolPurchase [id=" + id + ", ids=" + Arrays.toString(ids) + ", code=" + code + ", totalPrices=" + + totalPrices + ", date=" + date + ", userName=" + userName + ", auditor=" + auditor + ", status=" + + status + ", notInvoiceAmount=" + notInvoiceAmount + ", invoiceAmount=" + invoiceAmount + + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + proceedsAmount + + ", settlementRatio=" + settlementRatio + ", remarks=" + remarks + ", delFlag=" + delFlag + + ", sparedOne=" + sparedOne + ", sapredTwo=" + sapredTwo + ", sapredThree=" + sapredThree + + ", sparedFour=" + sparedFour + ", name=" + name + ", sellerName=" + sellerName + ", appointTime=" + + appointTime + ", bigTotalPrices=" + bigTotalPrices + ", agreement=" + agreement + ", contractStatus=" + + contractStatus + ", taxRate=" + taxRate + ", deliveryType=" + deliveryType + ", payer=" + payer + + ", modeOfPayment=" + modeOfPayment + ", withhold=" + withhold + ", billingInformation=" + + billingInformation + ", leadership=" + leadership + ", leadershipTime=" + leadershipTime + + ", paymentAmount=" + paymentAmount + ", money=" + money + ", unitName=" + unitName + ", payWay=" + + payWay + ", contractPath=" + contractPath + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolPurchaseDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolPurchaseDetail.java new file mode 100644 index 0000000..e8a83ba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolPurchaseDetail.java @@ -0,0 +1,307 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具采购详情对象 pw_cutting_tool_purchase_detail + * + * @author zhukangchao + * @date 2022-03-09 + */ +public class PwCuttingToolPurchaseDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + private int num; + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + /** 采购单id */ + private Long purchaseId; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂商 */ + @Excel(name = "生产厂商") + private String manufacturer; + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal unitPrice; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + + /** 未税单价 */ + @Excel(name = "未税单价") + private BigDecimal untaxedPrice; + + /** 物料MD5加密码 */ + @Excel(name = "物料MD5加密码") + private String materialCode; + + /** 总价 */ + @Excel(name = "总价") + private BigDecimal totalPrice; + + /** 状态 */ + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Long delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 刀具id */ + private Long cuttingToolId; + + public BigDecimal getUntaxedPrice() { + return untaxedPrice; + } + + public void setUntaxedPrice(BigDecimal untaxedPrice) { + this.untaxedPrice = untaxedPrice; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getPurchaseId() { + return purchaseId; + } + + public void setPurchaseId(Long purchaseId) { + this.purchaseId = purchaseId; + } + + public Long getCuttingToolId() { + return cuttingToolId; + } + + public void setCuttingToolId(Long cuttingToolId) { + this.cuttingToolId = cuttingToolId; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setUnitPrice(BigDecimal unitPrice) + { + this.unitPrice = unitPrice; + } + + public BigDecimal getUnitPrice() + { + return unitPrice; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setTotalPrice(BigDecimal totalPrice) + { + this.totalPrice = totalPrice; + } + + public BigDecimal getTotalPrice() + { + return totalPrice; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Long delFlag) + { + this.delFlag = delFlag; + } + + public Long getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "PwCuttingToolPurchaseDetail [id=" + id + ", purchaseId=" + purchaseId + ", name=" + name + ", brand=" + + brand + ", type=" + type + ", unit=" + unit + ", supplier=" + supplier + ", manufacturer=" + + manufacturer + ", unitPrice=" + unitPrice + ", quantity=" + quantity + ", totalPrice=" + totalPrice + + ", status=" + status + ", remarks=" + remarks + ", delFlag=" + delFlag + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", cuttingToolId=" + cuttingToolId + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrap.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrap.java new file mode 100644 index 0000000..317f6cf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrap.java @@ -0,0 +1,194 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具报废申请单对象 pw_cutting_tool_scrap + * + * @author zhukangchao + * @date 2022-03-19 + */ +public class PwCuttingToolScrap extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date date; + + /** 申请人 */ + @Excel(name = "申请人") + private String userName; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 状态(未申请,未审核,未入库,已入库) */ + @Excel(name = "状态", readConverterExp = "未=申请,未审核,未入库,已入库") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sapredTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setAuditor(String auditor) + { + this.auditor = auditor; + } + + public String getAuditor() + { + return auditor; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSapredTwo(String sapredTwo) + { + this.sapredTwo = sapredTwo; + } + + public String getSapredTwo() + { + return sapredTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("date", getDate()) + .append("userName", getUserName()) + .append("auditor", getAuditor()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("delFlag", getDelFlag()) + .append("sparedOne", getSparedOne()) + .append("sapredTwo", getSapredTwo()) + .append("sapredThree", getSapredThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapDetail.java new file mode 100644 index 0000000..8d64224 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapDetail.java @@ -0,0 +1,257 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具报废详情对象 pw_cutting_tool_scrap_detail + * + * @author zhukangchao + * @date 2022-03-19 + */ +public class PwCuttingToolScrapDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 采购单id */ + @Excel(name = "采购单id") + private Long scrapId; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂商 */ + @Excel(name = "生产厂商") + private String manufacturer; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Long delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 刀具id */ + private Long cuttingToolId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setScrapId(Long scrapId) + { + this.scrapId = scrapId; + } + + public Long getScrapId() + { + return scrapId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Long delFlag) + { + this.delFlag = delFlag; + } + + public Long getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public Long getCuttingToolId() { + return cuttingToolId; + } + + public void setCuttingToolId(Long cuttingToolId) { + this.cuttingToolId = cuttingToolId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("scrapId", getScrapId()) + .append("name", getName()) + .append("brand", getBrand()) + .append("type", getType()) + .append("unit", getUnit()) + .append("supplier", getSupplier()) + .append("manufacturer", getManufacturer()) + .append("quantity", getQuantity()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("delFlag", getDelFlag()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapGodownEntry.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapGodownEntry.java new file mode 100644 index 0000000..62c0b25 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapGodownEntry.java @@ -0,0 +1,179 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具报废入库单对象 pw_cutting_tool_scrap_godown_entry + * + * @author zhukangchao + * @date 2022-03-19 + */ +public class PwCuttingToolScrapGodownEntry extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 数据创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "数据创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cerateTime; + + /** 关联合同 */ + @Excel(name = "关联合同") + private String contractCode; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String seller; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sapredFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCerateTime(Date cerateTime) + { + this.cerateTime = cerateTime; + } + + public Date getCerateTime() + { + return cerateTime; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setSeller(String seller) + { + this.seller = seller; + } + + public String getSeller() + { + return seller; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSapredFour(Long sapredFour) + { + this.sapredFour = sapredFour; + } + + public Long getSapredFour() + { + return sapredFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("cerateTime", getCerateTime()) + .append("contractCode", getContractCode()) + .append("seller", getSeller()) + .append("inventoryStatus", getInventoryStatus()) + .append("remarks", getRemarks()) + .append("delFlag", getDelFlag()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sapredFour", getSapredFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapGodownEntryDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapGodownEntryDetail.java new file mode 100644 index 0000000..0fa1baf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwCuttingToolScrapGodownEntryDetail.java @@ -0,0 +1,306 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 刀具报废入库详情对象 pw_cutting_tool_scrap_godown_entry_detail + * + * @author zhukangchao + * @date 2022-03-19 + */ +public class PwCuttingToolScrapGodownEntryDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 刀具入库单id */ + @Excel(name = "刀具入库单id") + private Long gosownEntryId; + + /** 刀具名称 */ + @Excel(name = "刀具名称") + private String name; + + /** 刀具品牌 */ + @Excel(name = "刀具品牌") + private String brand; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String type; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 刀具厂商 */ + @Excel(name = "刀具厂商") + private String supplier; + + /** 生产厂商 */ + @Excel(name = "生产厂商") + private String manufacturer; + + /** 单价 */ + @Excel(name = "单价") + private Double unitPrice; + + /** 申请数量 */ + @Excel(name = "申请数量") + private Long quantity; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrice; + + /** 入库人 */ + @Excel(name = "入库人") + private String userName; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String godownEntryStatus; + + /** 入库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date godownEntryDate; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setGosownEntryId(Long gosownEntryId) + { + this.gosownEntryId = gosownEntryId; + } + + public Long getGosownEntryId() + { + return gosownEntryId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setTotalPrice(Double totalPrice) + { + this.totalPrice = totalPrice; + } + + public Double getTotalPrice() + { + return totalPrice; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setGodownEntryStatus(String godownEntryStatus) + { + this.godownEntryStatus = godownEntryStatus; + } + + public String getGodownEntryStatus() + { + return godownEntryStatus; + } + public void setGodownEntryDate(Date godownEntryDate) + { + this.godownEntryDate = godownEntryDate; + } + + public Date getGodownEntryDate() + { + return godownEntryDate; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("gosownEntryId", getGosownEntryId()) + .append("name", getName()) + .append("brand", getBrand()) + .append("type", getType()) + .append("unit", getUnit()) + .append("supplier", getSupplier()) + .append("manufacturer", getManufacturer()) + .append("unitPrice", getUnitPrice()) + .append("quantity", getQuantity()) + .append("totalPrice", getTotalPrice()) + .append("userName", getUserName()) + .append("godownEntryStatus", getGodownEntryStatus()) + .append("godownEntryDate", getGodownEntryDate()) + .append("remarks", getRemarks()) + .append("delFlag", getDelFlag()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwDanceNotStandard.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwDanceNotStandard.java new file mode 100644 index 0000000..3d4c1ee --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwDanceNotStandard.java @@ -0,0 +1,183 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 舞非型号对象 pw_dance_not_standard + * + * @author zhukangchao + * @date 2021-08-02 + */ +public class PwDanceNotStandard extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 型号 */ + @Excel(name = "型号") + private String typeName; + + /** 名称 */ + @Excel(name = "名称") + private String name; + private String productName; + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal univalent; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + private Double vipLevel; + private Long number; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public BigDecimal getUnivalent() { + return univalent; + } + + public void setUnivalent(BigDecimal univalent) { + this.univalent = univalent; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public Double getVipLevel() { + return vipLevel; + } + + public void setVipLevel(Double vipLevel) { + this.vipLevel = vipLevel; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + @Override + public String toString() { + return "PwDanceNotStandard [id=" + id + ", typeName=" + typeName + ", name=" + name + ", univalent=" + univalent + + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", vipLevel=" + vipLevel + ", number=" + + number + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwDefectiveMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwDefectiveMaterial.java new file mode 100644 index 0000000..8357074 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwDefectiveMaterial.java @@ -0,0 +1,178 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 残料对象 pw_defective_material + * + * @author zhukangchao + * @date 2022-12-14 + */ +public class PwDefectiveMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料图号 */ + @Excel(name = "材料图号") + private String materialsFigureNumber; + + /** 材料单位 */ + @Excel(name = "材料单位") + private String materialsUnit; + + /** 长度 */ + @Excel(name = "长度") + private Long len; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setMaterialsName(String materialsName) + { + this.materialsName = materialsName; + } + + public String getMaterialsName() + { + return materialsName; + } + public void setMaterialsFigureNumber(String materialsFigureNumber) + { + this.materialsFigureNumber = materialsFigureNumber; + } + + public String getMaterialsFigureNumber() + { + return materialsFigureNumber; + } + public void setMaterialsUnit(String materialsUnit) + { + this.materialsUnit = materialsUnit; + } + + public String getMaterialsUnit() + { + return materialsUnit; + } + public void setLen(Long len) + { + this.len = len; + } + + public Long getLen() + { + return len; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("materialsName", getMaterialsName()) + .append("materialsFigureNumber", getMaterialsFigureNumber()) + .append("materialsUnit", getMaterialsUnit()) + .append("len", getLen()) + .append("number", getNumber()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwEquipmentInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwEquipmentInfo.java new file mode 100644 index 0000000..b80b91d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwEquipmentInfo.java @@ -0,0 +1,346 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 生产设备信息对象 pw_equipment_info + * + * @author zhukangchao + * @date 2023-08-01 + */ +public class PwEquipmentInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String code; + + /** 资产编码 */ + @Excel(name = "资产编码") + private String propertyCode; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String name; + + /** 设备型号 */ + @Excel(name = "设备型号") + private String type; + + /** 规格 */ + @Excel(name = "规格") + private String specification; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String deptName; + + /** 生产标记 */ + @Excel(name = "生产标记") + private String productionMark; + + /** 出厂编号 */ + @Excel(name = "出厂编号") + private String leaveFactoryCode; + + /** 制造日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "制造日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date manufactureDate; + + /** 安装日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date installDate; + + /** 启用日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "启用日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date useDate; + + /** 功率 */ + @Excel(name = "功率") + private String power; + + /** 重量(吨) */ + @Excel(name = "重量(吨)") + private Double weight; + + /** 设备状态 */ + @Excel(name = "设备状态") + private String status; + + /** 生产厂家 */ + @Excel(name = "生产厂家") + private String manufacturer; + + /** 联系人 */ + @Excel(name = "联系人") + private String linkman; + + /** 联系电话 */ + @Excel(name = "联系电话") + private String phone; + + /** 设备负责人 */ + @Excel(name = "设备负责人") + private String principal; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setPropertyCode(String propertyCode) + { + this.propertyCode = propertyCode; + } + + public String getPropertyCode() + { + return propertyCode; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + public void setProductionMark(String productionMark) + { + this.productionMark = productionMark; + } + + public String getProductionMark() + { + return productionMark; + } + public void setLeaveFactoryCode(String leaveFactoryCode) + { + this.leaveFactoryCode = leaveFactoryCode; + } + + public String getLeaveFactoryCode() + { + return leaveFactoryCode; + } + public void setManufactureDate(Date manufactureDate) + { + this.manufactureDate = manufactureDate; + } + + public Date getManufactureDate() + { + return manufactureDate; + } + public void setInstallDate(Date installDate) + { + this.installDate = installDate; + } + + public Date getInstallDate() + { + return installDate; + } + public void setUseDate(Date useDate) + { + this.useDate = useDate; + } + + public Date getUseDate() + { + return useDate; + } + public void setPower(String power) + { + this.power = power; + } + + public String getPower() + { + return power; + } + public void setWeight(Double weight) + { + this.weight = weight; + } + + public Double getWeight() + { + return weight; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setLinkman(String linkman) + { + this.linkman = linkman; + } + + public String getLinkman() + { + return linkman; + } + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPhone() + { + return phone; + } + public void setPrincipal(String principal) + { + this.principal = principal; + } + + public String getPrincipal() + { + return principal; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "PwEquipmentInfo [id=" + id + ", code=" + code + ", propertyCode=" + propertyCode + ", name=" + name + + ", type=" + type + ", specification=" + specification + ", deptName=" + deptName + ", productionMark=" + + productionMark + ", leaveFactoryCode=" + leaveFactoryCode + ", manufactureDate=" + manufactureDate + + ", installDate=" + installDate + ", useDate=" + useDate + ", power=" + power + ", weight=" + weight + + ", status=" + status + ", manufacturer=" + manufacturer + ", linkman=" + linkman + ", phone=" + phone + + ", principal=" + principal + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrders.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrders.java new file mode 100644 index 0000000..90fb4ec --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrders.java @@ -0,0 +1,180 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预采购单对象 pw_futures_orders + * + * @author zhukangchao + * @date 2022-06-22 + */ +public class PwFuturesOrders extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 项目令号 */ + @Excel(name = "项目令号") + private String code; + + /** 申请人 */ + @Excel(name = "申请人") + private String user; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date time; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setUser(String user) + { + this.user = user; + } + + public String getUser() + { + return user; + } + public void setTime(Date time) + { + this.time = time; + } + + public Date getTime() + { + return time; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("user", getUser()) + .append("time", getTime()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrdersDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrdersDetail.java new file mode 100644 index 0000000..dd413ff --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrdersDetail.java @@ -0,0 +1,338 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预采购单明细对象 pw_futures_orders_detail + * + * @author zhukangchao + * @date 2022-06-22 + */ +public class PwFuturesOrdersDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 预采购单主键 */ + private Long ordersId; + + /** 项目令号 */ + @Excel(name = "项目令号") + private String code; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 下料尺寸 */ + @Excel(name = "下料尺寸") + private Long measure; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Double workblank; + + /** 总数量 */ + @Excel(name = "总数量") + private Double number; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 采购数量 */ + @Excel(name = "采购数量") + private Double quantity; + + /** 采购计量单位 */ + @Excel(name = "采购计量单位") + private String unitTwo; + + /** 参考数量 */ + // @Excel(name = "参考数量") + private Double referenceNumber; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long inventoryQuantity; + + /** 预存数量 */ + @Excel(name = "在途数量") + private Long preliminaryInventory; + + /** 锁定数量 */ + @Excel(name = "锁定数量") + private Long lockNumber; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sapredFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getOrdersId() { + return ordersId; + } + + public void setOrdersId(Long ordersId) { + this.ordersId = ordersId; + } + + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setMeasure(Long measure) + { + this.measure = measure; + } + + public Long getMeasure() + { + return measure; + } + public void setWorkblank(Double workblank) + { + this.workblank = workblank; + } + + public Double getWorkblank() + { + return workblank; + } + public void setNumber(Double number) + { + this.number = number; + } + + public Double getNumber() + { + return number; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setQuantity(Double quantity) + { + this.quantity = quantity; + } + + public Double getQuantity() + { + return quantity; + } + public void setUnitTwo(String unitTwo) + { + this.unitTwo = unitTwo; + } + + public String getUnitTwo() + { + return unitTwo; + } + + public Double getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(Double referenceNumber) { + this.referenceNumber = referenceNumber; + } + + public void setInventoryQuantity(Long inventoryQuantity) + { + this.inventoryQuantity = inventoryQuantity; + } + + public Long getInventoryQuantity() + { + return inventoryQuantity; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSapredFour(Long sapredFour) + { + this.sapredFour = sapredFour; + } + + public Long getSapredFour() + { + return sapredFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public Long getPreliminaryInventory() { + return preliminaryInventory; + } + + public void setPreliminaryInventory(Long preliminaryInventory) { + this.preliminaryInventory = preliminaryInventory; + } + + public Long getLockNumber() { + return lockNumber; + } + + public void setLockNumber(Long lockNumber) { + this.lockNumber = lockNumber; + } + + @Override + public String toString() { + return "PwFuturesOrdersDetail [id=" + id + ", ordersId=" + ordersId + ", code=" + code + ", name=" + name + + ", figureNumber=" + figureNumber + ", materials=" + materials + ", pieceWeight=" + pieceWeight + + ", measure=" + measure + ", workblank=" + workblank + ", number=" + number + ", unit=" + unit + + ", quantity=" + quantity + ", unitTwo=" + unitTwo + ", referenceNumber=" + referenceNumber + + ", inventoryQuantity=" + inventoryQuantity + ", preliminaryInventory=" + preliminaryInventory + + ", lockNumber=" + lockNumber + ", status=" + status + ", remarks=" + remarks + ", sparedOne=" + + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sapredFour=" + sapredFour + + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrdersDetailTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrdersDetailTwo.java new file mode 100644 index 0000000..53346ba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwFuturesOrdersDetailTwo.java @@ -0,0 +1,329 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预采购单明细详情对象 pw_futures_orders_detail_two + * + * @author zhukangchao + * @date 2022-06-27 + */ +public class PwFuturesOrdersDetailTwo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 预采购详情单id */ + @Excel(name = "预采购详情单id") + private Long ordersDetailId; + + /** 项目令号 */ + @Excel(name = "项目令号") + private String code; + + /** 物料id */ + private Long matenaisId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 下料尺寸 */ + @Excel(name = "下料尺寸") + private Long measure; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Double workblank; + + /** 总数量 */ + @Excel(name = "总数量") + private Double number; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 采购数量 */ + @Excel(name = "采购数量") + private Double quantity; + + /** 采购计量单位 */ + @Excel(name = "采购计量单位") + private String unitTwo; + + /** 参考数量(Kg) */ + @Excel(name = "参考数量", readConverterExp = "K=g") + private Double referenceNumber; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long inventoryQuantity; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sapredFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOrdersDetailId(Long ordersDetailId) + { + this.ordersDetailId = ordersDetailId; + } + + public Long getOrdersDetailId() + { + return ordersDetailId; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + + public Long getMatenaisId() { + return matenaisId; + } + + public void setMatenaisId(Long matenaisId) { + this.matenaisId = matenaisId; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setMeasure(Long measure) + { + this.measure = measure; + } + + public Long getMeasure() + { + return measure; + } + public void setWorkblank(Double workblank) + { + this.workblank = workblank; + } + + public Double getWorkblank() + { + return workblank; + } + public void setNumber(Double number) + { + this.number = number; + } + + public Double getNumber() + { + return number; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setQuantity(Double quantity) + { + this.quantity = quantity; + } + + public Double getQuantity() + { + return quantity; + } + public void setUnitTwo(String unitTwo) + { + this.unitTwo = unitTwo; + } + + public String getUnitTwo() + { + return unitTwo; + } + public void setReferenceNumber(Double referenceNumber) + { + this.referenceNumber = referenceNumber; + } + + public Double getReferenceNumber() + { + return referenceNumber; + } + public void setInventoryQuantity(Long inventoryQuantity) + { + this.inventoryQuantity = inventoryQuantity; + } + + public Long getInventoryQuantity() + { + return inventoryQuantity; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSapredFour(Long sapredFour) + { + this.sapredFour = sapredFour; + } + + public Long getSapredFour() + { + return sapredFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("ordersDetailId", getOrdersDetailId()) + .append("code", getCode()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("measure", getMeasure()) + .append("workblank", getWorkblank()) + .append("number", getNumber()) + .append("unit", getUnit()) + .append("quantity", getQuantity()) + .append("unitTwo", getUnitTwo()) + .append("referenceNumber", getReferenceNumber()) + .append("inventoryQuantity", getInventoryQuantity()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sapredFour", getSapredFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwGxProcess.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwGxProcess.java new file mode 100644 index 0000000..68a2455 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwGxProcess.java @@ -0,0 +1,202 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +import java.util.List; + +/** + * 物料工序信息对象 pw_material_process + * + * @author chenyongjiang + * @date 2024-08-06 + */ +public class PwGxProcess extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 父级ID */ + @Excel(name = "父级ID") + private Long parentId; + + private String num; //序号 + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 物料材质 */ + @Excel(name = "物料材质") + private String materials; + + /** 派工部门 */ + @Excel(name = "派工部门") + private String dispatchingDept; + + /** 用量 */ + @Excel(name = "用量") + private String workblank; + + /** 序工时 */ + @Excel(name = "序工时") + private Long serialTime; + + private List children; + + /** 删除标记 */ + private String delFlag; + + @Excel(name = "描述") + private String remarks; + + private String tableData; //工序集合 + + private String tableSon; // 原材料 + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Long getParentId() + { + return parentId; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setDispatchingDept(String dispatchingDept) + { + this.dispatchingDept = dispatchingDept; + } + + public String getDispatchingDept() + { + return dispatchingDept; + } + public void setWorkblank(String workblank) + { + this.workblank = workblank; + } + + public String getWorkblank() + { + return workblank; + } + public void setSerialTime(Long serialTime) + { + this.serialTime = serialTime; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public Long getSerialTime() + { + return serialTime; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getTableData() { + return tableData; + } + + public void setTableData(String tableData) { + this.tableData = tableData; + } + + public String getTableSon() { + return tableSon; + } + + public void setTableSon(String tableSon) { + this.tableSon = tableSon; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("parentId", getParentId()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("materials", getMaterials()) + .append("dispatchingDept", getDispatchingDept()) + .append("workblank", getWorkblank()) + .append("serialTime", getSerialTime()) + .append("delFlag", getDelFlag()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwHeightPermittedInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwHeightPermittedInfo.java new file mode 100644 index 0000000..eaf880e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwHeightPermittedInfo.java @@ -0,0 +1,248 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 安全库存限制信息对象 pw_height_permitted_info + * + * @author zhukangchao + * @date 2023-03-29 + */ +public class PwHeightPermittedInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 最低库存 */ + @Excel(name = "最低库存") + private Long minimum; + + /** 最高库存 */ + @Excel(name = "最高库存") + private Long highest; + + /** 最高限制量 */ + @Excel(name = "最高限制量") + private Long highestNumber; + + /** 已制作数量 */ + @Excel(name = "已制作数量") + private Long produced; + + /** 可制作数量 */ + @Excel(name = "可制作数量") + private Long needMake; + + /** 是否限高 */ + @Excel(name = "是否限高") + private String heightPermitted; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setMinimum(Long minimum) + { + this.minimum = minimum; + } + + public Long getMinimum() + { + return minimum; + } + public void setHighest(Long highest) + { + this.highest = highest; + } + + public Long getHighest() + { + return highest; + } + public void setHighestNumber(Long highestNumber) + { + this.highestNumber = highestNumber; + } + + public Long getHighestNumber() + { + return highestNumber; + } + public void setProduced(Long produced) + { + this.produced = produced; + } + + public Long getProduced() + { + return produced; + } + public void setNeedMake(Long needMake) + { + this.needMake = needMake; + } + + public Long getNeedMake() + { + return needMake; + } + public void setHeightPermitted(String heightPermitted) + { + this.heightPermitted = heightPermitted; + } + + public String getHeightPermitted() + { + return heightPermitted; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("minimum", getMinimum()) + .append("highest", getHighest()) + .append("highestNumber", getHighestNumber()) + .append("produced", getProduced()) + .append("needMake", getNeedMake()) + .append("heightPermitted", getHeightPermitted()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwInspectionCard.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwInspectionCard.java new file mode 100644 index 0000000..d046bb4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwInspectionCard.java @@ -0,0 +1,194 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 检验单对象 pw_inspection_card + * + * @author zhukangchao + * @date 2022-07-20 + */ +public class PwInspectionCard extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编号 */ + @Excel(name = "单据编号") + private String code; + + /** 单据日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date receiptsDate; + + /** 检验方名称 */ + @Excel(name = "检验方名称") + private String name; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 检验状态 */ + @Excel(name = "检验状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setReceiptsDate(Date receiptsDate) + { + this.receiptsDate = receiptsDate; + } + + public Date getReceiptsDate() + { + return receiptsDate; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setTotalPrices(Double totalPrices) + { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() + { + return totalPrices; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("receiptsDate", getReceiptsDate()) + .append("name", getName()) + .append("totalPrices", getTotalPrices()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwInspectionCardDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwInspectionCardDetail.java new file mode 100644 index 0000000..2115bcd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwInspectionCardDetail.java @@ -0,0 +1,277 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 检验单详情对象 pw_inspection_card_detail + * + * @author zhukangchao + * @date 2022-07-20 + */ +public class PwInspectionCardDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 检验单id */ + private Long cardId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String name; + + /** 品牌 */ + @Excel(name = "品牌") + private String brand; + + /** 编号 */ + @Excel(name = "编号") + private String type; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 生产厂家 */ + @Excel(name = "生产厂家") + private String manufacturer; + + /** 需检日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "需检日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date needDate; + + /** 检验日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检验日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date checkoutDate; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 单价 */ + @Excel(name = "单价") + private Double unitPrice; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 检验状态 */ + @Excel(name = "检验状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setNeedDate(Date needDate) + { + this.needDate = needDate; + } + + public Date getNeedDate() + { + return needDate; + } + public void setCheckoutDate(Date checkoutDate) + { + this.checkoutDate = checkoutDate; + } + + public Date getCheckoutDate() + { + return checkoutDate; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + public void setTotalPrices(Double totalPrices) + { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() + { + return totalPrices; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "PwInspectionCardDetail [id=" + id + ", cardId=" + cardId + ", name=" + name + ", brand=" + brand + + ", type=" + type + ", unit=" + unit + ", manufacturer=" + manufacturer + ", needDate=" + needDate + + ", checkoutDate=" + checkoutDate + ", quantity=" + quantity + ", unitPrice=" + unitPrice + + ", totalPrices=" + totalPrices + ", status=" + status + ", remarks=" + remarks + ", sparedOne=" + + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwInventoryComparison.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwInventoryComparison.java new file mode 100644 index 0000000..8f0bc12 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwInventoryComparison.java @@ -0,0 +1,140 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 盘库对比对象 pw_inventory_comparison + * + * @author zhukangchao + * @date 2023-11-06 + */ +public class PwInventoryComparison extends BaseEntity +{ + /** 参数主键 */ + private Long id; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 盘库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "盘库时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date inventoryDate; + + /** erp数据 */ + @Excel(name = "erp数据") + private Long erpNum; + + /** 盘库数据 */ + @Excel(name = "盘库数据") + private int inventoryNum; + + /** 差异数据 */ + @Excel(name = "差异数据") + private int differences; + + /** 盈亏 */ + @Excel(name = "盈亏") + private String profitAndLoss; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setInventoryDate(Date inventoryDate) + { + this.inventoryDate = inventoryDate; + } + + public Date getInventoryDate() + { + return inventoryDate; + } + public void setErpNum(Long erpNum) + { + this.erpNum = erpNum; + } + + public Long getErpNum() + { + return erpNum; + } + public void setInventoryNum(int inventoryNum) + { + this.inventoryNum = inventoryNum; + } + + public int getInventoryNum() + { + return inventoryNum; + } + public void setDifferences(int differences) + { + this.differences = differences; + } + + public int getDifferences() + { + return differences; + } + public void setProfitAndLoss(String profitAndLoss) + { + this.profitAndLoss = profitAndLoss; + } + + public String getProfitAndLoss() + { + return profitAndLoss; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("inventoryDate", getInventoryDate()) + .append("erpNum", getErpNum()) + .append("inventoryNum", getInventoryNum()) + .append("differences", getDifferences()) + .append("profitAndLoss", getProfitAndLoss()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwInventoryDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwInventoryDetail.java new file mode 100644 index 0000000..fa16589 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwInventoryDetail.java @@ -0,0 +1,507 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 库存明细对象 pw_inventory_detail + * + * @author zhukangchao + * @date 2020-07-18 + */ +public class PwInventoryDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料编码 */ + private String materialCode; + + /** 物品名称 */ + @Excel(name = "物品名称") + private String name; + + /** 规格型号名称 */ +// @Excel(name = "规格型号名称") + private String typeName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 所属类别 */ + @Excel(name = "所属类别") + private String type; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 长度 */ + @Excel(name = "长度") + private Double len; + + /** 宽度 */ + @Excel(name = "宽度") + private Double wid; + + /** b短边宽度 */ + @Excel(name = "短边宽度(b)") + private Double widTwo; + + /** 厚度t */ + @Excel(name = "厚度(t1)") + private Double thickness; + + /** 厚度 */ + @Excel(name = "厚度(t2)") + private Double thicknessTwo; + + /** 高度 */ + @Excel(name = "高度") + private Double altitude; + + /** 外直径 */ + @Excel(name = "外直径") + private Double outerDiameter; + + /** 内直径 */ + @Excel(name = "内直径") + private Double internalDiameter; + + /** 颜色 */ +// @Excel(name = "颜色") + private String colour; + + /** 所属型号 */ + @Excel(name = "所属型号") + private String category; + + /** 仓库id */ +// @Excel(name = "仓库id") + private Long warehouseId; + + /** 仓库名称 */ + @Excel(name = "仓库名称") + private String warehouseName; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 含税单价 */ + @Excel(name = "含税单价(重量)") + private BigDecimal univalence; + + /** 含税单价 */ + @Excel(name = "含税单价") + private BigDecimal unitPrice; + + /** 未税单价 */ + @Excel(name = "未税单价(单位)") + private BigDecimal unitUnivalence; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 参考数量(Kg) */ + @Excel(name = "参考数量(Kg)") + private Double theoryQuantity; + + /** 预存数量 */ + @Excel(name = "在途数量") + private Long preliminaryInventory; + + /** 锁定数量 */ + @Excel(name = "锁定数量") + private Long lockNumber; + + /** 可用数量 */ + @Excel(name = "可用数量") + private Long availableNumber; + + /** 最低库存 */ + @Excel(name = "最低库存") + private Long minimum; + + /** 最高库存 */ + @Excel(name = "最高库存") + private Long highest; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** + * 报废数量 + * @return + */ + private Long number; + + /** + * 报废原因 + * @return + */ + private String cause; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public Double getLen() { + return len; + } + + public void setLen(Double len) { + this.len = len; + } + + public Double getWid() { + return wid; + } + + public void setWid(Double wid) { + this.wid = wid; + } + + public Double getAltitude() { + return altitude; + } + + public void setAltitude(Double altitude) { + this.altitude = altitude; + } + + public Double getOuterDiameter() { + return outerDiameter; + } + + public void setOuterDiameter(Double outerDiameter) { + this.outerDiameter = outerDiameter; + } + + public Double getInternalDiameter() { + return internalDiameter; + } + + public void setInternalDiameter(Double internalDiameter) { + this.internalDiameter = internalDiameter; + } + + public String getColour() { + return colour; + } + + public void setColour(String colour) { + this.colour = colour; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public Long getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(Long warehouseId) { + this.warehouseId = warehouseId; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public BigDecimal getUnivalence() { + return univalence; + } + + public void setUnivalence(BigDecimal univalence) { + this.univalence = univalence; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public BigDecimal getUnitUnivalence() { + return unitUnivalence; + } + + public void setUnitUnivalence(BigDecimal unitUnivalence) { + this.unitUnivalence = unitUnivalence; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Long getPreliminaryInventory() { + return preliminaryInventory; + } + + public void setPreliminaryInventory(Long preliminaryInventory) { + this.preliminaryInventory = preliminaryInventory; + } + + public Long getLockNumber() { + return lockNumber; + } + + public void setLockNumber(Long lockNumber) { + this.lockNumber = lockNumber; + } + + public Long getAvailableNumber() { + return availableNumber; + } + + public void setAvailableNumber(Long availableNumber) { + this.availableNumber = availableNumber; + } + + public Long getMinimum() { + return minimum; + } + + public void setMinimum(Long minimum) { + this.minimum = minimum; + } + + public Long getHighest() { + return highest; + } + + public void setHighest(Long highest) { + this.highest = highest; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public Double getWidTwo() { + return widTwo; + } + + public void setWidTwo(Double widTwo) { + this.widTwo = widTwo; + } + + public Double getThickness() { + return thickness; + } + + public void setThickness(Double thickness) { + this.thickness = thickness; + } + + public Double getThicknessTwo() { + return thicknessTwo; + } + + public void setThicknessTwo(Double thicknessTwo) { + this.thicknessTwo = thicknessTwo; + } + + public Double getTheoryQuantity() { + return theoryQuantity; + } + + public void setTheoryQuantity(Double theoryQuantity) { + this.theoryQuantity = theoryQuantity; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public String getCause() { + return cause; + } + + public void setCause(String cause) { + this.cause = cause; + } + + @Override + public String toString() { + return "PwInventoryDetail [id=" + id + ", materialCode=" + materialCode + ", name=" + name + ", typeName=" + + typeName + ", figureNumber=" + figureNumber + ", type=" + type + ", materials=" + materials + + ", pieceWeight=" + pieceWeight + ", len=" + len + ", wid=" + wid + ", widTwo=" + widTwo + + ", thickness=" + thickness + ", thicknessTwo=" + thicknessTwo + ", altitude=" + altitude + + ", outerDiameter=" + outerDiameter + ", internalDiameter=" + internalDiameter + ", colour=" + colour + + ", category=" + category + ", warehouseId=" + warehouseId + ", warehouseName=" + warehouseName + + ", unit=" + unit + ", univalence=" + univalence + ", unitPrice=" + unitPrice + ", unitUnivalence=" + + unitUnivalence + ", quantity=" + quantity + ", theoryQuantity=" + theoryQuantity + + ", preliminaryInventory=" + preliminaryInventory + ", lockNumber=" + lockNumber + ", availableNumber=" + + availableNumber + ", minimum=" + minimum + ", highest=" + highest + ", remarks=" + remarks + + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", number=" + number + ", cause=" + cause + + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwInvoiceInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwInvoiceInfo.java new file mode 100644 index 0000000..d7d56ba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwInvoiceInfo.java @@ -0,0 +1,194 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 发票信息对象 pw_invoice_info + * + * @author zhukangchao + * @date 2023-04-09 + */ +public class PwInvoiceInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 发票号码 */ + @Excel(name = "发票号码") + private String code; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String supplierName; + + /** 发票文件地址 */ + @Excel(name = "发票文件地址") + private String url; + + /** 是否付款 */ + @Excel(name = "是否付款") + private String payment; + + /** 发票金额 */ + @Excel(name = "发票金额") + private Double money; + + /** 付款单id */ + @Excel(name = "付款单id") + private Long paymentInfoId; + + /** 发票来源 */ + @Excel(name = "发票来源") + private String source; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setSupplierName(String supplierName) + { + this.supplierName = supplierName; + } + + public String getSupplierName() + { + return supplierName; + } + public void setUrl(String url) + { + this.url = url; + } + + public String getUrl() + { + return url; + } + public void setPayment(String payment) + { + this.payment = payment; + } + + public String getPayment() + { + return payment; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public void setPaymentInfoId(Long paymentInfoId) + { + this.paymentInfoId = paymentInfoId; + } + + public Long getPaymentInfoId() + { + return paymentInfoId; + } + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "PwInvoiceInfo [id=" + id + ", code=" + code + ", supplierName=" + supplierName + ", url=" + url + + ", payment=" + payment + ", money=" + money + ", paymentInfoId=" + paymentInfoId + ", source=" + + source + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdvice.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdvice.java new file mode 100644 index 0000000..d47d370 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdvice.java @@ -0,0 +1,359 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 发运通知单对象 pw_letter_of_advice + * + * @author zhukangchao + * @date 2020-07-20 + */ +public class PwLetterOfAdvice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractCode; + + /** 运费支付方 */ + @Excel(name = "运费支付方") + private String freightPayer; + + /** 购买方名称 */ + @Excel(name = "购买方名称") + private String purchaserUnitName; + + /** 收货人 */ + @Excel(name = "收货人") + private String consignee; + + /** 收货地址 */ + @Excel(name = "收货地址") + private String shippingAddress; + + /** 收货人电话 */ + @Excel(name = "收货人电话") + private String purchaserUnitPhone; + + /** 承运方单位名称 */ + @Excel(name = "承运方单位名称") + private String carrierUnitName; + + /** 承运人 */ + @Excel(name = "承运人") + private String haulier; + + /** 承运车辆 */ + @Excel(name = "承运车辆") + private String carrierCar; + + /** 承运人电话 */ + @Excel(name = "承运人电话") + private String haulierPhone; + + /** 物流单号 */ + @Excel(name = "物流单号") + private String trackingNumber; + + /** 财务审核(0:未审核;1:审核通过;2:审核未通过) */ + @Excel(name = "财务审核", readConverterExp = "0=:未审核;1:审核通过;2:审核未通过") + private Integer financialAudit; + + /** 财务审核时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "财务审核时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date financialAuditTime; + + /** 财务审核建议 */ + @Excel(name = "财务审核建议") + private String financialAuditSuggest; + + /** + * 审核人 + */ + private String ratifyName; + + /** 领导审核(0:未审核;1:审核通过;2:审核未通过) */ + @Excel(name = "领导审核", readConverterExp = "0=:未审核;1:审核通过;2:审核未通过") + private Integer ratify; + + /** 领导审核时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "领导审核时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date ratifyTime; + + /** 运单状态(1:未申请,2:已发货) */ + @Excel(name = "运单状态", readConverterExp = "1=:未申请,2:已发货") + private Integer status; + + /** 申请人 */ + @Excel(name = "申请人") + private String proposer; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除;1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setFreightPayer(String freightPayer) + { + this.freightPayer = freightPayer; + } + + public String getFreightPayer() + { + return freightPayer; + } + public void setPurchaserUnitName(String purchaserUnitName) + { + this.purchaserUnitName = purchaserUnitName; + } + + public String getPurchaserUnitName() + { + return purchaserUnitName; + } + public void setConsignee(String consignee) + { + this.consignee = consignee; + } + + public String getConsignee() + { + return consignee; + } + public void setShippingAddress(String shippingAddress) + { + this.shippingAddress = shippingAddress; + } + + public String getShippingAddress() + { + return shippingAddress; + } + public void setPurchaserUnitPhone(String purchaserUnitPhone) + { + this.purchaserUnitPhone = purchaserUnitPhone; + } + + public String getPurchaserUnitPhone() + { + return purchaserUnitPhone; + } + public void setCarrierUnitName(String carrierUnitName) + { + this.carrierUnitName = carrierUnitName; + } + + public String getCarrierUnitName() + { + return carrierUnitName; + } + public void setHaulier(String haulier) + { + this.haulier = haulier; + } + + public String getHaulier() + { + return haulier; + } + + public String getTrackingNumber() { + return trackingNumber; + } + + public void setTrackingNumber(String trackingNumber) { + this.trackingNumber = trackingNumber; + } + + public void setCarrierCar(String carrierCar) + { + this.carrierCar = carrierCar; + } + + public String getCarrierCar() + { + return carrierCar; + } + public void setHaulierPhone(String haulierPhone) + { + this.haulierPhone = haulierPhone; + } + + public String getHaulierPhone() + { + return haulierPhone; + } + public void setFinancialAudit(Integer financialAudit) + { + this.financialAudit = financialAudit; + } + + public Integer getFinancialAudit() + { + return financialAudit; + } + public void setFinancialAuditTime(Date financialAuditTime) + { + this.financialAuditTime = financialAuditTime; + } + + public Date getFinancialAuditTime() + { + return financialAuditTime; + } + + public String getFinancialAuditSuggest() { + return financialAuditSuggest; + } + + public void setFinancialAuditSuggest(String financialAuditSuggest) { + this.financialAuditSuggest = financialAuditSuggest; + } + + public String getRatifyName() { + return ratifyName; + } + + public void setRatifyName(String ratifyName) { + this.ratifyName = ratifyName; + } + + public void setRatify(Integer ratify) + { + this.ratify = ratify; + } + + public Integer getRatify() + { + return ratify; + } + public void setRatifyTime(Date ratifyTime) + { + this.ratifyTime = ratifyTime; + } + + public Date getRatifyTime() + { + return ratifyTime; + } + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + public String getProposer() { + return proposer; + } + + public void setProposer(String proposer) { + this.proposer = proposer; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "PwLetterOfAdvice [id=" + id + ", contractCode=" + contractCode + ", freightPayer=" + freightPayer + + ", purchaserUnitName=" + purchaserUnitName + ", consignee=" + consignee + ", shippingAddress=" + + shippingAddress + ", purchaserUnitPhone=" + purchaserUnitPhone + ", carrierUnitName=" + + carrierUnitName + ", haulier=" + haulier + ", carrierCar=" + carrierCar + ", haulierPhone=" + + haulierPhone + ", trackingNumber=" + trackingNumber + ", financialAudit=" + financialAudit + + ", financialAuditTime=" + financialAuditTime + ", financialAuditSuggest=" + financialAuditSuggest + + ", ratifyName=" + ratifyName + ", ratify=" + ratify + ", ratifyTime=" + ratifyTime + ", status=" + + status + ", proposer=" + proposer + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdviceDetails.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdviceDetails.java new file mode 100644 index 0000000..7efe3f1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdviceDetails.java @@ -0,0 +1,245 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品发货通知单详情对象 pw_letter_of_advice_details + * + * @author zhukangchao + * @date 2022-03-01 + */ +public class PwLetterOfAdviceDetails extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 发运单id */ +// @Excel(name = "发运单id") + private Long letterOfAdviceId; + + /** 执行单号 */ +// @Excel(name = "执行单号") + private String productionBillCode; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String productType; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 应发数量 */ +// @Excel(name = "应发数量") + private Long number; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String equipmentNumber; + + /** 已发数量 */ +// @Excel(name = "已发数量") + private Long sentNumber; + + /** 申请数量 */ + @Excel(name = "申请数量") + private Long applyNumber; + + /** 库存数量 */ +// @Excel(name = "库存数量") + private Long quantity; + + /** 备用字段1 */ + @Excel(name = "箱号") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除;1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public void setLetterOfAdviceId(Long letterOfAdviceId) + { + this.letterOfAdviceId = letterOfAdviceId; + } + + public Long getLetterOfAdviceId() + { + return letterOfAdviceId; + } + public void setProductionBillCode(String productionBillCode) + { + this.productionBillCode = productionBillCode; + } + + public String getProductionBillCode() + { + return productionBillCode; + } + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setEquipmentNumber(String equipmentNumber) + { + this.equipmentNumber = equipmentNumber; + } + + public String getEquipmentNumber() + { + return equipmentNumber; + } + public void setSentNumber(Long sentNumber) + { + this.sentNumber = sentNumber; + } + + public Long getSentNumber() + { + return sentNumber; + } + public void setApplyNumber(Long applyNumber) + { + this.applyNumber = applyNumber; + } + + public Long getApplyNumber() + { + return applyNumber; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("letterOfAdviceId", getLetterOfAdviceId()) + .append("productionBillCode", getProductionBillCode()) + .append("productType", getProductType()) + .append("number", getNumber()) + .append("equipmentNumber", getEquipmentNumber()) + .append("sentNumber", getSentNumber()) + .append("applyNumber", getApplyNumber()) + .append("quantity", getQuantity()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdviceProduct.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdviceProduct.java new file mode 100644 index 0000000..35c4782 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwLetterOfAdviceProduct.java @@ -0,0 +1,207 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品发货通知单关联对象 pw_letter_of_advice_product + * + * @author zhukangchao + * @date 2021-11-10 + */ +public class PwLetterOfAdviceProduct extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 发运单id */ + @Excel(name = "发运单id") + private Long letterOfAdviceId; + + /** 执行单号 */ + @Excel(name = "执行单号") + private String productionBillCode; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String productType; + + /** 应发数量 */ + @Excel(name = "应发数量") + private Long number; + + /** 已申请数量 */ + @Excel(name = "申请数量") + private Long applyNumber; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String equipmentNumber; + + /** 已发数量 */ + @Excel(name = "已发数量") + private Long sentNumber; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除;1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setLetterOfAdviceId(Long letterOfAdviceId) + { + this.letterOfAdviceId = letterOfAdviceId; + } + + public Long getLetterOfAdviceId() + { + return letterOfAdviceId; + } + public void setProductionBillCode(String productionBillCode) + { + this.productionBillCode = productionBillCode; + } + + public String getProductionBillCode() + { + return productionBillCode; + } + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setEquipmentNumber(String equipmentNumber) + { + this.equipmentNumber = equipmentNumber; + } + + public String getEquipmentNumber() + { + return equipmentNumber; + } + public void setSentNumber(Long sentNumber) + { + this.sentNumber = sentNumber; + } + + public Long getSentNumber() + { + return sentNumber; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public Long getApplyNumber() { + return applyNumber; + } + + public void setApplyNumber(Long applyNumber) { + this.applyNumber = applyNumber; + } + + @Override + public String toString() { + return "PwLetterOfAdviceProduct [id=" + id + ", letterOfAdviceId=" + letterOfAdviceId + ", productionBillCode=" + + productionBillCode + ", productType=" + productType + ", number=" + number + ", applyNumber=" + + applyNumber + ", quantity=" + quantity + ", equipmentNumber=" + equipmentNumber + ", sentNumber=" + + sentNumber + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwMakeDocuments.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwMakeDocuments.java new file mode 100644 index 0000000..53e87c8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwMakeDocuments.java @@ -0,0 +1,269 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 库存制作单对象 pw_make_documents + * + * @author zhukangchao + * @date 2020-11-11 + */ +public class PwMakeDocuments extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 编号 */ + @Excel(name = "编号") + private String code; + + /** 单据名称 */ + @Excel(name = "单据名称") + private String name; + + /** 说明 */ +// @Excel(name = "说明") + private String declares; + + /** 下单日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date date; + + /** 制单人 */ + @Excel(name = "制单人") + private String prepared; + + /** 审批人 */ + @Excel(name = "审批人") + private String approver; + + /** 是否审批(0:未通过,1:已通过) */ + @Excel(name = "是否审批", readConverterExp = "0=:未通过,1:已通过") + private Integer pass; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 隐藏标记 */ + @Excel(name = "隐藏标记") + private int hid; + + /** 是否超时 */ + @Excel(name = "是否超时") + private String overtime; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** 编制 */ + private String userName; + + /** 制单日期 */ + private String prepareDate; + + /** 详情信息 */ + private List pwMakeDocumentsDetail; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public String getDeclares() { + return declares; + } + + public void setDeclares(String declares) { + this.declares = declares; + } + + public void setDate(Date date) + { + this.date = date; + } + + public Date getDate() + { + return date; + } + public void setPrepared(String prepared) + { + this.prepared = prepared; + } + + public String getPrepared() + { + return prepared; + } + public void setApprover(String approver) + { + this.approver = approver; + } + + public String getApprover() + { + return approver; + } + public void setPass(Integer pass) + { + this.pass = pass; + } + + public Integer getPass() + { + return pass; + } + + public String getOvertime() { + return overtime; + } + + public void setOvertime(String overtime) { + this.overtime = overtime; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public int getHid() { + return hid; + } + + public void setHid(int hid) { + this.hid = hid; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPrepareDate() { + return prepareDate; + } + + public void setPrepareDate(String prepareDate) { + this.prepareDate = prepareDate; + } + + public List getPwMakeDocumentsDetail() { + return pwMakeDocumentsDetail; + } + + public void setPwMakeDocumentsDetail(List pwMakeDocumentsDetail) { + this.pwMakeDocumentsDetail = pwMakeDocumentsDetail; + } + + @Override + public String toString() { + return "PwMakeDocuments [id=" + id + ", code=" + code + ", name=" + name + ", declares=" + declares + ", date=" + + date + ", prepared=" + prepared + ", approver=" + approver + ", pass=" + pass + ", status=" + status + + ", hid=" + hid + ", overtime=" + overtime + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", userName=" + + userName + ", prepareDate=" + prepareDate + ", pwMakeDocumentsDetail=" + pwMakeDocumentsDetail + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwMakeDocumentsDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwMakeDocumentsDetail.java new file mode 100644 index 0000000..d9363fd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwMakeDocumentsDetail.java @@ -0,0 +1,925 @@ +package com.ruoyi.project.management.domain; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 库存制作单明细对象 pw_make_documents_detail + * + * @author zhukangchao + * @date 2020-11-11 + */ +public class PwMakeDocumentsDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 序号 */ +// @Excel(name = "序号") + private String num; + + /** 物料id */ + private Long materialId; + + /** 库存制作单编号 */ + @Excel(name = "令号") + private String makeDocumentsCode; + + private Long[] ids; + + /** 单据名称*/ + private String billsName; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材质 */ + @Excel(name = "材质") + private String materialType; + + /** 数量 */ + @Excel(name = "投产数量") + private Long quantity; + + /** 申请领料数量 */ + @Excel(name = "申请领料数量") + private Long shenQingLingLiaoNumber; + + /** 已发料数量 */ + @Excel(name = "已发料数量") + private Long yiFaLiaoNumber; + + /** 本序数量 */ + @Excel(name = "本序数量") + private Long benXuNumber; + + /** 未完成数量 */ + @Excel(name = "未完成数量") + private Long weiWanChengNumber; + + /** 申请交检数量 */ + @Excel(name = "申请交检数量") + private Long shenQingJiaoJianNumber; + + /** 已检验数量 */ + @Excel(name = "已检验数量") + private Long yiJianYanNumber; + + /** 待质检数量 */ + @Excel(name = "待质检数量") + private Long weiZhiJianNumber; + + /** 已入库数量 */ + @Excel(name = "已入库数量") + private Long wanChengNumber; + + /** 待入库数量 */ + @Excel(name = "待入库数量") + private Long weiRuKuNumber; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long inventoryDetailNumber; + + /** 库存可用数量 */ +// @Excel(name = "库存可用数量") + private Long usableQuantity; + + /** 入库状态(0:未入库,1:已申请,2:已入库) */ + private String inventoryStatus; + + /** 工序名称 */ +// @Excel(name = "工序名称") + private String processName; + + /** 工序名称集合 */ +// @Excel(name = "工序名称") + private String[] processNames; + + /** 加工部门 */ + @Excel(name = "加工部门") + private String departmentName; + + /** 是否入库 */ + @Excel(name = "是否入库") + private String godownEntry; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 上级id */ +// @Excel(name = "上级id") + private Long superiorId; + + /** 父级图号 */ +// @Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 父级名称 */ +// @Excel(name = "父级名称") + private String parentLevelName; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + //申请入库数量 + private Long number; + + //单价 + private Double unitPrice; + + //子集集合 + private List children; + + //申领数量 + private Long lingliaoNumber; + + /** 供应商名称 */ +// @Excel(name = "供应商名称") + private String preferentialOriginName; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料规格 */ + @Excel(name = "材料图号") + private String materialsSpecification; + + /** 下料尺寸 */ + private String measure; + + /** 下料规格 */ + @Excel(name = "下料规格") + private String specification; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 成品数量 */ + private Long finished; + + /** + * 领料数量 + */ + private Long receiveNumber; + + /** 材料采购日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date materialsDate; + + /** + * 序描述 + */ + @Excel(name = "序描述") + private String xuDescribe; + + /** + * 工期描述 + */ + private String dateDescribe; + + //序工时 + private Double xuTime; + + /** 下料尺寸长度 */ + private Long len; + /** 下料尺寸宽度 */ + private Long wid; + + /** + * 第二套材料信息 + * @param id + */ + /** 物料id */ + private Long materialIdTwo; + + /** 材料名称 */ + private String materialsNameTwo; + + /** 材料规格 */ + private String materialsSpecificationTwo; + + /** 下料尺寸 */ + private String measureTwo; + + /** 下料尺寸长度 */ + private Long lenTwo; + + /** 下料尺寸宽度 */ + private Long widTwo; + + /** 下料规格 */ + private String specificationTwo; + + /** 毛坯数量 */ + private Long workblankTwo; + + /** 成品数量 */ + private Long finishedTwo; + + /** 编制人员(打印用) */ +// @Excel(name = "加工部门") + private String userName; + + /** 日期 */ +// @Excel(name = "加工部门") + private String date; + + /** 备用2 */ + private String remarksTwo; + + /** + * 外协合同标记 + */ + private String outsourceContratDetailId; + + private String qrCodeUrl; + + private String qrCodeUrlTwo; + + private String qrCodeUrlThree; + + private String qrCodeUrlFour; + + private String qrCodeUrlFive; + + private String qrCodeUrlSix; + + //板材的重量 + private Double weight; + + private List makeList; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public void setMakeDocumentsCode(String makeDocumentsCode) + { + this.makeDocumentsCode = makeDocumentsCode; + } + + public String getMakeDocumentsCode() + { + return makeDocumentsCode; + } + + public String getBillsName() { + return billsName; + } + + public void setBillsName(String billsName) { + this.billsName = billsName; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterialType(String materialType) + { + this.materialType = materialType; + } + + public String getMaterialType() + { + return materialType; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + + public Long getUsableQuantity() { + return usableQuantity; + } + + public void setUsableQuantity(Long usableQuantity) { + this.usableQuantity = usableQuantity; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String[] getProcessNames() { + return processNames; + } + + public void setProcessNames(String[] processNames) { + this.processNames = processNames; + } + + public String getGodownEntry() { + return godownEntry; + } + + public void setGodownEntry(String godownEntry) { + this.godownEntry = godownEntry; + } + + public Date getCompletionDate() { + return completionDate; + } + + public void setCompletionDate(Date completionDate) { + this.completionDate = completionDate; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public Long getSuperiorId() { + return superiorId; + } + + public void setSuperiorId(Long superiorId) { + this.superiorId = superiorId; + } + + public String getParentLevelFigureNumber() { + return parentLevelFigureNumber; + } + + public void setParentLevelFigureNumber(String parentLevelFigureNumber) { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelName() { + return parentLevelName; + } + + public void setParentLevelName(String parentLevelName) { + this.parentLevelName = parentLevelName; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public Double getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(Double unitPrice) { + this.unitPrice = unitPrice; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public Long getLingliaoNumber() { + return lingliaoNumber; + } + + public void setLingliaoNumber(Long lingliaoNumber) { + this.lingliaoNumber = lingliaoNumber; + } + + public String getPreferentialOriginName() { + return preferentialOriginName; + } + + public void setPreferentialOriginName(String preferentialOriginName) { + this.preferentialOriginName = preferentialOriginName; + } + + public String getMaterialsName() { + return materialsName; + } + + public void setMaterialsName(String materialsName) { + this.materialsName = materialsName; + } + + public String getMaterialsSpecification() { + return materialsSpecification; + } + + public void setMaterialsSpecification(String materialsSpecification) { + this.materialsSpecification = materialsSpecification; + } + + public String getMeasure() { + return measure; + } + + public void setMeasure(String measure) { + this.measure = measure; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public Long getWorkblank() { + return workblank; + } + + public void setWorkblank(Long workblank) { + this.workblank = workblank; + } + + public Long getFinished() { + return finished; + } + + public void setFinished(Long finished) { + this.finished = finished; + } + + public Long getLen() { + return len; + } + + public void setLen(Long len) { + this.len = len; + } + + public Long getWid() { + return wid; + } + + public void setWid(Long wid) { + this.wid = wid; + } + + public Long getMaterialIdTwo() { + return materialIdTwo; + } + + public void setMaterialIdTwo(Long materialIdTwo) { + this.materialIdTwo = materialIdTwo; + } + + public String getMaterialsNameTwo() { + return materialsNameTwo; + } + + public void setMaterialsNameTwo(String materialsNameTwo) { + this.materialsNameTwo = materialsNameTwo; + } + + public String getMaterialsSpecificationTwo() { + return materialsSpecificationTwo; + } + + public void setMaterialsSpecificationTwo(String materialsSpecificationTwo) { + this.materialsSpecificationTwo = materialsSpecificationTwo; + } + + public String getMeasureTwo() { + return measureTwo; + } + + public void setMeasureTwo(String measureTwo) { + this.measureTwo = measureTwo; + } + + public Long getLenTwo() { + return lenTwo; + } + + public void setLenTwo(Long lenTwo) { + this.lenTwo = lenTwo; + } + + public Long getWidTwo() { + return widTwo; + } + + public void setWidTwo(Long widTwo) { + this.widTwo = widTwo; + } + + public String getSpecificationTwo() { + return specificationTwo; + } + + public void setSpecificationTwo(String specificationTwo) { + this.specificationTwo = specificationTwo; + } + + public Long getWorkblankTwo() { + return workblankTwo; + } + + public void setWorkblankTwo(Long workblankTwo) { + this.workblankTwo = workblankTwo; + } + + public Long getFinishedTwo() { + return finishedTwo; + } + + public void setFinishedTwo(Long finishedTwo) { + this.finishedTwo = finishedTwo; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public Double getXuTime() { + return xuTime; + } + + public void setXuTime(Double xuTime) { + this.xuTime = xuTime; + } + + public Long getReceiveNumber() { + return receiveNumber; + } + + public void setReceiveNumber(Long receiveNumber) { + this.receiveNumber = receiveNumber; + } + public String getXuDescribe() { + return xuDescribe; + } + + public void setXuDescribe(String xuDescribe) { + this.xuDescribe = xuDescribe; + } + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public Long getWanChengNumber() { + return wanChengNumber; + } + + public void setWanChengNumber(Long wanChengNumber) { + this.wanChengNumber = wanChengNumber; + } + + public Long getWeiWanChengNumber() { + return weiWanChengNumber; + } + + public void setWeiWanChengNumber(Long weiWanChengNumber) { + this.weiWanChengNumber = weiWanChengNumber; + } + + public Long getInventoryDetailNumber() { + return inventoryDetailNumber; + } + + public void setInventoryDetailNumber(Long inventoryDetailNumber) { + this.inventoryDetailNumber = inventoryDetailNumber; + } + + public String getRemarksTwo() { + return remarksTwo; + } + + public void setRemarksTwo(String remarksTwo) { + this.remarksTwo = remarksTwo; + } + + public String getOutsourceContratDetailId() { + return outsourceContratDetailId; + } + + public void setOutsourceContratDetailId(String outsourceContratDetailId) { + this.outsourceContratDetailId = outsourceContratDetailId; + } + + public String getQrCodeUrl() { + return qrCodeUrl; + } + + public void setQrCodeUrl(String qrCodeUrl) { + this.qrCodeUrl = qrCodeUrl; + } + + public String getQrCodeUrlTwo() { + return qrCodeUrlTwo; + } + + public void setQrCodeUrlTwo(String qrCodeUrlTwo) { + this.qrCodeUrlTwo = qrCodeUrlTwo; + } + + public String getQrCodeUrlThree() { + return qrCodeUrlThree; + } + + public void setQrCodeUrlThree(String qrCodeUrlThree) { + this.qrCodeUrlThree = qrCodeUrlThree; + } + + public String getQrCodeUrlFour() { + return qrCodeUrlFour; + } + + public void setQrCodeUrlFour(String qrCodeUrlFour) { + this.qrCodeUrlFour = qrCodeUrlFour; + } + + public String getQrCodeUrlFive() { + return qrCodeUrlFive; + } + + public void setQrCodeUrlFive(String qrCodeUrlFive) { + this.qrCodeUrlFive = qrCodeUrlFive; + } + + public String getQrCodeUrlSix() { + return qrCodeUrlSix; + } + + public void setQrCodeUrlSix(String qrCodeUrlSix) { + this.qrCodeUrlSix = qrCodeUrlSix; + } + + public Date getMaterialsDate() { + return materialsDate; + } + + public void setMaterialsDate(Date materialsDate) { + this.materialsDate = materialsDate; + } + + public String getDateDescribe() { + return dateDescribe; + } + + public void setDateDescribe(String dateDescribe) { + this.dateDescribe = dateDescribe; + } + + public Double getWeight() { + return weight; + } + + public void setWeight(Double weight) { + this.weight = weight; + } + + public Long getBenXuNumber() { + return benXuNumber; + } + + public void setBenXuNumber(Long benXuNumber) { + this.benXuNumber = benXuNumber; + } + + public Long getWeiZhiJianNumber() { + return weiZhiJianNumber; + } + + public void setWeiZhiJianNumber(Long weiZhiJianNumber) { + this.weiZhiJianNumber = weiZhiJianNumber; + } + + public Long getWeiRuKuNumber() { + return weiRuKuNumber; + } + + public void setWeiRuKuNumber(Long weiRuKuNumber) { + this.weiRuKuNumber = weiRuKuNumber; + } + + public Long getShenQingLingLiaoNumber() { + return shenQingLingLiaoNumber; + } + + public void setShenQingLingLiaoNumber(Long shenQingLingLiaoNumber) { + this.shenQingLingLiaoNumber = shenQingLingLiaoNumber; + } + + public Long getYiFaLiaoNumber() { + return yiFaLiaoNumber; + } + + public void setYiFaLiaoNumber(Long yiFaLiaoNumber) { + this.yiFaLiaoNumber = yiFaLiaoNumber; + } + + public Long getShenQingJiaoJianNumber() { + return shenQingJiaoJianNumber; + } + + public void setShenQingJiaoJianNumber(Long shenQingJiaoJianNumber) { + this.shenQingJiaoJianNumber = shenQingJiaoJianNumber; + } + + public Long getYiJianYanNumber() { + return yiJianYanNumber; + } + + public void setYiJianYanNumber(Long yiJianYanNumber) { + this.yiJianYanNumber = yiJianYanNumber; + } + public List getMakeList() { + return makeList; + } + + public void setMakeList(List makeList) { + this.makeList = makeList; + } + + @Override + public String toString() { + return "PwMakeDocumentsDetail [id=" + id + ", num=" + num + ", materialId=" + materialId + + ", makeDocumentsCode=" + makeDocumentsCode + ", ids=" + Arrays.toString(ids) + ", billsName=" + + billsName + ", name=" + name + ", figureNumber=" + figureNumber + ", materialType=" + materialType + + ", quantity=" + quantity + ", shenQingLingLiaoNumber=" + shenQingLingLiaoNumber + ", yiFaLiaoNumber=" + + yiFaLiaoNumber + ", benXuNumber=" + benXuNumber + ", weiWanChengNumber=" + weiWanChengNumber + + ", shenQingJiaoJianNumber=" + shenQingJiaoJianNumber + ", yiJianYanNumber=" + yiJianYanNumber + + ", weiZhiJianNumber=" + weiZhiJianNumber + ", wanChengNumber=" + wanChengNumber + ", weiRuKuNumber=" + + weiRuKuNumber + ", inventoryDetailNumber=" + inventoryDetailNumber + ", usableQuantity=" + + usableQuantity + ", inventoryStatus=" + inventoryStatus + ", processName=" + processName + + ", processNames=" + Arrays.toString(processNames) + ", departmentName=" + departmentName + + ", godownEntry=" + godownEntry + ", completionDate=" + completionDate + ", superiorId=" + superiorId + + ", parentLevelFigureNumber=" + parentLevelFigureNumber + ", parentLevelName=" + parentLevelName + + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", number=" + number + ", unitPrice=" + + unitPrice + ", children=" + children + ", lingliaoNumber=" + lingliaoNumber + + ", preferentialOriginName=" + preferentialOriginName + ", materialsName=" + materialsName + + ", materialsSpecification=" + materialsSpecification + ", measure=" + measure + ", specification=" + + specification + ", workblank=" + workblank + ", finished=" + finished + ", receiveNumber=" + + receiveNumber + ", materialsDate=" + materialsDate + ", xuDescribe=" + xuDescribe + ", dateDescribe=" + + dateDescribe + ", xuTime=" + xuTime + ", len=" + len + ", wid=" + wid + ", materialIdTwo=" + + materialIdTwo + ", materialsNameTwo=" + materialsNameTwo + ", materialsSpecificationTwo=" + + materialsSpecificationTwo + ", measureTwo=" + measureTwo + ", lenTwo=" + lenTwo + ", widTwo=" + widTwo + + ", specificationTwo=" + specificationTwo + ", workblankTwo=" + workblankTwo + ", finishedTwo=" + + finishedTwo + ", userName=" + userName + ", date=" + date + ", remarksTwo=" + remarksTwo + + ", outsourceContratDetailId=" + outsourceContratDetailId + ", qrCodeUrl=" + qrCodeUrl + + ", qrCodeUrlTwo=" + qrCodeUrlTwo + ", qrCodeUrlThree=" + qrCodeUrlThree + ", qrCodeUrlFour=" + + qrCodeUrlFour + ", qrCodeUrlFive=" + qrCodeUrlFive + ", qrCodeUrlSix=" + qrCodeUrlSix + ", weight=" + + weight + ", makeList=" + makeList + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialBorrowInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialBorrowInfo.java new file mode 100644 index 0000000..392a0e2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialBorrowInfo.java @@ -0,0 +1,236 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 借用信息对象 pw_material_borrow_info + * + * @author zhukangchao + * @date 2023-11-24 + */ +public class PwMaterialBorrowInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料id */ + private Long mateialId; + + /** 令号 */ + @Excel(name = "令号") + private String code; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 借用原因 */ + @Excel(name = "借用原因") + private String cause; + + /** 审批人 */ + @Excel(name = "审批人") + private String approver; + + /** 审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date approverTime; + + /** 状态(未申请、已申请、已出库、已归还) */ + @Excel(name = "状态(未申请、已申请、已出库、已归还)") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 库存数量 */ + private Long quantity; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getMateialId() { + return mateialId; + } + + public void setMateialId(Long mateialId) { + this.mateialId = mateialId; + } + + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setCause(String cause) + { + this.cause = cause; + } + + public String getCause() + { + return cause; + } + public void setApprover(String approver) + { + this.approver = approver; + } + + public String getApprover() + { + return approver; + } + public void setApproverTime(Date approverTime) + { + this.approverTime = approverTime; + } + + public Date getApproverTime() + { + return approverTime; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "PwMaterialBorrowInfo [id=" + id + ", mateialId=" + mateialId + ", code=" + code + ", name=" + name + + ", figureNumber=" + figureNumber + ", number=" + number + ", cause=" + cause + ", approver=" + + approver + ", approverTime=" + approverTime + ", status=" + status + ", remarks=" + remarks + + ", quantity=" + quantity + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + + sparedThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialMaterials.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialMaterials.java new file mode 100644 index 0000000..627212b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialMaterials.java @@ -0,0 +1,402 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料原材料对象 pw_material_materials + * + * @author zhukangchao + * @date 2022-12-14 + */ +public class PwMaterialMaterials extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 令号 */ + @Excel(name = "令号") + private String code; + + /** 物料id */ + @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料图号 */ + @Excel(name = "物料图号") + private String materialFigureNumber; + + /** 原材料 */ + @Excel(name = "原材料") + private Long materialsId; + + /** 原材料名称 */ + @Excel(name = "原材料名称") + private String materialsName; + + /** 原材料图号 */ + @Excel(name = "原材料图号") + private String materialsFigureNumber; + + /** 原材料单位 */ + @Excel(name = "原材料单位") + private String materialsUnit; + + /** 下料尺寸 */ + @Excel(name = "下料尺寸") + private String measure; + + /** 长度 */ + @Excel(name = "长度") + private String len; + + /** 宽度 */ + @Excel(name = "宽度") + private String wid; + + /** 下料规格 */ + @Excel(name = "下料规格") + private String specification; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 成品数量 */ + @Excel(name = "成品数量") + private Long finished; + + /** 领料数量 */ + @Excel(name = "领料数量") + private Long quantity; + + /** 剩余尺寸 */ + @Excel(name = "剩余尺寸") + private Long remainderLen; + + /** 剩余数量 */ + @Excel(name = "剩余数量") + private Long remainderNumber; + + /** 是否是残料 */ + @Excel(name = "是否是残料") + private String defectiveMaterial; + + /** 剩余尺寸2 */ + @Excel(name = "剩余尺寸2") + private Long remainderLenTwo; + + /** 剩余数量2 */ + @Excel(name = "剩余数量2") + private Long remainderNumberTwo; + + /** 是否是残料2 */ + @Excel(name = "是否是残料2") + private String defectiveMaterialTwo; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setMaterialFigureNumber(String materialFigureNumber) + { + this.materialFigureNumber = materialFigureNumber; + } + + public String getMaterialFigureNumber() + { + return materialFigureNumber; + } + public void setMaterialsId(Long materialsId) + { + this.materialsId = materialsId; + } + + public Long getMaterialsId() + { + return materialsId; + } + public void setMaterialsName(String materialsName) + { + this.materialsName = materialsName; + } + + public String getMaterialsName() + { + return materialsName; + } + public void setMaterialsFigureNumber(String materialsFigureNumber) + { + this.materialsFigureNumber = materialsFigureNumber; + } + + public String getMaterialsFigureNumber() + { + return materialsFigureNumber; + } + public void setMaterialsUnit(String materialsUnit) + { + this.materialsUnit = materialsUnit; + } + + public String getMaterialsUnit() + { + return materialsUnit; + } + public void setMeasure(String measure) + { + this.measure = measure; + } + + public String getMeasure() + { + return measure; + } + public void setLen(String len) + { + this.len = len; + } + + public String getLen() + { + return len; + } + public void setWid(String wid) + { + this.wid = wid; + } + + public String getWid() + { + return wid; + } + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + public void setWorkblank(Long workblank) + { + this.workblank = workblank; + } + + public Long getWorkblank() + { + return workblank; + } + public void setFinished(Long finished) + { + this.finished = finished; + } + + public Long getFinished() + { + return finished; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public void setRemainderLen(Long remainderLen) + { + this.remainderLen = remainderLen; + } + + public Long getRemainderLen() + { + return remainderLen; + } + public void setRemainderNumber(Long remainderNumber) + { + this.remainderNumber = remainderNumber; + } + + public Long getRemainderNumber() + { + return remainderNumber; + } + public void setDefectiveMaterial(String defectiveMaterial) + { + this.defectiveMaterial = defectiveMaterial; + } + + public String getDefectiveMaterial() + { + return defectiveMaterial; + } + public void setRemainderLenTwo(Long remainderLenTwo) + { + this.remainderLenTwo = remainderLenTwo; + } + + public Long getRemainderLenTwo() + { + return remainderLenTwo; + } + public void setRemainderNumberTwo(Long remainderNumberTwo) + { + this.remainderNumberTwo = remainderNumberTwo; + } + + public Long getRemainderNumberTwo() + { + return remainderNumberTwo; + } + public void setDefectiveMaterialTwo(String defectiveMaterialTwo) + { + this.defectiveMaterialTwo = defectiveMaterialTwo; + } + + public String getDefectiveMaterialTwo() + { + return defectiveMaterialTwo; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("materialFigureNumber", getMaterialFigureNumber()) + .append("materialsId", getMaterialsId()) + .append("materialsName", getMaterialsName()) + .append("materialsFigureNumber", getMaterialsFigureNumber()) + .append("materialsUnit", getMaterialsUnit()) + .append("measure", getMeasure()) + .append("len", getLen()) + .append("wid", getWid()) + .append("specification", getSpecification()) + .append("workblank", getWorkblank()) + .append("finished", getFinished()) + .append("quantity", getQuantity()) + .append("remainderLen", getRemainderLen()) + .append("remainderNumber", getRemainderNumber()) + .append("defectiveMaterial", getDefectiveMaterial()) + .append("remainderLenTwo", getRemainderLenTwo()) + .append("remainderNumberTwo", getRemainderNumberTwo()) + .append("defectiveMaterialTwo", getDefectiveMaterialTwo()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialParams.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialParams.java new file mode 100644 index 0000000..9b84b6c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialParams.java @@ -0,0 +1,79 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料参数对象 pw_material_params + * + * @author chenyongjiang + * @date 2024-04-16 + */ +public class PwMaterialParams extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 参数值 */ + @Excel(name = "参数值") + private String paramValue; + + /** 参数名称 */ + @Excel(name = "参数名称") + private String paramName; + + /** 参数标识 */ + @Excel(name = "参数标识") + private String paramFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setParamValue(String paramValue) + { + this.paramValue = paramValue; + } + + public String getParamValue() + { + return paramValue; + } + public void setParamName(String paramName) + { + this.paramName = paramName; + } + + public String getParamName() + { + return paramName; + } + public void setParamFlag(String paramFlag) + { + this.paramFlag = paramFlag; + } + + public String getParamFlag() + { + return paramFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("paramValue", getParamValue()) + .append("paramName", getParamName()) + .append("paramFlag", getParamFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialPrice.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialPrice.java new file mode 100644 index 0000000..440e603 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialPrice.java @@ -0,0 +1,164 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料价格校验对象 pw_material_price + * + * @author zhukangchao + * @date 2023-06-23 + */ +public class PwMaterialPrice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单价 */ + @Excel(name = "单价") + private Double unitPrice; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("type", getType()) + .append("unitPrice", getUnitPrice()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialProcess.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialProcess.java new file mode 100644 index 0000000..9c6a3c8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwMaterialProcess.java @@ -0,0 +1,288 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料工序信息对象 pw_material_process + * + * @author zhukangchao + * @date 2022-07-28 + */ +public class PwMaterialProcess extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 序号 */ + @Excel(name = "序号") + private Long serialNumber; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String process; + + /** 派工部门 */ + @Excel(name = "派工部门") + private String dispatchingDept; + + /** 是否入库 */ + @Excel(name = "是否入库") + private String storage; + + /** 材料id */ + @Excel(name = "材料id") + private Long materialsId; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料规格 */ + @Excel(name = "材料规格") + private String materialsSpecification; + + /** 下料长度 */ + @Excel(name = "下料长度") + private Double len; + + /** 下料宽度 */ + @Excel(name = "下料宽度") + private Double wid; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 序工时 */ + @Excel(name = "序工时") + private Double serialTime; + + /** 删除标记 */ + private Integer delFlag; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setSerialNumber(Long serialNumber) + { + this.serialNumber = serialNumber; + } + + public Long getSerialNumber() + { + return serialNumber; + } + public void setProcess(String process) + { + this.process = process; + } + + public String getProcess() + { + return process; + } + public void setDispatchingDept(String dispatchingDept) + { + this.dispatchingDept = dispatchingDept; + } + + public String getDispatchingDept() + { + return dispatchingDept; + } + public void setStorage(String storage) + { + this.storage = storage; + } + + public String getStorage() + { + return storage; + } + + public Long getMaterialsId() { + return materialsId; + } + + public void setMaterialsId(Long materialsId) { + this.materialsId = materialsId; + } + + public void setMaterialsName(String materialsName) + { + this.materialsName = materialsName; + } + + public String getMaterialsName() + { + return materialsName; + } + public void setMaterialsSpecification(String materialsSpecification) + { + this.materialsSpecification = materialsSpecification; + } + + public String getMaterialsSpecification() + { + return materialsSpecification; + } + public void setLen(Double len) + { + this.len = len; + } + + public Double getLen() + { + return len; + } + public void setWid(Double wid) + { + this.wid = wid; + } + + public Double getWid() + { + return wid; + } + public void setWorkblank(Long workblank) + { + this.workblank = workblank; + } + + public Long getWorkblank() + { + return workblank; + } + public void setSerialTime(Double serialTime) + { + this.serialTime = serialTime; + } + + public Double getSerialTime() + { + return serialTime; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("serialNumber", getSerialNumber()) + .append("process", getProcess()) + .append("dispatchingDept", getDispatchingDept()) + .append("storage", getStorage()) + .append("materialsName", getMaterialsName()) + .append("materialsSpecification", getMaterialsSpecification()) + .append("len", getLen()) + .append("wid", getWid()) + .append("workblank", getWorkblank()) + .append("serialTime", getSerialTime()) + .append("delFlag", getDelFlag()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwModulePart.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwModulePart.java new file mode 100644 index 0000000..045fb0e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwModulePart.java @@ -0,0 +1,206 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 零部件关联对象 pw_module_part + * + * @author zhukangchao + * @date 2022-11-28 + */ +public class PwModulePart extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 部件物料id */ + @Excel(name = "部件物料id") + private Long materialId; + + /** 部件名称 */ + @Excel(name = "部件名称") + private String materialName; + + /** 部件图号 */ + @Excel(name = "部件图号") + private String figureNumber; + + /** 零件id */ + @Excel(name = "零件id") + private Long partId; + + /** 零件名称 */ + @Excel(name = "零件名称") + private String name; + + /** 零件图号 */ + @Excel(name = "零件图号") + private String specification; + + /** 单件数量 */ + @Excel(name = "单件数量") + private Long number; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setPartId(Long partId) + { + this.partId = partId; + } + + public Long getPartId() + { + return partId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("partId", getPartId()) + .append("name", getName()) + .append("specification", getSpecification()) + .append("number", getNumber()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwOtherCorrespondent.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwOtherCorrespondent.java new file mode 100644 index 0000000..758f4d7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwOtherCorrespondent.java @@ -0,0 +1,284 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 其它往来单位信息对象 pw_other_correspondent + * + * @author zhukangchao + * @date 2023-12-04 + */ +public class PwOtherCorrespondent extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String name; + + /** 联系电话 */ + @Excel(name = "联系电话") + private String phone; + + /** 地址 */ + @Excel(name = "地址") + private String address; + + /** 负责人 */ + @Excel(name = "负责人") + private String contacts; + + /** 传真 */ + @Excel(name = "传真") + private String fax; + + /** 邮编 */ + @Excel(name = "邮编") + private String zipCode; + + /** 邮件地址 */ + @Excel(name = "邮件地址") + private String emailAddress; + + /** 账号 */ + @Excel(name = "账号") + private String accountNumber; + + /** 税号 */ + @Excel(name = "税号") + private String dutyParagraph; + + /** 开户行地址 */ + @Excel(name = "开户行地址") + private String bankAddress; + + public String getBankAddress() { + return bankAddress; + } + + public void setBankAddress(String bankAddress) { + this.bankAddress = bankAddress; + } + + /** 开户行 */ + @Excel(name = "开户行") + private String openingBank; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + /** 联行号 */ + @Excel(name = "联行号") + private String interbankNumber; + + /** 外汇标记 */ + @Excel(name = "外汇标记") + private String swiftCode; + + public String getInterbankNumber() { + return interbankNumber; + } + + public void setInterbankNumber(String interbankNumber) { + this.interbankNumber = interbankNumber; + } + + public String getSwiftCode() { + return swiftCode; + } + + public void setSwiftCode(String swiftCode) { + this.swiftCode = swiftCode; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPhone() + { + return phone; + } + public void setAddress(String address) + { + this.address = address; + } + + public String getAddress() + { + return address; + } + public void setContacts(String contacts) + { + this.contacts = contacts; + } + + public String getContacts() + { + return contacts; + } + public void setFax(String fax) + { + this.fax = fax; + } + + public String getFax() + { + return fax; + } + public void setZipCode(String zipCode) + { + this.zipCode = zipCode; + } + + public String getZipCode() + { + return zipCode; + } + public void setEmailAddress(String emailAddress) + { + this.emailAddress = emailAddress; + } + + public String getEmailAddress() + { + return emailAddress; + } + public void setAccountNumber(String accountNumber) + { + this.accountNumber = accountNumber; + } + + public String getAccountNumber() + { + return accountNumber; + } + public void setDutyParagraph(String dutyParagraph) + { + this.dutyParagraph = dutyParagraph; + } + + public String getDutyParagraph() + { + return dutyParagraph; + } + public void setOpeningBank(String openingBank) + { + this.openingBank = openingBank; + } + + public String getOpeningBank() + { + return openingBank; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("phone", getPhone()) + .append("address", getAddress()) + .append("contacts", getContacts()) + .append("fax", getFax()) + .append("zipCode", getZipCode()) + .append("emailAddress", getEmailAddress()) + .append("accountNumber", getAccountNumber()) + .append("dutyParagraph", getDutyParagraph()) + .append("openingBank", getOpeningBank()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourceContract.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourceContract.java new file mode 100644 index 0000000..a536ecc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourceContract.java @@ -0,0 +1,483 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 外协合同信息对象 pw_outsource_contract + * + * @author zhukangchao + * @date 2023-04-09 + */ +public class PwOutsourceContract extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** id集合 */ + private Long[] ids; + + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractCode; + + /** 执行单令号 */ + @Excel(name = "执行单令号") + private String productionCode; + + /** 供应商 */ + @Excel(name = "供应商") + private String supplier; + + /** 总价(小写) */ + @Excel(name = "总价(小写)") + private Double totalPricesSmall; + + /** 总价(大写) */ + @Excel(name = "总价(大写)") + private String totalPricesBig; + + /** 税率 */ + @Excel(name = "税率") + private Long taxRate; + + /** 交货方式 */ + @Excel(name = "交货方式") + private String deliveryType; + + /** 运费支付方 */ + @Excel(name = "运费支付方") + private String payer; + + /** 交货地点 */ + @Excel(name = "交货地点") + private String deliveryAddress; + + /** 货款支付方式 */ + @Excel(name = "货款支付方式") + private String modeOfPayment; + + /** 签订日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "签订日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date signDate; + + /** 合同状态 */ + @Excel(name = "合同状态") + private String contractStatus; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 扣款金额 */ + @Excel(name = "扣款金额") + private Double withhold; + + /** 是否开票 */ + @Excel(name = "是否开票") + private String billingInformation; + + /** 发票id */ + @Excel(name = "发票id") + private Long invoice; + + /** 未开票金额 */ + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + private BigDecimal invoiceAmount; + + /** 未收款金额 */ + private BigDecimal notProceedsAmount; + + /** 已收款金额 */ + private BigDecimal proceedsAmount; + + /** 结算比例 */ + private BigDecimal settlementRatio; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadership; + + /** 总经理审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 令号 */ +// @Excel(name = "令号") + private String code; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + //付款金额 + private Double paymentAmount; + + //物流费用 + private Double money; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + //合同路径 + @Excel(name = "合同路径") + private String contractPath; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setSupplier(String supplier) + { + this.supplier = supplier; + } + + public String getSupplier() + { + return supplier; + } + public void setTotalPricesSmall(Double totalPricesSmall) + { + this.totalPricesSmall = totalPricesSmall; + } + + public Double getTotalPricesSmall() + { + return totalPricesSmall; + } + public void setTotalPricesBig(String totalPricesBig) + { + this.totalPricesBig = totalPricesBig; + } + + public String getTotalPricesBig() + { + return totalPricesBig; + } + public void setTaxRate(Long taxRate) + { + this.taxRate = taxRate; + } + + public Long getTaxRate() + { + return taxRate; + } + public void setDeliveryType(String deliveryType) + { + this.deliveryType = deliveryType; + } + + public String getDeliveryType() + { + return deliveryType; + } + public void setPayer(String payer) + { + this.payer = payer; + } + + public String getPayer() + { + return payer; + } + public void setDeliveryAddress(String deliveryAddress) + { + this.deliveryAddress = deliveryAddress; + } + + public String getDeliveryAddress() + { + return deliveryAddress; + } + public void setModeOfPayment(String modeOfPayment) + { + this.modeOfPayment = modeOfPayment; + } + + public String getModeOfPayment() + { + return modeOfPayment; + } + public void setSignDate(Date signDate) + { + this.signDate = signDate; + } + + public Date getSignDate() + { + return signDate; + } + public void setContractStatus(String contractStatus) + { + this.contractStatus = contractStatus; + } + + public String getContractStatus() + { + return contractStatus; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setWithhold(Double withhold) + { + this.withhold = withhold; + } + + public Double getWithhold() + { + return withhold; + } + public void setBillingInformation(String billingInformation) + { + this.billingInformation = billingInformation; + } + + public String getBillingInformation() + { + return billingInformation; + } + public void setInvoice(Long invoice) + { + this.invoice = invoice; + } + + public Long getInvoice() + { + return invoice; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + public String getContractPath() { + return contractPath; + } + + public void setContractPath(String contractPath) { + this.contractPath = contractPath; + } + + @Override + public String toString() { + return "PwOutsourceContract [id=" + id + ", ids=" + Arrays.toString(ids) + ", contractCode=" + contractCode + + ", productionCode=" + productionCode + ", supplier=" + supplier + ", totalPricesSmall=" + + totalPricesSmall + ", totalPricesBig=" + totalPricesBig + ", taxRate=" + taxRate + ", deliveryType=" + + deliveryType + ", payer=" + payer + ", deliveryAddress=" + deliveryAddress + ", modeOfPayment=" + + modeOfPayment + ", signDate=" + signDate + ", contractStatus=" + contractStatus + ", remarks=" + + remarks + ", withhold=" + withhold + ", billingInformation=" + billingInformation + ", invoice=" + + invoice + ", notInvoiceAmount=" + notInvoiceAmount + ", invoiceAmount=" + invoiceAmount + + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + proceedsAmount + + ", settlementRatio=" + settlementRatio + ", leadership=" + leadership + ", leadershipTime=" + + leadershipTime + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + + sparedThree + ", sparedFour=" + sparedFour + ", code=" + code + ", materialName=" + materialName + + ", paymentAmount=" + paymentAmount + ", money=" + money + ", unitName=" + unitName + ", payWay=" + + payWay + ", contractPath=" + contractPath + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourceContractDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourceContractDetail.java new file mode 100644 index 0000000..8423a2b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourceContractDetail.java @@ -0,0 +1,318 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 外协合同详情信息对象 pw_outsource_contract_detail + * + * @author zhukangchao + * @date 2023-04-09 + */ +public class PwOutsourceContractDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @Excel(name = "id") + private Long id; + + /** 序号 */ + private Long num; + + /** 外协合同id */ +// @Excel(name = "外协合同id") + private Long outsourceContractId; + + /** 执行单令号 */ + @Excel(name = "执行单令号") + private String code; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 单价 */ + @Excel(name = "单价") + private Double unitPrice; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 完成状态 */ + @Excel(name = "完成状态") + private String accomplishStatus; + + /** 完成数量 */ +// @Excel(name = "完成数量") + private Long accomplishQuantity; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** + * 申请质检的数量 + * @param id + */ + private Long number; + + /** + * 申请领料数量 + */ + private Long lingliaoNumber; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public Long getNum() { + return num; + } + + public void setNum(Long num) { + this.num = num; + } + + public void setOutsourceContractId(Long outsourceContractId) + { + this.outsourceContractId = outsourceContractId; + } + + public Long getOutsourceContractId() + { + return outsourceContractId; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setUnitPrice(Double unitPrice) + { + this.unitPrice = unitPrice; + } + + public Double getUnitPrice() + { + return unitPrice; + } + public void setTotalPrices(Double totalPrices) + { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() + { + return totalPrices; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setAccomplishStatus(String accomplishStatus) + { + this.accomplishStatus = accomplishStatus; + } + + public String getAccomplishStatus() + { + return accomplishStatus; + } + public void setAccomplishQuantity(Long accomplishQuantity) + { + this.accomplishQuantity = accomplishQuantity; + } + + public Long getAccomplishQuantity() + { + return accomplishQuantity; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public Long getLingliaoNumber() { + return lingliaoNumber; + } + + public void setLingliaoNumber(Long lingliaoNumber) { + this.lingliaoNumber = lingliaoNumber; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("num", getNum()) + .append("createTime", getCreateTime()) + .append("outsourceContractId", getOutsourceContractId()) + .append("code", getCode()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("unit", getUnit()) + .append("quantity", getQuantity()) + .append("unitPrice", getUnitPrice()) + .append("totalPrices", getTotalPrices()) + .append("remarks", getRemarks()) + .append("accomplishStatus", getAccomplishStatus()) + .append("accomplishQuantity", getAccomplishQuantity()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("number", getNumber()) + .append("lingliaoNumber", getLingliaoNumber()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourcingContract.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourcingContract.java new file mode 100644 index 0000000..a1758ef --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourcingContract.java @@ -0,0 +1,406 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 外协合同对象 pw_outsourcing_contract + * + * @author zhukangchao + * @date 2020-07-01 + */ +public class PwOutsourcingContract extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 甲方 */ + @Excel(name = "甲方") + private String purchaserName; + + /** 乙方 */ + @Excel(name = "乙方") + private String sellerName; + + /** 外协合同编号 */ + @Excel(name = "外协合同编号") + private String contractCode; + + /** 合同签订时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同签订时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date appointTime; + + /** 总价格(小写) */ + @Excel(name = "总价格", readConverterExp = "小=写") + private Long totalPricesSmall; + + /** 总价格(大写) */ + @Excel(name = "总价格", readConverterExp = "大=写") + private String totalPricesBig; + + /** 完工日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完工日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date completeTime; + + /** 合同协议 */ + @Excel(name = "合同协议") + private String agreement; + + /** 甲方电话 */ + @Excel(name = "甲方电话") + private String purchaserPhone; + + /** 甲方传真 */ + @Excel(name = "甲方传真") + private String purchaserFax; + + /** 甲方地址 */ + @Excel(name = "甲方地址") + private String purchaserAddress; + + /** 甲方账号 */ + @Excel(name = "甲方账号") + private String purchaserAccount; + + /** 甲方税号 */ + @Excel(name = "甲方税号") + private String purchaserDutyParagraph; + + /** 甲方开户行 */ + @Excel(name = "甲方开户行") + private String purchaserBankOfDeposit; + + /** 乙方电话 */ + @Excel(name = "乙方电话") + private String sellerPhone; + + /** 乙方传真 */ + @Excel(name = "乙方传真") + private String sellerFax; + + /** 乙方地址 */ + @Excel(name = "乙方地址") + private String sellerAddress; + + /** 乙方账号 */ + @Excel(name = "乙方账号") + private String sellerAccount; + + /** 乙方税号 */ + @Excel(name = "乙方税号") + private String sellerDuctParagraph; + + /** 乙方开户行 */ + @Excel(name = "乙方开户行") + private String sellerBankOfDeposit; + + /** 合同状态(1:未完成,2:已完成) */ + @Excel(name = "合同状态", readConverterExp = "1=:未完成,2:已完成") + private Integer contractStatus; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setPurchaserName(String purchaserName) + { + this.purchaserName = purchaserName; + } + + public String getPurchaserName() + { + return purchaserName; + } + public void setSellerName(String sellerName) + { + this.sellerName = sellerName; + } + + public String getSellerName() + { + return sellerName; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setAppointTime(Date appointTime) + { + this.appointTime = appointTime; + } + + public Date getAppointTime() + { + return appointTime; + } + public void setTotalPricesSmall(Long totalPricesSmall) + { + this.totalPricesSmall = totalPricesSmall; + } + + public Long getTotalPricesSmall() + { + return totalPricesSmall; + } + public void setTotalPricesBig(String totalPricesBig) + { + this.totalPricesBig = totalPricesBig; + } + + public String getTotalPricesBig() + { + return totalPricesBig; + } + public void setCompleteTime(Date completeTime) + { + this.completeTime = completeTime; + } + + public Date getCompleteTime() + { + return completeTime; + } + public void setAgreement(String agreement) + { + this.agreement = agreement; + } + + public String getAgreement() + { + return agreement; + } + public void setPurchaserPhone(String purchaserPhone) + { + this.purchaserPhone = purchaserPhone; + } + + public String getPurchaserPhone() + { + return purchaserPhone; + } + public void setPurchaserFax(String purchaserFax) + { + this.purchaserFax = purchaserFax; + } + + public String getPurchaserFax() + { + return purchaserFax; + } + public void setPurchaserAddress(String purchaserAddress) + { + this.purchaserAddress = purchaserAddress; + } + + public String getPurchaserAddress() + { + return purchaserAddress; + } + public void setPurchaserAccount(String purchaserAccount) + { + this.purchaserAccount = purchaserAccount; + } + + public String getPurchaserAccount() + { + return purchaserAccount; + } + public void setPurchaserDutyParagraph(String purchaserDutyParagraph) + { + this.purchaserDutyParagraph = purchaserDutyParagraph; + } + + public String getPurchaserDutyParagraph() + { + return purchaserDutyParagraph; + } + public void setPurchaserBankOfDeposit(String purchaserBankOfDeposit) + { + this.purchaserBankOfDeposit = purchaserBankOfDeposit; + } + + public String getPurchaserBankOfDeposit() + { + return purchaserBankOfDeposit; + } + public void setSellerPhone(String sellerPhone) + { + this.sellerPhone = sellerPhone; + } + + public String getSellerPhone() + { + return sellerPhone; + } + public void setSellerFax(String sellerFax) + { + this.sellerFax = sellerFax; + } + + public String getSellerFax() + { + return sellerFax; + } + public void setSellerAddress(String sellerAddress) + { + this.sellerAddress = sellerAddress; + } + + public String getSellerAddress() + { + return sellerAddress; + } + public void setSellerAccount(String sellerAccount) + { + this.sellerAccount = sellerAccount; + } + + public String getSellerAccount() + { + return sellerAccount; + } + public void setSellerDuctParagraph(String sellerDuctParagraph) + { + this.sellerDuctParagraph = sellerDuctParagraph; + } + + public String getSellerDuctParagraph() + { + return sellerDuctParagraph; + } + public void setSellerBankOfDeposit(String sellerBankOfDeposit) + { + this.sellerBankOfDeposit = sellerBankOfDeposit; + } + + public String getSellerBankOfDeposit() + { + return sellerBankOfDeposit; + } + public void setContractStatus(Integer contractStatus) + { + this.contractStatus = contractStatus; + } + + public Integer getContractStatus() + { + return contractStatus; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("purchaserName", getPurchaserName()) + .append("sellerName", getSellerName()) + .append("contractCode", getContractCode()) + .append("appointTime", getAppointTime()) + .append("totalPricesSmall", getTotalPricesSmall()) + .append("totalPricesBig", getTotalPricesBig()) + .append("completeTime", getCompleteTime()) + .append("agreement", getAgreement()) + .append("remark", getRemark()) + .append("purchaserPhone", getPurchaserPhone()) + .append("purchaserFax", getPurchaserFax()) + .append("purchaserAddress", getPurchaserAddress()) + .append("purchaserAccount", getPurchaserAccount()) + .append("purchaserDutyParagraph", getPurchaserDutyParagraph()) + .append("purchaserBankOfDeposit", getPurchaserBankOfDeposit()) + .append("sellerPhone", getSellerPhone()) + .append("sellerFax", getSellerFax()) + .append("sellerAddress", getSellerAddress()) + .append("sellerAccount", getSellerAccount()) + .append("sellerDuctParagraph", getSellerDuctParagraph()) + .append("sellerBankOfDeposit", getSellerBankOfDeposit()) + .append("contractStatus", getContractStatus()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourcingContractMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourcingContractMaterial.java new file mode 100644 index 0000000..6a24282 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwOutsourcingContractMaterial.java @@ -0,0 +1,234 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 零件和外协合同关联对象 pw_outsourcing_contract_material + * + * @author zhukangchao + * @date 2020-07-01 + */ +public class PwOutsourcingContractMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 外协合同id */ + @Excel(name = "外协合同id") + private Long outsourcingContractId; + + /** 零件id */ + @Excel(name = "零件id") + private Long materialId; + + /** 零件名称 */ + @Excel(name = "零件名称") + private String materialName; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 合计 */ + @Excel(name = "合计") + private Long summation; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOutsourcingContractId(Long outsourcingContractId) + { + this.outsourcingContractId = outsourcingContractId; + } + + public Long getOutsourcingContractId() + { + return outsourcingContractId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setSummation(Long summation) + { + this.summation = summation; + } + + public Long getSummation() + { + return summation; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("outsourcingContractId", getOutsourcingContractId()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("typeName", getTypeName()) + .append("figureNumber", getFigureNumber()) + .append("unit", getUnit()) + .append("quantity", getQuantity()) + .append("univalence", getUnivalence()) + .append("summation", getSummation()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwPankuRecord.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwPankuRecord.java new file mode 100644 index 0000000..89ddb8d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwPankuRecord.java @@ -0,0 +1,192 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 盘库记录对象 pw_panku_record + * + * @author zhukangchao + * @date 2020-08-27 + */ +public class PwPankuRecord extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String typeName; + + /** 仓库名称 */ +// @Excel(name = "仓库名称") + private String warehouseName; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 盘库数量 */ + @Excel(name = "盘库数量") + private Long practicalQuantity; + + /** 备用字段1 */ + @Excel(name = "盘库人") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "盈亏数量") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setWarehouseName(String warehouseName) + { + this.warehouseName = warehouseName; + } + + public String getWarehouseName() + { + return warehouseName; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setPracticalQuantity(Long practicalQuantity) + { + this.practicalQuantity = practicalQuantity; + } + + public Long getPracticalQuantity() + { + return practicalQuantity; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("typeName", getTypeName()) + .append("warehouseName", getWarehouseName()) + .append("unit", getUnit()) + .append("quantity", getQuantity()) + .append("practicalQuantity", getPracticalQuantity()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwPredictPurchase.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwPredictPurchase.java new file mode 100644 index 0000000..57c786f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwPredictPurchase.java @@ -0,0 +1,500 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预采购单对象 pw_predict_purchase + * + * @author zhukangchao + * @date 2023-02-02 + */ +public class PwPredictPurchase extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** id集合 */ + private Long[] ids; + + /** 令号 */ + @Excel(name = "令号") + private String code; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 用途 */ + @Excel(name = "用途") + private String purpose; + + /** 总价(元) */ + @Excel(name = "总价(元)") + private Double totalPrices; + + /** 需求日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date demandDate; + + /** 审核人 */ + @Excel(name = "审核人") + private String proposer; + + /** 申请人 */ + @Excel(name = "申请人") + private String auditor; + + /** 申请单状态(1:未审核,2:已审核,3:已完成) */ + @Excel(name = "申请单状态", readConverterExp = "1=:未审核,2:已审核,3:已完成") + private String status; + + /** 未开票金额 */ + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + private BigDecimal invoiceAmount; + + /** 未收款金额 */ + private BigDecimal notProceedsAmount; + + /** 已收款金额 */ + private BigDecimal proceedsAmount; + + /** 结算比例 */ + private BigDecimal settlementRatio; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private String sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private String sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private String delFlag; + + /** 供应商 */ + @Excel(name = "供应商") + private String sellerName; + + /** 合同签订时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同签订时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date appointTime; + + /** 总价(大写) */ + @Excel(name = "总价(大写)") + private String bigTotalPrices; + + /** 合同协议 */ + @Excel(name = "合同协议") + private String agreement; + + /** 合同状态(1:进行中,2:已完成) */ + @Excel(name = "合同状态", readConverterExp = "1=:进行中,2:已完成") + private Long contractStatus; + + /** 税率 */ + @Excel(name = "税率") + private int taxRate; + + /** 交货方式 */ + @Excel(name = "交货方式") + private String deliveryType; + + /** 运费支付方 */ + @Excel(name = "运费支付方") + private String payer; + + /** 货款支付方式 */ + @Excel(name = "货款支付方式") + private String modeOfPayment; + + /** 扣款金额 */ + @Excel(name = "扣款金额") + private Double withhold; + + /** 是否开票 */ + @Excel(name = "是否开票") + private String billingInformation; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadership; + + /** 总经理审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + //付款金额 + private Double paymentAmount; + + //物流费用 + private Double money; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + //合同路径 + private String contractPath; + + public String getContractPath() { + return contractPath; + } + + public void setContractPath(String contractPath) { + this.contractPath = contractPath; + } + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setPurpose(String purpose) + { + this.purpose = purpose; + } + + public String getPurpose() + { + return purpose; + } + public void setTotalPrices(Double totalPrices) + { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() + { + return totalPrices; + } + public void setDemandDate(Date demandDate) + { + this.demandDate = demandDate; + } + + public Date getDemandDate() + { + return demandDate; + } + public void setProposer(String proposer) + { + this.proposer = proposer; + } + + public String getProposer() + { + return proposer; + } + public void setAuditor(String auditor) + { + this.auditor = auditor; + } + + public String getAuditor() + { + return auditor; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(String sparedThree) + { + this.sparedThree = sparedThree; + } + + public String getSparedThree() + { + return sparedThree; + } + public void setSparedFour(String sparedFour) + { + this.sparedFour = sparedFour; + } + + public String getSparedFour() + { + return sparedFour; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + public String getSellerName() { + return sellerName; + } + + public void setSellerName(String sellerName) { + this.sellerName = sellerName; + } + + public Date getAppointTime() { + return appointTime; + } + + public void setAppointTime(Date appointTime) { + this.appointTime = appointTime; + } + + public String getBigTotalPrices() { + return bigTotalPrices; + } + + public void setBigTotalPrices(String bigTotalPrices) { + this.bigTotalPrices = bigTotalPrices; + } + + public String getAgreement() { + return agreement; + } + + public void setAgreement(String agreement) { + this.agreement = agreement; + } + + public Long getContractStatus() { + return contractStatus; + } + + public void setContractStatus(Long contractStatus) { + this.contractStatus = contractStatus; + } + + public int getTaxRate() { + return taxRate; + } + + public void setTaxRate(int taxRate) { + this.taxRate = taxRate; + } + + public String getDeliveryType() { + return deliveryType; + } + + public void setDeliveryType(String deliveryType) { + this.deliveryType = deliveryType; + } + + public String getPayer() { + return payer; + } + + public void setPayer(String payer) { + this.payer = payer; + } + + public String getModeOfPayment() { + return modeOfPayment; + } + + public void setModeOfPayment(String modeOfPayment) { + this.modeOfPayment = modeOfPayment; + } + + public Double getWithhold() { + return withhold; + } + + public void setWithhold(Double withhold) { + this.withhold = withhold; + } + + public String getBillingInformation() { + return billingInformation; + } + + public void setBillingInformation(String billingInformation) { + this.billingInformation = billingInformation; + } + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + @Override + public String toString() { + return "PwPredictPurchase [id=" + id + ", ids=" + Arrays.toString(ids) + ", code=" + code + ", name=" + name + + ", purpose=" + purpose + ", totalPrices=" + totalPrices + ", demandDate=" + demandDate + ", proposer=" + + proposer + ", auditor=" + auditor + ", status=" + status + ", notInvoiceAmount=" + notInvoiceAmount + + ", invoiceAmount=" + invoiceAmount + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + + proceedsAmount + ", settlementRatio=" + settlementRatio + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + + ", sellerName=" + sellerName + ", appointTime=" + appointTime + ", bigTotalPrices=" + bigTotalPrices + + ", agreement=" + agreement + ", contractStatus=" + contractStatus + ", taxRate=" + taxRate + + ", deliveryType=" + deliveryType + ", payer=" + payer + ", modeOfPayment=" + modeOfPayment + + ", withhold=" + withhold + ", billingInformation=" + billingInformation + ", leadership=" + leadership + + ", leadershipTime=" + leadershipTime + ", paymentAmount=" + paymentAmount + ", money=" + money + + ", unitName=" + unitName + ", payWay=" + payWay + ", contractPath=" + contractPath + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwPredictPurchaseTwo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwPredictPurchaseTwo.java new file mode 100644 index 0000000..02e200d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwPredictPurchaseTwo.java @@ -0,0 +1,354 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预采购单详情对象 pw_predict_purchase_two + * + * @author zhukangchao + * @date 2023-02-02 + */ +public class PwPredictPurchaseTwo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + private int num; + + /** 预购单id */ +// @Excel(name = "预购单id") + private Long predictPurchaseId; + + /** 物料id */ +// @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String materialCode; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 单位 */ + @Excel(name = "单位") + private String unitOfMeasurementName; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalprice; + + /** 参考重量(Kg) */ +// @Excel(name = "参考重量", readConverterExp = "K=g") + private Double referenceNumber; + + /** 实际重量(Kg) */ +// @Excel(name = "实际重量", readConverterExp = "K=g") + private Double practicalNumber; + + /** 供应商 */ + @Excel(name = "供应商") + private String preferentialOriginName; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + /** + * 申请入库数量 + */ + private Long quantity; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private String sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private String sparedFour; + + /** 删除标记(0未删除,1已删除) */ + private String delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setPredictPurchaseId(Long predictPurchaseId) + { + this.predictPurchaseId = predictPurchaseId; + } + + public Long getPredictPurchaseId() + { + return predictPurchaseId; + } + public void setMaterialId(Long materialId) + { + this.materialId = materialId; + } + + public Long getMaterialId() + { + return materialId; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnitOfMeasurementName(String unitOfMeasurementName) + { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public String getUnitOfMeasurementName() + { + return unitOfMeasurementName; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setTotalprice(Double totalprice) + { + this.totalprice = totalprice; + } + + public Double getTotalprice() + { + return totalprice; + } + public void setReferenceNumber(Double referenceNumber) + { + this.referenceNumber = referenceNumber; + } + + public Double getReferenceNumber() + { + return referenceNumber; + } + public void setPracticalNumber(Double practicalNumber) + { + this.practicalNumber = practicalNumber; + } + + public Double getPracticalNumber() + { + return practicalNumber; + } + public void setPreferentialOriginName(String preferentialOriginName) + { + this.preferentialOriginName = preferentialOriginName; + } + + public String getPreferentialOriginName() + { + return preferentialOriginName; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(String sparedThree) + { + this.sparedThree = sparedThree; + } + + public String getSparedThree() + { + return sparedThree; + } + public void setSparedFour(String sparedFour) + { + this.sparedFour = sparedFour; + } + + public String getSparedFour() + { + return sparedFour; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("predictPurchaseId", getPredictPurchaseId()) + .append("materialId", getMaterialId()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("unitOfMeasurementName", getUnitOfMeasurementName()) + .append("number", getNumber()) + .append("univalence", getUnivalence()) + .append("totalprice", getTotalprice()) + .append("referenceNumber", getReferenceNumber()) + .append("practicalNumber", getPracticalNumber()) + .append("preferentialOriginName", getPreferentialOriginName()) + .append("inventoryStatus", getInventoryStatus()) + .append("quantity", getQuantity()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProcess.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProcess.java new file mode 100644 index 0000000..339041a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProcess.java @@ -0,0 +1,166 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 工序对象 pw_process + * + * @author zhukangchao + * @date 2021-10-11 + */ +public class PwProcess extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 序号 */ + private Long serial; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 是否检验 */ + @Excel(name = "是否检验") + private String checkout; + + /** 是否入库 */ + @Excel(name = "是否入库") + private String godownEntry; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getSerial() { + return serial; + } + + public void setSerial(Long serial) { + this.serial = serial; + } + + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + + public String getCheckout() { + return checkout; + } + + public void setCheckout(String checkout) { + this.checkout = checkout; + } + + public String getGodownEntry() { + return godownEntry; + } + + public void setGodownEntry(String godownEntry) { + this.godownEntry = godownEntry; + } + + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "PwProcess [id=" + id + ", serial=" + serial + ", processName=" + processName + ", checkout=" + checkout + + ", godownEntry=" + godownEntry + ", remarks=" + remarks + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProcessOrDept.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProcessOrDept.java new file mode 100644 index 0000000..bc48f66 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProcessOrDept.java @@ -0,0 +1,131 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 工序部门对象 pw_process_or_dept + * + * @author chenyongjiang + * @date 2024-05-23 + */ +public class PwProcessOrDept extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 部门名称 */ + @Excel(name = "部门名称") + private String deptName; + + /** 属性标识0自制,1委外 */ + @Excel(name = "属性标识0自制,1委外") + private String attrFlag; + + /** 简写 */ + @Excel(name = "简写") + private String abbreviation; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + @Excel(name = "序时") + private int xuTime; + + @Excel(name = "序时单位") + private String timeUnit; + + public int getXuTime() { + return xuTime; + } + + public void setXuTime(int xuTime) { + this.xuTime = xuTime; + } + + public String getTimeUnit() { + return timeUnit; + } + + public void setTimeUnit(String timeUnit) { + this.timeUnit = timeUnit; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setAttrFlag(String attrFlag) + { + this.attrFlag = attrFlag; + } + + public String getAttrFlag() + { + return attrFlag; + } + public void setAbbreviation(String abbreviation) + { + this.abbreviation = abbreviation; + } + + public String getAbbreviation() + { + return abbreviation; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("processName", getProcessName()) + .append("deptName", getDeptName()) + .append("attrFlag", getAttrFlag()) + .append("abbreviation", getAbbreviation()) + .append("remarks", getRemarks()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProduct.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProduct.java new file mode 100644 index 0000000..4553143 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProduct.java @@ -0,0 +1,164 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品对象 pw_product + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PwProduct extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String name; + + /** 使用领域 */ + @Excel(name = "使用领域") + private Integer fieldOfEmployment; + + /** 是否为标准产品(0:非标,1:标准) */ + @Excel(name = "是否为标准产品", readConverterExp = "0=:非标,1:标准") + private Integer standard; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFieldOfEmployment(Integer fieldOfEmployment) + { + this.fieldOfEmployment = fieldOfEmployment; + } + + public Integer getFieldOfEmployment() + { + return fieldOfEmployment; + } + public void setStandard(Integer standard) + { + this.standard = standard; + } + + public Integer getStandard() + { + return standard; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("fieldOfEmployment", getFieldOfEmployment()) + .append("standard", getStandard()) + .append("picture", getPicture()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductBillBom.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductBillBom.java new file mode 100644 index 0000000..52e5259 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductBillBom.java @@ -0,0 +1,290 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 生产执行单bom对象 pw_product_bill_bom + * + * @author zhukangchao + * @date 2020-08-17 + */ +public class PwProductBillBom extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 零件名称 */ + @Excel(name = "零件名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long singleQuantity; + + /** 材料类型 */ + @Excel(name = "材料类型") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long totalQuantity; + + /** 上级图号 */ + @Excel(name = "上级图号") + private String parentLevelFigureNumber; + + /** 上级名称 */ + @Excel(name = "上级名称") + private String parentLevelName; + + /** 产品id */ + @Excel(name = "产品id") + private Long productionBillProductId; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long inventory; + + /** 预数量 */ + @Excel(name = "预数量") + private Long prestoreQuantity; + + /** 锁定数量 */ + @Excel(name = "锁定数量") + private Long lockQuantity; + + /** 可用数量 */ + @Excel(name = "可用数量") + private Long availableQuantity; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setSingleQuantity(Long singleQuantity) + { + this.singleQuantity = singleQuantity; + } + + public Long getSingleQuantity() + { + return singleQuantity; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setTotalQuantity(Long totalQuantity) + { + this.totalQuantity = totalQuantity; + } + + public Long getTotalQuantity() + { + return totalQuantity; + } + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setProductionBillProductId(Long productionBillProductId) + { + this.productionBillProductId = productionBillProductId; + } + + public Long getProductionBillProductId() + { + return productionBillProductId; + } + public void setInventory(Long inventory) + { + this.inventory = inventory; + } + + public Long getInventory() + { + return inventory; + } + public void setPrestoreQuantity(Long prestoreQuantity) + { + this.prestoreQuantity = prestoreQuantity; + } + + public Long getPrestoreQuantity() + { + return prestoreQuantity; + } + public void setLockQuantity(Long lockQuantity) + { + this.lockQuantity = lockQuantity; + } + + public Long getLockQuantity() + { + return lockQuantity; + } + public void setAvailableQuantity(Long availableQuantity) + { + this.availableQuantity = availableQuantity; + } + + public Long getAvailableQuantity() + { + return availableQuantity; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("singleQuantity", getSingleQuantity()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("totalQuantity", getTotalQuantity()) + .append("parentLevelFigureNumber", getParentLevelFigureNumber()) + .append("parentLevelName", getParentLevelName()) + .append("productionBillProductId", getProductionBillProductId()) + .append("inventory", getInventory()) + .append("prestoreQuantity", getPrestoreQuantity()) + .append("lockQuantity", getLockQuantity()) + .append("availableQuantity", getAvailableQuantity()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductDetail.java new file mode 100644 index 0000000..361fe3c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductDetail.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 金蝶生产详情对象 pw_product_detail + * + * @author chenyongjiang + * @date 2024-04-23 + */ +public class PwProductDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productCode; + + /** 产品图号 */ + @Excel(name = "产品图号") + private String figureNumber; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductCode(String productCode) + { + this.productCode = productCode; + } + + public String getProductCode() + { + return productCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("productCode", getProductCode()) + .append("figureNumber", getFigureNumber()) + .append("productName", getProductName()) + .append("unit", getUnit()) + .append("number", getNumber()) + .append("remarks", getRemarks()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductQuotation.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductQuotation.java new file mode 100644 index 0000000..dbfd8ff --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductQuotation.java @@ -0,0 +1,289 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品报价单关联对象 pw_product_quotation + * + * @author zhukangchao + * @date 2020-07-07 + */ +public class PwProductQuotation extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 报价单id */ + @Excel(name = "报价单id") + private Long quotationId; + + /** + * 产品类型 + */ + @Excel(name = "产品类型") + private String productType; + + /** + * 型号类型 + */ + @Excel(name = "型号类型") + private String productClassify; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 型号id */ + @Excel(name = "型号id") + private Long typeId; + + /** 型号名称 */ + @Excel(name = "型号名称") + private String typeName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 是否花键 */ + @Excel(name = "是否花键") + private String spline; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 合计 */ + @Excel(name = "合计") + private Double total; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setQuotationId(Long quotationId) + { + this.quotationId = quotationId; + } + + public Long getQuotationId() + { + return quotationId; + } + + public String getProductType() { + return productType; + } + + public void setProductType(String productType) { + this.productType = productType; + } + + public String getProductClassify() { + return productClassify; + } + + public void setProductClassify(String productClassify) { + this.productClassify = productClassify; + } + + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setTypeId(Long typeId) + { + this.typeId = typeId; + } + + public Long getTypeId() + { + return typeId; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + + public String getSpline() { + return spline; + } + + public void setSpline(String spline) { + this.spline = spline; + } + + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setTotal(Double total) + { + this.total = total; + } + + public Double getTotal() + { + return total; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "PwProductQuotation [id=" + id + ", quotationId=" + quotationId + ", productType=" + productType + + ", productClassify=" + productClassify + ", productId=" + productId + ", productName=" + productName + + ", typeId=" + typeId + ", typeName=" + typeName + ", figureNumber=" + figureNumber + ", materialName=" + + materialName + ", unit=" + unit + ", spline=" + spline + ", number=" + number + ", univalence=" + + univalence + ", total=" + total + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBill.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBill.java new file mode 100644 index 0000000..5d2bbb9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBill.java @@ -0,0 +1,319 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 生产执行单对象 pw_production_bill + * + * @author zhukangchao + * @date 2020-07-21 + */ +public class PwProductionBill extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String code; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String purchaser; + + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractCode; + + /** 报价单编号 */ + @Excel(name = "合同编号") + private String pwQuotationCode; + + /** 增加说明 */ + @Excel(name = "增加说明") + private String illustrate; + + /** 运输方式(运输费用) */ + @Excel(name = "运输方式", readConverterExp = "运=输费用") + private String transportType; + + /** 发单日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "发单日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date billDate; + + /** 生产图路径 */ + private String productionImage; + + /** 审核状态id */ + @Excel(name = "审核状态id") + private Long statusId; + + /** 审核状态 */ + @Excel(name = "审核状态") + private String statusName; + + /** 完成状态 */ + @Excel(name = "完成状态") + private String status; + + /** 是否超时 */ +// @Excel(name = "是否超时") + private String overtime; + + /** + * 设计者 + */ + private String designer; + + /** + * 销售业务员 + */ + private String salesman; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + /** 是否有图 */ + private String sign; + private String commitFlag; + + public String getCommitFlag() { + return commitFlag; + } + + public void setCommitFlag(String commitFlag) { + this.commitFlag = commitFlag; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setProjectName(String projectName) + { + this.projectName = projectName; + } + + public String getProjectName() + { + return projectName; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + + public String getPwQuotationCode() { + return pwQuotationCode; + } + + public void setPwQuotationCode(String pwQuotationCode) { + this.pwQuotationCode = pwQuotationCode; + } + + public void setIllustrate(String illustrate) + { + this.illustrate = illustrate; + } + + public String getIllustrate() + { + return illustrate; + } + public void setTransportType(String transportType) + { + this.transportType = transportType; + } + + public String getTransportType() + { + return transportType; + } + public void setBillDate(Date billDate) + { + this.billDate = billDate; + } + + public Date getBillDate() + { + return billDate; + } + public String getProductionImage() { + return productionImage; + } + + public void setProductionImage(String productionImage) { + this.productionImage = productionImage; + } + + public void setStatusId(Long statusId) + { + this.statusId = statusId; + } + + public Long getStatusId() + { + return statusId; + } + public void setStatusName(String statusName) + { + this.statusName = statusName; + } + + public String getStatusName() + { + return statusName; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getOvertime() { + return overtime; + } + + public void setOvertime(String overtime) { + this.overtime = overtime; + } + + public String getDesigner() { + return designer; + } + + public void setDesigner(String designer) { + this.designer = designer; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + public String getPurchaser() { + return purchaser; + } + + public void setPurchaser(String purchaser) { + this.purchaser = purchaser; + } + + public String getSalesman() { + return salesman; + } + + public void setSalesman(String salesman) { + this.salesman = salesman; + } + + @Override + public String toString() { + return "PwProductionBill [id=" + id + ", code=" + code + ", projectName=" + projectName + ", purchaser=" + + purchaser + ", contractCode=" + contractCode + ", pwQuotationCode=" + pwQuotationCode + + ", illustrate=" + illustrate + ", transportType=" + transportType + ", billDate=" + billDate + + ", productionImage=" + productionImage + ", statusId=" + statusId + ", statusName=" + statusName + + ", status=" + status + ", overtime=" + overtime + ", designer=" + designer + ", salesman=" + salesman + + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", sign=" + sign + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillNew.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillNew.java new file mode 100644 index 0000000..0c46edf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillNew.java @@ -0,0 +1,64 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +public class PwProductionBillNew { + + //令号 + private String producitonorder; + //图纸文件保存路径 + private String destpath; + //发图时间 + private String releasedate; + //完成日期 + private String completedate; + //产品信息 + private List product; + + public String getProducitonorder() { + return producitonorder; + } + + public void setProducitonorder(String producitonorder) { + this.producitonorder = producitonorder; + } + + public String getDestpath() { + return destpath; + } + + public void setDestpath(String destpath) { + this.destpath = destpath; + } + + public String getReleasedate() { + return releasedate; + } + + public void setReleasedate(String releasedate) { + this.releasedate = releasedate; + } + + public String getCompletedate() { + return completedate; + } + + public void setCompletedate(String completedate) { + this.completedate = completedate; + } + + public List getProduct() { + return product; + } + + public void setProduct(List product) { + this.product = product; + } + + @Override + public String toString() { + return "PwProductionBillNew [producitonorder=" + producitonorder + ", destpath=" + destpath + ", releasedate=" + + releasedate + ", completedate=" + completedate + ", product=" + product + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillNonstandard.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillNonstandard.java new file mode 100644 index 0000000..4ebe728 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillNonstandard.java @@ -0,0 +1,317 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 产品非标生产执行单关联对象 pw_production_bill_nonstandard + * + * @author zhukangchao + * @date 2020-07-21 + */ +public class PwProductionBillNonstandard extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 产品型号id */ + @Excel(name = "产品型号id") + private Long productTypeId; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String productType; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 单台升降台所用部件数量 */ + @Excel(name = "单台升降台所用部件数量") + private Long oneQuantity; + + /** 升降台数量 */ + @Excel(name = "升降台数量") + private Long cageAssemblyQuantity; + + /** 台面规格 */ + @Excel(name = "台面规格") + private String mesaSpecifications; + + /** 台面面积(㎡) */ + @Excel(name = "台面面积", readConverterExp = "㎡=") + private Long mesaArea; + + /** 销齿链型号 */ + @Excel(name = "销齿链型号") + private String rigidChainType; + + /** 动载(Kg/㎡) */ + @Excel(name = "动载", readConverterExp = "动载(Kg/㎡)") + private Long dynamicLoad; + + /** 静载(Kg/㎡) */ + @Excel(name = "静载", readConverterExp = "K=g/㎡") + private Long deadLoad; + + /** 升降速度(mm/s) */ + @Excel(name = "升降速度", readConverterExp = "m=m/s") + private Long lifterSpeed; + + /** 升降行程(m) */ + @Excel(name = "升降行程", readConverterExp = "m=") + private Long lifterJourney; + + /** 电机功率(kW) */ + @Excel(name = "电机功率", readConverterExp = "k=W") + private Long motorPower; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setProductTypeId(Long productTypeId) + { + this.productTypeId = productTypeId; + } + + public Long getProductTypeId() + { + return productTypeId; + } + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setOneQuantity(Long oneQuantity) + { + this.oneQuantity = oneQuantity; + } + + public Long getOneQuantity() + { + return oneQuantity; + } + public void setCageAssemblyQuantity(Long cageAssemblyQuantity) + { + this.cageAssemblyQuantity = cageAssemblyQuantity; + } + + public Long getCageAssemblyQuantity() + { + return cageAssemblyQuantity; + } + public void setMesaSpecifications(String mesaSpecifications) + { + this.mesaSpecifications = mesaSpecifications; + } + + public String getMesaSpecifications() + { + return mesaSpecifications; + } + public void setMesaArea(Long mesaArea) + { + this.mesaArea = mesaArea; + } + + public Long getMesaArea() + { + return mesaArea; + } + public void setRigidChainType(String rigidChainType) + { + this.rigidChainType = rigidChainType; + } + + public String getRigidChainType() + { + return rigidChainType; + } + public void setDynamicLoad(Long dynamicLoad) + { + this.dynamicLoad = dynamicLoad; + } + + public Long getDynamicLoad() + { + return dynamicLoad; + } + public void setDeadLoad(Long deadLoad) + { + this.deadLoad = deadLoad; + } + + public Long getDeadLoad() + { + return deadLoad; + } + public void setLifterSpeed(Long lifterSpeed) + { + this.lifterSpeed = lifterSpeed; + } + + public Long getLifterSpeed() + { + return lifterSpeed; + } + public void setLifterJourney(Long lifterJourney) + { + this.lifterJourney = lifterJourney; + } + + public Long getLifterJourney() + { + return lifterJourney; + } + public void setMotorPower(Long motorPower) + { + this.motorPower = motorPower; + } + + public Long getMotorPower() + { + return motorPower; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("productTypeId", getProductTypeId()) + .append("productType", getProductType()) + .append("unit", getUnit()) + .append("oneQuantity", getOneQuantity()) + .append("cageAssemblyQuantity", getCageAssemblyQuantity()) + .append("mesaSpecifications", getMesaSpecifications()) + .append("mesaArea", getMesaArea()) + .append("rigidChainType", getRigidChainType()) + .append("dynamicLoad", getDynamicLoad()) + .append("deadLoad", getDeadLoad()) + .append("lifterSpeed", getLifterSpeed()) + .append("lifterJourney", getLifterJourney()) + .append("motorPower", getMotorPower()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillProduct.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillProduct.java new file mode 100644 index 0000000..4420a70 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionBillProduct.java @@ -0,0 +1,287 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 销齿链生产执行单关联对象 pw_production_bill_product + * + * @author zhukangchao + * @date 2020-07-21 + */ +public class PwProductionBillProduct extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产执行单id */ + @Excel(name = "生产执行单id") + private Long productionBillId; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 产品型号id */ + @Excel(name = "产品型号id") + private Long productTypeId; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String productType; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String equipmentCode; + + /** 完工日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完工日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date completeDate; + + /** 包装方式 */ + @Excel(name = "包装方式") + private String packType; + + /** 总装图 */ + @Excel(name = "总装图") + private String generalAssemblyDrawing; + + /** 生产图 */ + @Excel(name = "生产图") + private String productionDrawing; + + /** bom明细文件路径 */ + @Excel(name = "bom明细文件路径") + private String bomUrl; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + private Long shuliang; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionBillId(Long productionBillId) + { + this.productionBillId = productionBillId; + } + + public Long getProductionBillId() + { + return productionBillId; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setProductTypeId(Long productTypeId) + { + this.productTypeId = productTypeId; + } + + public Long getProductTypeId() + { + return productTypeId; + } + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setEquipmentCode(String equipmentCode) + { + this.equipmentCode = equipmentCode; + } + + public String getEquipmentCode() + { + return equipmentCode; + } + public void setCompleteDate(Date completeDate) + { + this.completeDate = completeDate; + } + + public Date getCompleteDate() + { + return completeDate; + } + public void setPackType(String packType) + { + this.packType = packType; + } + + public String getPackType() + { + return packType; + } + + public String getGeneralAssemblyDrawing() { + return generalAssemblyDrawing; + } + + public void setGeneralAssemblyDrawing(String generalAssemblyDrawing) { + this.generalAssemblyDrawing = generalAssemblyDrawing; + } + + public String getProductionDrawing() { + return productionDrawing; + } + + public void setProductionDrawing(String productionDrawing) { + this.productionDrawing = productionDrawing; + } + + public String getBomUrl() { + return bomUrl; + } + + public void setBomUrl(String bomUrl) { + this.bomUrl = bomUrl; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public Long getShuliang() { + return shuliang; + } + + public void setShuliang(Long shuliang) { + this.shuliang = shuliang; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionBillId", getProductionBillId()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("productTypeId", getProductTypeId()) + .append("productType", getProductType()) + .append("quantity", getQuantity()) + .append("equipmentCode", getEquipmentCode()) + .append("completeDate", getCompleteDate()) + .append("packType", getPackType()) + .append("generalAssemblyDrawing", getGeneralAssemblyDrawing()) + .append("productionDrawing", getProductionDrawing()) + .append("bomUrl", getBomUrl()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionOrder.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionOrder.java new file mode 100644 index 0000000..2b3581c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionOrder.java @@ -0,0 +1,192 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 生产订单信息对象 pw_production_order + * + * @author zhukangchao + * @date 2023-12-06 + */ +public class PwProductionOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产订单编号 */ + @Excel(name = "生产订单编号") + private String code; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productBillCode; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String itemName; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String unitName; + + /** 说明 */ + @Excel(name = "说明") + private String illustrate; + + /** 订单状态 */ + @Excel(name = "订单状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setProductBillCode(String productBillCode) + { + this.productBillCode = productBillCode; + } + + public String getProductBillCode() + { + return productBillCode; + } + public void setItemName(String itemName) + { + this.itemName = itemName; + } + + public String getItemName() + { + return itemName; + } + public void setUnitName(String unitName) + { + this.unitName = unitName; + } + + public String getUnitName() + { + return unitName; + } + public void setIllustrate(String illustrate) + { + this.illustrate = illustrate; + } + + public String getIllustrate() + { + return illustrate; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("productBillCode", getProductBillCode()) + .append("itemName", getItemName()) + .append("unitName", getUnitName()) + .append("illustrate", getIllustrate()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sapredThree", getSapredThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionOrderInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionOrderInfo.java new file mode 100644 index 0000000..f70a97d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionOrderInfo.java @@ -0,0 +1,248 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 生产订单详情信息对象 pw_production_order_info + * + * @author zhukangchao + * @date 2023-12-06 + */ +public class PwProductionOrderInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产订单id */ + @Excel(name = "生产订单id") + private Long productionOrderId; + + /** 产品类型 */ + @Excel(name = "产品类型") + private String productType; + + /** 型号类型 */ + @Excel(name = "型号类型") + private String productClassify; + + /** 所属产品名称 */ + @Excel(name = "所属产品名称") + private String productName; + + /** 所属型号名称 */ + @Excel(name = "所属型号名称") + private String typeName; + + /** 物料图号 */ + @Excel(name = "物料图号") + private String figureNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 计量单位 */ + @Excel(name = "计量单位") + private String unit; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionOrderId(Long productionOrderId) + { + this.productionOrderId = productionOrderId; + } + + public Long getProductionOrderId() + { + return productionOrderId; + } + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + public void setProductClassify(String productClassify) + { + this.productClassify = productClassify; + } + + public String getProductClassify() + { + return productClassify; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setUnit(String unit) + { + this.unit = unit; + } + + public String getUnit() + { + return unit; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionOrderId", getProductionOrderId()) + .append("productType", getProductType()) + .append("productClassify", getProductClassify()) + .append("productName", getProductName()) + .append("typeName", getTypeName()) + .append("figureNumber", getFigureNumber()) + .append("materialName", getMaterialName()) + .append("unit", getUnit()) + .append("number", getNumber()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionScheduling.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionScheduling.java new file mode 100644 index 0000000..ac992fe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionScheduling.java @@ -0,0 +1,182 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 排产信息对象 pw_production_scheduling + * + * @author zhukangchao + * @date 2023-06-08 + */ +public class PwProductionScheduling extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 项目令号 */ + @Excel(name = "项目令号") + private String code; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String typeName; + + /** 排产数量 */ + @Excel(name = "排产数量") + private Long quantity; + + /** 要求完工日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "要求完工日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date requireDate; + + /** 实际完工日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "实际完工日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date practicalDate; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setRequireDate(Date requireDate) + { + this.requireDate = requireDate; + } + + public Date getRequireDate() + { + return requireDate; + } + public void setPracticalDate(Date practicalDate) + { + this.practicalDate = practicalDate; + } + + public Date getPracticalDate() + { + return practicalDate; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("typeName", getTypeName()) + .append("quantity", getQuantity()) + .append("requireDate", getRequireDate()) + .append("practicalDate", getPracticalDate()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionSchedulingNumber.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionSchedulingNumber.java new file mode 100644 index 0000000..000b1b5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwProductionSchedulingNumber.java @@ -0,0 +1,540 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 排产缺料统计对象 pw_production_scheduling_number + * + * @author zhukangchao + * @date 2023-06-08 + */ +public class PwProductionSchedulingNumber extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 派工部门 */ +// @Excel(name = "派工部门") + private String deptName; + + /** 待检数量 */ +// @Excel(name = "待检数量") + private Long inspectionNumber; + + /** 待入库数量 */ +// @Excel(name = "待入库数量") + private Long stockPendingNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long oneNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twoNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long threeNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long fourNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long fiveNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long sixNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long sevenNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long eightNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long nineNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long tenNumber; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long eleven; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twelve; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long thirteen; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long fourteen; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long fifteen; + + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long sixteen; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long seventeen; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long eighteen; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long nineteen; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twenty; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentyOne; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentyTwo; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentyThree; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentyFour; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentyFive; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentySix; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentySeven; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentyEight; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long twentyNine; + /** 缺料数量 */ + @Excel(name = "缺料数量") + private Long thirty; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getDeptName() + { + return deptName; + } + public void setInspectionNumber(Long inspectionNumber) + { + this.inspectionNumber = inspectionNumber; + } + + public Long getInspectionNumber() + { + return inspectionNumber; + } + public void setStockPendingNumber(Long stockPendingNumber) + { + this.stockPendingNumber = stockPendingNumber; + } + + public Long getStockPendingNumber() + { + return stockPendingNumber; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setTwoNumber(Long twoNumber) + { + this.twoNumber = twoNumber; + } + + public Long getTwoNumber() + { + return twoNumber; + } + public void setThreeNumber(Long threeNumber) + { + this.threeNumber = threeNumber; + } + + public Long getThreeNumber() + { + return threeNumber; + } + public void setFourNumber(Long fourNumber) + { + this.fourNumber = fourNumber; + } + + public Long getFourNumber() + { + return fourNumber; + } + public void setFiveNumber(Long fiveNumber) + { + this.fiveNumber = fiveNumber; + } + + public Long getFiveNumber() + { + return fiveNumber; + } + public void setSixNumber(Long sixNumber) + { + this.sixNumber = sixNumber; + } + + public Long getSixNumber() + { + return sixNumber; + } + public void setSevenNumber(Long sevenNumber) + { + this.sevenNumber = sevenNumber; + } + + public Long getSevenNumber() + { + return sevenNumber; + } + public void setEightNumber(Long eightNumber) + { + this.eightNumber = eightNumber; + } + + public Long getEightNumber() + { + return eightNumber; + } + public void setNineNumber(Long nineNumber) + { + this.nineNumber = nineNumber; + } + + public Long getNineNumber() + { + return nineNumber; + } + public void setTenNumber(Long tenNumber) + { + this.tenNumber = tenNumber; + } + + public Long getTenNumber() + { + return tenNumber; + } + public void setEleven(Long eleven) + { + this.eleven = eleven; + } + + public Long getEleven() + { + return eleven; + } + public void setTwelve(Long twelve) + { + this.twelve = twelve; + } + + public Long getTwelve() + { + return twelve; + } + public void setThirteen(Long thirteen) + { + this.thirteen = thirteen; + } + + public Long getThirteen() + { + return thirteen; + } + public void setFourteen(Long fourteen) + { + this.fourteen = fourteen; + } + + public Long getFourteen() + { + return fourteen; + } + public void setFifteen(Long fifteen) + { + this.fifteen = fifteen; + } + + public Long getFifteen() + { + return fifteen; + } + + public Long getSixteen() { + return sixteen; + } + + public void setSixteen(Long sixteen) { + this.sixteen = sixteen; + } + + public Long getSeventeen() { + return seventeen; + } + + public void setSeventeen(Long seventeen) { + this.seventeen = seventeen; + } + + public Long getEighteen() { + return eighteen; + } + + public void setEighteen(Long eighteen) { + this.eighteen = eighteen; + } + + public Long getNineteen() { + return nineteen; + } + + public void setNineteen(Long nineteen) { + this.nineteen = nineteen; + } + + public Long getTwenty() { + return twenty; + } + + public void setTwenty(Long twenty) { + this.twenty = twenty; + } + + public Long getTwentyOne() { + return twentyOne; + } + + public void setTwentyOne(Long twentyOne) { + this.twentyOne = twentyOne; + } + + public Long getTwentyTwo() { + return twentyTwo; + } + + public void setTwentyTwo(Long twentyTwo) { + this.twentyTwo = twentyTwo; + } + + public Long getTwentyThree() { + return twentyThree; + } + + public void setTwentyThree(Long twentyThree) { + this.twentyThree = twentyThree; + } + + public Long getTwentyFour() { + return twentyFour; + } + + public void setTwentyFour(Long twentyFour) { + this.twentyFour = twentyFour; + } + + public Long getTwentyFive() { + return twentyFive; + } + + public void setTwentyFive(Long twentyFive) { + this.twentyFive = twentyFive; + } + + public Long getTwentySix() { + return twentySix; + } + + public void setTwentySix(Long twentySix) { + this.twentySix = twentySix; + } + + public Long getTwentySeven() { + return twentySeven; + } + + public void setTwentySeven(Long twentySeven) { + this.twentySeven = twentySeven; + } + + public Long getTwentyEight() { + return twentyEight; + } + + public void setTwentyEight(Long twentyEight) { + this.twentyEight = twentyEight; + } + + public Long getTwentyNine() { + return twentyNine; + } + + public void setTwentyNine(Long twentyNine) { + this.twentyNine = twentyNine; + } + + public Long getThirty() { + return thirty; + } + + public void setThirty(Long thirty) { + this.thirty = thirty; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return "PwProductionSchedulingNumber [id=" + id + ", figureNumber=" + figureNumber + ", name=" + name + + ", quantity=" + quantity + ", deptName=" + deptName + ", inspectionNumber=" + inspectionNumber + + ", stockPendingNumber=" + stockPendingNumber + ", oneNumber=" + oneNumber + ", twoNumber=" + twoNumber + + ", threeNumber=" + threeNumber + ", fourNumber=" + fourNumber + ", fiveNumber=" + fiveNumber + + ", sixNumber=" + sixNumber + ", sevenNumber=" + sevenNumber + ", eightNumber=" + eightNumber + + ", nineNumber=" + nineNumber + ", tenNumber=" + tenNumber + ", eleven=" + eleven + ", twelve=" + + twelve + ", thirteen=" + thirteen + ", fourteen=" + fourteen + ", fifteen=" + fifteen + ", sixteen=" + + sixteen + ", seventeen=" + seventeen + ", eighteen=" + eighteen + ", nineteen=" + nineteen + + ", twenty=" + twenty + ", twentyOne=" + twentyOne + ", twentyTwo=" + twentyTwo + ", twentyThree=" + + twentyThree + ", twentyFour=" + twentyFour + ", twentyFive=" + twentyFive + ", twentySix=" + twentySix + + ", twentySeven=" + twentySeven + ", twentyEight=" + twentyEight + ", twentyNine=" + twentyNine + + ", thirty=" + thirty + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + + sparedThree + ", sparedFour=" + sparedFour + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchase.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchase.java new file mode 100644 index 0000000..eda461d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchase.java @@ -0,0 +1,234 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 部件对象 pw_purchase + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PwPurchase extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 零件名称 */ + @Excel(name = "零件名称") + private String partName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 单价 */ + @Excel(name = "单价") + private Long univalence; + + /** 厂家 */ + @Excel(name = "厂家") + private String manufacturers; + + /** 是否常用 */ + @Excel(name = "是否常用") + private Integer common; + + /** 现有库存 */ + @Excel(name = "现有库存") + private Long nowInventory; + + /** 库存最低数量 */ + @Excel(name = "库存最低数量") + private Long minimum; + + /** 库存最高数量 */ + @Excel(name = "库存最高数量") + private Long highest; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setPartName(String partName) + { + this.partName = partName; + } + + public String getPartName() + { + return partName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setUnivalence(Long univalence) + { + this.univalence = univalence; + } + + public Long getUnivalence() + { + return univalence; + } + public void setManufacturers(String manufacturers) + { + this.manufacturers = manufacturers; + } + + public String getManufacturers() + { + return manufacturers; + } + public void setCommon(Integer common) + { + this.common = common; + } + + public Integer getCommon() + { + return common; + } + public void setNowInventory(Long nowInventory) + { + this.nowInventory = nowInventory; + } + + public Long getNowInventory() + { + return nowInventory; + } + public void setMinimum(Long minimum) + { + this.minimum = minimum; + } + + public Long getMinimum() + { + return minimum; + } + public void setHighest(Long highest) + { + this.highest = highest; + } + + public Long getHighest() + { + return highest; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("partName", getPartName()) + .append("figureNumber", getFigureNumber()) + .append("picture", getPicture()) + .append("univalence", getUnivalence()) + .append("manufacturers", getManufacturers()) + .append("common", getCommon()) + .append("nowInventory", getNowInventory()) + .append("minimum", getMinimum()) + .append("highest", getHighest()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchaseContract.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchaseContract.java new file mode 100644 index 0000000..8f27fe9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchaseContract.java @@ -0,0 +1,674 @@ +package com.ruoyi.project.management.domain; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 采购合同对象 pw_purchase_contract + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PwPurchaseContract extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** id集合 */ + private Long[] ids; + + /** 数据创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "数据创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cerateTime; + + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractCode; + + /** 执行单令号 */ + @Excel(name = "执行单令号") + private String code; + + /** 买方名称 */ +// @Excel(name = "买方名称") + private String purchaserName; + + /** 卖方名称 */ + @Excel(name = "卖方名称") + private String sellerName; + + /** 合同签订时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同签订时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date appointTime; + + /** 总价 */ + @Excel(name = "总价") + private double totalPrices; + + /** 总价大写 */ + @Excel(name = "总价大写") + private String bigTotalPrices; + + /** 完工时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完工时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completeTime; + + /** 合同协议 */ + @Excel(name = "合同协议") + private String agreement; + + /** 买方电话 */ + @Excel(name = "买方电话") + private String purchaserPhone; + + /** 买方传真 */ + @Excel(name = "买方传真") + private String purchaserFax; + + /** 买方地址 */ + @Excel(name = "买方地址") + private String purchaserAddress; + + /** 买方账号 */ + @Excel(name = "买方账号") + private String purchaserAccount; + + /** 买方税号 */ + @Excel(name = "买方税号") + private String purchaserDutyParagraph; + + /** 买方开户行 */ + @Excel(name = "买方开户行") + private String purchaserBankOfDeposit; + + /** 卖方电话 */ + @Excel(name = "卖方电话") + private String sellerPhone; + + /** 卖方传真 */ + @Excel(name = "卖方传真") + private String sellerFax; + + /** 卖方地址 */ + @Excel(name = "卖方地址") + private String sellerAddress; + + /** 卖方账号 */ + @Excel(name = "卖方账号") + private String sellerAccount; + + /** 卖方税号 */ + @Excel(name = "卖方税号") + private String sellerDuctParagraph; + + /** 卖方开户行 */ + @Excel(name = "卖方开户行") + private String sellerBankOfDeposit; + + /** 合同状态 */ + @Excel(name = "合同状态") + private Long contractStatus; + + /** 税率 */ + @Excel(name = "税率") + private Long taxRate; + + /** 交货方式 */ + @Excel(name = "交货方式") + private String deliveryType; + + /** 运费支付方 */ + @Excel(name = "运费支付方") + private String payer; + + /** 交货地点 */ + @Excel(name = "交货地点") + private String deliveryAddress; + + /** 货款支付方式 */ + @Excel(name = "货款支付方式") + private String modeOfPayment; + + /** 扣款金额 */ + @Excel(name = "扣款金额") + private Double withhold; + + /** 是否开票 */ + @Excel(name = "是否开票") + private String billingInformation; + + /** 发票id */ +// @Excel(name = "发票id") + private Long invoice; + + /** 未开票金额 */ + private BigDecimal notInvoiceAmount; + + /** 已开票金额 */ + private BigDecimal invoiceAmount; + + /** 未收款金额 */ + private BigDecimal notProceedsAmount; + + /** 已收款金额 */ + private BigDecimal proceedsAmount; + + /** 结算比例 */ + private BigDecimal settlementRatio; + + /** 总经理审批 */ + @Excel(name = "总经理审批") + private String leadership; + + /** 总经理审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "总经理审批时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date leadershipTime; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1已删除) */ + private Integer delFlag; + + private String name; + + //付款金额 + private Double paymentAmount; + + //物流费用 + private Double money; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 支付方式 */ + @Excel(name = "支付方式") + private String payWay; + + @Excel(name = "合同路径") + private String contractPath; + + public String getContractPath() { + return contractPath; + } + + public void setContractPath(String contractPath) { + this.contractPath = contractPath; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public void setCerateTime(Date cerateTime) + { + this.cerateTime = cerateTime; + } + + public Date getCerateTime() + { + return cerateTime; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public void setPurchaserName(String purchaserName) + { + this.purchaserName = purchaserName; + } + + public String getPurchaserName() + { + return purchaserName; + } + public void setSellerName(String sellerName) + { + this.sellerName = sellerName; + } + + public String getSellerName() + { + return sellerName; + } + public void setAppointTime(Date appointTime) + { + this.appointTime = appointTime; + } + + public Date getAppointTime() + { + return appointTime; + } + + public void setTotalPrices(double totalPrices) + { + this.totalPrices = totalPrices; + } + + public double getTotalPrices() + { + return totalPrices; + } + public void setCompleteTime(Date completeTime) + { + this.completeTime = completeTime; + } + + public Date getCompleteTime() + { + return completeTime; + } + public void setAgreement(String agreement) + { + this.agreement = agreement; + } + + public String getAgreement() + { + return agreement; + } + public void setPurchaserPhone(String purchaserPhone) + { + this.purchaserPhone = purchaserPhone; + } + + public String getPurchaserPhone() + { + return purchaserPhone; + } + public void setPurchaserFax(String purchaserFax) + { + this.purchaserFax = purchaserFax; + } + + public String getPurchaserFax() + { + return purchaserFax; + } + public void setPurchaserAddress(String purchaserAddress) + { + this.purchaserAddress = purchaserAddress; + } + + public String getPurchaserAddress() + { + return purchaserAddress; + } + public void setPurchaserAccount(String purchaserAccount) + { + this.purchaserAccount = purchaserAccount; + } + + public String getPurchaserAccount() + { + return purchaserAccount; + } + public void setPurchaserDutyParagraph(String purchaserDutyParagraph) + { + this.purchaserDutyParagraph = purchaserDutyParagraph; + } + + public String getPurchaserDutyParagraph() + { + return purchaserDutyParagraph; + } + public void setPurchaserBankOfDeposit(String purchaserBankOfDeposit) + { + this.purchaserBankOfDeposit = purchaserBankOfDeposit; + } + + public String getPurchaserBankOfDeposit() + { + return purchaserBankOfDeposit; + } + public void setSellerPhone(String sellerPhone) + { + this.sellerPhone = sellerPhone; + } + + public String getSellerPhone() + { + return sellerPhone; + } + public void setSellerFax(String sellerFax) + { + this.sellerFax = sellerFax; + } + + public String getSellerFax() + { + return sellerFax; + } + public void setSellerAddress(String sellerAddress) + { + this.sellerAddress = sellerAddress; + } + + public String getSellerAddress() + { + return sellerAddress; + } + public void setSellerAccount(String sellerAccount) + { + this.sellerAccount = sellerAccount; + } + + public String getSellerAccount() + { + return sellerAccount; + } + public void setSellerDuctParagraph(String sellerDuctParagraph) + { + this.sellerDuctParagraph = sellerDuctParagraph; + } + + public String getSellerDuctParagraph() + { + return sellerDuctParagraph; + } + public void setSellerBankOfDeposit(String sellerBankOfDeposit) + { + this.sellerBankOfDeposit = sellerBankOfDeposit; + } + + public String getSellerBankOfDeposit() + { + return sellerBankOfDeposit; + } + + public Long getContractStatus() { + return contractStatus; + } + + public void setContractStatus(Long contractStatus) { + this.contractStatus = contractStatus; + } + + public BigDecimal getNotInvoiceAmount() { + return notInvoiceAmount; + } + + public void setNotInvoiceAmount(BigDecimal notInvoiceAmount) { + this.notInvoiceAmount = notInvoiceAmount; + } + + public BigDecimal getInvoiceAmount() { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public BigDecimal getNotProceedsAmount() { + return notProceedsAmount; + } + + public void setNotProceedsAmount(BigDecimal notProceedsAmount) { + this.notProceedsAmount = notProceedsAmount; + } + + public BigDecimal getProceedsAmount() { + return proceedsAmount; + } + + public void setProceedsAmount(BigDecimal proceedsAmount) { + this.proceedsAmount = proceedsAmount; + } + + public BigDecimal getSettlementRatio() { + return settlementRatio; + } + + public void setSettlementRatio(BigDecimal settlementRatio) { + this.settlementRatio = settlementRatio; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getBigTotalPrices() { + return bigTotalPrices; + } + + public void setBigTotalPrices(String bigTotalPrices) { + this.bigTotalPrices = bigTotalPrices; + } + + public Long getTaxRate() { + return taxRate; + } + + public void setTaxRate(Long taxRate) { + this.taxRate = taxRate; + } + + public String getDeliveryType() { + return deliveryType; + } + + public void setDeliveryType(String deliveryType) { + this.deliveryType = deliveryType; + } + + public String getPayer() { + return payer; + } + + public void setPayer(String payer) { + this.payer = payer; + } + + public String getDeliveryAddress() { + return deliveryAddress; + } + + public void setDeliveryAddress(String deliveryAddress) { + this.deliveryAddress = deliveryAddress; + } + + public String getModeOfPayment() { + return modeOfPayment; + } + + public void setModeOfPayment(String modeOfPayment) { + this.modeOfPayment = modeOfPayment; + } + + public Double getWithhold() { + return withhold; + } + + public void setWithhold(Double withhold) { + this.withhold = withhold; + } + + public String getBillingInformation() { + return billingInformation; + } + + public void setBillingInformation(String billingInformation) { + this.billingInformation = billingInformation; + } + + public Long getInvoice() { + return invoice; + } + + public void setInvoice(Long invoice) { + this.invoice = invoice; + } + public Double getPaymentAmount() { + return paymentAmount; + } + + public void setPaymentAmount(Double paymentAmount) { + this.paymentAmount = paymentAmount; + } + + public String getLeadership() { + return leadership; + } + + public void setLeadership(String leadership) { + this.leadership = leadership; + } + + public Date getLeadershipTime() { + return leadershipTime; + } + + public void setLeadershipTime(Date leadershipTime) { + this.leadershipTime = leadershipTime; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getPayWay() { + return payWay; + } + + public void setPayWay(String payWay) { + this.payWay = payWay; + } + + @Override + public String toString() { + return "PwPurchaseContract [id=" + id + ", ids=" + Arrays.toString(ids) + ", cerateTime=" + cerateTime + + ", contractCode=" + contractCode + ", code=" + code + ", purchaserName=" + purchaserName + + ", sellerName=" + sellerName + ", appointTime=" + appointTime + ", totalPrices=" + totalPrices + + ", bigTotalPrices=" + bigTotalPrices + ", completeTime=" + completeTime + ", agreement=" + agreement + + ", purchaserPhone=" + purchaserPhone + ", purchaserFax=" + purchaserFax + ", purchaserAddress=" + + purchaserAddress + ", purchaserAccount=" + purchaserAccount + ", purchaserDutyParagraph=" + + purchaserDutyParagraph + ", purchaserBankOfDeposit=" + purchaserBankOfDeposit + ", sellerPhone=" + + sellerPhone + ", sellerFax=" + sellerFax + ", sellerAddress=" + sellerAddress + ", sellerAccount=" + + sellerAccount + ", sellerDuctParagraph=" + sellerDuctParagraph + ", sellerBankOfDeposit=" + + sellerBankOfDeposit + ", contractStatus=" + contractStatus + ", taxRate=" + taxRate + + ", deliveryType=" + deliveryType + ", payer=" + payer + ", deliveryAddress=" + deliveryAddress + + ", modeOfPayment=" + modeOfPayment + ", withhold=" + withhold + ", billingInformation=" + + billingInformation + ", invoice=" + invoice + ", notInvoiceAmount=" + notInvoiceAmount + + ", invoiceAmount=" + invoiceAmount + ", notProceedsAmount=" + notProceedsAmount + ", proceedsAmount=" + + proceedsAmount + ", settlementRatio=" + settlementRatio + ", leadership=" + leadership + + ", leadershipTime=" + leadershipTime + ", sparedOne=" + sparedOne + ", sparedTwo=" + sparedTwo + + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + ", name=" + + name + ", paymentAmount=" + paymentAmount + ", money=" + money + ", unitName=" + unitName + + ", payWay=" + payWay + ", contractPath=" + contractPath + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchaseContractMaterial.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchaseContractMaterial.java new file mode 100644 index 0000000..f1c2efa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwPurchaseContractMaterial.java @@ -0,0 +1,308 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物料和采购合同关联对象 pw_purchase_contract_material + * + * @author zhukangchao + * @date 2020-07-06 + */ +/** + * @author 13323659953@163.com + * + */ +public class PwPurchaseContractMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 采购合同id */ +// @Excel(name = "采购合同id") + private Long purchaseContractId; + + /** 项目令号 */ + @Excel(name = "项目令号") + private String code; + + /** 物料id */ +// @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 数量 */ + @Excel(name = "数量") + private Long amount; + + /** 单位 */ +// @Excel(name = "单位") + private String unit; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completeDate; + + //申请入库数量 + private Long number; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 库存数量 */ + private Long quantity; + + /** 预存数量 */ + private Long preliminaryInventory; + + /** 锁定数量 */ + private Long lockNumber; + + /** 备用字段1 */ +// @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ +// @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ +// @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ +// @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** 序号 */ + private Long num; + + public Long getNum() { + return num; + } + + public void setNum(Long num) { + this.num = num; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPurchaseContractId() { + return purchaseContractId; + } + + public void setPurchaseContractId(Long purchaseContractId) { + this.purchaseContractId = purchaseContractId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getMaterials() { + return materials; + } + + public void setMaterials(String materials) { + this.materials = materials; + } + + public Long getAmount() { + return amount; + } + + public void setAmount(Long amount) { + this.amount = amount; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Date getCompleteDate() { + return completeDate; + } + + public void setCompleteDate(Date completeDate) { + this.completeDate = completeDate; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public Double getUnivalence() { + return univalence; + } + + public void setUnivalence(Double univalence) { + this.univalence = univalence; + } + + public Double getTotalPrices() { + return totalPrices; + } + + public void setTotalPrices(Double totalPrices) { + this.totalPrices = totalPrices; + } + + public String getInventoryStatus() { + return inventoryStatus; + } + + public void setInventoryStatus(String inventoryStatus) { + this.inventoryStatus = inventoryStatus; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public Long getPreliminaryInventory() { + return preliminaryInventory; + } + + public void setPreliminaryInventory(Long preliminaryInventory) { + this.preliminaryInventory = preliminaryInventory; + } + + public Long getLockNumber() { + return lockNumber; + } + + public void setLockNumber(Long lockNumber) { + this.lockNumber = lockNumber; + } + + public String getSparedOne() { + return sparedOne; + } + + public void setSparedOne(String sparedOne) { + this.sparedOne = sparedOne; + } + + public String getSparedTwo() { + return sparedTwo; + } + + public void setSparedTwo(String sparedTwo) { + this.sparedTwo = sparedTwo; + } + + public Long getSparedThree() { + return sparedThree; + } + + public void setSparedThree(Long sparedThree) { + this.sparedThree = sparedThree; + } + + public Long getSparedFour() { + return sparedFour; + } + + public void setSparedFour(Long sparedFour) { + this.sparedFour = sparedFour; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + @Override + public String toString() { + return "PwPurchaseContractMaterial [id=" + id + ", purchaseContractId=" + purchaseContractId + ", code=" + code + + ", materialId=" + materialId + ", materialName=" + materialName + ", figureNumber=" + figureNumber + + ", materials=" + materials + ", amount=" + amount + ", unit=" + unit + ", completeDate=" + + completeDate + ", number=" + number + ", univalence=" + univalence + ", totalPrices=" + totalPrices + + ", inventoryStatus=" + inventoryStatus + ", quantity=" + quantity + ", preliminaryInventory=" + + preliminaryInventory + ", lockNumber=" + lockNumber + ", sparedOne=" + sparedOne + ", sparedTwo=" + + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + ", delFlag=" + delFlag + + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwQrcode.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwQrcode.java new file mode 100644 index 0000000..d136765 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwQrcode.java @@ -0,0 +1,251 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 二维码信息对象 pw_qrcode + * + * @author zhukangchao + * @date 2023-04-19 + */ +public class PwQrcode extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 二维码路径 */ + @Excel(name = "二维码路径") + private String url; + + /** 令号 */ + @Excel(name = "令号") + private String code; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long quantity; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 加工部门 */ + @Excel(name = "加工部门") + private String departmentName; + + /** 是否失效 */ + @Excel(name = "是否失效") + private String loseEfficacy; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUrl(String url) + { + this.url = url; + } + + public String getUrl() + { + return url; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setCompletionDate(Date completionDate) + { + this.completionDate = completionDate; + } + + public Date getCompletionDate() + { + return completionDate; + } + public void setDepartmentName(String departmentName) + { + this.departmentName = departmentName; + } + + public String getDepartmentName() + { + return departmentName; + } + public void setLoseEfficacy(String loseEfficacy) + { + this.loseEfficacy = loseEfficacy; + } + + public String getLoseEfficacy() + { + return loseEfficacy; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("url", getUrl()) + .append("code", getCode()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("quantity", getQuantity()) + .append("completionDate", getCompletionDate()) + .append("departmentName", getDepartmentName()) + .append("loseEfficacy", getLoseEfficacy()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwQuotation.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwQuotation.java new file mode 100644 index 0000000..ea15006 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwQuotation.java @@ -0,0 +1,369 @@ +package com.ruoyi.project.management.domain; + +import java.util.List; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 报价单对象 pw_quotation + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PwQuotation extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单位名称 */ + @Excel(name = "单位名称") + private String unitName; + + /** 询价人 */ + @Excel(name = "询价人") + private String inquirer; + + /** 联系电话 */ + @Excel(name = "联系电话") + private String phone; + + /** 邮箱 */ + @Excel(name = "邮箱") + private String eMail; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String itemName; + + /** 项目地址 */ + @Excel(name = "项目地址") + private String itemAddress; + + /** 贸易方式 */ + @Excel(name = "贸易方式") + private String modeOfTrade; + + /** 包装方式 */ + @Excel(name = "包装方式") + private String modeOfPacking; + + /** 运输方式 */ + @Excel(name = "运输方式") + private String modeOfTransportation; + + /** 是否开票 */ + @Excel(name = "是否开票") + private Integer makeOutAnInvoice; + + /** 报价人 */ + @Excel(name = "报价人") + private String offerer; + + /** 折扣率 */ + @Excel(name = "折扣率") + private Double discountRate; + + /** 产品id */ + @Excel(name = "产品id") + private Long productId; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrices; + + /** 用户id */ + private Long userId; + + /** 生成合同标记 */ + private Integer createContractSign; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + /** 产品集合 */ + private List productList; + + /** 方案id */ + private Long schemeId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUnitName(String unitName) + { + this.unitName = unitName; + } + + public String getUnitName() + { + return unitName; + } + public void setInquirer(String inquirer) + { + this.inquirer = inquirer; + } + + public String getInquirer() + { + return inquirer; + } + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPhone() + { + return phone; + } + public void seteMail(String eMail) + { + this.eMail = eMail; + } + + public String geteMail() + { + return eMail; + } + public void setItemName(String itemName) + { + this.itemName = itemName; + } + + public String getItemName() + { + return itemName; + } + public void setItemAddress(String itemAddress) + { + this.itemAddress = itemAddress; + } + + public String getItemAddress() + { + return itemAddress; + } + public void setModeOfTrade(String modeOfTrade) + { + this.modeOfTrade = modeOfTrade; + } + + public String getModeOfTrade() + { + return modeOfTrade; + } + public void setModeOfPacking(String modeOfPacking) + { + this.modeOfPacking = modeOfPacking; + } + + public String getModeOfPacking() + { + return modeOfPacking; + } + public void setModeOfTransportation(String modeOfTransportation) + { + this.modeOfTransportation = modeOfTransportation; + } + + public String getModeOfTransportation() + { + return modeOfTransportation; + } + public void setMakeOutAnInvoice(Integer makeOutAnInvoice) + { + this.makeOutAnInvoice = makeOutAnInvoice; + } + + public Integer getMakeOutAnInvoice() + { + return makeOutAnInvoice; + } + public void setOfferer(String offerer) + { + this.offerer = offerer; + } + + public String getOfferer() + { + return offerer; + } + public void setDiscountRate(Double discountRate) + { + this.discountRate = discountRate; + } + + public Double getDiscountRate() + { + return discountRate; + } + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setTotalPrices(Double totalPrices) + { + this.totalPrices = totalPrices; + } + + public Double getTotalPrices() + { + return totalPrices; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Integer getCreateContractSign() { + return createContractSign; + } + + public void setCreateContractSign(Integer createContractSign) { + this.createContractSign = createContractSign; + } + + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public List getProductList() { + return productList; + } + + public void setProductList(List productList) { + this.productList = productList; + } + + public Long getSchemeId() { + return schemeId; + } + + public void setSchemeId(Long schemeId) { + this.schemeId = schemeId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("unitName", getUnitName()) + .append("inquirer", getInquirer()) + .append("phone", getPhone()) + .append("eMail", geteMail()) + .append("itemName", getItemName()) + .append("itemAddress", getItemAddress()) + .append("modeOfTrade", getModeOfTrade()) + .append("modeOfPacking", getModeOfPacking()) + .append("modeOfTransportation", getModeOfTransportation()) + .append("makeOutAnInvoice", getMakeOutAnInvoice()) + .append("offerer", getOfferer()) + .append("discountRate", getDiscountRate()) + .append("productId", getProductId()) + .append("productName", getProductName()) + .append("totalPrices", getTotalPrices()) + .append("remark", getRemark()) + .append("userId", getUserId()) + .append("createContractSign", getCreateContractSign()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .append("productList", getProductList()) + .append("schemeId", getSchemeId()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwSafetyInventory.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwSafetyInventory.java new file mode 100644 index 0000000..f420faf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwSafetyInventory.java @@ -0,0 +1,234 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 安全库存明细对象 pw_safety_inventory + * + * @author zhukangchao + * @date 2022-12-31 + */ +public class PwSafetyInventory extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 物料图号 */ + @Excel(name = "物料图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 最低安全库存 */ + @Excel(name = "最低安全库存") + private Long minimum; + + /** 最高安全库存 */ + @Excel(name = "最高安全库存") + private Long highest; + + /** 现有库存 */ + @Excel(name = "现有库存") + private Long quantity; + + /** 在途(在制)数量 */ + @Excel(name = "在途(在制)数量") + private Long preliminaryInventory; + + /** 项目预定数量 */ + @Excel(name = "项目预定数量") + private Long lockNumber; + + /** 触发系数 */ + @Excel(name = "触发系数") + private Long proportion; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setMinimum(Long minimum) + { + this.minimum = minimum; + } + + public Long getMinimum() + { + return minimum; + } + public void setHighest(Long highest) + { + this.highest = highest; + } + + public Long getHighest() + { + return highest; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setPreliminaryInventory(Long preliminaryInventory) + { + this.preliminaryInventory = preliminaryInventory; + } + + public Long getPreliminaryInventory() + { + return preliminaryInventory; + } + public void setLockNumber(Long lockNumber) + { + this.lockNumber = lockNumber; + } + + public Long getLockNumber() + { + return lockNumber; + } + public void setProportion(Long proportion) + { + this.proportion = proportion; + } + + public Long getProportion() + { + return proportion; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("minimum", getMinimum()) + .append("highest", getHighest()) + .append("quantity", getQuantity()) + .append("preliminaryInventory", getPreliminaryInventory()) + .append("lockNumber", getLockNumber()) + .append("proportion", getProportion()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwScheme.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwScheme.java new file mode 100644 index 0000000..c73f60a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwScheme.java @@ -0,0 +1,310 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 方案对象 pw_scheme + * + * @author zhukangchao + * @date 2020-06-09 + */ +public class PwScheme extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 报价单id */ + @Excel(name = "报价单id") + private Long quotationId; + + /** 安装位置 */ + @Excel(name = "安装位置") + private String installationSite; + + /** 基坑(m) */ + @Excel(name = "基坑", readConverterExp = "m=") + private Double foundationTrench; + + /** 行程(m) */ + @Excel(name = "行程", readConverterExp = "m=") + private Double journey; + + /** 升降台长 */ + @Excel(name = "升降台长") + private Double liftingPlatformLong; + + /** 升降台宽 */ + @Excel(name = "升降台宽") + private Double liftingPlatformWide; + + /** 升降台直径 */ + @Excel(name = "升降台直径") + private Double liftingPlatformDiameter; + + /** 升降台面积 */ + @Excel(name = "升降台面积") + private Double liftingPlatformArea; + + /** 动载荷 */ + @Excel(name = "动载荷") + private Double dynamicLoad; + + /** 静载荷 */ + @Excel(name = "静载荷") + private Double deadLoad; + + /** 速度 */ + @Excel(name = "速度") + private Double speed; + + /** 钢结构及其他 */ + @Excel(name = "钢结构及其他") + private Double steelStructure; + + /** 方案图 */ + @Excel(name = "方案图") + private String picture; + + /** 技术参数 */ + @Excel(name = "技术参数") + private String technicalParameters; + + /** 总价 */ + @Excel(name = "总价") + private Double totalPrice; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setQuotationId(Long quotationId) + { + this.quotationId = quotationId; + } + + public Long getQuotationId() + { + return quotationId; + } + public void setInstallationSite(String installationSite) + { + this.installationSite = installationSite; + } + + public String getInstallationSite() + { + return installationSite; + } + + public Double getFoundationTrench() { + return foundationTrench; + } + + public void setFoundationTrench(Double foundationTrench) { + this.foundationTrench = foundationTrench; + } + + public Double getJourney() { + return journey; + } + + public void setJourney(Double journey) { + this.journey = journey; + } + + public Double getLiftingPlatformLong() { + return liftingPlatformLong; + } + + public void setLiftingPlatformLong(Double liftingPlatformLong) { + this.liftingPlatformLong = liftingPlatformLong; + } + + public Double getLiftingPlatformWide() { + return liftingPlatformWide; + } + + public void setLiftingPlatformWide(Double liftingPlatformWide) { + this.liftingPlatformWide = liftingPlatformWide; + } + + public Double getLiftingPlatformDiameter() { + return liftingPlatformDiameter; + } + + public void setLiftingPlatformDiameter(Double liftingPlatformDiameter) { + this.liftingPlatformDiameter = liftingPlatformDiameter; + } + + public Double getLiftingPlatformArea() { + return liftingPlatformArea; + } + + public void setLiftingPlatformArea(Double liftingPlatformArea) { + this.liftingPlatformArea = liftingPlatformArea; + } + + public Double getDynamicLoad() { + return dynamicLoad; + } + + public void setDynamicLoad(Double dynamicLoad) { + this.dynamicLoad = dynamicLoad; + } + + public Double getDeadLoad() { + return deadLoad; + } + + public void setDeadLoad(Double deadLoad) { + this.deadLoad = deadLoad; + } + + public void setSpeed(Double speed) + { + this.speed = speed; + } + + public Double getSpeed() + { + return speed; + } + + public Double getSteelStructure() { + return steelStructure; + } + + public void setSteelStructure(Double steelStructure) { + this.steelStructure = steelStructure; + } + + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setTechnicalParameters(String technicalParameters) + { + this.technicalParameters = technicalParameters; + } + + public String getTechnicalParameters() + { + return technicalParameters; + } + public void setTotalPrice(Double totalPrice) + { + this.totalPrice = totalPrice; + } + + public Double getTotalPrice() + { + return totalPrice; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("quotationId", getQuotationId()) + .append("installationSite", getInstallationSite()) + .append("foundationTrench", getFoundationTrench()) + .append("journey", getJourney()) + .append("liftingPlatformLong", getLiftingPlatformLong()) + .append("liftingPlatformWide", getLiftingPlatformWide()) + .append("liftingPlatformDiameter", getLiftingPlatformDiameter()) + .append("liftingPlatformArea", getLiftingPlatformArea()) + .append("dynamicLoad", getDynamicLoad()) + .append("deadLoad", getDeadLoad()) + .append("speed", getSpeed()) + .append("steelStructure", getSteelStructure()) + .append("picture", getPicture()) + .append("technicalParameters", getTechnicalParameters()) + .append("totalPrice", getTotalPrice()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwScrapInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwScrapInfo.java new file mode 100644 index 0000000..7d100a8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwScrapInfo.java @@ -0,0 +1,234 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 报废信息对象 pw_scrap_info + * + * @author zhukangchao + * @date 2023-04-01 + */ +public class PwScrapInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 库存数量 */ + @Excel(name = "库存数量") + private Long quantity; + + /** 报废数量 */ + @Excel(name = "报废数量") + private Long number; + + /** 剩余数量 */ + @Excel(name = "剩余数量") + private Long residueNumber; + + /** 操作者 */ + @Excel(name = "操作者") + private String userName; + + /** 报废原因 */ + @Excel(name = "报废原因") + private String cause; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setResidueNumber(Long residueNumber) + { + this.residueNumber = residueNumber; + } + + public Long getResidueNumber() + { + return residueNumber; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setCause(String cause) + { + this.cause = cause; + } + + public String getCause() + { + return cause; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("quantity", getQuantity()) + .append("number", getNumber()) + .append("residueNumber", getResidueNumber()) + .append("userName", getUserName()) + .append("cause", getCause()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwSpectaculars.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwSpectaculars.java new file mode 100644 index 0000000..13b5f60 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwSpectaculars.java @@ -0,0 +1,368 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 生产看板对象 pw_spectaculars + * + * @author zhukangchao + * @date 2023-02-01 + */ +public class PwSpectaculars extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + private String code; + + /** 序号 */ + @Excel(name = "序号") + private Long num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 派工部门 */ + @Excel(name = "派工部门") + private String departmentName; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 是否入库 */ + @Excel(name = "是否入库") + private String godownEntry; + + /** 图纸路径 */ + @Excel(name = "图纸路径") + private String pdfUrl; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料图号 */ + @Excel(name = "材料图号") + private String materialsSpecification; + + /** 下料规格 */ + @Excel(name = "下料规格") + private String specification; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 成品数量 */ + @Excel(name = "成品数量") + private Long finished; + + /** 领料数量 */ + @Excel(name = "领料数量") + private Long receiveNumber; + + /** 序描述 */ + @Excel(name = "序描述") + private String xuDescribe; + + /** 当前状态 */ + @Excel(name = "当前状态") + private String status; + + /** 状态日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "状态日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date statusDate; + + //子集集合 + private List children; + + /** 实时库存 */ + @Excel(name = "实时库存") + private Long quantity; + + /** + * 是否超时 + */ + private String overTime; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public void setNum(Long num) + { + this.num = num; + } + + public Long getNum() + { + return num; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + public void setCompletionDate(Date completionDate) + { + this.completionDate = completionDate; + } + + public Date getCompletionDate() + { + return completionDate; + } + public void setGodownEntry(String godownEntry) + { + this.godownEntry = godownEntry; + } + + public String getGodownEntry() + { + return godownEntry; + } + public void setPdfUrl(String pdfUrl) + { + this.pdfUrl = pdfUrl; + } + + public String getPdfUrl() + { + return pdfUrl; + } + public void setMaterialsName(String materialsName) + { + this.materialsName = materialsName; + } + + public String getMaterialsName() + { + return materialsName; + } + public void setMaterialsSpecification(String materialsSpecification) + { + this.materialsSpecification = materialsSpecification; + } + + public String getMaterialsSpecification() + { + return materialsSpecification; + } + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + public void setWorkblank(Long workblank) + { + this.workblank = workblank; + } + + public Long getWorkblank() + { + return workblank; + } + public void setFinished(Long finished) + { + this.finished = finished; + } + + public Long getFinished() + { + return finished; + } + public void setReceiveNumber(Long receiveNumber) + { + this.receiveNumber = receiveNumber; + } + + public Long getReceiveNumber() + { + return receiveNumber; + } + public void setXuDescribe(String xuDescribe) + { + this.xuDescribe = xuDescribe; + } + + public String getXuDescribe() + { + return xuDescribe; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setStatusDate(Date statusDate) + { + this.statusDate = statusDate; + } + + public Date getStatusDate() + { + return statusDate; + } + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public String getOverTime() { + return overTime; + } + + public void setOverTime(String overTime) { + this.overTime = overTime; + } + + @Override + public String toString() { + return "PwSpectaculars [id=" + id + ", code=" + code + ", num=" + num + ", figureNumber=" + figureNumber + + ", name=" + name + ", oneNumber=" + oneNumber + ", type=" + type + ", pieceWeight=" + pieceWeight + + ", sumNumber=" + sumNumber + ", remarks=" + remarks + ", departmentName=" + departmentName + + ", completionDate=" + completionDate + ", godownEntry=" + godownEntry + ", pdfUrl=" + pdfUrl + + ", materialsName=" + materialsName + ", materialsSpecification=" + materialsSpecification + + ", specification=" + specification + ", workblank=" + workblank + ", finished=" + finished + + ", receiveNumber=" + receiveNumber + ", xuDescribe=" + xuDescribe + ", status=" + status + + ", statusDate=" + statusDate + ", children=" + children + ", quantity=" + quantity + ", overTime=" + + overTime + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwSpectacularsInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwSpectacularsInfo.java new file mode 100644 index 0000000..28eac0c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwSpectacularsInfo.java @@ -0,0 +1,779 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 新生产看板信息对象 pw_spectaculars_info + * + * @author zhukangchao + * @date 2023-04-03 + */ +public class PwSpectacularsInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 令号 */ + @Excel(name = "令号") + private String code; + + /** 令号 */ + @Excel(name = "企标单令号") + private String makeDocumentCode; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String productName; + + /** 序号 */ + @Excel(name = "序号") + private Long num; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 工序名称1 */ + @Excel(name = "工序名称1") + private String processNameOne; + + /** 质检详情1 */ + @Excel(name = "质检详情1") + private String inspectorInfoOne; + + /** 入库详情1 */ + @Excel(name = "入库详情1") + private String godownEntryOne; + + /** 工序名称2 */ + @Excel(name = "工序名称2") + private String processNameTwo; + + /** 质检详情2 */ + @Excel(name = "质检详情2") + private String inspectorInfoTwo; + + /** 入库详情2 */ + @Excel(name = "入库详情2") + private String godownEntryTwo; + + /** 工序名称3 */ + @Excel(name = "工序名称3") + private String processNameThree; + + /** 质检详情3 */ + @Excel(name = "质检详情3") + private String inspectorInfoThree; + + /** 入库详情3 */ + @Excel(name = "入库详情3") + private String godownEntryThree; + + /** 工序名称4 */ + @Excel(name = "工序名称4") + private String processNameFour; + + /** 质检详情4 */ + @Excel(name = "质检详情4") + private String inspectorInfoFour; + + /** 入库详情4 */ + @Excel(name = "入库详情4") + private String godownEntryFour; + + /** 工序名称5 */ + @Excel(name = "工序名称5") + private String processNameFive; + + /** 质检详情5 */ + @Excel(name = "质检详情5") + private String inspectorInfoFive; + + /** 入库详情5 */ + @Excel(name = "入库详情5") + private String godownEntryFive; + + /** 工序名称6 */ + @Excel(name = "工序名称6") + private String processNameSix; + + /** 质检详情6 */ + @Excel(name = "质检详情6") + private String inspectorInfoSix; + + /** 入库详情6 */ + @Excel(name = "入库详情6") + private String godownEntrySix; + + /** 工序名称7 */ + @Excel(name = "工序名称7") + private String processNameSeven; + + /** 质检详情7 */ + @Excel(name = "质检详情7") + private String inspectorInfoSeven; + + /** 入库详情7 */ + @Excel(name = "入库详情7") + private String godownEntrySeven; + + /** 工序名称8 */ + @Excel(name = "工序名称8") + private String processNameEight; + + /** 质检详情8 */ + @Excel(name = "质检详情8") + private String inspectorInfoEight; + + /** 入库详情8 */ + @Excel(name = "入库详情8") + private String godownEntryEight; + + /** 工序名称9 */ + @Excel(name = "工序名称9") + private String processNameNine; + + /** 质检详情9 */ + @Excel(name = "质检详情9") + private String inspectorInfoNine; + + /** 入库详情9 */ + @Excel(name = "入库详情9") + private String godownEntryNine; + + /** 工序名称10 */ + @Excel(name = "工序名称10") + private String processNameTen; + + /** 质检详情10 */ + @Excel(name = "质检详情10") + private String inspectorInfoTen; + + /** 入库详情10 */ + @Excel(name = "入库详情10") + private String godownEntryTen; + + /** 材料名称 */ + @Excel(name = "材料名称") + private String materialsName; + + /** 材料图号 */ + @Excel(name = "材料图号") + private String materialsSpecification; + + /** 下料规格 */ + @Excel(name = "下料规格") + private String specification; + + /** 毛坯数量 */ + @Excel(name = "毛坯数量") + private Long workblank; + + /** 成品数量 */ + @Excel(name = "成品数量") + private Long finished; + + /** 序描述 */ + @Excel(name = "序描述") + private String xuDescribe; + + /** 是否超时 */ + @Excel(name = "是否超时") + private String overTime; + + /** 系统分析 */ + @Excel(name = "系统分析") + private String analysis; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public String getMakeDocumentCode() { + return makeDocumentCode; + } + + public void setMakeDocumentCode(String makeDocumentCode) { + this.makeDocumentCode = makeDocumentCode; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setNum(Long num) + { + this.num = num; + } + + public Long getNum() + { + return num; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setProcessNameOne(String processNameOne) + { + this.processNameOne = processNameOne; + } + + public String getProcessNameOne() + { + return processNameOne; + } + public void setInspectorInfoOne(String inspectorInfoOne) + { + this.inspectorInfoOne = inspectorInfoOne; + } + + public String getInspectorInfoOne() + { + return inspectorInfoOne; + } + public void setGodownEntryOne(String godownEntryOne) + { + this.godownEntryOne = godownEntryOne; + } + + public String getGodownEntryOne() + { + return godownEntryOne; + } + public void setProcessNameTwo(String processNameTwo) + { + this.processNameTwo = processNameTwo; + } + + public String getProcessNameTwo() + { + return processNameTwo; + } + public void setInspectorInfoTwo(String inspectorInfoTwo) + { + this.inspectorInfoTwo = inspectorInfoTwo; + } + + public String getInspectorInfoTwo() + { + return inspectorInfoTwo; + } + public void setGodownEntryTwo(String godownEntryTwo) + { + this.godownEntryTwo = godownEntryTwo; + } + + public String getGodownEntryTwo() + { + return godownEntryTwo; + } + public void setProcessNameThree(String processNameThree) + { + this.processNameThree = processNameThree; + } + + public String getProcessNameThree() + { + return processNameThree; + } + public void setInspectorInfoThree(String inspectorInfoThree) + { + this.inspectorInfoThree = inspectorInfoThree; + } + + public String getInspectorInfoThree() + { + return inspectorInfoThree; + } + public void setGodownEntryThree(String godownEntryThree) + { + this.godownEntryThree = godownEntryThree; + } + + public String getGodownEntryThree() + { + return godownEntryThree; + } + public void setProcessNameFour(String processNameFour) + { + this.processNameFour = processNameFour; + } + + public String getProcessNameFour() + { + return processNameFour; + } + public void setInspectorInfoFour(String inspectorInfoFour) + { + this.inspectorInfoFour = inspectorInfoFour; + } + + public String getInspectorInfoFour() + { + return inspectorInfoFour; + } + public void setGodownEntryFour(String godownEntryFour) + { + this.godownEntryFour = godownEntryFour; + } + + public String getGodownEntryFour() + { + return godownEntryFour; + } + public void setProcessNameFive(String processNameFive) + { + this.processNameFive = processNameFive; + } + + public String getProcessNameFive() + { + return processNameFive; + } + public void setInspectorInfoFive(String inspectorInfoFive) + { + this.inspectorInfoFive = inspectorInfoFive; + } + + public String getInspectorInfoFive() + { + return inspectorInfoFive; + } + public void setGodownEntryFive(String godownEntryFive) + { + this.godownEntryFive = godownEntryFive; + } + + public String getGodownEntryFive() + { + return godownEntryFive; + } + public void setProcessNameSix(String processNameSix) + { + this.processNameSix = processNameSix; + } + + public String getProcessNameSix() + { + return processNameSix; + } + public void setInspectorInfoSix(String inspectorInfoSix) + { + this.inspectorInfoSix = inspectorInfoSix; + } + + public String getInspectorInfoSix() + { + return inspectorInfoSix; + } + public void setGodownEntrySix(String godownEntrySix) + { + this.godownEntrySix = godownEntrySix; + } + + public String getGodownEntrySix() + { + return godownEntrySix; + } + public void setProcessNameSeven(String processNameSeven) + { + this.processNameSeven = processNameSeven; + } + + public String getProcessNameSeven() + { + return processNameSeven; + } + public void setInspectorInfoSeven(String inspectorInfoSeven) + { + this.inspectorInfoSeven = inspectorInfoSeven; + } + + public String getInspectorInfoSeven() + { + return inspectorInfoSeven; + } + public void setGodownEntrySeven(String godownEntrySeven) + { + this.godownEntrySeven = godownEntrySeven; + } + + public String getGodownEntrySeven() + { + return godownEntrySeven; + } + public void setProcessNameEight(String processNameEight) + { + this.processNameEight = processNameEight; + } + + public String getProcessNameEight() + { + return processNameEight; + } + public void setInspectorInfoEight(String inspectorInfoEight) + { + this.inspectorInfoEight = inspectorInfoEight; + } + + public String getInspectorInfoEight() + { + return inspectorInfoEight; + } + public void setGodownEntryEight(String godownEntryEight) + { + this.godownEntryEight = godownEntryEight; + } + + public String getGodownEntryEight() + { + return godownEntryEight; + } + public void setProcessNameNine(String processNameNine) + { + this.processNameNine = processNameNine; + } + + public String getProcessNameNine() + { + return processNameNine; + } + public void setInspectorInfoNine(String inspectorInfoNine) + { + this.inspectorInfoNine = inspectorInfoNine; + } + + public String getInspectorInfoNine() + { + return inspectorInfoNine; + } + public void setGodownEntryNine(String godownEntryNine) + { + this.godownEntryNine = godownEntryNine; + } + + public String getGodownEntryNine() + { + return godownEntryNine; + } + public void setProcessNameTen(String processNameTen) + { + this.processNameTen = processNameTen; + } + + public String getProcessNameTen() + { + return processNameTen; + } + public void setInspectorInfoTen(String inspectorInfoTen) + { + this.inspectorInfoTen = inspectorInfoTen; + } + + public String getInspectorInfoTen() + { + return inspectorInfoTen; + } + public void setGodownEntryTen(String godownEntryTen) + { + this.godownEntryTen = godownEntryTen; + } + + public String getGodownEntryTen() + { + return godownEntryTen; + } + public void setMaterialsName(String materialsName) + { + this.materialsName = materialsName; + } + + public String getMaterialsName() + { + return materialsName; + } + public void setMaterialsSpecification(String materialsSpecification) + { + this.materialsSpecification = materialsSpecification; + } + + public String getMaterialsSpecification() + { + return materialsSpecification; + } + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + public void setWorkblank(Long workblank) + { + this.workblank = workblank; + } + + public Long getWorkblank() + { + return workblank; + } + public void setFinished(Long finished) + { + this.finished = finished; + } + + public Long getFinished() + { + return finished; + } + public void setXuDescribe(String xuDescribe) + { + this.xuDescribe = xuDescribe; + } + + public String getXuDescribe() + { + return xuDescribe; + } + public void setOverTime(String overTime) + { + this.overTime = overTime; + } + + public String getOverTime() + { + return overTime; + } + public void setAnalysis(String analysis) + { + this.analysis = analysis; + } + + public String getAnalysis() + { + return analysis; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("makeDocumentCode", getMakeDocumentCode()) + .append("productName", getProductName()) + .append("num", getNum()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("oneNumber", getOneNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("sumNumber", getSumNumber()) + .append("remarks", getRemarks()) + .append("processNameOne", getProcessNameOne()) + .append("inspectorInfoOne", getInspectorInfoOne()) + .append("godownEntryOne", getGodownEntryOne()) + .append("processNameTwo", getProcessNameTwo()) + .append("inspectorInfoTwo", getInspectorInfoTwo()) + .append("godownEntryTwo", getGodownEntryTwo()) + .append("processNameThree", getProcessNameThree()) + .append("inspectorInfoThree", getInspectorInfoThree()) + .append("godownEntryThree", getGodownEntryThree()) + .append("processNameFour", getProcessNameFour()) + .append("inspectorInfoFour", getInspectorInfoFour()) + .append("godownEntryFour", getGodownEntryFour()) + .append("processNameFive", getProcessNameFive()) + .append("inspectorInfoFive", getInspectorInfoFive()) + .append("godownEntryFive", getGodownEntryFive()) + .append("processNameSix", getProcessNameSix()) + .append("inspectorInfoSix", getInspectorInfoSix()) + .append("godownEntrySix", getGodownEntrySix()) + .append("processNameSeven", getProcessNameSeven()) + .append("inspectorInfoSeven", getInspectorInfoSeven()) + .append("godownEntrySeven", getGodownEntrySeven()) + .append("processNameEight", getProcessNameEight()) + .append("inspectorInfoEight", getInspectorInfoEight()) + .append("godownEntryEight", getGodownEntryEight()) + .append("processNameNine", getProcessNameNine()) + .append("inspectorInfoNine", getInspectorInfoNine()) + .append("godownEntryNine", getGodownEntryNine()) + .append("processNameTen", getProcessNameTen()) + .append("inspectorInfoTen", getInspectorInfoTen()) + .append("godownEntryTen", getGodownEntryTen()) + .append("materialsName", getMaterialsName()) + .append("materialsSpecification", getMaterialsSpecification()) + .append("specification", getSpecification()) + .append("workblank", getWorkblank()) + .append("finished", getFinished()) + .append("xuDescribe", getXuDescribe()) + .append("overTime", getOverTime()) + .append("analysis", getAnalysis()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwStoresRequisition.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwStoresRequisition.java new file mode 100644 index 0000000..3f73f70 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwStoresRequisition.java @@ -0,0 +1,237 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 物品领料单对象 pw_stores_requisition + * + * @author zhukangchao + * @date 2022-03-14 + */ +public class PwStoresRequisition extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主讲 */ + private Long id; + + /** 领料单编号 */ + @Excel(name = "领料单编号") + private String code; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 用途 */ + @Excel(name = "用途") + private String purpose; + + /** 物料名称 */ +// @Excel(name = "物料名称") + private String materialName; + + /** 领料日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "领料日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date demandDate; + + /** 申请人 */ + @Excel(name = "申请人") + private String proposer; + + /** 审核人 */ + @Excel(name = "审核人") + private String auditor; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用1 */ + @Excel(name = "备用1") + private String sparedOne; + + /** 备用2 */ + @Excel(name = "备用2") + private String sparedTwo; + + /** 备用3 */ + @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4 */ + @Excel(name = "备用4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + /** 详情信息 */ + private List list; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public void setPurpose(String purpose) + { + this.purpose = purpose; + } + + public String getPurpose() + { + return purpose; + } + public void setDemandDate(Date demandDate) + { + this.demandDate = demandDate; + } + + public Date getDemandDate() + { + return demandDate; + } + public void setProposer(String proposer) + { + this.proposer = proposer; + } + + public String getProposer() + { + return proposer; + } + public void setAuditor(String auditor) + { + this.auditor = auditor; + } + + public String getAuditor() + { + return auditor; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + @Override + public String toString() { + return "PwStoresRequisition [id=" + id + ", code=" + code + ", name=" + name + ", purpose=" + purpose + + ", materialName=" + materialName + ", demandDate=" + demandDate + ", proposer=" + proposer + + ", auditor=" + auditor + ", status=" + status + ", remarks=" + remarks + ", sparedOne=" + sparedOne + + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwStoresRequistionDetail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwStoresRequistionDetail.java new file mode 100644 index 0000000..4c15b2e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwStoresRequistionDetail.java @@ -0,0 +1,312 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 领料单详情对象 pw_stores_requistion_detail + * + * @author zhukangchao + * @date 2022-03-14 + */ +public class PwStoresRequistionDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 领料单id */ + @Excel(name = "领料单id") + private Long storesRequisitionId; + + /** 物料id */ +// @Excel(name = "领料单id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 材料 */ + @Excel(name = "材料") + private String materials; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 单位 */ + @Excel(name = "单位") + private String unitOfMeasurementName; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 单价 */ + @Excel(name = "单价") + private Double univalence; + + /** 总价 */ + @Excel(name = "总价") + private Double totalprice; + + /** 领料人 */ + @Excel(name = "领料人") + private String preferentialOriginName; + + /** 出库状态 */ + @Excel(name = "出库状态") + private String status; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sapredThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + /** + * 令号 + */ + private String code; + + /** 审核人 */ + private String auditor; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getAuditor() { + return auditor; + } + + public void setAuditor(String auditor) { + this.auditor = auditor; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setStoresRequisitionId(Long storesRequisitionId) + { + this.storesRequisitionId = storesRequisitionId; + } + + public Long getStoresRequisitionId() + { + return storesRequisitionId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setUnitOfMeasurementName(String unitOfMeasurementName) + { + this.unitOfMeasurementName = unitOfMeasurementName; + } + + public String getUnitOfMeasurementName() + { + return unitOfMeasurementName; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setUnivalence(Double univalence) + { + this.univalence = univalence; + } + + public Double getUnivalence() + { + return univalence; + } + public void setTotalprice(Double totalprice) + { + this.totalprice = totalprice; + } + + public Double getTotalprice() + { + return totalprice; + } + public void setPreferentialOriginName(String preferentialOriginName) + { + this.preferentialOriginName = preferentialOriginName; + } + + public String getPreferentialOriginName() + { + return preferentialOriginName; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSapredThree(Long sapredThree) + { + this.sapredThree = sapredThree; + } + + public Long getSapredThree() + { + return sapredThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("storesRequisitionId", getStoresRequisitionId()) + .append("materialName", getMaterialName()) + .append("figureNumber", getFigureNumber()) + .append("materials", getMaterials()) + .append("pieceWeight", getPieceWeight()) + .append("unitOfMeasurementName", getUnitOfMeasurementName()) + .append("number", getNumber()) + .append("univalence", getUnivalence()) + .append("totalprice", getTotalprice()) + .append("preferentialOriginName", getPreferentialOriginName()) + .append("status", getStatus()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sapredThree", getSapredThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwTask.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwTask.java new file mode 100644 index 0000000..e3ef95a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwTask.java @@ -0,0 +1,323 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 任务对象 pw_task + * + * @author zhukangchao + * @date 2020-08-11 + */ +public class PwTask extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 执行单产品id */ + @Excel(name = "执行单产品id") + private Long productionBillProduceId; + + /** 父级任务id */ + @Excel(name = "父级任务id") + private Long parentLevelTaskId; + + /** 任务编号 */ + @Excel(name = "任务编号") + private String taskCode; + + /** 任务名称 */ + @Excel(name = "任务名称") + private String taskName; + + /** 加工数量 */ + @Excel(name = "加工数量") + private Long quantity; + + /** 发布者名称 */ + @Excel(name = "发布者名称") + private String taskPromulgatorName; + + /** 计划完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionTime; + + /** 任务开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "任务开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date beginTimes; + + /** 实际完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "实际完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date realityCompletionTime; + + /** 任务用时 */ + @Excel(name = "任务用时") + private Double workingTime; + + /** 领任务人名称 */ + @Excel(name = "领任务人名称") + private String userName; + + /** 领任务人id */ + @Excel(name = "领任务人id") + private Long userId; + + /** 任务状态(0:未发布,1:已发布,2:已领用,3:已完成) */ + @Excel(name = "任务状态", readConverterExp = "0=:未发布,1:已发布,2:已领用,3:待质检,4:已完成") + private Integer taskStatus; + + /** 零件图号 */ + @Excel(name = "零件图号") + private String partGather; + + /** 生产图纸 */ + @Excel(name = "生产图纸") + private String drawing; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionBillProduceId(Long productionBillProduceId) + { + this.productionBillProduceId = productionBillProduceId; + } + + public Long getProductionBillProduceId() + { + return productionBillProduceId; + } + public void setParentLevelTaskId(Long parentLevelTaskId) + { + this.parentLevelTaskId = parentLevelTaskId; + } + + public Long getParentLevelTaskId() + { + return parentLevelTaskId; + } + public void setTaskCode(String taskCode) + { + this.taskCode = taskCode; + } + + public String getTaskCode() + { + return taskCode; + } + public void setTaskName(String taskName) + { + this.taskName = taskName; + } + + public String getTaskName() + { + return taskName; + } + + public Long getQuantity() { + return quantity; + } + + public void setQuantity(Long quantity) { + this.quantity = quantity; + } + + public void setTaskPromulgatorName(String taskPromulgatorName) + { + this.taskPromulgatorName = taskPromulgatorName; + } + + public String getTaskPromulgatorName() + { + return taskPromulgatorName; + } + public void setCompletionTime(Date completionTime) + { + this.completionTime = completionTime; + } + + public Date getCompletionTime() + { + return completionTime; + } + public void setBeginTimes(Date beginTimes) + { + this.beginTimes = beginTimes; + } + + public Date getBeginTimes() + { + return beginTimes; + } + public void setRealityCompletionTime(Date realityCompletionTime) + { + this.realityCompletionTime = realityCompletionTime; + } + + public Date getRealityCompletionTime() + { + return realityCompletionTime; + } + public void setWorkingTime(Double workingTime) + { + this.workingTime = workingTime; + } + + public Double getWorkingTime() + { + return workingTime; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setTaskStatus(Integer taskStatus) + { + this.taskStatus = taskStatus; + } + + public Integer getTaskStatus() + { + return taskStatus; + } + public void setPartGather(String partGather) + { + this.partGather = partGather; + } + + public String getPartGather() + { + return partGather; + } + public void setDrawing(String drawing) + { + this.drawing = drawing; + } + + public String getDrawing() + { + return drawing; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionBillProduceId", getProductionBillProduceId()) + .append("parentLevelTaskId", getParentLevelTaskId()) + .append("taskCode", getTaskCode()) + .append("taskName", getTaskName()) + .append("quantity", getQuantity()) + .append("taskPromulgatorName", getTaskPromulgatorName()) + .append("completionTime", getCompletionTime()) + .append("beginTimes", getBeginTime()) + .append("realityCompletionTime", getRealityCompletionTime()) + .append("workingTime", getWorkingTime()) + .append("userName", getUserName()) + .append("userId", getUserId()) + .append("taskStatus", getTaskStatus()) + .append("partGather", getPartGather()) + .append("drawing", getDrawing()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwTaskBom.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwTaskBom.java new file mode 100644 index 0000000..e70fb81 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwTaskBom.java @@ -0,0 +1,177 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 任务零部件关联对象 pw_task_bom + * + * @author zhukangchao + * @date 2020-08-20 + */ +public class PwTaskBom extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 任务id */ + @Excel(name = "任务id") + private Long taskId; + + /** 物料id */ + @Excel(name = "物料id") + private Long materialId; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String material; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String figureNumber; + + /** 数量 */ + @Excel(name = "数量") + private Long quantity; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTaskId(Long taskId) + { + this.taskId = taskId; + } + + public Long getTaskId() + { + return taskId; + } + public Long getMaterialId() { + return materialId; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public void setMaterial(String material) + { + this.material = material; + } + + public String getMaterial() + { + return material; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setQuantity(Long quantity) + { + this.quantity = quantity; + } + + public Long getQuantity() + { + return quantity; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("taskId", getTaskId()) + .append("materialId", getMaterialId()) + .append("material", getMaterial()) + .append("figureNumber", getFigureNumber()) + .append("quantity", getQuantity()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwTaskOverTimeInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwTaskOverTimeInfo.java new file mode 100644 index 0000000..9f52303 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwTaskOverTimeInfo.java @@ -0,0 +1,336 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 任务超时信息对象 pw_task_over_time_info + * + * @author zhukangchao + * @date 2023-09-01 + */ +public class PwTaskOverTimeInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 令号 */ + @Excel(name = "令号") + private String code; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String productName; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 下单时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date orderTime; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 加工部门 */ + @Excel(name = "加工部门") + private String departmentName; + + /** 计划完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 超时时间(天) */ + @Excel(name = "超时时间(天)") + private Long timeoutDays; + + /** 领料数量 */ + @Excel(name = "领料数量") + private Double materialRequisitionQuantity; + + /** 请检数量 */ + @Excel(name = "请检数量") + private Double applyForQuantity; + + /** 检验数量 */ + @Excel(name = "检验数量") + private Double checkoutQuantity; + + /** 入库数量 */ + @Excel(name = "入库数量") + private Double storageQuantity; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private String sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 备用字段5 */ + @Excel(name = "备用字段5") + private Long sparedFive; + + /** 备用字段6 */ + @Excel(name = "备用字段6") + private Long sparedSix; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setOrderTime(Date orderTime) + { + this.orderTime = orderTime; + } + + public Date getOrderTime() + { + return orderTime; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setDepartmentName(String departmentName) + { + this.departmentName = departmentName; + } + + public String getDepartmentName() + { + return departmentName; + } + public void setCompletionDate(Date completionDate) + { + this.completionDate = completionDate; + } + + public Date getCompletionDate() + { + return completionDate; + } + public void setTimeoutDays(Long timeoutDays) + { + this.timeoutDays = timeoutDays; + } + + public Long getTimeoutDays() + { + return timeoutDays; + } + public void setMaterialRequisitionQuantity(Double materialRequisitionQuantity) + { + this.materialRequisitionQuantity = materialRequisitionQuantity; + } + + public Double getMaterialRequisitionQuantity() + { + return materialRequisitionQuantity; + } + public void setApplyForQuantity(Double applyForQuantity) + { + this.applyForQuantity = applyForQuantity; + } + + public Double getApplyForQuantity() + { + return applyForQuantity; + } + public void setCheckoutQuantity(Double checkoutQuantity) + { + this.checkoutQuantity = checkoutQuantity; + } + + public Double getCheckoutQuantity() + { + return checkoutQuantity; + } + public void setStorageQuantity(Double storageQuantity) + { + this.storageQuantity = storageQuantity; + } + + public Double getStorageQuantity() + { + return storageQuantity; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(String sparedThree) + { + this.sparedThree = sparedThree; + } + + public String getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setSparedFive(Long sparedFive) + { + this.sparedFive = sparedFive; + } + + public Long getSparedFive() + { + return sparedFive; + } + public void setSparedSix(Long sparedSix) + { + this.sparedSix = sparedSix; + } + + public Long getSparedSix() + { + return sparedSix; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("productName", getProductName()) + .append("name", getName()) + .append("figureNumber", getFigureNumber()) + .append("sumNumber", getSumNumber()) + .append("orderTime", getOrderTime()) + .append("processName", getProcessName()) + .append("departmentName", getDepartmentName()) + .append("completionDate", getCompletionDate()) + .append("timeoutDays", getTimeoutDays()) + .append("materialRequisitionQuantity", getMaterialRequisitionQuantity()) + .append("applyForQuantity", getApplyForQuantity()) + .append("checkoutQuantity", getCheckoutQuantity()) + .append("storageQuantity", getStorageQuantity()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("sparedFive", getSparedFive()) + .append("sparedSix", getSparedSix()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwTicketInfo.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwTicketInfo.java new file mode 100644 index 0000000..10bda73 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwTicketInfo.java @@ -0,0 +1,234 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 处罚单信息对象 pw_ticket_info + * + * @author zhukangchao + * @date 2023-08-01 + */ +public class PwTicketInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 处罚单编号 */ + @Excel(name = "处罚单编号") + private String code; + + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractCode; + + /** 处罚金额(小写) */ + @Excel(name = "处罚金额(小写)") + private Double money; + + /** 处罚金额(大写) */ + @Excel(name = "处罚金额(大写)") + private String moneyBig; + + /** 处罚原因 */ + @Excel(name = "处罚原因") + private String punishReason; + + /** 是否开票 */ + @Excel(name = "是否开票") + private String invoice; + + /** 发票图片 */ + @Excel(name = "发票图片") + private String invoiceImgUrl; + + /** 是否收款 */ + @Excel(name = "是否收款") + private String proceeds; + + /** 收款截图 */ + @Excel(name = "收款截图") + private String proceedsImgUrl; + + /** 备注 */ + @Excel(name = "备注") + private String remakes; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setContractCode(String contractCode) + { + this.contractCode = contractCode; + } + + public String getContractCode() + { + return contractCode; + } + public void setMoney(Double money) + { + this.money = money; + } + + public Double getMoney() + { + return money; + } + public void setMoneyBig(String moneyBig) + { + this.moneyBig = moneyBig; + } + + public String getMoneyBig() + { + return moneyBig; + } + public void setPunishReason(String punishReason) + { + this.punishReason = punishReason; + } + + public String getPunishReason() + { + return punishReason; + } + public void setInvoice(String invoice) + { + this.invoice = invoice; + } + + public String getInvoice() + { + return invoice; + } + public void setInvoiceImgUrl(String invoiceImgUrl) + { + this.invoiceImgUrl = invoiceImgUrl; + } + + public String getInvoiceImgUrl() + { + return invoiceImgUrl; + } + public void setProceeds(String proceeds) + { + this.proceeds = proceeds; + } + + public String getProceeds() + { + return proceeds; + } + public void setProceedsImgUrl(String proceedsImgUrl) + { + this.proceedsImgUrl = proceedsImgUrl; + } + + public String getProceedsImgUrl() + { + return proceedsImgUrl; + } + public void setRemakes(String remakes) + { + this.remakes = remakes; + } + + public String getRemakes() + { + return remakes; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("code", getCode()) + .append("contractCode", getContractCode()) + .append("money", getMoney()) + .append("moneyBig", getMoneyBig()) + .append("punishReason", getPunishReason()) + .append("invoice", getInvoice()) + .append("invoiceImgUrl", getInvoiceImgUrl()) + .append("proceeds", getProceeds()) + .append("proceedsImgUrl", getProceedsImgUrl()) + .append("remakes", getRemakes()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/PwUserEmail.java b/evo/src/main/java/com/ruoyi/project/management/domain/PwUserEmail.java new file mode 100644 index 0000000..8190702 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/PwUserEmail.java @@ -0,0 +1,149 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 邮箱对象 pw_user_email + * + * @author zhukangchao + * @date 2022-09-24 + */ +public class PwUserEmail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 邮箱地址 */ + @Excel(name = "邮箱地址") + private String email; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setEmail(String email) + { + this.email = email; + } + + public String getEmail() + { + return email; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("name", getName()) + .append("email", getEmail()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/RealInventoryVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/RealInventoryVo.java new file mode 100644 index 0000000..2ecd0e1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/RealInventoryVo.java @@ -0,0 +1,23 @@ +package com.ruoyi.project.management.domain; + +public class RealInventoryVo { + + private String figureNumber; //物料编号 + private Double number; //可用数量 + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public Double getNumber() { + return number; + } + + public void setNumber(Double number) { + this.number = number; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/RequestVo.java b/evo/src/main/java/com/ruoyi/project/management/domain/RequestVo.java new file mode 100644 index 0000000..bc72436 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/RequestVo.java @@ -0,0 +1,111 @@ +package com.ruoyi.project.management.domain; + +public class RequestVo { + + /** 图号 */ + private String figureNumber; + + /** 名称 */ + private String name; + + /** 单台数量 */ + private Long oneNumber; + + /** 材料 */ + private String type; + + /** 单重(KG) */ + private Double pieceWeight; + /** 工序名称 */ + private String processName; + + /** 完工部门*/ + private String departmentName; + + /** 用时 */ + private Long xuTime; + /** 用时单位 */ + private String timeUnit; + /** 序描述*/ + private String xuDescribe; + + public String getFigureNumber() { + return figureNumber; + } + + public void setFigureNumber(String figureNumber) { + this.figureNumber = figureNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getOneNumber() { + return oneNumber; + } + + public void setOneNumber(Long oneNumber) { + this.oneNumber = oneNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Double getPieceWeight() { + return pieceWeight; + } + + public void setPieceWeight(Double pieceWeight) { + this.pieceWeight = pieceWeight; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public Long getXuTime() { + return xuTime; + } + + public void setXuTime(Long xuTime) { + this.xuTime = xuTime; + } + + public String getTimeUnit() { + return timeUnit; + } + + public void setTimeUnit(String timeUnit) { + this.timeUnit = timeUnit; + } + + public String getXuDescribe() { + return xuDescribe; + } + + public void setXuDescribe(String xuDescribe) { + this.xuDescribe = xuDescribe; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/Scheme.java b/evo/src/main/java/com/ruoyi/project/management/domain/Scheme.java new file mode 100644 index 0000000..84aaea4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/Scheme.java @@ -0,0 +1,32 @@ +package com.ruoyi.project.management.domain; + +public class Scheme { + + private String typeName; + private String name; + private Integer num; + + public String getTypeName() { + return typeName; + } + public void setTypeName(String typeName) { + this.typeName = typeName; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public Integer getNum() { + return num; + } + public void setNum(Integer num) { + this.num = num; + } + @Override + public String toString() { + return "Scheme [typeName=" + typeName + ", name=" + name + ", num=" + num + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/Subparts.java b/evo/src/main/java/com/ruoyi/project/management/domain/Subparts.java new file mode 100644 index 0000000..10ec273 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/Subparts.java @@ -0,0 +1,26 @@ +package com.ruoyi.project.management.domain; + +public class Subparts { + + //图号 + private String partname; + //数量 + private String number; + public String getPartname() { + return partname; + } + public void setPartname(String partname) { + this.partname = partname; + } + public String getNumber() { + return number; + } + public void setNumber(String number) { + this.number = number; + } + @Override + public String toString() { + return "Subparts [partname=" + partname + ", number=" + number + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/SysConfigIni.java b/evo/src/main/java/com/ruoyi/project/management/domain/SysConfigIni.java new file mode 100644 index 0000000..6befb02 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/SysConfigIni.java @@ -0,0 +1,179 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 图纸配置 +对象 sys_config_ini + * + * @author zhukangchao + * @date 2021-03-05 + */ +public class SysConfigIni extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** dir */ + @Excel(name = "dir") + private String dir; + + /** 路径 */ + @Excel(name = "路径") + private String url; + + /** 项目图纸路径 */ + @Excel(name = "项目图纸路径") + private String productDir; + + /** 图纸类别 */ + @Excel(name = "图纸类别") + private String fileType; + + /** 图纸路径 */ + @Excel(name = "图纸路径") + private String fileUrl; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记(0:未删除,1:已删除) */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDir(String dir) + { + this.dir = dir; + } + + public String getDir() + { + return dir; + } + public void setUrl(String url) + { + this.url = url; + } + + public String getUrl() + { + return url; + } + public void setProductDir(String productDir) + { + this.productDir = productDir; + } + + public String getProductDir() + { + return productDir; + } + public void setFileType(String fileType) + { + this.fileType = fileType; + } + + public String getFileType() + { + return fileType; + } + public void setFileUrl(String fileUrl) + { + this.fileUrl = fileUrl; + } + + public String getFileUrl() + { + return fileUrl; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("dir", getDir()) + .append("url", getUrl()) + .append("productDir", getProductDir()) + .append("fileType", getFileType()) + .append("fileUrl", getFileUrl()) + .append("remark", getRemark()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/YcBomNumberPreliminaryInquiry.java b/evo/src/main/java/com/ruoyi/project/management/domain/YcBomNumberPreliminaryInquiry.java new file mode 100644 index 0000000..c3649c2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/YcBomNumberPreliminaryInquiry.java @@ -0,0 +1,248 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预查询点件对象 yc_bom_number_preliminary_inquiry + * + * @author zhukangchao + * @date 2021-12-08 + */ +public class YcBomNumberPreliminaryInquiry extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productionCode; + + /** 型号 */ + @Excel(name = "型号") + private String typeName; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 父级图号 */ + @Excel(name = "父级图号") + private String parentLevelFigureNumber; + + /** 父级名称 */ + @Excel(name = "父级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 备用1 */ + @Excel(name = "备用1") + private String sparedOne; + + /** 备用2 */ + @Excel(name = "备用2") + private String sparedTwo; + + /** 备用3 */ + @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4 */ + @Excel(name = "备用4") + private Long sparedFour; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTypeName() + { + return typeName; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionCode", getProductionCode()) + .append("typeName", getTypeName()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("oneNumber", getOneNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("parentLevelFigureNumber", getParentLevelFigureNumber()) + .append("parentLevelName", getParentLevelName()) + .append("sumNumber", getSumNumber()) + .append("remarks", getRemarks()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/YcBomNumberTwoPreliminaryInquiry.java b/evo/src/main/java/com/ruoyi/project/management/domain/YcBomNumberTwoPreliminaryInquiry.java new file mode 100644 index 0000000..dcce926 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/YcBomNumberTwoPreliminaryInquiry.java @@ -0,0 +1,320 @@ +package com.ruoyi.project.management.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预查询计算后的点件对象 yc_bom_number_two_preliminary_inquiry + * + * @author zhukangchao + * @date 2021-12-08 + */ +public class YcBomNumberTwoPreliminaryInquiry extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 生产令号 */ + @Excel(name = "生产令号") + private String productionCode; + + /** 图号 */ + @Excel(name = "图号") + private String figureNumber; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 单台数量 */ + @Excel(name = "单台数量") + private Long oneNumber; + + /** 材料 */ + @Excel(name = "材料") + private String type; + + /** 单重 */ + @Excel(name = "单重") + private Double pieceWeight; + + /** 上级图号 */ + @Excel(name = "上级图号") + private String parentLevelFigureNumber; + + /** 上级名称 */ + @Excel(name = "上级名称") + private String parentLevelName; + + /** 本批数量 */ + @Excel(name = "本批数量") + private Long sumNumber; + + /** 所属型号 */ + @Excel(name = "所属型号") + private String sparedOne; + + /** 有无库存 */ + @Excel(name = "有无库存") + private String sparedTwo; + + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + + /** 入库状态 */ + @Excel(name = "入库状态") + private String inventoryStatus; + + /** 上级id */ + @Excel(name = "上级id") + private Long superiorId; + + /** 备注 */ + @Excel(name = "备注") + private String remarks; + + /** 完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date completionDate; + + /** 加工部门 */ + @Excel(name = "加工部门") + private String departmentName; + + /** 备用3 */ + @Excel(name = "备用3") + private Long sparedThree; + + /** 备用4(即时库存数量) */ + @Excel(name = "备用4", readConverterExp = "即=时库存数量") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setProductionCode(String productionCode) + { + this.productionCode = productionCode; + } + + public String getProductionCode() + { + return productionCode; + } + public void setFigureNumber(String figureNumber) + { + this.figureNumber = figureNumber; + } + + public String getFigureNumber() + { + return figureNumber; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setOneNumber(Long oneNumber) + { + this.oneNumber = oneNumber; + } + + public Long getOneNumber() + { + return oneNumber; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setPieceWeight(Double pieceWeight) + { + this.pieceWeight = pieceWeight; + } + + public Double getPieceWeight() + { + return pieceWeight; + } + public void setParentLevelFigureNumber(String parentLevelFigureNumber) + { + this.parentLevelFigureNumber = parentLevelFigureNumber; + } + + public String getParentLevelFigureNumber() + { + return parentLevelFigureNumber; + } + public void setParentLevelName(String parentLevelName) + { + this.parentLevelName = parentLevelName; + } + + public String getParentLevelName() + { + return parentLevelName; + } + public void setSumNumber(Long sumNumber) + { + this.sumNumber = sumNumber; + } + + public Long getSumNumber() + { + return sumNumber; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setProcessName(String processName) + { + this.processName = processName; + } + + public String getProcessName() + { + return processName; + } + public void setInventoryStatus(String inventoryStatus) + { + this.inventoryStatus = inventoryStatus; + } + + public String getInventoryStatus() + { + return inventoryStatus; + } + public void setSuperiorId(Long superiorId) + { + this.superiorId = superiorId; + } + + public Long getSuperiorId() + { + return superiorId; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setCompletionDate(Date completionDate) + { + this.completionDate = completionDate; + } + + public Date getCompletionDate() + { + return completionDate; + } + public void setDepartmentName(String departmentName) + { + this.departmentName = departmentName; + } + + public String getDepartmentName() + { + return departmentName; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("productionCode", getProductionCode()) + .append("figureNumber", getFigureNumber()) + .append("name", getName()) + .append("oneNumber", getOneNumber()) + .append("type", getType()) + .append("pieceWeight", getPieceWeight()) + .append("parentLevelFigureNumber", getParentLevelFigureNumber()) + .append("parentLevelName", getParentLevelName()) + .append("sumNumber", getSumNumber()) + .append("sparedOne", getSparedOne()) + .append("sparedTwo", getSparedTwo()) + .append("processName", getProcessName()) + .append("inventoryStatus", getInventoryStatus()) + .append("superiorId", getSuperiorId()) + .append("remarks", getRemarks()) + .append("completionDate", getCompletionDate()) + .append("departmentName", getDepartmentName()) + .append("sparedThree", getSparedThree()) + .append("sparedFour", getSparedFour()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/domain/YcProduct.java b/evo/src/main/java/com/ruoyi/project/management/domain/YcProduct.java new file mode 100644 index 0000000..a1e38d1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/domain/YcProduct.java @@ -0,0 +1,126 @@ +package com.ruoyi.project.management.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 预查询产品对象 yc_product + * + * @author zhukangchao + * @date 2021-12-08 + */ +public class YcProduct extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 产品型号 */ + @Excel(name = "产品型号") + private String productType; + + /** 数量 */ + @Excel(name = "数量") + private Long number; + + /** 备用字段1 */ + @Excel(name = "备用字段1") + private String sparedOne; + + /** 备用字段2 */ + @Excel(name = "备用字段2") + private String sparedTwo; + + /** 备用字段3 */ + @Excel(name = "备用字段3") + private Long sparedThree; + + /** 备用字段4 */ + @Excel(name = "备用字段4") + private Long sparedFour; + + /** 删除标记 */ + private Integer delFlag; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public void setProductType(String productType) + { + this.productType = productType; + } + + public String getProductType() + { + return productType; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setSparedOne(String sparedOne) + { + this.sparedOne = sparedOne; + } + + public String getSparedOne() + { + return sparedOne; + } + public void setSparedTwo(String sparedTwo) + { + this.sparedTwo = sparedTwo; + } + + public String getSparedTwo() + { + return sparedTwo; + } + public void setSparedThree(Long sparedThree) + { + this.sparedThree = sparedThree; + } + + public Long getSparedThree() + { + return sparedThree; + } + public void setSparedFour(Long sparedFour) + { + this.sparedFour = sparedFour; + } + + public Long getSparedFour() + { + return sparedFour; + } + public void setDelFlag(Integer delFlag) + { + this.delFlag = delFlag; + } + + public Integer getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return "YcProduct [id=" + id + ", productType=" + productType + ", number=" + number + ", sparedOne=" + + sparedOne + ", sparedTwo=" + sparedTwo + ", sparedThree=" + sparedThree + ", sparedFour=" + sparedFour + + ", delFlag=" + delFlag + "]"; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/AutoInventoryIssueMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/AutoInventoryIssueMapper.java new file mode 100644 index 0000000..cccb089 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/AutoInventoryIssueMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.AutoInventoryIssue; + +/** + * 安全库存出单Mapper接口 + * + * @author chenyongjiang + * @date 2024-02-19 + */ +public interface AutoInventoryIssueMapper +{ + /** + * 查询安全库存出单 + * + * @param id 安全库存出单ID + * @return 安全库存出单 + */ + public AutoInventoryIssue selectAutoInventoryIssueById(Long id); + + /** + * 查询安全库存出单列表 + * + * @param autoInventoryIssue 安全库存出单 + * @return 安全库存出单集合 + */ + public List selectAutoInventoryIssueList(AutoInventoryIssue autoInventoryIssue); + + /** + * 新增安全库存出单 + * + * @param autoInventoryIssue 安全库存出单 + * @return 结果 + */ + public int insertAutoInventoryIssue(AutoInventoryIssue autoInventoryIssue); + + /** + * 修改安全库存出单 + * + * @param autoInventoryIssue 安全库存出单 + * @return 结果 + */ + public int updateAutoInventoryIssue(AutoInventoryIssue autoInventoryIssue); + + /** + * 删除安全库存出单 + * + * @param id 安全库存出单ID + * @return 结果 + */ + public int deleteAutoInventoryIssueById(Long id); + + /** + * 批量删除安全库存出单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteAutoInventoryIssueByIds(Long[] ids); + + /** + * 根据图号查询安全库存出单 + * + * @param figureNumber 安全库存出单ID + * @return 安全库存出单 + */ + public AutoInventoryIssue selectAutoInventoryIssueByFigureNumber(String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/BaseQuestionMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/BaseQuestionMapper.java new file mode 100644 index 0000000..7b46313 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/BaseQuestionMapper.java @@ -0,0 +1,55 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import com.ruoyi.project.management.domain.BaseQuestion; + +/** + * 问题处理Mapper接口 + * + * @author zhukangchao + * @date 2023-10-07 + */ +public interface BaseQuestionMapper +{ + /** + * 查询问题处理 + * + * @param questionId 问题处理ID + * @return 问题处理 + */ + public BaseQuestion selectBaseQuestionById(Long questionId); + + /** + * 查询问题处理列表 + * + * @param baseQuestion 问题处理 + * @return 问题处理集合 + */ + public List selectBaseQuestionList(BaseQuestion baseQuestion); + + /** + * 新增问题处理 + * + * @param baseQuestion 问题处理 + * @return 结果 + */ + public int insertBaseQuestion(BaseQuestion baseQuestion); + + /** + * 修改问题处理 + * + * @param baseQuestion 问题处理 + * @return 结果 + */ + public int updateBaseQuestion(BaseQuestion baseQuestion); + + /** + * 删除问题处理 + * + * @param questionId 问题处理ID + * @return 结果 + */ + public int deleteBaseQuestionById(Long questionId); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CadMaterialInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CadMaterialInfoMapper.java new file mode 100644 index 0000000..8242b98 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CadMaterialInfoMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CadMaterialInfo; + +/** + * CAD物料明细Mapper接口 + * + * @author zhukangchao + * @date 2023-06-13 + */ +public interface CadMaterialInfoMapper +{ + /** + * 查询CAD物料明细 + * + * @param id CAD物料明细ID + * @return CAD物料明细 + */ + public CadMaterialInfo selectCadMaterialInfoById(Long id); + + /** + * 查询CAD物料明细列表 + * + * @param cadMaterialInfo CAD物料明细 + * @return CAD物料明细集合 + */ + public List selectCadMaterialInfoList(CadMaterialInfo cadMaterialInfo); + + /** + * 新增CAD物料明细 + * + * @param cadMaterialInfo CAD物料明细 + * @return 结果 + */ + public int insertCadMaterialInfo(CadMaterialInfo cadMaterialInfo); + + /** + * 修改CAD物料明细 + * + * @param cadMaterialInfo CAD物料明细 + * @return 结果 + */ + public int updateCadMaterialInfo(CadMaterialInfo cadMaterialInfo); + + /** + * 删除CAD物料明细 + * + * @param id CAD物料明细ID + * @return 结果 + */ + public int deleteCadMaterialInfoById(Long id); + + /** + * 批量删除CAD物料明细 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCadMaterialInfoByIds(Long[] ids); + + public CadMaterialInfo selectCadMaterialInfoByNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceMapper.java new file mode 100644 index 0000000..0fb7d06 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwAttendance; + +/** + * 考勤记录Mapper接口 + * + * @author zhukangchao + * @date 2021-11-02 + */ +public interface CwAttendanceMapper +{ + /** + * 查询考勤记录 + * + * @param id 考勤记录ID + * @return 考勤记录 + */ + public CwAttendance selectCwAttendanceById(Long id); + + /** + * 查询考勤记录列表 + * + * @param cwAttendance 考勤记录 + * @return 考勤记录集合 + */ + public List selectCwAttendanceList(CwAttendance cwAttendance); + + /** + * 新增考勤记录 + * + * @param cwAttendance 考勤记录 + * @return 结果 + */ + public int insertCwAttendance(CwAttendance cwAttendance); + + /** + * 修改考勤记录 + * + * @param cwAttendance 考勤记录 + * @return 结果 + */ + public int updateCwAttendance(CwAttendance cwAttendance); + + /** + * 删除考勤记录 + * + * @param id 考勤记录ID + * @return 结果 + */ + public int deleteCwAttendanceById(Long id); + + /** + * 批量删除考勤记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwAttendanceByIds(Long[] ids); + + public CwAttendance selectCwAttendanceByNameAndBelongsToDate(@Param("name")String name,@Param("riqi") String riqi); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceRecordDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceRecordDetailMapper.java new file mode 100644 index 0000000..3e3eecc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceRecordDetailMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.mapper; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwAttendanceRecordDetail; + +/** + * 考勤记录Mapper接口 + * + * @author zhukangchao + * @date 2022-10-21 + */ +public interface CwAttendanceRecordDetailMapper +{ + /** + * 查询考勤记录 + * + * @param id 考勤记录ID + * @return 考勤记录 + */ + public CwAttendanceRecordDetail selectCwAttendanceRecordDetailById(Long id); + + /** + * 查询考勤记录列表 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 考勤记录集合 + */ + public List selectCwAttendanceRecordDetailList(CwAttendanceRecordDetail cwAttendanceRecordDetail); + + /** + * 新增考勤记录 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 结果 + */ + public int insertCwAttendanceRecordDetail(CwAttendanceRecordDetail cwAttendanceRecordDetail); + + /** + * 修改考勤记录 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 结果 + */ + public int updateCwAttendanceRecordDetail(CwAttendanceRecordDetail cwAttendanceRecordDetail); + + /** + * 删除考勤记录 + * + * @param id 考勤记录ID + * @return 结果 + */ + public int deleteCwAttendanceRecordDetailById(Long id); + + /** + * 批量删除考勤记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwAttendanceRecordDetailByIds(Long[] ids); + + public List selectCwAttendanceRecordDetailByCode(@Param("userId") String userId); + + public List selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(@Param("userId") String userId,@Param("date") Date date,@Param("string") String string); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceUserMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceUserMapper.java new file mode 100644 index 0000000..590ddae --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwAttendanceUserMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwAttendanceUser; + +/** + * 员工信息Mapper接口 + * + * @author zhukangchao + * @date 2022-10-21 + */ +public interface CwAttendanceUserMapper +{ + /** + * 查询员工信息 + * + * @param id 员工信息ID + * @return 员工信息 + */ + public CwAttendanceUser selectCwAttendanceUserById(Long id); + + /** + * 查询员工信息列表 + * + * @param cwAttendanceUser 员工信息 + * @return 员工信息集合 + */ + public List selectCwAttendanceUserList(CwAttendanceUser cwAttendanceUser); + + /** + * 新增员工信息 + * + * @param cwAttendanceUser 员工信息 + * @return 结果 + */ + public int insertCwAttendanceUser(CwAttendanceUser cwAttendanceUser); + + /** + * 修改员工信息 + * + * @param cwAttendanceUser 员工信息 + * @return 结果 + */ + public int updateCwAttendanceUser(CwAttendanceUser cwAttendanceUser); + + /** + * 删除员工信息 + * + * @param id 员工信息ID + * @return 结果 + */ + public int deleteCwAttendanceUserById(Long id); + + /** + * 批量删除员工信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwAttendanceUserByIds(Long[] ids); + + public CwAttendanceUser selectCwAttendanceUserByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwButtonMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwButtonMapper.java new file mode 100644 index 0000000..c6fb4e7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwButtonMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwButton; + +/** + * 按钮信息Mapper接口 + * + * @author zhukangchao + * @date 2022-10-31 + */ +public interface CwButtonMapper +{ + /** + * 查询按钮信息 + * + * @param id 按钮信息ID + * @return 按钮信息 + */ + public CwButton selectCwButtonById(Long id); + + /** + * 查询按钮信息列表 + * + * @param cwButton 按钮信息 + * @return 按钮信息集合 + */ + public List selectCwButtonList(CwButton cwButton); + + /** + * 新增按钮信息 + * + * @param cwButton 按钮信息 + * @return 结果 + */ + public int insertCwButton(CwButton cwButton); + + /** + * 修改按钮信息 + * + * @param cwButton 按钮信息 + * @return 结果 + */ + public int updateCwButton(CwButton cwButton); + + /** + * 删除按钮信息 + * + * @param id 按钮信息ID + * @return 结果 + */ + public int deleteCwButtonById(Long id); + + /** + * 批量删除按钮信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwButtonByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwCostAnalysisMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwCostAnalysisMapper.java new file mode 100644 index 0000000..b354dca --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwCostAnalysisMapper.java @@ -0,0 +1,74 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwCostAnalysis; + +/** + * 成本分析信息Mapper接口 + * + * @author zhukangchao + * @date 2023-08-11 + */ +public interface CwCostAnalysisMapper +{ + /** + * 查询成本分析信息 + * + * @param id 成本分析信息ID + * @return 成本分析信息 + */ + public CwCostAnalysis selectCwCostAnalysisById(Long id); + + /** + * 查询成本分析信息列表 + * + * @param cwCostAnalysis 成本分析信息 + * @return 成本分析信息集合 + */ + public List selectCwCostAnalysisList(CwCostAnalysis cwCostAnalysis); + + /** + * 新增成本分析信息 + * + * @param cwCostAnalysis 成本分析信息 + * @return 结果 + */ + public int insertCwCostAnalysis(CwCostAnalysis cwCostAnalysis); + + /** + * 修改成本分析信息 + * + * @param cwCostAnalysis 成本分析信息 + * @return 结果 + */ + public int updateCwCostAnalysis(CwCostAnalysis cwCostAnalysis); + + /** + * 删除成本分析信息 + * + * @param id 成本分析信息ID + * @return 结果 + */ + public int deleteCwCostAnalysisById(Long id); + + /** + * 批量删除成本分析信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwCostAnalysisByIds(Long[] ids); + + public int insertCwCostAnalysiss(List list2); + + public int deleteCwCostAnalysisBySparedFour(@Param("long1")Long long1); + + public List selectCwCostAnalysisByUuid(String uuid); + + public List selectCwCostAnalysisByStatisticsId(@Param("id") Long id); + + public int updateCwCostAnalysiss(List list2); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwCostStatisticsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwCostStatisticsMapper.java new file mode 100644 index 0000000..a2f80f9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwCostStatisticsMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwCostStatistics; + +/** + * 成本统计信息Mapper接口 + * + * @author zhukangchao + * @date 2023-08-12 + */ +public interface CwCostStatisticsMapper +{ + /** + * 查询成本统计信息 + * + * @param id 成本统计信息ID + * @return 成本统计信息 + */ + public CwCostStatistics selectCwCostStatisticsById(Long id); + + /** + * 查询成本统计信息列表 + * + * @param cwCostStatistics 成本统计信息 + * @return 成本统计信息集合 + */ + public List selectCwCostStatisticsList(CwCostStatistics cwCostStatistics); + + /** + * 新增成本统计信息 + * + * @param cwCostStatistics 成本统计信息 + * @return 结果 + */ + public int insertCwCostStatistics(CwCostStatistics cwCostStatistics); + + /** + * 修改成本统计信息 + * + * @param cwCostStatistics 成本统计信息 + * @return 结果 + */ + public int updateCwCostStatistics(CwCostStatistics cwCostStatistics); + + /** + * 删除成本统计信息 + * + * @param id 成本统计信息ID + * @return 结果 + */ + public int deleteCwCostStatisticsById(Long id); + + /** + * 批量删除成本统计信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwCostStatisticsByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwDepartmentMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwDepartmentMapper.java new file mode 100644 index 0000000..1caf529 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwDepartmentMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwDepartment; + +/** + * 财务部门Mapper接口 + * + * @author zhukangchao + * @date 2021-10-25 + */ +public interface CwDepartmentMapper +{ + /** + * 查询财务部门 + * + * @param id 财务部门ID + * @return 财务部门 + */ + public CwDepartment selectCwDepartmentById(Long id); + + /** + * 查询财务部门列表 + * + * @param cwDepartment 财务部门 + * @return 财务部门集合 + */ + public List selectCwDepartmentList(CwDepartment cwDepartment); + + /** + * 新增财务部门 + * + * @param cwDepartment 财务部门 + * @return 结果 + */ + public int insertCwDepartment(CwDepartment cwDepartment); + + /** + * 修改财务部门 + * + * @param cwDepartment 财务部门 + * @return 结果 + */ + public int updateCwDepartment(CwDepartment cwDepartment); + + /** + * 删除财务部门 + * + * @param id 财务部门ID + * @return 结果 + */ + public int deleteCwDepartmentById(Long id); + + /** + * 批量删除财务部门 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwDepartmentByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwDimissionMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwDimissionMapper.java new file mode 100644 index 0000000..5a8ffa7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwDimissionMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwDimission; + +/** + * 员工离职单Mapper接口 + * + * @author zhukangchao + * @date 2022-04-09 + */ +public interface CwDimissionMapper +{ + /** + * 查询员工离职单 + * + * @param id 员工离职单ID + * @return 员工离职单 + */ + public CwDimission selectCwDimissionById(Long id); + + /** + * 查询员工离职单列表 + * + * @param cwDimission 员工离职单 + * @return 员工离职单集合 + */ + public List selectCwDimissionList(CwDimission cwDimission); + + /** + * 新增员工离职单 + * + * @param cwDimission 员工离职单 + * @return 结果 + */ + public int insertCwDimission(CwDimission cwDimission); + + /** + * 修改员工离职单 + * + * @param cwDimission 员工离职单 + * @return 结果 + */ + public int updateCwDimission(CwDimission cwDimission); + + /** + * 删除员工离职单 + * + * @param id 员工离职单ID + * @return 结果 + */ + public int deleteCwDimissionById(Long id); + + /** + * 批量删除员工离职单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwDimissionByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwEmployeeInformationMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwEmployeeInformationMapper.java new file mode 100644 index 0000000..89edebe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwEmployeeInformationMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwEmployeeInformation; + +/** + * 员工信息Mapper接口 + * + * @author zhukangchao + * @date 2021-10-25 + */ +public interface CwEmployeeInformationMapper +{ + /** + * 查询员工信息 + * + * @param id 员工信息ID + * @return 员工信息 + */ + public CwEmployeeInformation selectCwEmployeeInformationById(Long id); + + /** + * 查询员工信息列表 + * + * @param cwEmployeeInformation 员工信息 + * @return 员工信息集合 + */ + public List selectCwEmployeeInformationList(CwEmployeeInformation cwEmployeeInformation); + + /** + * 新增员工信息 + * + * @param cwEmployeeInformation 员工信息 + * @return 结果 + */ + public int insertCwEmployeeInformation(CwEmployeeInformation cwEmployeeInformation); + + /** + * 修改员工信息 + * + * @param cwEmployeeInformation 员工信息 + * @return 结果 + */ + public int updateCwEmployeeInformation(CwEmployeeInformation cwEmployeeInformation); + + /** + * 删除员工信息 + * + * @param id 员工信息ID + * @return 结果 + */ + public int deleteCwEmployeeInformationById(Long id); + + /** + * 批量删除员工信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwEmployeeInformationByIds(Long[] ids); + + /** + * 根据员工姓名查询员工信息 + * @param name + * @return + */ + public CwEmployeeInformation selectCwEmployeeInformationByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwEvectionMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwEvectionMapper.java new file mode 100644 index 0000000..15b92df --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwEvectionMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwEvection; + +/** + * 出差申请Mapper接口 + * + * @author zhukangchao + * @date 2021-12-28 + */ +public interface CwEvectionMapper +{ + /** + * 查询出差申请 + * + * @param id 出差申请ID + * @return 出差申请 + */ + public CwEvection selectCwEvectionById(Long id); + + /** + * 查询出差申请列表 + * + * @param cwEvection 出差申请 + * @return 出差申请集合 + */ + public List selectCwEvectionList(CwEvection cwEvection); + + /** + * 新增出差申请 + * + * @param cwEvection 出差申请 + * @return 结果 + */ + public int insertCwEvection(CwEvection cwEvection); + + /** + * 修改出差申请 + * + * @param cwEvection 出差申请 + * @return 结果 + */ + public int updateCwEvection(CwEvection cwEvection); + + /** + * 删除出差申请 + * + * @param id 出差申请ID + * @return 结果 + */ + public int deleteCwEvectionById(Long id); + + /** + * 批量删除出差申请 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwEvectionByIds(Long[] ids); + + public List selectCwEvectionByNameAndAttendanceDate(@Param("name") String name,@Param("string") String string); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwExpenseReimbursementMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwExpenseReimbursementMapper.java new file mode 100644 index 0000000..a25c719 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwExpenseReimbursementMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwExpenseReimbursement; + +/** + * 费用报销信息Mapper接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface CwExpenseReimbursementMapper +{ + /** + * 查询费用报销信息 + * + * @param id 费用报销信息ID + * @return 费用报销信息 + */ + public CwExpenseReimbursement selectCwExpenseReimbursementById(Long id); + + /** + * 查询费用报销信息列表 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 费用报销信息集合 + */ + public List selectCwExpenseReimbursementList(CwExpenseReimbursement cwExpenseReimbursement); + + /** + * 新增费用报销信息 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 结果 + */ + public int insertCwExpenseReimbursement(CwExpenseReimbursement cwExpenseReimbursement); + + /** + * 修改费用报销信息 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 结果 + */ + public int updateCwExpenseReimbursement(CwExpenseReimbursement cwExpenseReimbursement); + + /** + * 删除费用报销信息 + * + * @param id 费用报销信息ID + * @return 结果 + */ + public int deleteCwExpenseReimbursementById(Long id); + + /** + * 批量删除费用报销信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwExpenseReimbursementByIds(Long[] ids); + + public CwExpenseReimbursement selectCwExpenseReimbursementByCode(@Param("code") String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwJobsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwJobsMapper.java new file mode 100644 index 0000000..0dacd46 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwJobsMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwJobs; + +/** + * 岗位Mapper接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface CwJobsMapper +{ + /** + * 查询岗位 + * + * @param id 岗位ID + * @return 岗位 + */ + public CwJobs selectCwJobsById(Long id); + + /** + * 查询岗位列表 + * + * @param cwJobs 岗位 + * @return 岗位集合 + */ + public List selectCwJobsList(CwJobs cwJobs); + + /** + * 新增岗位 + * + * @param cwJobs 岗位 + * @return 结果 + */ + public int insertCwJobs(CwJobs cwJobs); + + /** + * 修改岗位 + * + * @param cwJobs 岗位 + * @return 结果 + */ + public int updateCwJobs(CwJobs cwJobs); + + /** + * 删除岗位 + * + * @param id 岗位ID + * @return 结果 + */ + public int deleteCwJobsById(Long id); + + /** + * 批量删除岗位 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwJobsByIds(Long[] ids); + + /** + * 根据岗位名称查询岗位信息 + * @param jobs + * @return + */ + public CwJobs selectCwJobsByJobsName(@Param("jobs") String jobs,@Param("deptName") String deptName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwLeaveRecordMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLeaveRecordMapper.java new file mode 100644 index 0000000..01dd107 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLeaveRecordMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwLeaveRecord; + +/** + * 请假记录Mapper接口 + * + * @author zhukangchao + * @date 2021-12-22 + */ +public interface CwLeaveRecordMapper +{ + /** + * 查询请假记录 + * + * @param id 请假记录ID + * @return 请假记录 + */ + public CwLeaveRecord selectCwLeaveRecordById(Long id); + + /** + * 查询请假记录列表 + * + * @param cwLeaveRecord 请假记录 + * @return 请假记录集合 + */ + public List selectCwLeaveRecordList(CwLeaveRecord cwLeaveRecord); + + /** + * 新增请假记录 + * + * @param cwLeaveRecord 请假记录 + * @return 结果 + */ + public int insertCwLeaveRecord(CwLeaveRecord cwLeaveRecord); + + /** + * 修改请假记录 + * + * @param cwLeaveRecord 请假记录 + * @return 结果 + */ + public int updateCwLeaveRecord(CwLeaveRecord cwLeaveRecord); + + /** + * 删除请假记录 + * + * @param id 请假记录ID + * @return 结果 + */ + public int deleteCwLeaveRecordById(Long id); + + /** + * 批量删除请假记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwLeaveRecordByIds(Long[] ids); + + /** + * 根据名称和日期查询请假记录 + * @param name + * @param string + */ + public List selectCwLeaveRecordByNameAndDate(@Param("name") String name,@Param("date") String date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwLevelOfEducationMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLevelOfEducationMapper.java new file mode 100644 index 0000000..072c476 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLevelOfEducationMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwLevelOfEducation; + +/** + * 补助Mapper接口 + * + * @author zhukangchao + * @date 2021-12-17 + */ +public interface CwLevelOfEducationMapper +{ + /** + * 查询补助 + * + * @param id 补助ID + * @return 补助 + */ + public CwLevelOfEducation selectCwLevelOfEducationById(Long id); + + /** + * 查询补助列表 + * + * @param cwLevelOfEducation 补助 + * @return 补助集合 + */ + public List selectCwLevelOfEducationList(CwLevelOfEducation cwLevelOfEducation); + + /** + * 新增补助 + * + * @param cwLevelOfEducation 补助 + * @return 结果 + */ + public int insertCwLevelOfEducation(CwLevelOfEducation cwLevelOfEducation); + + /** + * 修改补助 + * + * @param cwLevelOfEducation 补助 + * @return 结果 + */ + public int updateCwLevelOfEducation(CwLevelOfEducation cwLevelOfEducation); + + /** + * 删除补助 + * + * @param id 补助ID + * @return 结果 + */ + public int deleteCwLevelOfEducationById(Long id); + + /** + * 批量删除补助 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwLevelOfEducationByIds(Long[] ids); + + /** + * 根据补助项名称查询 + * @param levelOfEducation + * @return + */ + public CwLevelOfEducation selectCwLevelOfEducationBysubsidiesName(@Param("levelOfEducation") String levelOfEducation); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwLogisticsFeesInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLogisticsFeesInfoMapper.java new file mode 100644 index 0000000..6beb825 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLogisticsFeesInfoMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwLogisticsFeesInfo; + +/** + * 物流费用信息Mapper接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface CwLogisticsFeesInfoMapper +{ + /** + * 查询物流费用信息 + * + * @param id 物流费用信息ID + * @return 物流费用信息 + */ + public CwLogisticsFeesInfo selectCwLogisticsFeesInfoById(Long id); + + /** + * 查询物流费用信息列表 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 物流费用信息集合 + */ + public List selectCwLogisticsFeesInfoList(CwLogisticsFeesInfo cwLogisticsFeesInfo); + + /** + * 新增物流费用信息 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 结果 + */ + public int insertCwLogisticsFeesInfo(CwLogisticsFeesInfo cwLogisticsFeesInfo); + + /** + * 修改物流费用信息 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 结果 + */ + public int updateCwLogisticsFeesInfo(CwLogisticsFeesInfo cwLogisticsFeesInfo); + + /** + * 删除物流费用信息 + * + * @param id 物流费用信息ID + * @return 结果 + */ + public int deleteCwLogisticsFeesInfoById(Long id); + + /** + * 批量删除物流费用信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwLogisticsFeesInfoByIds(Long[] ids); + + public CwLogisticsFeesInfo selectCwLogisticsFeesInfoByCode(@Param("code") String contractCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwLogsotocsFeesMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLogsotocsFeesMaterialMapper.java new file mode 100644 index 0000000..6d1625b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwLogsotocsFeesMaterialMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwLogsotocsFeesMaterial; + +/** + * 物流费用和入库单关联Mapper接口 + * + * @author zhukangchao + * @date 2023-12-13 + */ +public interface CwLogsotocsFeesMaterialMapper +{ + /** + * 查询物流费用和入库单关联 + * + * @param id 物流费用和入库单关联ID + * @return 物流费用和入库单关联 + */ + public CwLogsotocsFeesMaterial selectCwLogsotocsFeesMaterialById(Long id); + + /** + * 查询物流费用和入库单关联列表 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 物流费用和入库单关联集合 + */ + public List selectCwLogsotocsFeesMaterialList(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial); + + /** + * 新增物流费用和入库单关联 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 结果 + */ + public int insertCwLogsotocsFeesMaterial(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial); + + /** + * 修改物流费用和入库单关联 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 结果 + */ + public int updateCwLogsotocsFeesMaterial(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial); + + /** + * 删除物流费用和入库单关联 + * + * @param id 物流费用和入库单关联ID + * @return 结果 + */ + public int deleteCwLogsotocsFeesMaterialById(Long id); + + /** + * 批量删除物流费用和入库单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwLogsotocsFeesMaterialByIds(Long[] ids); + + public List selectCwLogsotocsFeesMaterialByProductReceiptMaterialId(@Param("idTwo") Long idTwo); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewAttendanceMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewAttendanceMapper.java new file mode 100644 index 0000000..52ba57d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewAttendanceMapper.java @@ -0,0 +1,91 @@ +package com.ruoyi.project.management.mapper; + +import java.util.LinkedList; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwNewAttendance; + +/** + * 新考勤记录Mapper接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface CwNewAttendanceMapper +{ + /** + * 查询新考勤记录 + * + * @param id 新考勤记录ID + * @return 新考勤记录 + */ + public CwNewAttendance selectCwNewAttendanceById(Long id); + + /** + * 查询新考勤记录列表 + * + * @param cwNewAttendance 新考勤记录 + * @return 新考勤记录集合 + */ + public List selectCwNewAttendanceList(CwNewAttendance cwNewAttendance); + + /** + * 新增新考勤记录 + * + * @param cwNewAttendance 新考勤记录 + * @return 结果 + */ + public int insertCwNewAttendance(CwNewAttendance cwNewAttendance); + + /** + * 修改新考勤记录 + * + * @param cwNewAttendance 新考勤记录 + * @return 结果 + */ + public int updateCwNewAttendance(CwNewAttendance cwNewAttendance); + + /** + * 删除新考勤记录 + * + * @param id 新考勤记录ID + * @return 结果 + */ + public int deleteCwNewAttendanceById(Long id); + + /** + * 批量删除新考勤记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwNewAttendanceByIds(Long[] ids); + + /** + * 批量添加 + * @param list + * @return + */ + public int insertCwNewAttendanceList(List list); + + public List selectCwNewAttendanceByNameAndAttendanceDate(@Param("name") String name,@Param("string") String string); + + /** + * 根据考勤日期和考勤规则查询机加车间-12的数据 + * @param date + * @param string + * @return + */ + public List selectCwNewAttendanceByRulseAndAttDate(@Param("d") String d, @Param("string") String string); + + public CwNewAttendance selectCwNewAttendanceByNameAndAttendanceDateAndWorkEndTimeNull(@Param("name") String name,@Param("format") String format); + + public CwNewAttendance selectCwNewAttendanceByNameAndAttendanceDateAndDay(@Param("name") String name,@Param("format") String format); + + public List selectCwNewAttendanceByDeptAndDate(@Param("deptName") String deptName,@Param("format") String format); + + public List selectCwNewAttendanceByName(@Param("name") String name); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewAttendanceStatisticalMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewAttendanceStatisticalMapper.java new file mode 100644 index 0000000..1b9e5b7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewAttendanceStatisticalMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.mapper; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; + +/** + * 考勤记录统计Mapper接口 + * + * @author zhukangchao + * @date 2022-03-30 + */ +public interface CwNewAttendanceStatisticalMapper +{ + /** + * 查询考勤记录统计 + * + * @param id 考勤记录统计ID + * @return 考勤记录统计 + */ + public CwNewAttendanceStatistical selectCwNewAttendanceStatisticalById(Long id); + + /** + * 查询考勤记录统计列表 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 考勤记录统计集合 + */ + public List selectCwNewAttendanceStatisticalList(CwNewAttendanceStatistical cwNewAttendanceStatistical); + + /** + * 新增考勤记录统计 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 结果 + */ + public int insertCwNewAttendanceStatistical(CwNewAttendanceStatistical cwNewAttendanceStatistical); + + /** + * 修改考勤记录统计 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 结果 + */ + public int updateCwNewAttendanceStatistical(CwNewAttendanceStatistical cwNewAttendanceStatistical); + + /** + * 删除考勤记录统计 + * + * @param id 考勤记录统计ID + * @return 结果 + */ + public int deleteCwNewAttendanceStatisticalById(Long id); + + /** + * 批量删除考勤记录统计 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwNewAttendanceStatisticalByIds(Long[] ids); + + public CwNewAttendanceStatistical selectCwNewAttendanceStatisticalByNameAndDate(@Param("name") String name,@Param("parse") String parse); + + public List selectCwNewAttendanceStatisticalByName(@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewEmployeeInformationMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewEmployeeInformationMapper.java new file mode 100644 index 0000000..fef1f99 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewEmployeeInformationMapper.java @@ -0,0 +1,78 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; + +/** + * 新员工基本信息Mapper接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface CwNewEmployeeInformationMapper +{ + /** + * 查询新员工基本信息 + * + * @param id 新员工基本信息ID + * @return 新员工基本信息 + */ + public CwNewEmployeeInformation selectCwNewEmployeeInformationById(Long id); + + /** + * 查询新员工基本信息列表 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 新员工基本信息集合 + */ + public List selectCwNewEmployeeInformationList(CwNewEmployeeInformation cwNewEmployeeInformation); + + /** + * 新增新员工基本信息 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 结果 + */ + public int insertCwNewEmployeeInformation(CwNewEmployeeInformation cwNewEmployeeInformation); + + /** + * 修改新员工基本信息 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 结果 + */ + public int updateCwNewEmployeeInformation(CwNewEmployeeInformation cwNewEmployeeInformation); + + /** + * 删除新员工基本信息 + * + * @param id 新员工基本信息ID + * @return 结果 + */ + public int deleteCwNewEmployeeInformationById(Long id); + + /** + * 批量删除新员工基本信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwNewEmployeeInformationByIds(Long[] ids); + + /** + * 根据员工姓名查询员工信息 + * @param name + * @return + */ + public CwNewEmployeeInformation selectCwNewEmployeeInformationByName(String name); + + public List selectCwNewEmployeeInformationByDateList(@Param("string")String string); + + public List selectCwNewEmployeeInformationListByName( + CwNewEmployeeInformation cwNewEmployeeInformation); + + public int updateCwNewEmployeeInformationByBuZhu(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewPayrollMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewPayrollMapper.java new file mode 100644 index 0000000..14ae7bc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNewPayrollMapper.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwNewPayroll; + +/** + * 新工资单Mapper接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface CwNewPayrollMapper +{ + /** + * 查询新工资单 + * + * @param id 新工资单ID + * @return 新工资单 + */ + public CwNewPayroll selectCwNewPayrollById(Long id); + + /** + * 查询新工资单列表 + * + * @param cwNewPayroll 新工资单 + * @return 新工资单集合 + */ + public List selectCwNewPayrollList(CwNewPayroll cwNewPayroll); + + /** + * 新增新工资单 + * + * @param cwNewPayroll 新工资单 + * @return 结果 + */ + public int insertCwNewPayroll(CwNewPayroll cwNewPayroll); + + /** + * 修改新工资单 + * + * @param cwNewPayroll 新工资单 + * @return 结果 + */ + public int updateCwNewPayroll(CwNewPayroll cwNewPayroll); + + /** + * 删除新工资单 + * + * @param id 新工资单ID + * @return 结果 + */ + public int deleteCwNewPayrollById(Long id); + + /** + * 批量删除新工资单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwNewPayrollByIds(Long[] ids); + + /** + * 根据名称查询 + * @param cwNewPayroll + * @return + */ + public List selectCwNewPayrollListByName(CwNewPayroll cwNewPayroll); + + public List selectCwNewPayrollByAffiliationMonth(@Param("affiliationMonth") String affiliationMonth); + + public List selectCwNewPayrollListByDepartmentName(CwNewPayroll cwNewPayroll); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwNonbusinessIncomeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNonbusinessIncomeMapper.java new file mode 100644 index 0000000..049d83d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwNonbusinessIncomeMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwNonbusinessIncome; + +/** + * 营业外收入信息Mapper接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface CwNonbusinessIncomeMapper +{ + /** + * 查询营业外收入信息 + * + * @param id 营业外收入信息ID + * @return 营业外收入信息 + */ + public CwNonbusinessIncome selectCwNonbusinessIncomeById(Long id); + + /** + * 查询营业外收入信息列表 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 营业外收入信息集合 + */ + public List selectCwNonbusinessIncomeList(CwNonbusinessIncome cwNonbusinessIncome); + + /** + * 新增营业外收入信息 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 结果 + */ + public int insertCwNonbusinessIncome(CwNonbusinessIncome cwNonbusinessIncome); + + /** + * 修改营业外收入信息 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 结果 + */ + public int updateCwNonbusinessIncome(CwNonbusinessIncome cwNonbusinessIncome); + + /** + * 删除营业外收入信息 + * + * @param id 营业外收入信息ID + * @return 结果 + */ + public int deleteCwNonbusinessIncomeById(Long id); + + /** + * 批量删除营业外收入信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwNonbusinessIncomeByIds(Long[] ids); + + public CwNonbusinessIncome selectCwNonbusinessIncomeByCode(@Param("code") String contractCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwOtherPaymentInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwOtherPaymentInfoMapper.java new file mode 100644 index 0000000..0f71c77 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwOtherPaymentInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwOtherPaymentInfo; + +/** + * 付款单合同关联信息Mapper接口 + * + * @author zhukangchao + * @date 2023-12-10 + */ +public interface CwOtherPaymentInfoMapper +{ + /** + * 查询付款单合同关联信息 + * + * @param id 付款单合同关联信息ID + * @return 付款单合同关联信息 + */ + public CwOtherPaymentInfo selectCwOtherPaymentInfoById(Long id); + + /** + * 查询付款单合同关联信息列表 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 付款单合同关联信息集合 + */ + public List selectCwOtherPaymentInfoList(CwOtherPaymentInfo cwOtherPaymentInfo); + + /** + * 新增付款单合同关联信息 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 结果 + */ + public int insertCwOtherPaymentInfo(CwOtherPaymentInfo cwOtherPaymentInfo); + + /** + * 修改付款单合同关联信息 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 结果 + */ + public int updateCwOtherPaymentInfo(CwOtherPaymentInfo cwOtherPaymentInfo); + + /** + * 删除付款单合同关联信息 + * + * @param id 付款单合同关联信息ID + * @return 结果 + */ + public int deleteCwOtherPaymentInfoById(Long id); + + /** + * 批量删除付款单合同关联信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwOtherPaymentInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwOtherPaymentMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwOtherPaymentMapper.java new file mode 100644 index 0000000..e89e6a7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwOtherPaymentMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwOtherPayment; + +/** + * 其他付款申请单Mapper接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface CwOtherPaymentMapper +{ + /** + * 查询其他付款申请单 + * + * @param id 其他付款申请单ID + * @return 其他付款申请单 + */ + public CwOtherPayment selectCwOtherPaymentById(Long id); + + /** + * 查询其他付款申请单列表 + * + * @param cwOtherPayment 其他付款申请单 + * @return 其他付款申请单集合 + */ + public List selectCwOtherPaymentList(CwOtherPayment cwOtherPayment); + + /** + * 新增其他付款申请单 + * + * @param cwOtherPayment 其他付款申请单 + * @return 结果 + */ + public int insertCwOtherPayment(CwOtherPayment cwOtherPayment); + + /** + * 修改其他付款申请单 + * + * @param cwOtherPayment 其他付款申请单 + * @return 结果 + */ + public int updateCwOtherPayment(CwOtherPayment cwOtherPayment); + + /** + * 删除其他付款申请单 + * + * @param id 其他付款申请单ID + * @return 结果 + */ + public int deleteCwOtherPaymentById(Long id); + + /** + * 批量删除其他付款申请单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwOtherPaymentByIds(Long[] ids); + + public CwOtherPayment selectCwOtherPaymentByCode(@Param("code") String contractCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwPayrollMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwPayrollMapper.java new file mode 100644 index 0000000..542f908 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwPayrollMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwPayroll; + +/** + * 工资单Mapper接口 + * + * @author zhukangchao + * @date 2021-10-25 + */ +public interface CwPayrollMapper +{ + /** + * 查询工资单 + * + * @param id 工资单ID + * @return 工资单 + */ + public CwPayroll selectCwPayrollById(Long id); + + /** + * 查询工资单列表 + * + * @param cwPayroll 工资单 + * @return 工资单集合 + */ + public List selectCwPayrollList(CwPayroll cwPayroll); + + /** + * 新增工资单 + * + * @param cwPayroll 工资单 + * @return 结果 + */ + public int insertCwPayroll(CwPayroll cwPayroll); + + /** + * 修改工资单 + * + * @param cwPayroll 工资单 + * @return 结果 + */ + public int updateCwPayroll(CwPayroll cwPayroll); + + /** + * 删除工资单 + * + * @param id 工资单ID + * @return 结果 + */ + public int deleteCwPayrollById(Long id); + + /** + * 批量删除工资单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwPayrollByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwRulesMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwRulesMapper.java new file mode 100644 index 0000000..d2a42f7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwRulesMapper.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwRules; + +/** + * 排班Mapper接口 + * + * @author zhukangchao + * @date 2021-12-25 + */ +public interface CwRulesMapper +{ + /** + * 查询排班 + * + * @param id 排班ID + * @return 排班 + */ + public CwRules selectCwRulesById(Long id); + + /** + * 查询排班列表 + * + * @param cwRules 排班 + * @return 排班集合 + */ + public List selectCwRulesList(CwRules cwRules); + + /** + * 新增排班 + * + * @param cwRules 排班 + * @return 结果 + */ + public int insertCwRules(CwRules cwRules); + + /** + * 修改排班 + * + * @param cwRules 排班 + * @return 结果 + */ + public int updateCwRules(CwRules cwRules); + + /** + * 删除排班 + * + * @param id 排班ID + * @return 结果 + */ + public int deleteCwRulesById(Long id); + + /** + * 批量删除排班 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwRulesByIds(Long[] ids); + + public int insertCwRuless(List list); + + /** + * 根据姓名和日期查询排班记录 + * @param name + * @param string + */ + public List selectCwRulesByNameAndDate(@Param("name") String name,@Param("string") String string); + + public List selectCwRulesByName(@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwSnDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwSnDetailMapper.java new file mode 100644 index 0000000..a166c7a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwSnDetailMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwSnDetail; + +/** + * 考勤设备信息Mapper接口 + * + * @author zhukangchao + * @date 2022-11-01 + */ +public interface CwSnDetailMapper +{ + /** + * 查询考勤设备信息 + * + * @param id 考勤设备信息ID + * @return 考勤设备信息 + */ + public CwSnDetail selectCwSnDetailById(Long id); + + /** + * 查询考勤设备信息列表 + * + * @param cwSnDetail 考勤设备信息 + * @return 考勤设备信息集合 + */ + public List selectCwSnDetailList(CwSnDetail cwSnDetail); + + /** + * 新增考勤设备信息 + * + * @param cwSnDetail 考勤设备信息 + * @return 结果 + */ + public int insertCwSnDetail(CwSnDetail cwSnDetail); + + /** + * 修改考勤设备信息 + * + * @param cwSnDetail 考勤设备信息 + * @return 结果 + */ + public int updateCwSnDetail(CwSnDetail cwSnDetail); + + /** + * 删除考勤设备信息 + * + * @param id 考勤设备信息ID + * @return 结果 + */ + public int deleteCwSnDetailById(Long id); + + /** + * 批量删除考勤设备信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwSnDetailByIds(Long[] ids); + + public CwSnDetail selectCwSnDetailBySn(String sn); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwTaxRateInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwTaxRateInfoMapper.java new file mode 100644 index 0000000..f48a748 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwTaxRateInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwTaxRateInfo; + +/** + * 税率信息Mapper接口 + * + * @author zhukangchao + * @date 2023-12-18 + */ +public interface CwTaxRateInfoMapper +{ + /** + * 查询税率信息 + * + * @param id 税率信息ID + * @return 税率信息 + */ + public CwTaxRateInfo selectCwTaxRateInfoById(Long id); + + /** + * 查询税率信息列表 + * + * @param cwTaxRateInfo 税率信息 + * @return 税率信息集合 + */ + public List selectCwTaxRateInfoList(CwTaxRateInfo cwTaxRateInfo); + + /** + * 新增税率信息 + * + * @param cwTaxRateInfo 税率信息 + * @return 结果 + */ + public int insertCwTaxRateInfo(CwTaxRateInfo cwTaxRateInfo); + + /** + * 修改税率信息 + * + * @param cwTaxRateInfo 税率信息 + * @return 结果 + */ + public int updateCwTaxRateInfo(CwTaxRateInfo cwTaxRateInfo); + + /** + * 删除税率信息 + * + * @param id 税率信息ID + * @return 结果 + */ + public int deleteCwTaxRateInfoById(Long id); + + /** + * 批量删除税率信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwTaxRateInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwTypeTimeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwTypeTimeMapper.java new file mode 100644 index 0000000..1888170 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwTypeTimeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwTypeTime; + +/** + * 状态等待时间Mapper接口 + * + * @author zhukangchao + * @date 2022-10-31 + */ +public interface CwTypeTimeMapper +{ + /** + * 查询状态等待时间 + * + * @param id 状态等待时间ID + * @return 状态等待时间 + */ + public CwTypeTime selectCwTypeTimeById(Long id); + + /** + * 查询状态等待时间列表 + * + * @param cwTypeTime 状态等待时间 + * @return 状态等待时间集合 + */ + public List selectCwTypeTimeList(CwTypeTime cwTypeTime); + + /** + * 新增状态等待时间 + * + * @param cwTypeTime 状态等待时间 + * @return 结果 + */ + public int insertCwTypeTime(CwTypeTime cwTypeTime); + + /** + * 修改状态等待时间 + * + * @param cwTypeTime 状态等待时间 + * @return 结果 + */ + public int updateCwTypeTime(CwTypeTime cwTypeTime); + + /** + * 删除状态等待时间 + * + * @param id 状态等待时间ID + * @return 结果 + */ + public int deleteCwTypeTimeById(Long id); + + /** + * 批量删除状态等待时间 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwTypeTimeByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwWageSummaryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwWageSummaryMapper.java new file mode 100644 index 0000000..bb748f2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwWageSummaryMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.CwWageSummary; + +/** + * 工资汇总Mapper接口 + * + * @author zhukangchao + * @date 2021-12-23 + */ +public interface CwWageSummaryMapper +{ + /** + * 查询工资汇总 + * + * @param id 工资汇总ID + * @return 工资汇总 + */ + public CwWageSummary selectCwWageSummaryById(Long id); + + /** + * 查询工资汇总列表 + * + * @param cwWageSummary 工资汇总 + * @return 工资汇总集合 + */ + public List selectCwWageSummaryList(CwWageSummary cwWageSummary); + + /** + * 新增工资汇总 + * + * @param cwWageSummary 工资汇总 + * @return 结果 + */ + public int insertCwWageSummary(CwWageSummary cwWageSummary); + + /** + * 修改工资汇总 + * + * @param cwWageSummary 工资汇总 + * @return 结果 + */ + public int updateCwWageSummary(CwWageSummary cwWageSummary); + + /** + * 删除工资汇总 + * + * @param id 工资汇总ID + * @return 结果 + */ + public int deleteCwWageSummaryById(Long id); + + /** + * 批量删除工资汇总 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwWageSummaryByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwWorkOvertimeRecordMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwWorkOvertimeRecordMapper.java new file mode 100644 index 0000000..9aeeeed --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwWorkOvertimeRecordMapper.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwWorkOvertimeRecord; + +/** + * 加班申请Mapper接口 + * + * @author zhukangchao + * @date 2021-12-22 + */ +public interface CwWorkOvertimeRecordMapper +{ + /** + * 查询加班申请 + * + * @param id 加班申请ID + * @return 加班申请 + */ + public CwWorkOvertimeRecord selectCwWorkOvertimeRecordById(Long id); + + /** + * 查询加班申请列表 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 加班申请集合 + */ + public List selectCwWorkOvertimeRecordList(CwWorkOvertimeRecord cwWorkOvertimeRecord); + + /** + * 新增加班申请 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 结果 + */ + public int insertCwWorkOvertimeRecord(CwWorkOvertimeRecord cwWorkOvertimeRecord); + + /** + * 修改加班申请 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 结果 + */ + public int updateCwWorkOvertimeRecord(CwWorkOvertimeRecord cwWorkOvertimeRecord); + + /** + * 删除加班申请 + * + * @param id 加班申请ID + * @return 结果 + */ + public int deleteCwWorkOvertimeRecordById(Long id); + + /** + * 批量删除加班申请 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwWorkOvertimeRecordByIds(Long[] ids); + + /** + * 根据名称和工资所属月份查询加班信息 + * @param name + * @param string + * @return + */ + public List selectCwWorkOvertimeRecordByNameAndDate(@Param("name") String name,@Param("date") String date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CwWorkingDaysConfigurationMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CwWorkingDaysConfigurationMapper.java new file mode 100644 index 0000000..d3cc1e0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CwWorkingDaysConfigurationMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CwWorkingDaysConfiguration; + +/** + * 工作日配置Mapper接口 + * + * @author zhukangchao + * @date 2021-12-21 + */ +public interface CwWorkingDaysConfigurationMapper +{ + /** + * 查询工作日配置 + * + * @param id 工作日配置ID + * @return 工作日配置 + */ + public CwWorkingDaysConfiguration selectCwWorkingDaysConfigurationById(Long id); + + /** + * 查询工作日配置列表 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 工作日配置集合 + */ + public List selectCwWorkingDaysConfigurationList(CwWorkingDaysConfiguration cwWorkingDaysConfiguration); + + /** + * 新增工作日配置 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 结果 + */ + public int insertCwWorkingDaysConfiguration(CwWorkingDaysConfiguration cwWorkingDaysConfiguration); + + /** + * 修改工作日配置 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 结果 + */ + public int updateCwWorkingDaysConfiguration(CwWorkingDaysConfiguration cwWorkingDaysConfiguration); + + /** + * 删除工作日配置 + * + * @param id 工作日配置ID + * @return 结果 + */ + public int deleteCwWorkingDaysConfigurationById(Long id); + + /** + * 批量删除工作日配置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCwWorkingDaysConfigurationByIds(Long[] ids); + + /** + * 根据月份查询工作日 + * @param affiliationMonth + * @return + */ + public CwWorkingDaysConfiguration selectCwWorkingDaysConfigurationByDate(@Param("affiliationMonth") String affiliationMonth); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CyConsumptionInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CyConsumptionInfoMapper.java new file mode 100644 index 0000000..34df65f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CyConsumptionInfoMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.mapper; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CyConsumptionInfo; + +/** + * 餐饮消费明细Mapper接口 + * + * @author zhukangchao + * @date 2023-10-05 + */ +public interface CyConsumptionInfoMapper +{ + /** + * 查询餐饮消费明细 + * + * @param id 餐饮消费明细ID + * @return 餐饮消费明细 + */ + public CyConsumptionInfo selectCyConsumptionInfoById(Long id); + + /** + * 查询餐饮消费明细列表 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 餐饮消费明细集合 + */ + public List selectCyConsumptionInfoList(CyConsumptionInfo cyConsumptionInfo); + + /** + * 新增餐饮消费明细 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 结果 + */ + public int insertCyConsumptionInfo(CyConsumptionInfo cyConsumptionInfo); + + /** + * 修改餐饮消费明细 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 结果 + */ + public int updateCyConsumptionInfo(CyConsumptionInfo cyConsumptionInfo); + + /** + * 删除餐饮消费明细 + * + * @param id 餐饮消费明细ID + * @return 结果 + */ + public int deleteCyConsumptionInfoById(Long id); + + /** + * 批量删除餐饮消费明细 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCyConsumptionInfoByIds(Long[] ids); + + public List selectCyConsumptionInfoByDate(@Param("date") Date date); + + public List selectCyConsumptionInfoByYue(@Param("date") Date date,@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CyFaceInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CyFaceInfoMapper.java new file mode 100644 index 0000000..5be1993 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CyFaceInfoMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CyFaceInfo; + +/** + * 餐饮刷脸详情信息Mapper接口 + * + * @author zhukangchao + * @date 2023-10-05 + */ +public interface CyFaceInfoMapper +{ + /** + * 查询餐饮刷脸详情信息 + * + * @param id 餐饮刷脸详情信息ID + * @return 餐饮刷脸详情信息 + */ + public CyFaceInfo selectCyFaceInfoById(Long id); + + /** + * 查询餐饮刷脸详情信息列表 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 餐饮刷脸详情信息集合 + */ + public List selectCyFaceInfoList(CyFaceInfo cyFaceInfo); + + /** + * 新增餐饮刷脸详情信息 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 结果 + */ + public int insertCyFaceInfo(CyFaceInfo cyFaceInfo); + + /** + * 修改餐饮刷脸详情信息 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 结果 + */ + public int updateCyFaceInfo(CyFaceInfo cyFaceInfo); + + /** + * 删除餐饮刷脸详情信息 + * + * @param id 餐饮刷脸详情信息ID + * @return 结果 + */ + public int deleteCyFaceInfoById(Long id); + + /** + * 批量删除餐饮刷脸详情信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCyFaceInfoByIds(Long[] ids); + + public List selectCyFaceInfoByNameAndTime(@Param("name") String name); + + public List selectCyFaceInfoByDate(@Param("format") Date format); + + public List selectCyFaceInfoByNameAndDate(@Param("name") String name,@Param("dateTime") Date dateTime); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/CyStatisticsInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/CyStatisticsInfoMapper.java new file mode 100644 index 0000000..cf2fa14 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/CyStatisticsInfoMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.CyStatisticsInfo; + +/** + * 餐饮消费统计信息Mapper接口 + * + * @author zhukangchao + * @date 2023-10-05 + */ +public interface CyStatisticsInfoMapper +{ + /** + * 查询餐饮消费统计信息 + * + * @param id 餐饮消费统计信息ID + * @return 餐饮消费统计信息 + */ + public CyStatisticsInfo selectCyStatisticsInfoById(Long id); + + /** + * 查询餐饮消费统计信息列表 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 餐饮消费统计信息集合 + */ + public List selectCyStatisticsInfoList(CyStatisticsInfo cyStatisticsInfo); + + /** + * 新增餐饮消费统计信息 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 结果 + */ + public int insertCyStatisticsInfo(CyStatisticsInfo cyStatisticsInfo); + + /** + * 修改餐饮消费统计信息 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 结果 + */ + public int updateCyStatisticsInfo(CyStatisticsInfo cyStatisticsInfo); + + /** + * 删除餐饮消费统计信息 + * + * @param id 餐饮消费统计信息ID + * @return 结果 + */ + public int deleteCyStatisticsInfoById(Long id); + + /** + * 批量删除餐饮消费统计信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteCyStatisticsInfoByIds(Long[] ids); + + public CyStatisticsInfo selectCyStatisticsInfoByNameAndDate(@Param("name") String name,@Param("yue") String yue); + + public int updateCyStatisticsInfoByNameAndDate(CyStatisticsInfo cyStatisticsInfo); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/EvoInOutStorageManagementMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoInOutStorageManagementMapper.java new file mode 100644 index 0000000..bc396b3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoInOutStorageManagementMapper.java @@ -0,0 +1,54 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.EvoInOutStorageManagement; + +/** + * 物品出入库管理Mapper接口 + * + * @author chenyongjiang + * @date 2023-12-26 + */ +public interface EvoInOutStorageManagementMapper +{ + /** + * 查询物品出入库管理 + * + * @param id 物品出入库管理ID + * @return 物品出入库管理 + */ + public EvoInOutStorageManagement selectEvoInOutStorageManagementById(Long id); + + /** + * 查询物品出入库管理列表 + * + * @param evoInOutStorageManagement 物品出入库管理 + * @return 物品出入库管理集合 + */ + public List selectEvoInOutStorageManagementList(EvoInOutStorageManagement evoInOutStorageManagement); + + /** + * 新增物品出入库管理 + * + * @param evoInOutStorageManagement 物品出入库管理 + * @return 结果 + */ + public int insertEvoInOutStorageManagement(EvoInOutStorageManagement evoInOutStorageManagement); + + /** + * 修改物品出入库管理 + * + * @param evoInOutStorageManagement 物品出入库管理 + * @return 结果 + */ + public int updateEvoInOutStorageManagement(EvoInOutStorageManagement evoInOutStorageManagement); + + /** + * 删除物品出入库管理 + * + * @param id 物品出入库管理ID + * @return 结果 + */ + public int deleteEvoInOutStorageManagementById(Long id); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/EvoInvalidLibraryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoInvalidLibraryMapper.java new file mode 100644 index 0000000..7349b9c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoInvalidLibraryMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.EvoInvalidLibrary; +import io.lettuce.core.dynamic.annotation.Param; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author zhukangchao + * @date 2024-01-12 + */ +public interface EvoInvalidLibraryMapper +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 【请填写功能名称】 + */ + public EvoInvalidLibrary selectEvoInvalidLibraryById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param evoInvalidLibrary 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectEvoInvalidLibraryList(EvoInvalidLibrary evoInvalidLibrary); + + /** + * 新增【请填写功能名称】 + * + * @param evoInvalidLibrary 【请填写功能名称】 + * @return 结果 + */ + public int insertEvoInvalidLibrary(EvoInvalidLibrary evoInvalidLibrary); + + /** + * 修改【请填写功能名称】 + * + * @param evoInvalidLibrary 【请填写功能名称】 + * @return 结果 + */ + public int updateEvoInvalidLibrary(EvoInvalidLibrary evoInvalidLibrary); + + /** + * 删除【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 结果 + */ + public int deleteEvoInvalidLibraryById(Long id); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteEvoInvalidLibraryByIds(Long[] ids); + /** + * 根据图号和项目令号查询不良库中的不良品记录 + * + * @param figureNumber 图号 + * @param productBillCode 项目令号 + * @return 结果 + */ + public EvoInvalidLibrary selectEvoInvalidLibraryByFigureNumberAndProductBillCode(@Param("figureNumber") String figureNumber, @Param("productBillCode") String productBillCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/EvoOperatorTypeJdMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoOperatorTypeJdMapper.java new file mode 100644 index 0000000..7a16236 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoOperatorTypeJdMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.EvoOperatorTypeJd; + +/** + * 操作员类型Mapper接口 + * + * @author zhukangchao + * @date 2023-12-17 + */ +public interface EvoOperatorTypeJdMapper +{ + /** + * 查询操作员类型 + * + * @param id 操作员类型ID + * @return 操作员类型 + */ + public EvoOperatorTypeJd selectEvoOperatorTypeJdById(Long id); + + /** + * 查询操作员类型列表 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 操作员类型集合 + */ + public List selectEvoOperatorTypeJdList(EvoOperatorTypeJd evoOperatorTypeJd); + + /** + * 新增操作员类型 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 结果 + */ + public int insertEvoOperatorTypeJd(EvoOperatorTypeJd evoOperatorTypeJd); + + /** + * 修改操作员类型 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 结果 + */ + public int updateEvoOperatorTypeJd(EvoOperatorTypeJd evoOperatorTypeJd); + + /** + * 删除操作员类型 + * + * @param id 操作员类型ID + * @return 结果 + */ + public int deleteEvoOperatorTypeJdById(Long id); + + /** + * 批量删除操作员类型 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteEvoOperatorTypeJdByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/EvoStagnantStorageMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoStagnantStorageMapper.java new file mode 100644 index 0000000..951d0cb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/EvoStagnantStorageMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.EvoStagnantStorage; +import io.lettuce.core.dynamic.annotation.Param; + +/** + * 呆滞库Mapper接口 + * + * @author zhukangchao + * @date 2023-12-27 + */ +public interface EvoStagnantStorageMapper +{ + /** + * 查询呆滞库 + * + * @param id 呆滞库ID + * @return 呆滞库 + */ + public EvoStagnantStorage selectEvoStagnantStorageById(Long id); + + /** + * 查询呆滞库列表 + * + * @param evoStagnantStorage 呆滞库 + * @return 呆滞库集合 + */ + public List selectEvoStagnantStorageList(EvoStagnantStorage evoStagnantStorage); + + /** + * 新增呆滞库 + * + * @param evoStagnantStorage 呆滞库 + * @return 结果 + */ + public int insertEvoStagnantStorage(EvoStagnantStorage evoStagnantStorage); + + /** + * 修改呆滞库 + * + * @param evoStagnantStorage 呆滞库 + * @return 结果 + */ + public int updateEvoStagnantStorage(EvoStagnantStorage evoStagnantStorage); + + /** + * 删除呆滞库 + * + * @param id 呆滞库ID + * @return 结果 + */ + public int deleteEvoStagnantStorageById(Long id); + + /** + * 批量删除呆滞库 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteEvoStagnantStorageByIds(Long[] ids); + + /** + * 根据图号和名称查询 + * @param name + * @param figureNumber + * @return + */ + public EvoStagnantStorage selectEvoStagnantStorageByNameAndFigure(@Param("name") String name,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImCustomerMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImCustomerMapper.java new file mode 100644 index 0000000..4858c76 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImCustomerMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImCustomer; +import org.apache.ibatis.annotations.Param; + +/** + * 客户维护Mapper接口 + * + * @author chenyj + * @date 2023-10-26 + */ +public interface ImCustomerMapper +{ + /** + * 查询客户维护 + * + * @param id 客户维护ID + * @return 客户维护 + */ + public ImCustomer selectImCustomerById(Long id); + + public ImCustomer selectImCustomerByCustomerName(@Param("customerName") String customerName); + + /** + * 查询客户维护列表 + * + * @param imCustomer 客户维护 + * @return 客户维护集合 + */ + public List selectImCustomerList(ImCustomer imCustomer); + + /** + * 新增客户维护 + * + * @param imCustomer 客户维护 + * @return 结果 + */ + public int insertImCustomer(ImCustomer imCustomer); + + /** + * 修改客户维护 + * + * @param imCustomer 客户维护 + * @return 结果 + */ + public int updateImCustomer(ImCustomer imCustomer); + + /** + * 删除客户维护 + * + * @param id 客户维护ID + * @return 结果 + */ + public int deleteImCustomerById(Long id); + + /** + * 批量删除客户维护 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImCustomerByIds(Long[] ids); + + /** + * 获取所有客户 + * @return + */ + public List queryCustomers(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImCustomerTypeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImCustomerTypeMapper.java new file mode 100644 index 0000000..f29f2bd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImCustomerTypeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImCustomerType; + +/** + * 客户类型Mapper接口 + * + * @author zhukangchao + * @date 2023-12-04 + */ +public interface ImCustomerTypeMapper +{ + /** + * 查询客户类型 + * + * @param id 客户类型ID + * @return 客户类型 + */ + public ImCustomerType selectImCustomerTypeById(Long id); + + /** + * 查询客户类型列表 + * + * @param imCustomerType 客户类型 + * @return 客户类型集合 + */ + public List selectImCustomerTypeList(ImCustomerType imCustomerType); + + /** + * 新增客户类型 + * + * @param imCustomerType 客户类型 + * @return 结果 + */ + public int insertImCustomerType(ImCustomerType imCustomerType); + + /** + * 修改客户类型 + * + * @param imCustomerType 客户类型 + * @return 结果 + */ + public int updateImCustomerType(ImCustomerType imCustomerType); + + /** + * 删除客户类型 + * + * @param id 客户类型ID + * @return 结果 + */ + public int deleteImCustomerTypeById(Long id); + + /** + * 批量删除客户类型 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImCustomerTypeByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImDeliveryUnitMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImDeliveryUnitMapper.java new file mode 100644 index 0000000..2e9654a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImDeliveryUnitMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImDeliveryUnit; + +/** + * 交货单位Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImDeliveryUnitMapper +{ + /** + * 查询交货单位 + * + * @param id 交货单位ID + * @return 交货单位 + */ + public ImDeliveryUnit selectImDeliveryUnitById(Long id); + + /** + * 查询交货单位列表 + * + * @param imDeliveryUnit 交货单位 + * @return 交货单位集合 + */ + public List selectImDeliveryUnitList(ImDeliveryUnit imDeliveryUnit); + + /** + * 新增交货单位 + * + * @param imDeliveryUnit 交货单位 + * @return 结果 + */ + public int insertImDeliveryUnit(ImDeliveryUnit imDeliveryUnit); + + /** + * 修改交货单位 + * + * @param imDeliveryUnit 交货单位 + * @return 结果 + */ + public int updateImDeliveryUnit(ImDeliveryUnit imDeliveryUnit); + + /** + * 删除交货单位 + * + * @param id 交货单位ID + * @return 结果 + */ + public int deleteImDeliveryUnitById(Long id); + + /** + * 批量删除交货单位 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImDeliveryUnitByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImLogisticsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImLogisticsMapper.java new file mode 100644 index 0000000..6c7e79a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImLogisticsMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImLogistics; + +/** + * 物流Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImLogisticsMapper +{ + /** + * 查询物流 + * + * @param id 物流ID + * @return 物流 + */ + public ImLogistics selectImLogisticsById(Long id); + + /** + * 查询物流列表 + * + * @param imLogistics 物流 + * @return 物流集合 + */ + public List selectImLogisticsList(ImLogistics imLogistics); + + /** + * 新增物流 + * + * @param imLogistics 物流 + * @return 结果 + */ + public int insertImLogistics(ImLogistics imLogistics); + + /** + * 修改物流 + * + * @param imLogistics 物流 + * @return 结果 + */ + public int updateImLogistics(ImLogistics imLogistics); + + /** + * 删除物流 + * + * @param id 物流ID + * @return 结果 + */ + public int deleteImLogisticsById(Long id); + + /** + * 批量删除物流 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImLogisticsByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialGroupMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialGroupMapper.java new file mode 100644 index 0000000..4ae3edd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialGroupMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImMaterialGroup; + +/** + * 物料分组Mapper接口 + * + * @author zhukangchao + * @date 2023-12-15 + */ +public interface ImMaterialGroupMapper +{ + /** + * 查询物料分组 + * + * @param id 物料分组ID + * @return 物料分组 + */ + public ImMaterialGroup selectImMaterialGroupById(Long id); + + /** + * 查询物料分组列表 + * + * @param imMaterialGroup 物料分组 + * @return 物料分组集合 + */ + public List selectImMaterialGroupList(ImMaterialGroup imMaterialGroup); + + /** + * 新增物料分组 + * + * @param imMaterialGroup 物料分组 + * @return 结果 + */ + public int insertImMaterialGroup(ImMaterialGroup imMaterialGroup); + + /** + * 修改物料分组 + * + * @param imMaterialGroup 物料分组 + * @return 结果 + */ + public int updateImMaterialGroup(ImMaterialGroup imMaterialGroup); + + /** + * 删除物料分组 + * + * @param id 物料分组ID + * @return 结果 + */ + public int deleteImMaterialGroupById(Long id); + + /** + * 批量删除物料分组 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImMaterialGroupByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialMapper.java new file mode 100644 index 0000000..1d08498 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialMapper.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.ImMaterial; + + +/** + * 物料(零件)Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImMaterialMapper +{ + /** + * 查询物料(零件) + * + * @param id 物料(零件)ID + * @return 物料(零件) + */ + public ImMaterial selectImMaterialById(Long id); + + /** + * 查询物料(零件)列表 + * + * @param imMaterial 物料(零件) + * @return 物料(零件)集合 + */ + public List selectImMaterialList(ImMaterial imMaterial); + + /** + * 新增物料(零件) + * + * @param imMaterial 物料(零件) + * @return 结果 + */ + public int insertImMaterial(ImMaterial imMaterial); + + /** + * 修改物料(零件) + * + * @param imMaterial 物料(零件) + * @return 结果 + */ + public int updateImMaterial(ImMaterial imMaterial); + + /** + * 删除物料(零件) + * + * @param id 物料(零件)ID + * @return 结果 + */ + public int deleteImMaterialById(Long id); + + /** + * 批量删除物料(零件) + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImMaterialByIds(Long[] ids); + + /** + * 根据规格型号查询 + * @param figureNumber + * @return + */ + public ImMaterial selectImMaterialBySpecificationType(@Param("figureNumber") String figureNumber); + + /** + * 查询物料表中设置了最低库存和最高库存的数据 + */ + public List selectByMinimumAndHighest(); + + public ImMaterial selectImMaterialByMaterialNameAndSpecificationType(@Param("materialName") String materialName,@Param("figureNumber") String figureNumber); + + public List selectImMaterialListImMaterialByType(ImMaterial imMaterial); + + public List selectImMaterialListImMaterialByYuanCaiLiao(ImMaterial imMaterial); + + public List selectImMaterialListImMaterialByJiJian(ImMaterial imMaterial); + + public List selectImMaterialListImMaterialByYHP(ImMaterial imMaterial); + + public List selectByFigureNumberAndAllGB(); + + public List selectImMaterialListByTypeAndMinimum(); + + public List selectImMaterialListImMaterialByBuJianAndLingJian(); + + public List selectImMaterialListByMinimumAndHighest(); + /** + * 根据图号查询物料信息 + * @param materialName + * @return + */ + public List getImMaterialByMaterialName(String materialName); + + public int deleteImMaterials(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialTypeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialTypeMapper.java new file mode 100644 index 0000000..c58e420 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMaterialTypeMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImMaterialType; +import org.springframework.data.repository.query.Param; + +/** + * 物料(零件)类型Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImMaterialTypeMapper +{ + /** + * 查询物料(零件)类型 + * + * @param id 物料(零件)类型ID + * @return 物料(零件)类型 + */ + public ImMaterialType selectImMaterialTypeById(Long id); + + /** + * 查询物料(零件)类型列表 + * + * @param imMaterialType 物料(零件)类型 + * @return 物料(零件)类型集合 + */ + public List selectImMaterialTypeList(ImMaterialType imMaterialType); + + /** + * 新增物料(零件)类型 + * + * @param imMaterialType 物料(零件)类型 + * @return 结果 + */ + public int insertImMaterialType(ImMaterialType imMaterialType); + + /** + * 修改物料(零件)类型 + * + * @param imMaterialType 物料(零件)类型 + * @return 结果 + */ + public int updateImMaterialType(ImMaterialType imMaterialType); + + /** + * 删除物料(零件)类型 + * + * @param id 物料(零件)类型ID + * @return 结果 + */ + public int deleteImMaterialTypeById(Long id); + + /** + * 批量删除物料(零件)类型 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImMaterialTypeByIds(Long[] ids); + + /** + * 根据类型名称查询 + * @param materialTypeName + * @return + */ + public ImMaterialType selectImMaterialTypeByName(@Param("materialTypeName") String materialTypeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImMeteringUnitMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMeteringUnitMapper.java new file mode 100644 index 0000000..d0c0046 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImMeteringUnitMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImMeteringUnit; + +/** + * 计量单位Mapper接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface ImMeteringUnitMapper +{ + /** + * 查询计量单位 + * + * @param id 计量单位ID + * @return 计量单位 + */ + public ImMeteringUnit selectImMeteringUnitById(String id); + + /** + * 查询计量单位列表 + * + * @param imMeteringUnit 计量单位 + * @return 计量单位集合 + */ + public List selectImMeteringUnitList(ImMeteringUnit imMeteringUnit); + + /** + * 新增计量单位 + * + * @param imMeteringUnit 计量单位 + * @return 结果 + */ + public int insertImMeteringUnit(ImMeteringUnit imMeteringUnit); + + /** + * 修改计量单位 + * + * @param imMeteringUnit 计量单位 + * @return 结果 + */ + public int updateImMeteringUnit(ImMeteringUnit imMeteringUnit); + + /** + * 删除计量单位 + * + * @param id 计量单位ID + * @return 结果 + */ + public int deleteImMeteringUnitById(Long id); + + /** + * 批量删除计量单位 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImMeteringUnitByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductReceiptMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductReceiptMapper.java new file mode 100644 index 0000000..15563dc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductReceiptMapper.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.ImProductReceipt; + +/** + * 产品(半成品)入库单Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImProductReceiptMapper +{ + /** + * 查询产品(半成品)入库单 + * + * @param id 产品(半成品)入库单ID + * @return 产品(半成品)入库单 + */ + public ImProductReceipt selectImProductReceiptById(Long id); + + /** + * 查询产品(半成品)入库单列表 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 产品(半成品)入库单集合 + */ + public List selectImProductReceiptList(ImProductReceipt imProductReceipt); + + /** + * 新增产品(半成品)入库单 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 结果 + */ + public int insertImProductReceipt(ImProductReceipt imProductReceipt); + + /** + * 修改产品(半成品)入库单 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 结果 + */ + public int updateImProductReceipt(ImProductReceipt imProductReceipt); + + /** + * 删除产品(半成品)入库单 + * + * @param id 产品(半成品)入库单ID + * @return 结果 + */ + public int deleteImProductReceiptById(Long id); + + /** + * 批量删除产品(半成品)入库单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImProductReceiptByIds(Long[] ids); + + /** + * 根据合同编号查询入库单信息 + * */ + public ImProductReceipt selectImProductReceiptByContractCode(@Param("contractCode") String contractCode); + + public ImProductReceipt selectImProductReceiptByMakeDocumentsCode(@Param("makeDocumentsCode") String makeDocumentsCode); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductReceiptMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductReceiptMaterialMapper.java new file mode 100644 index 0000000..83c3cfa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductReceiptMaterialMapper.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.mapper; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImProductReceiptMaterialTwo; + +/** + * 物料产品入库单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImProductReceiptMaterialMapper +{ + /** + * 查询物料产品入库单关联 + * + * @param id 物料产品入库单关联ID + * @return 物料产品入库单关联 + */ + public ImProductReceiptMaterial selectImProductReceiptMaterialById(Long id); + + /** + * 查询物料产品入库单关联列表 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 物料产品入库单关联集合 + */ + public List selectImProductReceiptMaterialList(ImProductReceiptMaterial imProductReceiptMaterial); + + /** + * 新增物料产品入库单关联 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 结果 + */ + public int insertImProductReceiptMaterial(ImProductReceiptMaterial imProductReceiptMaterial); + + /** + * 修改物料产品入库单关联 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 结果 + */ + public int updateImProductReceiptMaterial(ImProductReceiptMaterial imProductReceiptMaterial); + + /** + * 删除物料产品入库单关联 + * + * @param id 物料产品入库单关联ID + * @return 结果 + */ + public int deleteImProductReceiptMaterialById(Long id); + + /** + * 批量删除物料产品入库单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImProductReceiptMaterialByIds(Long[] ids); + + /** + * 根据入库单id查询 + * @param productReceiptId + * @return + */ + public List selectImProductReceiptMaterialByProductReceiptId(Long productReceiptId); + + public List selectImProductReceiptMaterialLists(ImProductReceiptMaterial im); + + public List selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(@Param("makeDocumentsCode") String makeDocumentsCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public int selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectImProductReceiptMaterialListTwo(ImProductReceiptMaterial imProductReceiptMaterial); + + public List selectImProductReceiptMaterialByFigureNumberAndAllGB(); + + public List selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber(@Param("id") Long id,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectImProductReceiptMaterialByCode(@Param("code") String code); + + public List selectImProductReceiptMaterialByCodeAndFigureNumber(@Param("productionCode") String productionCode,@Param("figureNumber") String figureNumber); + + public List selectImProductReceiptMaterialByCodeAndSparedFour(@Param("code") String code,@Param("sparedFour") Long id); + + public List queryImProductReceiptMaterialByNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber,@Param("inDate") Date inDate); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductStockRequistionMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductStockRequistionMapper.java new file mode 100644 index 0000000..604d176 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductStockRequistionMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImProductStockRequistion; + +/** + * 销售出库单Mapper接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface ImProductStockRequistionMapper +{ + /** + * 查询销售出库单 + * + * @param id 销售出库单ID + * @return 销售出库单 + */ + public ImProductStockRequistion selectImProductStockRequistionById(Long id); + + /** + * 查询销售出库单列表 + * + * @param imProductStockRequistion 销售出库单 + * @return 销售出库单集合 + */ + public List selectImProductStockRequistionList(ImProductStockRequistion imProductStockRequistion); + + /** + * 新增销售出库单 + * + * @param imProductStockRequistion 销售出库单 + * @return 结果 + */ + public int insertImProductStockRequistion(ImProductStockRequistion imProductStockRequistion); + + /** + * 修改销售出库单 + * + * @param imProductStockRequistion 销售出库单 + * @return 结果 + */ + public int updateImProductStockRequistion(ImProductStockRequistion imProductStockRequistion); + + /** + * 删除销售出库单 + * + * @param id 销售出库单ID + * @return 结果 + */ + public int deleteImProductStockRequistionById(Long id); + + /** + * 批量删除销售出库单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImProductStockRequistionByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductStockRequistionProductMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductStockRequistionProductMapper.java new file mode 100644 index 0000000..d666f00 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImProductStockRequistionProductMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImProductStockRequistionProduct; + +/** + * 产品和产品出库单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface ImProductStockRequistionProductMapper +{ + /** + * 查询产品和产品出库单关联 + * + * @param id 产品和产品出库单关联ID + * @return 产品和产品出库单关联 + */ + public ImProductStockRequistionProduct selectImProductStockRequistionProductById(Long id); + + /** + * 查询产品和产品出库单关联列表 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 产品和产品出库单关联集合 + */ + public List selectImProductStockRequistionProductList(ImProductStockRequistionProduct imProductStockRequistionProduct); + + /** + * 新增产品和产品出库单关联 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 结果 + */ + public int insertImProductStockRequistionProduct(ImProductStockRequistionProduct imProductStockRequistionProduct); + + /** + * 修改产品和产品出库单关联 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 结果 + */ + public int updateImProductStockRequistionProduct(ImProductStockRequistionProduct imProductStockRequistionProduct); + + /** + * 删除产品和产品出库单关联 + * + * @param id 产品和产品出库单关联ID + * @return 结果 + */ + public int deleteImProductStockRequistionProductById(Long id); + + /** + * 批量删除产品和产品出库单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImProductStockRequistionProductByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImPurchaseReceiptMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImPurchaseReceiptMapper.java new file mode 100644 index 0000000..83f1dfe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImPurchaseReceiptMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImPurchaseReceipt; + +/** + * 采购入库单Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImPurchaseReceiptMapper +{ + /** + * 查询采购入库单 + * + * @param id 采购入库单ID + * @return 采购入库单 + */ + public ImPurchaseReceipt selectImPurchaseReceiptById(Long id); + + /** + * 查询采购入库单列表 + * + * @param imPurchaseReceipt 采购入库单 + * @return 采购入库单集合 + */ + public List selectImPurchaseReceiptList(ImPurchaseReceipt imPurchaseReceipt); + + /** + * 新增采购入库单 + * + * @param imPurchaseReceipt 采购入库单 + * @return 结果 + */ + public int insertImPurchaseReceipt(ImPurchaseReceipt imPurchaseReceipt); + + /** + * 修改采购入库单 + * + * @param imPurchaseReceipt 采购入库单 + * @return 结果 + */ + public int updateImPurchaseReceipt(ImPurchaseReceipt imPurchaseReceipt); + + /** + * 删除采购入库单 + * + * @param id 采购入库单ID + * @return 结果 + */ + public int deleteImPurchaseReceiptById(Long id); + + /** + * 批量删除采购入库单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImPurchaseReceiptByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImPurchaseReceiptMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImPurchaseReceiptMaterialMapper.java new file mode 100644 index 0000000..637313f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImPurchaseReceiptMaterialMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImPurchaseReceiptMaterial; + +/** + * 物料采购入库单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImPurchaseReceiptMaterialMapper +{ + /** + * 查询物料采购入库单关联 + * + * @param id 物料采购入库单关联ID + * @return 物料采购入库单关联 + */ + public ImPurchaseReceiptMaterial selectImPurchaseReceiptMaterialById(Long id); + + /** + * 查询物料采购入库单关联列表 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 物料采购入库单关联集合 + */ + public List selectImPurchaseReceiptMaterialList(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial); + + /** + * 新增物料采购入库单关联 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 结果 + */ + public int insertImPurchaseReceiptMaterial(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial); + + /** + * 修改物料采购入库单关联 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 结果 + */ + public int updateImPurchaseReceiptMaterial(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial); + + /** + * 删除物料采购入库单关联 + * + * @param id 物料采购入库单关联ID + * @return 结果 + */ + public int deleteImPurchaseReceiptMaterialById(Long id); + + /** + * 批量删除物料采购入库单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImPurchaseReceiptMaterialByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImStockRequisitionMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImStockRequisitionMapper.java new file mode 100644 index 0000000..1c7ca1e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImStockRequisitionMapper.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.ImStockRequisition; + +/** + * 领料单Mapper接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface ImStockRequisitionMapper +{ + /** + * 查询领料单 + * + * @param id 领料单ID + * @return 领料单 + */ + public ImStockRequisition selectImStockRequisitionById(Long id); + + /** + * 查询领料单列表 + * + * @param imStockRequisition 领料单 + * @return 领料单集合 + */ + public List selectImStockRequisitionList(ImStockRequisition imStockRequisition); + + /** + * 新增领料单 + * + * @param imStockRequisition 领料单 + * @return 结果 + */ + public int insertImStockRequisition(ImStockRequisition imStockRequisition); + + /** + * 修改领料单 + * + * @param imStockRequisition 领料单 + * @return 结果 + */ + public int updateImStockRequisition(ImStockRequisition imStockRequisition); + + /** + * 删除领料单 + * + * @param id 领料单ID + * @return 结果 + */ + public int deleteImStockRequisitionById(Long id); + + /** + * 批量删除领料单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImStockRequisitionByIds(Long[] ids); + + /** + * 根据code查询,此单据是否已经申请领料(防止重复领料) + * @param code + */ + public ImStockRequisition selectImStockRequisitionByCode(String code); + + /** + * 根据执行单令号和产品型号查询 + */ + public ImStockRequisition selectImStockRequisitionByCodeAndTypeName(@Param("code")String code,@Param("productName") String productName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImStockRequisitionMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImStockRequisitionMaterialMapper.java new file mode 100644 index 0000000..3235e22 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImStockRequisitionMaterialMapper.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.mapper; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterialTwo; + +import org.apache.ibatis.annotations.Param; + +/** + * 物料和物料出库单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface ImStockRequisitionMaterialMapper +{ + /** + * 查询物料和物料出库单关联 + * + * @param id 物料和物料出库单关联ID + * @return 物料和物料出库单关联 + */ + public ImStockRequisitionMaterial selectImStockRequisitionMaterialById(Long id); + + /** + * 查询物料和物料出库单关联列表 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 物料和物料出库单关联集合 + */ + public List selectImStockRequisitionMaterialList(ImStockRequisitionMaterial imStockRequisitionMaterial); + + /** + * 新增物料和物料出库单关联 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 结果 + */ + public int insertImStockRequisitionMaterial(ImStockRequisitionMaterial imStockRequisitionMaterial); + + /** + * 修改物料和物料出库单关联 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 结果 + */ + public int updateImStockRequisitionMaterial(ImStockRequisitionMaterial imStockRequisitionMaterial); + + /** + * 删除物料和物料出库单关联 + * + * @param id 物料和物料出库单关联ID + * @return 结果 + */ + public int deleteImStockRequisitionMaterialById(Long id); + + /** + * 批量删除物料和物料出库单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImStockRequisitionMaterialByIds(Long[] ids); + + /** + * 批量添加 + * @param lists + * @return + */ + public int insertImStockRequisitionMaterials(List lists); + + /** + * 根据code查询此物料下所有的物料 + * @param code + * @return + */ + public List selectImStockRequisitionMaterialByCode(String code); + + public List selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(@Param("productionCode")String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public int deleteImStockRequisitionMaterialByCode(@Param("code") String code); + + public List selectImStockRequisitionMaterialByCodeAndFigureNumber(@Param("productionCode")String productionCode, @Param("figureNumber") String figureNumber); + + public List selectImStockRequisitionMaterialListTwo( + ImStockRequisitionMaterial imStockRequisitionMaterial); + + public List selectImStockRequisitionMaterialBySparedThree(@Param("productionCode")String productionCode, @Param("sparedThree") Long id); + + public List selectImStockRequisitionMaterialByFigureNumberAndAllGB(); + + public List selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(@Param("productionCode")String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber,@Param("id") Long id); + + public List selectImStockRequisitionMaterialByNameAndFigureNumber(@Param("name") String materialName,@Param("figureNumber") String figureNumber); + + public List queryImStockRequisitionMaterialByNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber,@Param("outdate") Date outdate); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImSupplierMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImSupplierMapper.java new file mode 100644 index 0000000..7a73b9a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImSupplierMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.ImSupplier; + +/** + * 供应商Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImSupplierMapper +{ + /** + * 查询供应商 + * + * @param id 供应商ID + * @return 供应商 + */ + public ImSupplier selectImSupplierById(Long id); + + /** + * 查询供应商列表 + * + * @param imSupplier 供应商 + * @return 供应商集合 + */ + public List selectImSupplierList(ImSupplier imSupplier); + + /** + * 新增供应商 + * + * @param imSupplier 供应商 + * @return 结果 + */ + public int insertImSupplier(ImSupplier imSupplier); + + /** + * 修改供应商 + * + * @param imSupplier 供应商 + * @return 结果 + */ + public int updateImSupplier(ImSupplier imSupplier); + + /** + * 删除供应商 + * + * @param id 供应商ID + * @return 结果 + */ + public int deleteImSupplierById(Long id); + + /** + * 批量删除供应商 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImSupplierByIds(Long[] ids); + + public ImSupplier selectImSupplierByName(@Param("sellerName") String sellerName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImSupplierTypeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImSupplierTypeMapper.java new file mode 100644 index 0000000..3353dc0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImSupplierTypeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImSupplierType; + +/** + * 供应商类型Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImSupplierTypeMapper +{ + /** + * 查询供应商类型 + * + * @param id 供应商类型ID + * @return 供应商类型 + */ + public ImSupplierType selectImSupplierTypeById(Long id); + + /** + * 查询供应商类型列表 + * + * @param imSupplierType 供应商类型 + * @return 供应商类型集合 + */ + public List selectImSupplierTypeList(ImSupplierType imSupplierType); + + /** + * 新增供应商类型 + * + * @param imSupplierType 供应商类型 + * @return 结果 + */ + public int insertImSupplierType(ImSupplierType imSupplierType); + + /** + * 修改供应商类型 + * + * @param imSupplierType 供应商类型 + * @return 结果 + */ + public int updateImSupplierType(ImSupplierType imSupplierType); + + /** + * 删除供应商类型 + * + * @param id 供应商类型ID + * @return 结果 + */ + public int deleteImSupplierTypeById(Long id); + + /** + * 批量删除供应商类型 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImSupplierTypeByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/ImWarehouseMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/ImWarehouseMapper.java new file mode 100644 index 0000000..0a3b271 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/ImWarehouseMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.ImWarehouse; + +/** + * 仓库Mapper接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface ImWarehouseMapper +{ + /** + * 查询仓库 + * + * @param id 仓库ID + * @return 仓库 + */ + public ImWarehouse selectImWarehouseById(Long id); + + /** + * 查询仓库列表 + * + * @param imWarehouse 仓库 + * @return 仓库集合 + */ + public List selectImWarehouseList(ImWarehouse imWarehouse); + + /** + * 新增仓库 + * + * @param imWarehouse 仓库 + * @return 结果 + */ + public int insertImWarehouse(ImWarehouse imWarehouse); + + /** + * 修改仓库 + * + * @param imWarehouse 仓库 + * @return 结果 + */ + public int updateImWarehouse(ImWarehouse imWarehouse); + + /** + * 删除仓库 + * + * @param id 仓库ID + * @return 结果 + */ + public int deleteImWarehouseById(Long id); + + /** + * 批量删除仓库 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteImWarehouseByIds(Long[] ids); + + /** + * 根据名称查询仓库 + * @param name + * @return + */ + public ImWarehouse selectImWarehouseByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomMateriallsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomMateriallsMapper.java new file mode 100644 index 0000000..6e16563 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomMateriallsMapper.java @@ -0,0 +1,44 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.JdBomMaterialls; + +/** + * 金蝶BOM物料信息Mapper接口 + * + * @author chenyongjiang + * @date 2024-05-17 + */ +public interface JdBomMateriallsMapper +{ + /** + * 查询金蝶BOM物料信息列表 + * + * @param jdBomMaterialls 金蝶BOM物料信息 + * @return 金蝶BOM物料信息集合 + + public List selectJdBomMateriallsList(JdBomMaterialls jdBomMaterialls);*/ + + /** + * 新增金蝶BOM物料信息 + * + * @param jdBomMaterialls 金蝶BOM物料信息 + * @return 结果 + */ + public int insertJdBomMaterialls(JdBomMaterialls jdBomMaterialls); + + /** + * 修改信息 + * @param jdBomMaterialls + * @return + */ + public int updateJdBomMaterialls(JdBomMaterialls jdBomMaterialls); + + /** + * 根据生产令号查询数据 + * @param productCode + * @return + */ + List queryJdBomListByCode(String productCode); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomNumberMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomNumberMapper.java new file mode 100644 index 0000000..7b1f9ad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomNumberMapper.java @@ -0,0 +1,47 @@ +package com.ruoyi.project.management.mapper; + +import com.ruoyi.project.management.domain.JdBomNumber; + +import java.util.List; + +/** + * 金蝶临时存储Mapper接口 + * + * @author chenyongjiang + * @date 2024-03-14 + */ +public interface JdBomNumberMapper +{ + /** + * 查询金蝶临时存储 + * + * @param code 执行单号 + * @return 金蝶临时存储 + */ + public List selectJdBomNumberByCode(String code); + + /** + * 新增金蝶临时存储 + * + * @param jdBomNumber 金蝶临时存储 + * @return 结果 + */ + public int insertJdBomNumber(JdBomNumber jdBomNumber); + + /** + * 批量新增金蝶临时存储 + * + * @param list 金蝶临时存储 + * @return 结果 + */ + public int insertJdBomNumberBatch(List list); + + /** + * 查询金蝶临时存储序数据 + * + * @param code 执行单号 + * @return 金蝶临时存储 + */ + public List queryJdBomNumberByCode(String code); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomRecordMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomRecordMapper.java new file mode 100644 index 0000000..67dc822 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdBomRecordMapper.java @@ -0,0 +1,59 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.JdBomRecord; + +/** + * 金蝶BOM记录Mapper接口 + * + * @author chenyongjiang + * @date 2024-04-24 + */ +public interface JdBomRecordMapper +{ + /** + * 查询金蝶BOM记录列表 + * + * @param jdBomRecord 金蝶BOM记录 + * @return 金蝶BOM记录集合 + */ + public List selectJdBomRecordList(JdBomRecord jdBomRecord); + /** + * 根据ID查询金蝶BOM记录 + * + * @param id ERP执行单号 + * @return 金蝶BOM记录 + */ + public JdBomRecord selectJdBomRecordById(Long id); + + /** + * 新增金蝶BOM记录 + * + * @param jdBomRecord 金蝶BOM记录 + * @return 结果 + */ + public int insertJdBomRecord(JdBomRecord jdBomRecord); + + /** + * 修改 + * @param jdBomRecord + * @return + */ + public int updateJdBomRecord(JdBomRecord jdBomRecord); + + /** + * 查询金蝶BOM记录 + * + * @param productCode ERP执行单号 + * @return 金蝶BOM记录 + */ + public List selectJdBomRecordByCode(String productCode); + + /** + * 打完成标识 + * + * @param id 金蝶BOM记录 + * @return 结果 + */ + public int updateJdBomRecordById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdCurrencyMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdCurrencyMapper.java new file mode 100644 index 0000000..473ab34 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdCurrencyMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import com.ruoyi.project.management.domain.JdCurrency; + +/** + * 币别Mapper接口 + * + * @author zhukangchao + * @date 2023-12-15 + */ +public interface JdCurrencyMapper { + /** + * 查询币别 + * + * @param id 币别ID + * @return 币别 + */ + JdCurrency selectJdCurrencyById(Long id); + + /** + * 查询币别列表 + * + * @param jdCurrency 币别 + * @return 币别集合 + */ + List selectJdCurrencyList(JdCurrency jdCurrency); + + /** + * 新增币别 + * + * @param jdCurrency 币别 + * @return 结果 + */ + int insertJdCurrency(JdCurrency jdCurrency); + + /** + * 修改币别 + * + * @param jdCurrency 币别 + * @return 结果 + */ + int updateJdCurrency(JdCurrency jdCurrency); + + /** + * 删除币别 + * + * @param id 币别ID + * @return 结果 + */ + int deleteJdCurrencyById(Long id); + + /** + * 批量删除币别 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteJdCurrencyByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdErrorMessageMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdErrorMessageMapper.java new file mode 100644 index 0000000..4e19ddd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdErrorMessageMapper.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.management.mapper; + +import com.ruoyi.project.management.domain.JdErrorMessage; +import java.util.List; + +/** + * 金蝶接口错误信息Mapper接口 + * + * @author evo + * @date 2024-04-29 + */ +public interface JdErrorMessageMapper +{ + /** + * 查询金蝶接口错误信息 + * + * @param messageId 金蝶接口错误信息主键 + * @return 金蝶接口错误信息 + */ + public JdErrorMessage selectJdErrorMessageByMessageId(Long messageId); + + /** + * 查询金蝶接口错误信息列表 + * + * @param jdErrorMessage 金蝶接口错误信息 + * @return 金蝶接口错误信息集合 + */ + public List selectJdErrorMessageList(JdErrorMessage jdErrorMessage); + + /** + * 新增金蝶接口错误信息 + * + * @param jdErrorMessage 金蝶接口错误信息 + * @return 结果 + */ + public int insertJdErrorMessage(JdErrorMessage jdErrorMessage); + + /** + * 修改金蝶接口错误信息 + * + * @param jdErrorMessage 金蝶接口错误信息 + * @return 结果 + */ + public int updateJdErrorMessage(JdErrorMessage jdErrorMessage); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdExpenseItemsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdExpenseItemsMapper.java new file mode 100644 index 0000000..74ff891 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdExpenseItemsMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import com.ruoyi.project.management.domain.JdExpenseItems; + +/** + * 费用项目Mapper接口 + * + * @author zhukangchao + * @date 2023-12-16 + */ +public interface JdExpenseItemsMapper { + /** + * 查询费用项目 + * + * @param id 费用项目ID + * @return 费用项目 + */ + JdExpenseItems selectJdExpenseItemsById(Long id); + + /** + * 查询费用项目列表 + * + * @param jdExpenseItems 费用项目 + * @return 费用项目集合 + */ + List selectJdExpenseItemsList(JdExpenseItems jdExpenseItems); + + /** + * 新增费用项目 + * + * @param jdExpenseItems 费用项目 + * @return 结果 + */ + int insertJdExpenseItems(JdExpenseItems jdExpenseItems); + + /** + * 修改费用项目 + * + * @param jdExpenseItems 费用项目 + * @return 结果 + */ + int updateJdExpenseItems(JdExpenseItems jdExpenseItems); + + /** + * 删除费用项目 + * + * @param id 费用项目ID + * @return 结果 + */ + int deleteJdExpenseItemsById(Long id); + + /** + * 批量删除费用项目 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteJdExpenseItemsByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdProcessBomMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdProcessBomMapper.java new file mode 100644 index 0000000..cd32da6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdProcessBomMapper.java @@ -0,0 +1,91 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.JdProcessBom; +import org.apache.ibatis.annotations.Param; + +/** + * 金蝶工序BOM记录Mapper接口 + * + * @author chenyongjiang + * @date 2024-05-07 + */ +public interface JdProcessBomMapper +{ + /** + * 查询金蝶工序BOM记录 + * + * @param id 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public JdProcessBom selectJdProcessBomById(Long id); + + /** + * 查询金蝶工序BOM记录列表 + * + * @param ids 金蝶工序BOM记录 + * @return 金蝶工序BOM记录集合 + */ + public List selectJdProcessBomList(@Param("ids") List ids,@Param("status")String status); + + /** + * 新增金蝶工序BOM记录 + * + * @param jdProcessBom 金蝶工序BOM记录 + * @return 结果 + */ + public int insertJdProcessBom(JdProcessBom jdProcessBom); + + /** + * 修改金蝶工序BOM记录 + * + * @param jdProcessBom 金蝶工序BOM记录 + * @return 结果 + */ + public int updateJdProcessBom(JdProcessBom jdProcessBom); + /** + * 查询金蝶工序BOM记录 + * + * @param figureNumber 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public JdProcessBom selectJdProcessBomByFigurenumber(String figureNumber); + + /** + * 审核金蝶工序BOM记录 + * + * @param id 金蝶工序BOM记录 + * @return 结果 + */ + public int auditJdProcessBom(Long id); + + /** + * 根据父级图号模糊查询所有工艺 + * + * @param figureNumber 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public List queryJdProcessByFigurenumber(String figureNumber); + /** + * 根据生产令号查询所有工艺物料 + * + * @param productCode 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public List queryJdProcessByProductCode(String productCode); + + /** + * 根据id删除数据 + * @param id + * @return + */ + public int deleteJdProcessBomById(Long id); + + /** + * 根据父级ID模糊查询所有工艺 + * + * @param parentId 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public List queryJdProcessByPatentId(Long parentId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdProcessBomRecordMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdProcessBomRecordMapper.java new file mode 100644 index 0000000..339696c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdProcessBomRecordMapper.java @@ -0,0 +1,26 @@ +package com.ruoyi.project.management.mapper; + +import com.ruoyi.project.management.domain.JdProcessBomRecord; +import java.util.List; + +/** + * 金蝶记录和工艺关联表 + */ +public interface JdProcessBomRecordMapper { + /** + * 查询满足记录的工艺 + * @param recordId + * @return + */ + public List selectJdProcessBomRecordByRecordId(Long recordId); + /** + * 新增金蝶工艺关联表 + * + * @param jdProcessBomRecord 金蝶工序BOM记录 + * @return 结果 + */ + public int insertJdProcessBomAndRecord(JdProcessBomRecord jdProcessBomRecord); + + public JdProcessBomRecord selectJdProcessBomRecordByProcessId(Long processId); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/JdReceiptsDataInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/JdReceiptsDataInfoMapper.java new file mode 100644 index 0000000..61a4294 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/JdReceiptsDataInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.JdReceiptsDataInfo; + +/** + * 财务系统数据信息Mapper接口 + * + * @author zhukangchao + * @date 2023-11-27 + */ +public interface JdReceiptsDataInfoMapper +{ + /** + * 查询财务系统数据信息 + * + * @param id 财务系统数据信息ID + * @return 财务系统数据信息 + */ + public JdReceiptsDataInfo selectJdReceiptsDataInfoById(Long id); + + /** + * 查询财务系统数据信息列表 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 财务系统数据信息集合 + */ + public List selectJdReceiptsDataInfoList(JdReceiptsDataInfo jdReceiptsDataInfo); + + /** + * 新增财务系统数据信息 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 结果 + */ + public int insertJdReceiptsDataInfo(JdReceiptsDataInfo jdReceiptsDataInfo); + + /** + * 修改财务系统数据信息 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 结果 + */ + public int updateJdReceiptsDataInfo(JdReceiptsDataInfo jdReceiptsDataInfo); + + /** + * 删除财务系统数据信息 + * + * @param id 财务系统数据信息ID + * @return 结果 + */ + public int deleteJdReceiptsDataInfoById(Long id); + + /** + * 批量删除财务系统数据信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteJdReceiptsDataInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/MaterialSecureMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/MaterialSecureMapper.java new file mode 100644 index 0000000..93824a8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/MaterialSecureMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.MaterialSecure; + +/** + * 安全库存设置Mapper接口 + * + * @author chenyongjiang + * @date 2024-02-19 + */ +public interface MaterialSecureMapper +{ + /** + * 查询安全库存设置 + * + * @param id 安全库存设置ID + * @return 安全库存设置 + */ + public MaterialSecure selectMaterialSecureById(Long id); + + /** + * 查询安全库存设置列表 + * + * @param materialSecure 安全库存设置 + * @return 安全库存设置集合 + */ + public List selectMaterialSecureList(MaterialSecure materialSecure); + + /** + * 新增安全库存设置 + * + * @param materialSecure 安全库存设置 + * @return 结果 + */ + public int insertMaterialSecure(MaterialSecure materialSecure); + + /** + * 修改安全库存设置 + * + * @param materialSecure 安全库存设置 + * @return 结果 + */ + public int updateMaterialSecure(MaterialSecure materialSecure); + + /** + * 删除安全库存设置 + * + * @param id 安全库存设置ID + * @return 结果 + */ + public int deleteMaterialSecureById(Long id); + + /** + * 批量删除安全库存设置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteMaterialSecureByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcCurtainMachineMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcCurtainMachineMapper.java new file mode 100644 index 0000000..98821e0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcCurtainMachineMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcCurtainMachine; + +/** + * 大幕机型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcCurtainMachineMapper +{ + /** + * 查询大幕机型号 + * + * @param id 大幕机型号ID + * @return 大幕机型号 + */ + public PcCurtainMachine selectPcCurtainMachineById(Long id); + + /** + * 查询大幕机型号列表 + * + * @param pcCurtainMachine 大幕机型号 + * @return 大幕机型号集合 + */ + public List selectPcCurtainMachineList(PcCurtainMachine pcCurtainMachine); + + /** + * 新增大幕机型号 + * + * @param pcCurtainMachine 大幕机型号 + * @return 结果 + */ + public int insertPcCurtainMachine(PcCurtainMachine pcCurtainMachine); + + /** + * 修改大幕机型号 + * + * @param pcCurtainMachine 大幕机型号 + * @return 结果 + */ + public int updatePcCurtainMachine(PcCurtainMachine pcCurtainMachine); + + /** + * 删除大幕机型号 + * + * @param id 大幕机型号ID + * @return 结果 + */ + public int deletePcCurtainMachineById(Long id); + + /** + * 批量删除大幕机型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcCurtainMachineByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcCurtainMachine selectPcCurtainMachineByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcDetentMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcDetentMapper.java new file mode 100644 index 0000000..f818c78 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcDetentMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcDetent; + +/** + * 制动器型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcDetentMapper +{ + /** + * 查询制动器型号 + * + * @param id 制动器型号ID + * @return 制动器型号 + */ + public PcDetent selectPcDetentById(Long id); + + /** + * 查询制动器型号列表 + * + * @param pcDetent 制动器型号 + * @return 制动器型号集合 + */ + public List selectPcDetentList(PcDetent pcDetent); + + /** + * 新增制动器型号 + * + * @param pcDetent 制动器型号 + * @return 结果 + */ + public int insertPcDetent(PcDetent pcDetent); + + /** + * 修改制动器型号 + * + * @param pcDetent 制动器型号 + * @return 结果 + */ + public int updatePcDetent(PcDetent pcDetent); + + /** + * 删除制动器型号 + * + * @param id 制动器型号ID + * @return 结果 + */ + public int deletePcDetentById(Long id); + + /** + * 批量删除制动器型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcDetentByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcDetent selectPcDetentByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcElectricalMachineryAcMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcElectricalMachineryAcMapper.java new file mode 100644 index 0000000..1e0f67b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcElectricalMachineryAcMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcElectricalMachineryAc; + +/** + * 电机AC型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcElectricalMachineryAcMapper +{ + /** + * 查询电机AC型号 + * + * @param id 电机AC型号ID + * @return 电机AC型号 + */ + public PcElectricalMachineryAc selectPcElectricalMachineryAcById(Long id); + + /** + * 查询电机AC型号列表 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 电机AC型号集合 + */ + public List selectPcElectricalMachineryAcList(PcElectricalMachineryAc pcElectricalMachineryAc); + + /** + * 新增电机AC型号 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 结果 + */ + public int insertPcElectricalMachineryAc(PcElectricalMachineryAc pcElectricalMachineryAc); + + /** + * 修改电机AC型号 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 结果 + */ + public int updatePcElectricalMachineryAc(PcElectricalMachineryAc pcElectricalMachineryAc); + + /** + * 删除电机AC型号 + * + * @param id 电机AC型号ID + * @return 结果 + */ + public int deletePcElectricalMachineryAcById(Long id); + + /** + * 批量删除电机AC型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcElectricalMachineryAcByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcElectricalMachineryAc selectPcElectricalMachineryAcByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcFTypeReducerMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcFTypeReducerMapper.java new file mode 100644 index 0000000..4a9247f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcFTypeReducerMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcFTypeReducer; + +/** + * F型减速机型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcFTypeReducerMapper +{ + /** + * 查询F型减速机型号 + * + * @param id F型减速机型号ID + * @return F型减速机型号 + */ + public PcFTypeReducer selectPcFTypeReducerById(Long id); + + /** + * 查询F型减速机型号列表 + * + * @param pcFTypeReducer F型减速机型号 + * @return F型减速机型号集合 + */ + public List selectPcFTypeReducerList(PcFTypeReducer pcFTypeReducer); + + /** + * 新增F型减速机型号 + * + * @param pcFTypeReducer F型减速机型号 + * @return 结果 + */ + public int insertPcFTypeReducer(PcFTypeReducer pcFTypeReducer); + + /** + * 修改F型减速机型号 + * + * @param pcFTypeReducer F型减速机型号 + * @return 结果 + */ + public int updatePcFTypeReducer(PcFTypeReducer pcFTypeReducer); + + /** + * 删除F型减速机型号 + * + * @param id F型减速机型号ID + * @return 结果 + */ + public int deletePcFTypeReducerById(Long id); + + /** + * 批量删除F型减速机型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcFTypeReducerByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcFTypeReducer selectPcFTypeReducerByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcFireCurtainDampingDriveMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcFireCurtainDampingDriveMapper.java new file mode 100644 index 0000000..aa1ed2b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcFireCurtainDampingDriveMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcFireCurtainDampingDrive; + +/** + * 防火隔离幕阻尼驱动型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcFireCurtainDampingDriveMapper +{ + /** + * 查询防火隔离幕阻尼驱动型号 + * + * @param id 防火隔离幕阻尼驱动型号ID + * @return 防火隔离幕阻尼驱动型号 + */ + public PcFireCurtainDampingDrive selectPcFireCurtainDampingDriveById(Long id); + + /** + * 查询防火隔离幕阻尼驱动型号列表 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 防火隔离幕阻尼驱动型号集合 + */ + public List selectPcFireCurtainDampingDriveList(PcFireCurtainDampingDrive pcFireCurtainDampingDrive); + + /** + * 新增防火隔离幕阻尼驱动型号 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 结果 + */ + public int insertPcFireCurtainDampingDrive(PcFireCurtainDampingDrive pcFireCurtainDampingDrive); + + /** + * 修改防火隔离幕阻尼驱动型号 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 结果 + */ + public int updatePcFireCurtainDampingDrive(PcFireCurtainDampingDrive pcFireCurtainDampingDrive); + + /** + * 删除防火隔离幕阻尼驱动型号 + * + * @param id 防火隔离幕阻尼驱动型号ID + * @return 结果 + */ + public int deletePcFireCurtainDampingDriveById(Long id); + + /** + * 批量删除防火隔离幕阻尼驱动型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcFireCurtainDampingDriveByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcFireCurtainDampingDrive selectPcFireCurtainDampingDriveByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcHooksCouplingMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcHooksCouplingMapper.java new file mode 100644 index 0000000..7e3c545 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcHooksCouplingMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcHooksCoupling; + +/** + * 万向连轴器型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcHooksCouplingMapper +{ + /** + * 查询万向连轴器型号 + * + * @param id 万向连轴器型号ID + * @return 万向连轴器型号 + */ + public PcHooksCoupling selectPcHooksCouplingById(Long id); + + /** + * 查询万向连轴器型号列表 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 万向连轴器型号集合 + */ + public List selectPcHooksCouplingList(PcHooksCoupling pcHooksCoupling); + + /** + * 新增万向连轴器型号 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 结果 + */ + public int insertPcHooksCoupling(PcHooksCoupling pcHooksCoupling); + + /** + * 修改万向连轴器型号 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 结果 + */ + public int updatePcHooksCoupling(PcHooksCoupling pcHooksCoupling); + + /** + * 删除万向连轴器型号 + * + * @param id 万向连轴器型号ID + * @return 结果 + */ + public int deletePcHooksCouplingById(Long id); + + /** + * 批量删除万向连轴器型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcHooksCouplingByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcHooksCoupling selectPcHooksCouplingByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcRigidChainMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcRigidChainMapper.java new file mode 100644 index 0000000..0f8e725 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcRigidChainMapper.java @@ -0,0 +1,83 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcRigidChain; + +/** + * 销齿链型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcRigidChainMapper +{ + /** + * 查询销齿链型号 + * + * @param id 销齿链型号ID + * @return 销齿链型号 + */ + public PcRigidChain selectPcRigidChainById(Long id); + + /** + * 查询销齿链型号列表 + * + * @param pcRigidChain 销齿链型号 + * @return 销齿链型号集合 + */ + public List selectPcRigidChainList(PcRigidChain pcRigidChain); + + /** + * 新增销齿链型号 + * + * @param pcRigidChain 销齿链型号 + * @return 结果 + */ + public int insertPcRigidChain(PcRigidChain pcRigidChain); + + /** + * 修改销齿链型号 + * + * @param pcRigidChain 销齿链型号 + * @return 结果 + */ + public int updatePcRigidChain(PcRigidChain pcRigidChain); + + /** + * 删除销齿链型号 + * + * @param id 销齿链型号ID + * @return 结果 + */ + public int deletePcRigidChainById(Long id); + + /** + * 批量删除销齿链型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcRigidChainByIds(Long[] ids); + + /** + * 查询销齿链型号,按型号名称分类 + * @return + */ + public List selectPcRigidChainByTypeList(); + + /** + * 根据型号全称查询型号信息 + * @param typeName + * @return + */ + public PcRigidChain selectPcRigidChainByTypeName(String typeName); + + /** + * 根据型号查询行程(去重) + * @param type + * @return + */ + public List selectPcRigidChainByJourneyList(String type); + + public List selectPcRigidChainByType(String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcStrokeMeasurementMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcStrokeMeasurementMapper.java new file mode 100644 index 0000000..7ee7331 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcStrokeMeasurementMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcStrokeMeasurement; + +/** + * 行程检测型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcStrokeMeasurementMapper +{ + /** + * 查询行程检测型号 + * + * @param id 行程检测型号ID + * @return 行程检测型号 + */ + public PcStrokeMeasurement selectPcStrokeMeasurementById(Long id); + + /** + * 查询行程检测型号列表 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 行程检测型号集合 + */ + public List selectPcStrokeMeasurementList(PcStrokeMeasurement pcStrokeMeasurement); + + /** + * 新增行程检测型号 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 结果 + */ + public int insertPcStrokeMeasurement(PcStrokeMeasurement pcStrokeMeasurement); + + /** + * 修改行程检测型号 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 结果 + */ + public int updatePcStrokeMeasurement(PcStrokeMeasurement pcStrokeMeasurement); + + /** + * 删除行程检测型号 + * + * @param id 行程检测型号ID + * @return 结果 + */ + public int deletePcStrokeMeasurementById(Long id); + + /** + * 批量删除行程检测型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcStrokeMeasurementByIds(Long[] ids); + + /** + * 根据产品型号查询 + * @param typeName + * @return + */ + public PcStrokeMeasurement selectPcStrokeMeasurementByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcToothedCouplingMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcToothedCouplingMapper.java new file mode 100644 index 0000000..a51522e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcToothedCouplingMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcToothedCoupling; + +/** + * 齿形连轴器型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcToothedCouplingMapper +{ + /** + * 查询齿形连轴器型号 + * + * @param id 齿形连轴器型号ID + * @return 齿形连轴器型号 + */ + public PcToothedCoupling selectPcToothedCouplingById(Long id); + + /** + * 查询齿形连轴器型号列表 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 齿形连轴器型号集合 + */ + public List selectPcToothedCouplingList(PcToothedCoupling pcToothedCoupling); + + /** + * 新增齿形连轴器型号 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 结果 + */ + public int insertPcToothedCoupling(PcToothedCoupling pcToothedCoupling); + + /** + * 修改齿形连轴器型号 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 结果 + */ + public int updatePcToothedCoupling(PcToothedCoupling pcToothedCoupling); + + /** + * 删除齿形连轴器型号 + * + * @param id 齿形连轴器型号ID + * @return 结果 + */ + public int deletePcToothedCouplingById(Long id); + + /** + * 批量删除齿形连轴器型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcToothedCouplingByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcToothedCoupling selectPcToothedCouplingByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcTravelSwitchMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcTravelSwitchMapper.java new file mode 100644 index 0000000..a461bb9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcTravelSwitchMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcTravelSwitch; + +/** + * 行程开关型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcTravelSwitchMapper +{ + /** + * 查询行程开关型号 + * + * @param id 行程开关型号ID + * @return 行程开关型号 + */ + public PcTravelSwitch selectPcTravelSwitchById(Long id); + + /** + * 查询行程开关型号列表 + * + * @param pcTravelSwitch 行程开关型号 + * @return 行程开关型号集合 + */ + public List selectPcTravelSwitchList(PcTravelSwitch pcTravelSwitch); + + /** + * 新增行程开关型号 + * + * @param pcTravelSwitch 行程开关型号 + * @return 结果 + */ + public int insertPcTravelSwitch(PcTravelSwitch pcTravelSwitch); + + /** + * 修改行程开关型号 + * + * @param pcTravelSwitch 行程开关型号 + * @return 结果 + */ + public int updatePcTravelSwitch(PcTravelSwitch pcTravelSwitch); + + /** + * 删除行程开关型号 + * + * @param id 行程开关型号ID + * @return 结果 + */ + public int deletePcTravelSwitchById(Long id); + + /** + * 批量删除行程开关型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcTravelSwitchByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcTravelSwitch selectPcTravelSwitchByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcTwoStageReductionGearMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcTwoStageReductionGearMapper.java new file mode 100644 index 0000000..fee5316 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcTwoStageReductionGearMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcTwoStageReductionGear; + +/** + * 二级减速器型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcTwoStageReductionGearMapper +{ + /** + * 查询二级减速器型号 + * + * @param id 二级减速器型号ID + * @return 二级减速器型号 + */ + public PcTwoStageReductionGear selectPcTwoStageReductionGearById(Long id); + + /** + * 查询二级减速器型号列表 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 二级减速器型号集合 + */ + public List selectPcTwoStageReductionGearList(PcTwoStageReductionGear pcTwoStageReductionGear); + + /** + * 新增二级减速器型号 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 结果 + */ + public int insertPcTwoStageReductionGear(PcTwoStageReductionGear pcTwoStageReductionGear); + + /** + * 修改二级减速器型号 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 结果 + */ + public int updatePcTwoStageReductionGear(PcTwoStageReductionGear pcTwoStageReductionGear); + + /** + * 删除二级减速器型号 + * + * @param id 二级减速器型号ID + * @return 结果 + */ + public int deletePcTwoStageReductionGearById(Long id); + + /** + * 批量删除二级减速器型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcTwoStageReductionGearByIds(Long[] ids); + + /** + * 根据产品型号全称查询 + * @param typeName + * @return + */ + public PcTwoStageReductionGear selectPcTwoStageReductionGearByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PcWindlassMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PcWindlassMapper.java new file mode 100644 index 0000000..f0b6800 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PcWindlassMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PcWindlass; + +/** + * 卷扬机型号Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PcWindlassMapper +{ + /** + * 查询卷扬机型号 + * + * @param id 卷扬机型号ID + * @return 卷扬机型号 + */ + public PcWindlass selectPcWindlassById(Long id); + + /** + * 查询卷扬机型号列表 + * + * @param pcWindlass 卷扬机型号 + * @return 卷扬机型号集合 + */ + public List selectPcWindlassList(PcWindlass pcWindlass); + + /** + * 新增卷扬机型号 + * + * @param pcWindlass 卷扬机型号 + * @return 结果 + */ + public int insertPcWindlass(PcWindlass pcWindlass); + + /** + * 修改卷扬机型号 + * + * @param pcWindlass 卷扬机型号 + * @return 结果 + */ + public int updatePcWindlass(PcWindlass pcWindlass); + + /** + * 删除卷扬机型号 + * + * @param id 卷扬机型号ID + * @return 结果 + */ + public int deletePcWindlassById(Long id); + + /** + * 批量删除卷扬机型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePcWindlassByIds(Long[] ids); + + /** + * 根据产品型号查询 + * @param typeName + * @return + */ + public PcWindlass selectPcWindlassByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwAlterationDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwAlterationDetailMapper.java new file mode 100644 index 0000000..acb3fc2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwAlterationDetailMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwAlterationDetail; + +/** + * 变更单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-04-14 + */ +public interface PwAlterationDetailMapper +{ + /** + * 查询变更单详情 + * + * @param id 变更单详情ID + * @return 变更单详情 + */ + public PwAlterationDetail selectPwAlterationDetailById(Long id); + + /** + * 查询变更单详情列表 + * + * @param pwAlterationDetail 变更单详情 + * @return 变更单详情集合 + */ + public List selectPwAlterationDetailList(PwAlterationDetail pwAlterationDetail); + + /** + * 新增变更单详情 + * + * @param pwAlterationDetail 变更单详情 + * @return 结果 + */ + public int insertPwAlterationDetail(PwAlterationDetail pwAlterationDetail); + + /** + * 修改变更单详情 + * + * @param pwAlterationDetail 变更单详情 + * @return 结果 + */ + public int updatePwAlterationDetail(PwAlterationDetail pwAlterationDetail); + + /** + * 删除变更单详情 + * + * @param id 变更单详情ID + * @return 结果 + */ + public int deletePwAlterationDetailById(Long id); + + /** + * 批量删除变更单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwAlterationDetailByIds(Long[] ids); + + public List selectPwAlterationDetailByAlterationId(@Param("alterationId")Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwAlterationMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwAlterationMapper.java new file mode 100644 index 0000000..b483f40 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwAlterationMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwAlteration; + +/** + * 变更单Mapper接口 + * + * @author zhukangchao + * @date 2022-04-14 + */ +public interface PwAlterationMapper +{ + /** + * 查询变更单 + * + * @param id 变更单ID + * @return 变更单 + */ + public PwAlteration selectPwAlterationById(Long id); + + /** + * 查询变更单列表 + * + * @param pwAlteration 变更单 + * @return 变更单集合 + */ + public List selectPwAlterationList(PwAlteration pwAlteration); + + /** + * 新增变更单 + * + * @param pwAlteration 变更单 + * @return 结果 + */ + public int insertPwAlteration(PwAlteration pwAlteration); + + /** + * 修改变更单 + * + * @param pwAlteration 变更单 + * @return 结果 + */ + public int updatePwAlteration(PwAlteration pwAlteration); + + /** + * 删除变更单 + * + * @param id 变更单ID + * @return 结果 + */ + public int deletePwAlterationById(Long id); + + /** + * 批量删除变更单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwAlterationByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBacklogMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBacklogMapper.java new file mode 100644 index 0000000..8aeeb46 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBacklogMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBacklog; + +/** + * 待办事项Mapper接口 + * + * @author zhukangchao + * @date 2023-02-05 + */ +public interface PwBacklogMapper +{ + /** + * 查询待办事项 + * + * @param id 待办事项ID + * @return 待办事项 + */ + public PwBacklog selectPwBacklogById(Long id); + + /** + * 查询待办事项列表 + * + * @param pwBacklog 待办事项 + * @return 待办事项集合 + */ + public List selectPwBacklogList(PwBacklog pwBacklog); + + /** + * 新增待办事项 + * + * @param pwBacklog 待办事项 + * @return 结果 + */ + public int insertPwBacklog(PwBacklog pwBacklog); + + /** + * 修改待办事项 + * + * @param pwBacklog 待办事项 + * @return 结果 + */ + public int updatePwBacklog(PwBacklog pwBacklog); + + /** + * 删除待办事项 + * + * @param id 待办事项ID + * @return 结果 + */ + public int deletePwBacklogById(Long id); + + /** + * 批量删除待办事项 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBacklogByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomMapper.java new file mode 100644 index 0000000..474d146 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomMapper.java @@ -0,0 +1,91 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBom; + + +/** + * bomMapper接口 + * + * @author zhukangchao + * @date 2020-08-11 + */ +public interface PwBomMapper +{ + /** + * 查询bom + * + * @param id bomID + * @return bom + */ + public PwBom selectPwBomById(Long id); + + /** + * 查询bom列表 + * + * @param pwBom bom + * @return bom集合 + */ + public List selectPwBomList(PwBom pwBom); + + /** + * 新增bom + * + * @param pwBom bom + * @return 结果 + */ + public int insertPwBom(PwBom pwBom); + + /** + * 修改bom + * + * @param pwBom bom + * @return 结果 + */ + public int updatePwBom(PwBom pwBom); + + /** + * 删除bom + * + * @param id bomID + * @return 结果 + */ + public int deletePwBomById(Long id); + + /** + * 批量删除bom + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBomByIds(Long[] ids); + + /** + * 批量添加 + * @param list + */ + public int insertPwBoms(List list); + + /** + * 根据型号全称查询需要采购的零部件 + * @param typeName + * @return + */ + public List selectPwBomByTyepNameAndFigureNumber(String typeName); + + public List selectPwBomByFigureNumberAndProductType(String partGather,String productType); + + public PwBom selectPwBomByFigureNumber(@Param("partGather") String partGather); + + /** + * 根据型号全称查询需要采购的零部件 + * @param typeName + * @return + */ + public List selectPwBomByProductType(@Param("productType") String productType); + + public List selectPwBomByCode(@Param("code") String code,@Param("productType") String productType); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberMapper.java new file mode 100644 index 0000000..8e9cdfe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberMapper.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.project.management.domain.PwBomNumber; + +/** + * 数量计算Mapper接口 + * + * @author zhukangchao + * @date 2021-03-22 + */ +public interface PwBomNumberMapper +{ + /** + * 查询数量计算 + * + * @param id 数量计算ID + * @return 数量计算 + */ + public PwBomNumber selectPwBomNumberById(Long id); + + /** + * 查询数量计算列表 + * + * @param pwBomNumber 数量计算 + * @return 数量计算集合 + */ + public List selectPwBomNumberList(PwBomNumber pwBomNumber); + + /** + * 新增数量计算 + * + * @param pwBomNumber 数量计算 + * @return 结果 + */ + public int insertPwBomNumber(PwBomNumber pwBomNumber); + + /** + * 修改数量计算 + * + * @param pwBomNumber 数量计算 + * @return 结果 + */ + public int updatePwBomNumber(PwBomNumber pwBomNumber); + + /** + * 删除数量计算 + * + * @param code 执行单号 + * @param figureNumber 图号 + * @return 结果 + */ + public int deletePwBomNumberByCodeAndFigureNumber(String code,String figureNumber); + + public List selectPwBomNumberByParentLevelFigureNumber(@Param("parentLevelFigureNumber") String parentLevelFigureNumber,@Param("parentLevelFigureNumber2") String parentLevelFigureNumber2,@Param("parentLevelFigureNumber3") String parentLevelFigureNumber3, @Param("typeName") String typeName,@Param("code") String code); + + public List selectPwBomNumberByCode(@Param("code") String code); + + public int insertPwBoms(List list); + + /** + * 根据执行单号查询所有的物料 + * @param code + * @return + */ + public List queryPwBomNumberByCode(@Param("code") String code); + + public int deletePwBomNumberByCode(@Param("code") String code); + + public List selectPwBomNumberByCodeAndTypeName(@Param("code") String code,@Param("typeName") String typeName); + + public List selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber,@Param("sparedOne") String sparedOne); + + public List selectPwBomNumberByCodeAndNameAndFigureNumber(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + /** + * 根据执行单号查询所有总图 + * @param code + * @return + */ + public List queryPwBomNumberZTByCode(@Param("code") String code); + + public List selectPwBomNumberByParentFigureNumber(String parentLevelFigureNumber,String code); + + /** + * 根据生产单号,父级图号,序号查询 + * @param parentLevelFigureNumber 父级图号 + * @param code 生产单号 + * @param num 序号 + * @return + */ +public List queryPwBomNumberByParentFigureNumberAndNum(String parentLevelFigureNumber,String code,String num); + /** + * 根据生产令号和图号修改属性 + * @param purchaseMark 属性 + * @param productCode 生产令号 + * @param figureNumber 图号 + * @return + */ + public int updatePwBomNumberByCodeAndFigureNumber(String purchaseMark,String productCode,String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoFuMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoFuMapper.java new file mode 100644 index 0000000..fabaa1f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoFuMapper.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoFu; + +/** + * 副BomMapper接口 + * + * @author zhukangchao + * @date 2023-04-17 + */ +public interface PwBomNumberTwoFuMapper +{ + /** + * 查询副Bom + * + * @param id 副BomID + * @return 副Bom + */ + public PwBomNumberTwoFu selectPwBomNumberTwoFuById(Long id); + + /** + * 查询副Bom列表 + * + * @param pwBomNumberTwoFu 副Bom + * @return 副Bom集合 + */ + public List selectPwBomNumberTwoFuList(PwBomNumberTwoFu pwBomNumberTwoFu); + + /** + * 新增副Bom + * + * @param pwBomNumberTwoFu 副Bom + * @return 结果 + */ + public int insertPwBomNumberTwoFu(PwBomNumberTwoFu pwBomNumberTwoFu); + + /** + * 修改副Bom + * + * @param pwBomNumberTwoFu 副Bom + * @return 结果 + */ + public int updatePwBomNumberTwoFu(PwBomNumberTwoFu pwBomNumberTwoFu); + + /** + * 删除副Bom + * + * @param id 副BomID + * @return 结果 + */ + public int deletePwBomNumberTwoFuById(Long id); + + /** + * 批量删除副Bom + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBomNumberTwoFuByIds(Long[] ids); + + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndParentLevelNameAndParentLevelFigureNumber(@Param("productionCode")String productionCode,@Param("parentLevelName")String parentLevelName, @Param("parentLevelFigureNumber") String parentLevelFigureNumber); + + public List selectPwBomNumberTwoFuByCodeAndSuperiorId(@Param("productionCode") String productionCode,@Param("id") Long id); + + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndFigureNumber(@Param("productionCode") String productionCode,@Param("figureNumber") String figureNumber); + + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndNameAndFigureNumber(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwBomByCodeAndParentNameAndParentFigureNumbers(@Param("code")String code,@Param("name")String name, @Param("figureNumber")String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoGongxuMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoGongxuMapper.java new file mode 100644 index 0000000..71796de --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoGongxuMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoGongxu; + +/** + * BOM工序引用Mapper接口 + * + * @author zhukangchao + * @date 2023-09-24 + */ +public interface PwBomNumberTwoGongxuMapper +{ + /** + * 查询BOM工序引用 + * + * @param id BOM工序引用ID + * @return BOM工序引用 + */ + public PwBomNumberTwoGongxu selectPwBomNumberTwoGongxuById(Long id); + + /** + * 查询BOM工序引用列表 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return BOM工序引用集合 + */ + public List selectPwBomNumberTwoGongxuList(PwBomNumberTwoGongxu pwBomNumberTwoGongxu); + + /** + * 新增BOM工序引用 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return 结果 + */ + public int insertPwBomNumberTwoGongxu(PwBomNumberTwoGongxu pwBomNumberTwoGongxu); + + /** + * 修改BOM工序引用 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return 结果 + */ + public int updatePwBomNumberTwoGongxu(PwBomNumberTwoGongxu pwBomNumberTwoGongxu); + + /** + * 删除BOM工序引用 + * + * @param id BOM工序引用ID + * @return 结果 + */ + public int deletePwBomNumberTwoGongxuById(Long id); + + /** + * 批量删除BOM工序引用 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBomNumberTwoGongxuByIds(Long[] ids); + + /** + * 保留工序 + * @param list + * @return + */ + public int insertPwBomNumberTwoGongxus(List list); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoLingliaoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoLingliaoMapper.java new file mode 100644 index 0000000..11eef6f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoLingliaoMapper.java @@ -0,0 +1,78 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBomNumberTwoLingliao; + +/** + * 领料专用bomMapper接口 + * + * @author zhukangchao + * @date 2022-02-23 + */ +public interface PwBomNumberTwoLingliaoMapper +{ + /** + * 查询领料专用bom + * + * @param id 领料专用bomID + * @return 领料专用bom + */ + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingliaoById(Long id); + + /** + * 查询领料专用bom列表 + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 领料专用bom集合 + */ + public List selectPwBomNumberTwoLingliaoList(PwBomNumberTwoLingliao pwBomNumberTwoLingliao); + + /** + * 新增领料专用bom + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 结果 + */ + public int insertPwBomNumberTwoLingliao(PwBomNumberTwoLingliao pwBomNumberTwoLingliao); + + /** + * 修改领料专用bom + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 结果 + */ + public int updatePwBomNumberTwoLingliao(PwBomNumberTwoLingliao pwBomNumberTwoLingliao); + + /** + * 删除领料专用bom + * + * @param id 领料专用bomID + * @return 结果 + */ + public int deletePwBomNumberTwoLingliaoById(Long id); + + /** + * 批量删除领料专用bom + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBomNumberTwoLingliaoByIds(Long[] ids); + + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(@Param("productionCode") String productionCode, @Param("type") String type, @Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwBomNumberTwoLingliaoByCodeAndProductType(@Param("code") String code,@Param("productType") String productType); + + public int deletePwBomNumberTwoLingliaoByCode(@Param("code") String code); + + public List selectPwBomNumberTwoLingliaoByFigureNumberAndAllGB(); + + public List selectPwBomNumberTwoLingliaoByCodeAndFigureNumber(@Param("productionCode") String productionCode, @Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(@Param("productionCode") String productionCode, @Param("name") String name,@Param("figureNumber") String figureNumber,@Param("type") String type); + + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingLiaoByCodeAndNameAndFigureNumber(@Param("productionCode") String productionCode, @Param("name") String name,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoMapper.java new file mode 100644 index 0000000..3a947b3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBomNumberTwoMapper.java @@ -0,0 +1,199 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBom; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoVo; + + + +/** + * 数量保存Mapper接口 + * + * @author zhukangchao + * @date 2021-03-30 + */ +public interface PwBomNumberTwoMapper +{ + /** + * 查询数量保存 + * + * @param id 数量保存ID + * @return 数量保存 + */ + public PwBomNumberTwo selectPwBomNumberTwoById(Long id); + + /** + * 查询数量保存列表 + * + * @param pwBomNumberTwo 数量保存 + * @return 数量保存集合 + */ + public List selectPwBomNumberTwoList(PwBomNumberTwo pwBomNumberTwo); + + /** + * 查询数量保存列表(去掉本批数量为0的数据) + * + * @param pwBomNumberTwo 数量保存 + * @return 数量保存集合 + */ + public List selectPwBomNumberTwoLists(PwBomNumberTwo pwBomNumberTwo); + + /** + * 新增数量保存 + * + * @param pwBomNumberTwo 数量保存 + * @return 结果 + */ + public int insertPwBomNumberTwo(PwBomNumberTwo pwBomNumberTwo); + + /** + * 修改数量保存 + * + * @param pwBomNumberTwo 数量保存 + * @return 结果 + */ + public int updatePwBomNumberTwo(PwBomNumberTwo pwBomNumberTwo); + + /** + * 删除数量保存 + * + * @param id 数量保存ID + * @return 结果 + */ + public int deletePwBomNumberTwoById(Long id); + + /** + * 批量删除数量保存 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBomNumberTwoByIds(Long[] ids); + + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwBomNumberTwoByCode(@Param("code") String code); + + public int deletePwBomNumberTwoByCode(@Param("code") String code); + + public List selectPwBomNumberTwoByCodeAndProductType(@Param("code") String code,@Param("productType") String productType); + + /** + * 根据生产令号查询当前令号下所有的物料信息 + * @param code + * @return + */ + public List selectPwBomNumberTwoByProductionCode(@Param("code") String code); + + public List selectPwBomNumberTwoByNameAndFigureNumberNoRepetition(@Param("name") String name,@Param("figureNumber") String figureNumber); + + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndNameAndFigureNumber(@Param("makeDocumentsCode") String makeDocumentsCode, + @Param("materialName") String materialName,@Param("specification") String specification); + + public List selectPwBomNumberTwoByCodeAndIsSpacing(@Param("code") String code); + + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumber(@Param("productionCode")String productionCode,@Param("parentLevelName")String parentLevelName, @Param("parentLevelFigureNumber") String parentLevelFigureNumber); + + public List selectPwBomNumberTwoByCodeAndSuperiorId(@Param("productionCode") String productionCode,@Param("id") Long id); + + /** + * 根据code和上级图号和上级名称查询其所有子集 + * @param code + * @param parentLevelName + * @param figureNumber + * @return + */ + public List selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumbers(@Param("code")String code,@Param("parentLevelName")String parentLevelName, @Param("figureNumber")String figureNumber); + + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndFigureNumber(@Param("productionCode")String productionCode,@Param("figureNumber") String figureNumber); + + public List selectPwBomNumberTwoByCodeAndSuperiorIdAndDepartmentName(@Param("productionCode") String productionCode,@Param("id") Long id); + + public List selectPwBomNumberTwoListToBom(PwBomNumberTwo two); + + public List selectPwBomNumberTwoByProductionCodeALL(@Param("code") String code); + + public List selectPwBomNumberTwoListHomeMade(PwBomNumberTwo pwBomNumberTwo); + + public List selectPwBomNumberTwoListStandard(PwBomNumberTwo pwBomNumberTwo); + + public List selectPwBomNumberTwoListOutsourcing(PwBomNumberTwo pwBomNumberTwo); + + public List selectPwBomNumberTwoListFirstParty(PwBomNumberTwo pwBomNumberTwo); + + public List selectPwBomNumberTwoByCodeByG(@Param("code") String code); + + public List selectPwBomNumberTwoByCodeAndSuperiorIdNotIsNull(@Param("code") String productionCode); + + public List selectPwBomNumberTwoListToBomVo(PwBomNumberTwoVo two); + + public List selectPwBomNumberTwoVoByCodeAndSuperiorId(@Param("productionCode") String productionCode,@Param("id") Long id); + + public List selectPwBomNumberTwoByCodeAndMuXiang(@Param("code") String code); + + public List selectPwBomNumberTwoByFigureNumberAndAllGB(); + + public List selectPwBomNumberTwoByDeptNameAndWeiWanCheng(PwBomNumberTwo pwBomNumberTwo); + + public List selectPwBomByCodeAndParentNameAndParentFigureNumbers(@Param("code")String code,@Param("name")String name, @Param("figureNumber")String figureNumber); + + public List selectPwBomNumberTwoByCodeAndKanBan(@Param("code")String code); + + public List selectPwBomNumberTwoByCodeAndAll(@Param("code") String code); + + public List selectPwBomNumberTwoByNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwBomNumberTwoByMaterialId(@Param("materialId") Long id); + + public List selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(@Param("code") String code, @Param("name")String name, @Param("figureNumber") String figureNumber); + + public List selectBomTwoByCodeAndSparedOne(@Param("code") String code,@Param("productType") String productType); + + public List selectPwBomNumberTwoByCodeAndMaterialIdIsNotNull(@Param("code") String productionCode); + + public List selectbycodeAndSparedFive(@Param("productionCode") String productionCode,@Param("sparedFive") int i); + /** + * 批量新增数量保存 + * + * @param bomList 数量保存 + * @return 结果 + */ + public int insertBatchPwBomNumberTwo(List bomList); + + /** + * 根据令号查询金蝶缺少物料 + * @param productCode + * @return + */ + public List selectPwBomNumberTwoListForJd(String productCode); + /** + * 根据图号和生产令号,查询本图号及其工艺 + * @param productionCode + * @param figureNumber + * @return + */ + public List queryPwBomNumberTwoProcessByCodeAndFigureNumber(String productionCode, String figureNumber); + /** + * 根据序号和生产令号,查询本图号及其工艺 + * @param productionCode + * @param num + * @return + */ + public List queryPwBomNumberTwoProcessByCodeAndNum(String productionCode, String num); + + /** + * 根据图号和生产令号,查询本图号及其工艺 + * @return + */ + public List queryProcessByCodeAndFigureNumber(Long id); + + /** + * 根据父级ID查询工序 + * @return + */ + public List queryProcessByParentId(Long parentId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionJjMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionJjMapper.java new file mode 100644 index 0000000..725e191 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionJjMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBuyingRequisitionJj; + +/** + * 基建请购申请单Mapper接口 + * + * @author zhukangchao + * @date 2022-06-28 + */ +public interface PwBuyingRequisitionJjMapper +{ + /** + * 查询基建请购申请单 + * + * @param id 基建请购申请单ID + * @return 基建请购申请单 + */ + public PwBuyingRequisitionJj selectPwBuyingRequisitionJjById(Long id); + + /** + * 查询基建请购申请单列表 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 基建请购申请单集合 + */ + public List selectPwBuyingRequisitionJjList(PwBuyingRequisitionJj pwBuyingRequisitionJj); + + /** + * 新增基建请购申请单 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 结果 + */ + public int insertPwBuyingRequisitionJj(PwBuyingRequisitionJj pwBuyingRequisitionJj); + + /** + * 修改基建请购申请单 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 结果 + */ + public int updatePwBuyingRequisitionJj(PwBuyingRequisitionJj pwBuyingRequisitionJj); + + /** + * 删除基建请购申请单 + * + * @param id 基建请购申请单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionJjById(Long id); + + /** + * 批量删除基建请购申请单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBuyingRequisitionJjByIds(Long[] ids); + + public PwBuyingRequisitionJj selectPwBuyingRequisitionJjByCode(@Param("code")String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMapper.java new file mode 100644 index 0000000..74264ac --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBuyingRequisition; + +/** + * 采购申请单Mapper接口 + * + * @author zhukangchao + * @date 2020-08-31 + */ +public interface PwBuyingRequisitionMapper +{ + /** + * 查询采购申请单 + * + * @param id 采购申请单ID + * @return 采购申请单 + */ + public PwBuyingRequisition selectPwBuyingRequisitionById(Long id); + + /** + * 查询采购申请单列表 + * + * @param pwBuyingRequisition 采购申请单 + * @return 采购申请单集合 + */ + public List selectPwBuyingRequisitionList(PwBuyingRequisition pwBuyingRequisition); + + /** + * 新增采购申请单 + * + * @param pwBuyingRequisition 采购申请单 + * @return 结果 + */ + public int insertPwBuyingRequisition(PwBuyingRequisition pwBuyingRequisition); + + /** + * 修改采购申请单 + * + * @param pwBuyingRequisition 采购申请单 + * @return 结果 + */ + public int updatePwBuyingRequisition(PwBuyingRequisition pwBuyingRequisition); + + /** + * 删除采购申请单 + * + * @param id 采购申请单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionById(Long id); + + /** + * 批量删除采购申请单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBuyingRequisitionByIds(Long[] ids); + + public PwBuyingRequisition selectPwBuyingRequisitionByCode(@Param("makeDocumentsCode")String makeDocumentsCode); + + public List selectPwBuyingRequisitionByPurpose(@Param("code") String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialJjMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialJjMapper.java new file mode 100644 index 0000000..907bffc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialJjMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialJj; + +/** + * 基建请购单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-06-28 + */ +public interface PwBuyingRequisitionMaterialJjMapper +{ + /** + * 查询基建请购单详情 + * + * @param id 基建请购单详情ID + * @return 基建请购单详情 + */ + public PwBuyingRequisitionMaterialJj selectPwBuyingRequisitionMaterialJjById(Long id); + + /** + * 查询基建请购单详情列表 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 基建请购单详情集合 + */ + public List selectPwBuyingRequisitionMaterialJjList(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj); + + /** + * 新增基建请购单详情 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 结果 + */ + public int insertPwBuyingRequisitionMaterialJj(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj); + + /** + * 修改基建请购单详情 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 结果 + */ + public int updatePwBuyingRequisitionMaterialJj(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj); + + /** + * 删除基建请购单详情 + * + * @param id 基建请购单详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialJjById(Long id); + + /** + * 批量删除基建请购单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialJjByIds(Long[] ids); + + public List selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(@Param("id")Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialMapper.java new file mode 100644 index 0000000..528cc75 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialMapper.java @@ -0,0 +1,74 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; + +/** + * 请购单物料详情Mapper接口 + * + * @author zhukangchao + * @date 2021-10-18 + */ +public interface PwBuyingRequisitionMaterialMapper +{ + /** + * 查询请购单物料详情 + * + * @param id 请购单物料详情ID + * @return 请购单物料详情 + */ + public PwBuyingRequisitionMaterial selectPwBuyingRequisitionMaterialById(Long id); + + /** + * 查询请购单物料详情列表 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 请购单物料详情集合 + */ + public List selectPwBuyingRequisitionMaterialList(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial); + + /** + * 新增请购单物料详情 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 结果 + */ + public int insertPwBuyingRequisitionMaterial(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial); + + /** + * 修改请购单物料详情 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 结果 + */ + public int updatePwBuyingRequisitionMaterial(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial); + + /** + * 删除请购单物料详情 + * + * @param id 请购单物料详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialById(Long id); + + /** + * 批量删除请购单物料详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialByIds(Long[] ids); + + public List selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(Long buyingRequisitionId); + + public PwBuyingRequisitionMaterial selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(@Param("id")Long id,@Param("materialName")String materialName,@Param("specification") String specification); + + public List selectPwBuyingRequisitionMaterialByNameAndSpecification(@Param("materialName") String name,@Param("specification") String figureNumber); + + + public List selectPwBuyingRequisitionMaterialByName(@Param("materialsName") String materialsName); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialTwoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialTwoMapper.java new file mode 100644 index 0000000..9db5490 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionMaterialTwoMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialTwo; + +/** + * 易耗品请购单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-07-05 + */ +public interface PwBuyingRequisitionMaterialTwoMapper +{ + /** + * 查询易耗品请购单详情 + * + * @param id 易耗品请购单详情ID + * @return 易耗品请购单详情 + */ + public PwBuyingRequisitionMaterialTwo selectPwBuyingRequisitionMaterialTwoById(Long id); + + /** + * 查询易耗品请购单详情列表 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 易耗品请购单详情集合 + */ + public List selectPwBuyingRequisitionMaterialTwoList(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo); + + /** + * 新增易耗品请购单详情 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 结果 + */ + public int insertPwBuyingRequisitionMaterialTwo(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo); + + /** + * 修改易耗品请购单详情 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 结果 + */ + public int updatePwBuyingRequisitionMaterialTwo(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo); + + /** + * 删除易耗品请购单详情 + * + * @param id 易耗品请购单详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialTwoById(Long id); + + /** + * 批量删除易耗品请购单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialTwoByIds(Long[] ids); + + public List selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(@Param("buyingRequisitionId")Long buyingRequisitionId); + + public PwBuyingRequisitionMaterialTwo selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionIdAndName(@Param("id")Long id,@Param("materialName")String materialName, @Param("specification")String specification); + + public List selectPwBuyingRequisitionMaterialTwoByName(@Param("materialName") String materialName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionTwoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionTwoMapper.java new file mode 100644 index 0000000..ea7c398 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwBuyingRequisitionTwoMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBuyingRequisitionTwo; + +/** + * 易耗品请购单Mapper接口 + * + * @author zhukangchao + * @date 2022-07-05 + */ +public interface PwBuyingRequisitionTwoMapper +{ + /** + * 查询易耗品请购单 + * + * @param id 易耗品请购单ID + * @return 易耗品请购单 + */ + public PwBuyingRequisitionTwo selectPwBuyingRequisitionTwoById(Long id); + + /** + * 查询易耗品请购单列表 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 易耗品请购单集合 + */ + public List selectPwBuyingRequisitionTwoList(PwBuyingRequisitionTwo pwBuyingRequisitionTwo); + + /** + * 新增易耗品请购单 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 结果 + */ + public int insertPwBuyingRequisitionTwo(PwBuyingRequisitionTwo pwBuyingRequisitionTwo); + + /** + * 修改易耗品请购单 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 结果 + */ + public int updatePwBuyingRequisitionTwo(PwBuyingRequisitionTwo pwBuyingRequisitionTwo); + + /** + * 删除易耗品请购单 + * + * @param id 易耗品请购单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionTwoById(Long id); + + /** + * 批量删除易耗品请购单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwBuyingRequisitionTwoByIds(Long[] ids); + + public PwBuyingRequisitionTwo selectPwBuyingRequisitionTwoByCode(@Param("makeDocumentsCode")String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCompletionNoticeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCompletionNoticeMapper.java new file mode 100644 index 0000000..315a42e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCompletionNoticeMapper.java @@ -0,0 +1,74 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCompletionNotice; + +/** + * 完工通知单Mapper接口 + * + * @author zhukangchao + * @date 2020-07-20 + */ +public interface PwCompletionNoticeMapper +{ + /** + * 查询完工通知单 + * + * @param id 完工通知单ID + * @return 完工通知单 + */ + public PwCompletionNotice selectPwCompletionNoticeById(Long id); + + /** + * 查询完工通知单列表 + * + * @param pwCompletionNotice 完工通知单 + * @return 完工通知单集合 + */ + public List selectPwCompletionNoticeList(PwCompletionNotice pwCompletionNotice); + + /** + * 新增完工通知单 + * + * @param pwCompletionNotice 完工通知单 + * @return 结果 + */ + public int insertPwCompletionNotice(PwCompletionNotice pwCompletionNotice); + + /** + * 修改完工通知单 + * + * @param pwCompletionNotice 完工通知单 + * @return 结果 + */ + public int updatePwCompletionNotice(PwCompletionNotice pwCompletionNotice); + + /** + * 删除完工通知单 + * + * @param id 完工通知单ID + * @return 结果 + */ + public int deletePwCompletionNoticeById(Long id); + + /** + * 批量删除完工通知单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCompletionNoticeByIds(Long[] ids); + + public PwCompletionNotice selectPwCompletionNoticeByCode(@Param("productionCode") String productionCode); + + /** + * 根据执行单号和时间查询最大数据 + * @param productionCode + * @param date + * @return + */ + public PwCompletionNotice selectPwCompletionNoticeByDateAndCode(@Param("productionCode") String productionCode,@Param("date") String date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCompletionNoticeProductMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCompletionNoticeProductMapper.java new file mode 100644 index 0000000..fd98ab0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCompletionNoticeProductMapper.java @@ -0,0 +1,80 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; + +/** + * 产品完工通知单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-07-20 + */ +public interface PwCompletionNoticeProductMapper +{ + /** + * 查询产品完工通知单关联 + * + * @param id 产品完工通知单关联ID + * @return 产品完工通知单关联 + */ + public PwCompletionNoticeProduct selectPwCompletionNoticeProductById(Long id); + + /** + * 查询产品完工通知单关联列表 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 产品完工通知单关联集合 + */ + public List selectPwCompletionNoticeProductList(PwCompletionNoticeProduct pwCompletionNoticeProduct); + + /** + * 新增产品完工通知单关联 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 结果 + */ + public int insertPwCompletionNoticeProduct(PwCompletionNoticeProduct pwCompletionNoticeProduct); + + /** + * 修改产品完工通知单关联 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 结果 + */ + public int updatePwCompletionNoticeProduct(PwCompletionNoticeProduct pwCompletionNoticeProduct); + + /** + * 删除产品完工通知单关联 + * + * @param id 产品完工通知单关联ID + * @return 结果 + */ + public int deletePwCompletionNoticeProductById(Long id); + + /** + * 批量删除产品完工通知单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCompletionNoticeProductByIds(Long[] ids); + + public List selectPwCompletionNoticeProductByCode(@Param("productionCode") String productionCode); + + public List selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(@Param("makeDocumentsCode")String makeDocumentsCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + /** + * 根据名称和图号和令号查询时间最近的一条记录 + * @param productionCode + * @param name + * @param figureNumber + */ + public int selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwCompletionNoticeProductByCnpId(@Param("id") Long id); + + public List selectPwCompletionNoticeProductByFigureNumberAndAllGB(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwContractInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwContractInfoMapper.java new file mode 100644 index 0000000..c6b8b3b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwContractInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwContractInfo; + +/** + * 合同信息明细Mapper接口 + * + * @author zhukangchao + * @date 2023-12-06 + */ +public interface PwContractInfoMapper +{ + /** + * 查询合同信息明细 + * + * @param id 合同信息明细ID + * @return 合同信息明细 + */ + public PwContractInfo selectPwContractInfoById(Long id); + + /** + * 查询合同信息明细列表 + * + * @param pwContractInfo 合同信息明细 + * @return 合同信息明细集合 + */ + public List selectPwContractInfoList(PwContractInfo pwContractInfo); + + /** + * 新增合同信息明细 + * + * @param pwContractInfo 合同信息明细 + * @return 结果 + */ + public int insertPwContractInfo(PwContractInfo pwContractInfo); + + /** + * 修改合同信息明细 + * + * @param pwContractInfo 合同信息明细 + * @return 结果 + */ + public int updatePwContractInfo(PwContractInfo pwContractInfo); + + /** + * 删除合同信息明细 + * + * @param id 合同信息明细ID + * @return 结果 + */ + public int deletePwContractInfoById(Long id); + + /** + * 批量删除合同信息明细 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwContractInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwContractMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwContractMapper.java new file mode 100644 index 0000000..f9df6d3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwContractMapper.java @@ -0,0 +1,73 @@ +package com.ruoyi.project.management.mapper; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwContract; + +/** + * 合同Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PwContractMapper +{ + /** + * 查询合同 + * + * @param id 合同ID + * @return 合同 + */ + public PwContract selectPwContractById(Long id); + + /** + * 查询合同列表 + * + * @param pwContract 合同 + * @return 合同集合 + */ + public List selectPwContractList(PwContract pwContract); + + /** + * 新增合同 + * + * @param pwContract 合同 + * @return 结果 + */ + public int insertPwContract(PwContract pwContract); + + /** + * 修改合同 + * + * @param pwContract 合同 + * @return 结果 + */ + public int updatePwContract(PwContract pwContract); + + /** + * 删除合同 + * + * @param id 合同ID + * @return 结果 + */ + public int deletePwContractById(Long id); + + /** + * 批量删除合同 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwContractByIds(Long[] ids); + + /** + * 根据合同编号查询合同信息 + * @param code + */ + public PwContract selectByContractCode(@Param("code") String code); + + public List selectPwContractDate(@Param("date") Date date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolApplyDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolApplyDetailMapper.java new file mode 100644 index 0000000..c0ef767 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolApplyDetailMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; + +/** + * 刀具领用申请单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface PwCuttingToolApplyDetailMapper +{ + /** + * 查询刀具领用申请单详情 + * + * @param id 刀具领用申请单详情ID + * @return 刀具领用申请单详情 + */ + public PwCuttingToolApplyDetail selectPwCuttingToolApplyDetailById(Long id); + + /** + * 查询刀具领用申请单详情列表 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 刀具领用申请单详情集合 + */ + public List selectPwCuttingToolApplyDetailList(PwCuttingToolApplyDetail pwCuttingToolApplyDetail); + + /** + * 新增刀具领用申请单详情 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 结果 + */ + public int insertPwCuttingToolApplyDetail(PwCuttingToolApplyDetail pwCuttingToolApplyDetail); + + /** + * 修改刀具领用申请单详情 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 结果 + */ + public int updatePwCuttingToolApplyDetail(PwCuttingToolApplyDetail pwCuttingToolApplyDetail); + + /** + * 删除刀具领用申请单详情 + * + * @param id 刀具领用申请单详情ID + * @return 结果 + */ + public int deletePwCuttingToolApplyDetailById(Long id); + + /** + * 批量删除刀具领用申请单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolApplyDetailByIds(Long[] ids); + + public List selectPwCuttingToolApplyDetailByApplyDetailId(@Param("id")Long id); + + public PwCuttingToolApplyDetail selectPwCuttingToolApplyDetailByApplyDetailIdAndNameAndType(@Param("id") Long id,@Param("name") String name,@Param("type") String type); + + public List selectPwCuttingToolApplyDetailByName(@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolApplyMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolApplyMapper.java new file mode 100644 index 0000000..a620cfb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolApplyMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolApply; + +/** + * 刀具领用申请单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface PwCuttingToolApplyMapper +{ + /** + * 查询刀具领用申请单 + * + * @param id 刀具领用申请单ID + * @return 刀具领用申请单 + */ + public PwCuttingToolApply selectPwCuttingToolApplyById(Long id); + + /** + * 查询刀具领用申请单列表 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 刀具领用申请单集合 + */ + public List selectPwCuttingToolApplyList(PwCuttingToolApply pwCuttingToolApply); + + /** + * 新增刀具领用申请单 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 结果 + */ + public int insertPwCuttingToolApply(PwCuttingToolApply pwCuttingToolApply); + + /** + * 修改刀具领用申请单 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 结果 + */ + public int updatePwCuttingToolApply(PwCuttingToolApply pwCuttingToolApply); + + /** + * 删除刀具领用申请单 + * + * @param id 刀具领用申请单ID + * @return 结果 + */ + public int deletePwCuttingToolApplyById(Long id); + + /** + * 批量删除刀具领用申请单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolApplyByIds(Long[] ids); + + public PwCuttingToolApply selectPwCuttingToolApplyByCode(@Param("code")String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolDeliveryDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolDeliveryDetailMapper.java new file mode 100644 index 0000000..5a73d11 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolDeliveryDetailMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; + +/** + * 刀具出库单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface PwCuttingToolDeliveryDetailMapper +{ + /** + * 查询刀具出库单详情 + * + * @param id 刀具出库单详情ID + * @return 刀具出库单详情 + */ + public PwCuttingToolDeliveryDetail selectPwCuttingToolDeliveryDetailById(Long id); + + /** + * 查询刀具出库单详情列表 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 刀具出库单详情集合 + */ + public List selectPwCuttingToolDeliveryDetailList(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail); + + /** + * 新增刀具出库单详情 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 结果 + */ + public int insertPwCuttingToolDeliveryDetail(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail); + + /** + * 修改刀具出库单详情 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 结果 + */ + public int updatePwCuttingToolDeliveryDetail(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail); + + /** + * 删除刀具出库单详情 + * + * @param id 刀具出库单详情ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryDetailById(Long id); + + /** + * 批量删除刀具出库单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryDetailByIds(Long[] ids); + + public List selectPwCuttingToolDeliveryDetailByDeliveryId(@Param("deliveryId") Long deliveryId); + + public PwCuttingToolDeliveryDetail selectPwCuttingToolDeliveryDetailByDeliveryIdAndNameAndBrandAndType(@Param("id") Long id,@Param("name") String name,@Param("brand") String brand,@Param("type") String type); + + public List selectPwCuttingToolDeliveryDetailByName(@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolDeliveryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolDeliveryMapper.java new file mode 100644 index 0000000..34d8180 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolDeliveryMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; + +/** + * 刀具出库单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface PwCuttingToolDeliveryMapper +{ + /** + * 查询刀具出库单 + * + * @param id 刀具出库单ID + * @return 刀具出库单 + */ + public PwCuttingToolDelivery selectPwCuttingToolDeliveryById(Long id); + + /** + * 查询刀具出库单列表 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 刀具出库单集合 + */ + public List selectPwCuttingToolDeliveryList(PwCuttingToolDelivery pwCuttingToolDelivery); + + /** + * 新增刀具出库单 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 结果 + */ + public int insertPwCuttingToolDelivery(PwCuttingToolDelivery pwCuttingToolDelivery); + + /** + * 修改刀具出库单 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 结果 + */ + public int updatePwCuttingToolDelivery(PwCuttingToolDelivery pwCuttingToolDelivery); + + /** + * 删除刀具出库单 + * + * @param id 刀具出库单ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryById(Long id); + + /** + * 批量删除刀具出库单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryByIds(Long[] ids); + + public PwCuttingToolDelivery selectPwCuttingToolDeliveryByCode(@Param("code")String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolGodownEntryDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolGodownEntryDetailMapper.java new file mode 100644 index 0000000..35bd210 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolGodownEntryDetailMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntryDetail; + +/** + * 刀具入库详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface PwCuttingToolGodownEntryDetailMapper +{ + /** + * 查询刀具入库详情 + * + * @param id 刀具入库详情ID + * @return 刀具入库详情 + */ + public PwCuttingToolGodownEntryDetail selectPwCuttingToolGodownEntryDetailById(Long id); + + /** + * 查询刀具入库详情列表 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 刀具入库详情集合 + */ + public List selectPwCuttingToolGodownEntryDetailList(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail); + + /** + * 新增刀具入库详情 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 结果 + */ + public int insertPwCuttingToolGodownEntryDetail(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail); + + /** + * 修改刀具入库详情 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 结果 + */ + public int updatePwCuttingToolGodownEntryDetail(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail); + + /** + * 删除刀具入库详情 + * + * @param id 刀具入库详情ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryDetailById(Long id); + + /** + * 批量删除刀具入库详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryDetailByIds(Long[] ids); + + public List selectPwCuttingToolGodownEntryDetailByGosownEntryId(@Param("gosownEntryId") Long gosownEntryId); + + public List selectPwCuttingToolGodownEntryDetailByName(@Param("name") String name); + + public List selectPwCuttingToolGodownEntryDetailByIdAndNameAndBrandAndType(@Param("id")Long id,@Param("name")String name,@Param("brand") String brand,@Param("type") String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolGodownEntryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolGodownEntryMapper.java new file mode 100644 index 0000000..cfe93cd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolGodownEntryMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntry; + +/** + * 刀具入库单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface PwCuttingToolGodownEntryMapper +{ + /** + * 查询刀具入库单 + * + * @param id 刀具入库单ID + * @return 刀具入库单 + */ + public PwCuttingToolGodownEntry selectPwCuttingToolGodownEntryById(Long id); + + /** + * 查询刀具入库单列表 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 刀具入库单集合 + */ + public List selectPwCuttingToolGodownEntryList(PwCuttingToolGodownEntry pwCuttingToolGodownEntry); + + /** + * 新增刀具入库单 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 结果 + */ + public int insertPwCuttingToolGodownEntry(PwCuttingToolGodownEntry pwCuttingToolGodownEntry); + + /** + * 修改刀具入库单 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 结果 + */ + public int updatePwCuttingToolGodownEntry(PwCuttingToolGodownEntry pwCuttingToolGodownEntry); + + /** + * 删除刀具入库单 + * + * @param id 刀具入库单ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryById(Long id); + + /** + * 批量删除刀具入库单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryByIds(Long[] ids); + + /** + * 根据刀具采购单合同查询刀具入库单 + * @param code + * @return + */ + public PwCuttingToolGodownEntry selectPwCuttingToolGodownEntryByContractCode(@Param("code") String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolInventoryDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolInventoryDetailMapper.java new file mode 100644 index 0000000..c8fc93e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolInventoryDetailMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolInventoryDetail; + +/** + * 刀具库存Mapper接口 + * + * @author zhukangchao + * @date 2022-01-27 + */ +public interface PwCuttingToolInventoryDetailMapper +{ + /** + * 查询刀具库存 + * + * @param id 刀具库存ID + * @return 刀具库存 + */ + public PwCuttingToolInventoryDetail selectPwCuttingToolInventoryDetailById(Long id); + + /** + * 查询刀具库存列表 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 刀具库存集合 + */ + public List selectPwCuttingToolInventoryDetailList(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail); + + /** + * 新增刀具库存 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 结果 + */ + public int insertPwCuttingToolInventoryDetail(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail); + + /** + * 修改刀具库存 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 结果 + */ + public int updatePwCuttingToolInventoryDetail(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail); + + /** + * 删除刀具库存 + * + * @param id 刀具库存ID + * @return 结果 + */ + public int deletePwCuttingToolInventoryDetailById(Long id); + + /** + * 批量删除刀具库存 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolInventoryDetailByIds(Long[] ids); + + public PwCuttingToolInventoryDetail selectPwCuttingToolInventoryDetailByNameAndBrandAndType(@Param("name") String name,@Param("brand") String brand,@Param("type") String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMaintainDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMaintainDetailMapper.java new file mode 100644 index 0000000..e980d5b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMaintainDetailMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolMaintainDetail; + +/** + * 刀具维修申请单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-21 + */ +public interface PwCuttingToolMaintainDetailMapper +{ + /** + * 查询刀具维修申请单详情 + * + * @param id 刀具维修申请单详情ID + * @return 刀具维修申请单详情 + */ + public PwCuttingToolMaintainDetail selectPwCuttingToolMaintainDetailById(Long id); + + /** + * 查询刀具维修申请单详情列表 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 刀具维修申请单详情集合 + */ + public List selectPwCuttingToolMaintainDetailList(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail); + + /** + * 新增刀具维修申请单详情 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 结果 + */ + public int insertPwCuttingToolMaintainDetail(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail); + + /** + * 修改刀具维修申请单详情 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 结果 + */ + public int updatePwCuttingToolMaintainDetail(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail); + + /** + * 删除刀具维修申请单详情 + * + * @param id 刀具维修申请单详情ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainDetailById(Long id); + + /** + * 批量删除刀具维修申请单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainDetailByIds(Long[] ids); + + public List selectPwCuttingToolMaintainDetailByMaintainId(@Param("id")Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMaintainMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMaintainMapper.java new file mode 100644 index 0000000..d64ea1c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMaintainMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolMaintain; + +/** + * 刀具维修申请单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-21 + */ +public interface PwCuttingToolMaintainMapper +{ + /** + * 查询刀具维修申请单 + * + * @param id 刀具维修申请单ID + * @return 刀具维修申请单 + */ + public PwCuttingToolMaintain selectPwCuttingToolMaintainById(Long id); + + /** + * 查询刀具维修申请单列表 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 刀具维修申请单集合 + */ + public List selectPwCuttingToolMaintainList(PwCuttingToolMaintain pwCuttingToolMaintain); + + /** + * 新增刀具维修申请单 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 结果 + */ + public int insertPwCuttingToolMaintain(PwCuttingToolMaintain pwCuttingToolMaintain); + + /** + * 修改刀具维修申请单 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 结果 + */ + public int updatePwCuttingToolMaintain(PwCuttingToolMaintain pwCuttingToolMaintain); + + /** + * 删除刀具维修申请单 + * + * @param id 刀具维修申请单ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainById(Long id); + + /** + * 批量删除刀具维修申请单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMapper.java new file mode 100644 index 0000000..3e0d9e1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingTool; + +/** + * 刀具Mapper接口 + * + * @author zhukangchao + * @date 2022-01-27 + */ +public interface PwCuttingToolMapper +{ + /** + * 查询刀具 + * + * @param id 刀具ID + * @return 刀具 + */ + public PwCuttingTool selectPwCuttingToolById(Long id); + + /** + * 查询刀具列表 + * + * @param pwCuttingTool 刀具 + * @return 刀具集合 + */ + public List selectPwCuttingToolList(PwCuttingTool pwCuttingTool); + + /** + * 新增刀具 + * + * @param pwCuttingTool 刀具 + * @return 结果 + */ + public int insertPwCuttingTool(PwCuttingTool pwCuttingTool); + + /** + * 修改刀具 + * + * @param pwCuttingTool 刀具 + * @return 结果 + */ + public int updatePwCuttingTool(PwCuttingTool pwCuttingTool); + + /** + * 删除刀具 + * + * @param id 刀具ID + * @return 结果 + */ + public int deletePwCuttingToolById(Long id); + + /** + * 批量删除刀具 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolByIds(Long[] ids); + + public PwCuttingTool selectPwCuttingToolByName(@Param("name") String name,@Param("brand") String brand,@Param("type") String type,@Param("supplier") String supplier); + + public List selectPwCuttingToolByPeriodNotIsNull(); + + public List selectPwCuttingToolByNameAndType(@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolPurchaseDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolPurchaseDetailMapper.java new file mode 100644 index 0000000..2dc46d0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolPurchaseDetailMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; + +/** + * 刀具采购详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface PwCuttingToolPurchaseDetailMapper +{ + /** + * 查询刀具采购详情 + * + * @param id 刀具采购详情ID + * @return 刀具采购详情 + */ + public PwCuttingToolPurchaseDetail selectPwCuttingToolPurchaseDetailById(Long id); + + /** + * 查询刀具采购详情列表 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 刀具采购详情集合 + */ + public List selectPwCuttingToolPurchaseDetailList(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail); + + /** + * 新增刀具采购详情 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 结果 + */ + public int insertPwCuttingToolPurchaseDetail(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail); + + /** + * 修改刀具采购详情 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 结果 + */ + public int updatePwCuttingToolPurchaseDetail(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail); + + /** + * 删除刀具采购详情 + * + * @param id 刀具采购详情ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseDetailById(Long id); + + /** + * 批量删除刀具采购详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseDetailByIds(Long[] ids); + + public List selectPwCuttingToolPurchaseDetailByPurchaseId(@Param("id") Long id); + + public List selectPwCuttingToolPurchaseDetailByName(@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolPurchaseMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolPurchaseMapper.java new file mode 100644 index 0000000..9a63c8f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolPurchaseMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; + +/** + * 刀具采购申请单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-10 + */ +public interface PwCuttingToolPurchaseMapper +{ + /** + * 查询刀具采购申请单 + * + * @param id 刀具采购申请单ID + * @return 刀具采购申请单 + */ + public PwCuttingToolPurchase selectPwCuttingToolPurchaseById(Long id); + + /** + * 查询刀具采购申请单列表 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 刀具采购申请单集合 + */ + public List selectPwCuttingToolPurchaseList(PwCuttingToolPurchase pwCuttingToolPurchase); + + /** + * 新增刀具采购申请单 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 结果 + */ + public int insertPwCuttingToolPurchase(PwCuttingToolPurchase pwCuttingToolPurchase); + + /** + * 修改刀具采购申请单 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 结果 + */ + public int updatePwCuttingToolPurchase(PwCuttingToolPurchase pwCuttingToolPurchase); + + /** + * 删除刀具采购申请单 + * + * @param id 刀具采购申请单ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseById(Long id); + + /** + * 批量删除刀具采购申请单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseByIds(Long[] ids); + + public int updatePwCuttingToolPurchaseByCode(PwCuttingToolPurchase pwCuttingToolPurchase); + + public PwCuttingToolPurchase selectPwCuttingToolPurchaseByCode(@Param("code") String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapDetailMapper.java new file mode 100644 index 0000000..33a33e9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapDetailMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolScrapDetail; + +/** + * 刀具报废详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface PwCuttingToolScrapDetailMapper +{ + /** + * 查询刀具报废详情 + * + * @param id 刀具报废详情ID + * @return 刀具报废详情 + */ + public PwCuttingToolScrapDetail selectPwCuttingToolScrapDetailById(Long id); + + /** + * 查询刀具报废详情列表 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 刀具报废详情集合 + */ + public List selectPwCuttingToolScrapDetailList(PwCuttingToolScrapDetail pwCuttingToolScrapDetail); + + /** + * 新增刀具报废详情 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 结果 + */ + public int insertPwCuttingToolScrapDetail(PwCuttingToolScrapDetail pwCuttingToolScrapDetail); + + /** + * 修改刀具报废详情 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 结果 + */ + public int updatePwCuttingToolScrapDetail(PwCuttingToolScrapDetail pwCuttingToolScrapDetail); + + /** + * 删除刀具报废详情 + * + * @param id 刀具报废详情ID + * @return 结果 + */ + public int deletePwCuttingToolScrapDetailById(Long id); + + /** + * 批量删除刀具报废详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolScrapDetailByIds(Long[] ids); + + public List selectPwCuttingToolScrapDetailByScrapId(@Param("id")Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapGodownEntryDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapGodownEntryDetailMapper.java new file mode 100644 index 0000000..9deca16 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapGodownEntryDetailMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntryDetail; + +/** + * 刀具报废入库详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface PwCuttingToolScrapGodownEntryDetailMapper +{ + /** + * 查询刀具报废入库详情 + * + * @param id 刀具报废入库详情ID + * @return 刀具报废入库详情 + */ + public PwCuttingToolScrapGodownEntryDetail selectPwCuttingToolScrapGodownEntryDetailById(Long id); + + /** + * 查询刀具报废入库详情列表 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 刀具报废入库详情集合 + */ + public List selectPwCuttingToolScrapGodownEntryDetailList(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail); + + /** + * 新增刀具报废入库详情 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 结果 + */ + public int insertPwCuttingToolScrapGodownEntryDetail(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail); + + /** + * 修改刀具报废入库详情 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 结果 + */ + public int updatePwCuttingToolScrapGodownEntryDetail(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail); + + /** + * 删除刀具报废入库详情 + * + * @param id 刀具报废入库详情ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryDetailById(Long id); + + /** + * 批量删除刀具报废入库详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryDetailByIds(Long[] ids); + + public List selectPwCuttingToolGodownEntryDetailByGosownEntryId(@Param("gosownEntryId") Long gosownEntryId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapGodownEntryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapGodownEntryMapper.java new file mode 100644 index 0000000..5830399 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapGodownEntryMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntry; + +/** + * 刀具报废入库单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface PwCuttingToolScrapGodownEntryMapper +{ + /** + * 查询刀具报废入库单 + * + * @param id 刀具报废入库单ID + * @return 刀具报废入库单 + */ + public PwCuttingToolScrapGodownEntry selectPwCuttingToolScrapGodownEntryById(Long id); + + /** + * 查询刀具报废入库单列表 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 刀具报废入库单集合 + */ + public List selectPwCuttingToolScrapGodownEntryList(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry); + + /** + * 新增刀具报废入库单 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 结果 + */ + public int insertPwCuttingToolScrapGodownEntry(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry); + + /** + * 修改刀具报废入库单 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 结果 + */ + public int updatePwCuttingToolScrapGodownEntry(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry); + + /** + * 删除刀具报废入库单 + * + * @param id 刀具报废入库单ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryById(Long id); + + /** + * 批量删除刀具报废入库单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryByIds(Long[] ids); + + public PwCuttingToolScrapGodownEntry selectPwCuttingToolScrapGodownEntryByCode(@Param("code") String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapMapper.java new file mode 100644 index 0000000..8d2085c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwCuttingToolScrapMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolScrap; + +/** + * 刀具报废申请单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface PwCuttingToolScrapMapper +{ + /** + * 查询刀具报废申请单 + * + * @param id 刀具报废申请单ID + * @return 刀具报废申请单 + */ + public PwCuttingToolScrap selectPwCuttingToolScrapById(Long id); + + /** + * 查询刀具报废申请单列表 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 刀具报废申请单集合 + */ + public List selectPwCuttingToolScrapList(PwCuttingToolScrap pwCuttingToolScrap); + + /** + * 新增刀具报废申请单 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 结果 + */ + public int insertPwCuttingToolScrap(PwCuttingToolScrap pwCuttingToolScrap); + + /** + * 修改刀具报废申请单 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 结果 + */ + public int updatePwCuttingToolScrap(PwCuttingToolScrap pwCuttingToolScrap); + + /** + * 删除刀具报废申请单 + * + * @param id 刀具报废申请单ID + * @return 结果 + */ + public int deletePwCuttingToolScrapById(Long id); + + /** + * 批量删除刀具报废申请单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwCuttingToolScrapByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwDanceNotStandardMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwDanceNotStandardMapper.java new file mode 100644 index 0000000..41528f4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwDanceNotStandardMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwDanceNotStandard; + +/** + * 舞非型号Mapper接口 + * + * @author zhukangchao + * @date 2021-08-02 + */ +public interface PwDanceNotStandardMapper +{ + /** + * 查询舞非型号 + * + * @param id 舞非型号ID + * @return 舞非型号 + */ + public PwDanceNotStandard selectPwDanceNotStandardById(Long id); + + /** + * 查询舞非型号列表 + * + * @param pwDanceNotStandard 舞非型号 + * @return 舞非型号集合 + */ + public List selectPwDanceNotStandardList(PwDanceNotStandard pwDanceNotStandard); + + /** + * 新增舞非型号 + * + * @param pwDanceNotStandard 舞非型号 + * @return 结果 + */ + public int insertPwDanceNotStandard(PwDanceNotStandard pwDanceNotStandard); + + /** + * 修改舞非型号 + * + * @param pwDanceNotStandard 舞非型号 + * @return 结果 + */ + public int updatePwDanceNotStandard(PwDanceNotStandard pwDanceNotStandard); + + /** + * 删除舞非型号 + * + * @param id 舞非型号ID + * @return 结果 + */ + public int deletePwDanceNotStandardById(Long id); + + /** + * 批量删除舞非型号 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwDanceNotStandardByIds(Long[] ids); + + public PwDanceNotStandard selectPwDanceNotStandardByType(String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwDefectiveMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwDefectiveMaterialMapper.java new file mode 100644 index 0000000..185d542 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwDefectiveMaterialMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwDefectiveMaterial; + +/** + * 残料Mapper接口 + * + * @author zhukangchao + * @date 2022-12-14 + */ +public interface PwDefectiveMaterialMapper +{ + /** + * 查询残料 + * + * @param id 残料ID + * @return 残料 + */ + public PwDefectiveMaterial selectPwDefectiveMaterialById(Long id); + + /** + * 查询残料列表 + * + * @param pwDefectiveMaterial 残料 + * @return 残料集合 + */ + public List selectPwDefectiveMaterialList(PwDefectiveMaterial pwDefectiveMaterial); + + /** + * 新增残料 + * + * @param pwDefectiveMaterial 残料 + * @return 结果 + */ + public int insertPwDefectiveMaterial(PwDefectiveMaterial pwDefectiveMaterial); + + /** + * 修改残料 + * + * @param pwDefectiveMaterial 残料 + * @return 结果 + */ + public int updatePwDefectiveMaterial(PwDefectiveMaterial pwDefectiveMaterial); + + /** + * 删除残料 + * + * @param id 残料ID + * @return 结果 + */ + public int deletePwDefectiveMaterialById(Long id); + + /** + * 批量删除残料 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwDefectiveMaterialByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwEquipmentInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwEquipmentInfoMapper.java new file mode 100644 index 0000000..21e48f3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwEquipmentInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwEquipmentInfo; + +/** + * 生产设备信息Mapper接口 + * + * @author zhukangchao + * @date 2023-08-01 + */ +public interface PwEquipmentInfoMapper +{ + /** + * 查询生产设备信息 + * + * @param id 生产设备信息ID + * @return 生产设备信息 + */ + public PwEquipmentInfo selectPwEquipmentInfoById(Long id); + + /** + * 查询生产设备信息列表 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 生产设备信息集合 + */ + public List selectPwEquipmentInfoList(PwEquipmentInfo pwEquipmentInfo); + + /** + * 新增生产设备信息 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 结果 + */ + public int insertPwEquipmentInfo(PwEquipmentInfo pwEquipmentInfo); + + /** + * 修改生产设备信息 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 结果 + */ + public int updatePwEquipmentInfo(PwEquipmentInfo pwEquipmentInfo); + + /** + * 删除生产设备信息 + * + * @param id 生产设备信息ID + * @return 结果 + */ + public int deletePwEquipmentInfoById(Long id); + + /** + * 批量删除生产设备信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwEquipmentInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersDetailMapper.java new file mode 100644 index 0000000..1567e60 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersDetailMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwFuturesOrdersDetail; + +/** + * 预采购单明细Mapper接口 + * + * @author zhukangchao + * @date 2022-06-22 + */ +public interface PwFuturesOrdersDetailMapper +{ + /** + * 查询预采购单明细 + * + * @param id 预采购单明细ID + * @return 预采购单明细 + */ + public PwFuturesOrdersDetail selectPwFuturesOrdersDetailById(Long id); + + /** + * 查询预采购单明细列表 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 预采购单明细集合 + */ + public List selectPwFuturesOrdersDetailList(PwFuturesOrdersDetail pwFuturesOrdersDetail); + + /** + * 新增预采购单明细 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 结果 + */ + public int insertPwFuturesOrdersDetail(PwFuturesOrdersDetail pwFuturesOrdersDetail); + + /** + * 修改预采购单明细 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 结果 + */ + public int updatePwFuturesOrdersDetail(PwFuturesOrdersDetail pwFuturesOrdersDetail); + + /** + * 删除预采购单明细 + * + * @param id 预采购单明细ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailById(Long id); + + /** + * 批量删除预采购单明细 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailByIds(Long[] ids); + + public List selectPwFuturesOrdersDetailByCode(String makeDocumentsCode); + + public PwFuturesOrdersDetail selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(@Param("code")String code,@Param("materialsName")String materialsName,@Param("materialsSpecification") String materialsSpecification); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersDetailTwoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersDetailTwoMapper.java new file mode 100644 index 0000000..c74840b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersDetailTwoMapper.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwFuturesOrdersDetailTwo; + +/** + * 预采购单明细详情Mapper接口 + * + * @author zhukangchao + * @date 2022-06-27 + */ +public interface PwFuturesOrdersDetailTwoMapper +{ + /** + * 查询预采购单明细详情 + * + * @param id 预采购单明细详情ID + * @return 预采购单明细详情 + */ + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoById(Long id); + + /** + * 查询预采购单明细详情列表 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 预采购单明细详情集合 + */ + public List selectPwFuturesOrdersDetailTwoList(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo); + + /** + * 新增预采购单明细详情 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 结果 + */ + public int insertPwFuturesOrdersDetailTwo(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo); + + /** + * 修改预采购单明细详情 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 结果 + */ + public int updatePwFuturesOrdersDetailTwo(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo); + + /** + * 删除预采购单明细详情 + * + * @param id 预采购单明细详情ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailTwoById(Long id); + + /** + * 批量删除预采购单明细详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailTwoByIds(Long[] ids); + + public List selectPwFuturesOrdersDetailTwoByCode(@Param("code")String code); + + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoByMatenaisId(@Param("matenaisId")Long id); + + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoByMatenaisIdAndNameAndFigureNumber(@Param("matenaisId")Long id,@Param("materialsName") String materialsName,@Param("materialsSpecification") String materialsSpecification); + + public int deletePwFuturesOrdersDetailTwoByOrdersDetailId(@Param("ordersDetailId")Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersMapper.java new file mode 100644 index 0000000..a90f892 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwFuturesOrdersMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwFuturesOrders; + +/** + * 预采购单Mapper接口 + * + * @author zhukangchao + * @date 2022-06-22 + */ +public interface PwFuturesOrdersMapper +{ + /** + * 查询预采购单 + * + * @param id 预采购单ID + * @return 预采购单 + */ + public PwFuturesOrders selectPwFuturesOrdersById(Long id); + + /** + * 查询预采购单列表 + * + * @param pwFuturesOrders 预采购单 + * @return 预采购单集合 + */ + public List selectPwFuturesOrdersList(PwFuturesOrders pwFuturesOrders); + + /** + * 新增预采购单 + * + * @param pwFuturesOrders 预采购单 + * @return 结果 + */ + public int insertPwFuturesOrders(PwFuturesOrders pwFuturesOrders); + + /** + * 修改预采购单 + * + * @param pwFuturesOrders 预采购单 + * @return 结果 + */ + public int updatePwFuturesOrders(PwFuturesOrders pwFuturesOrders); + + /** + * 删除预采购单 + * + * @param id 预采购单ID + * @return 结果 + */ + public int deletePwFuturesOrdersById(Long id); + + /** + * 批量删除预采购单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwFuturesOrdersByIds(Long[] ids); + + public PwFuturesOrders selectPwFuturesOrdersByCode(@Param("makeDocumentsCode")String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwGxProcessMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwGxProcessMapper.java new file mode 100644 index 0000000..10853ee --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwGxProcessMapper.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwGxProcess; + +/** + * 物料工序信息Mapper接口 + * + * @author chenyongjiang + * @date 2024-08-06 + */ +public interface PwGxProcessMapper +{ + /** + * 查询物料工序信息 + * + * @param id 物料工序信息ID + * @return 物料工序信息 + */ + public PwGxProcess selectPwGxProcessById(Long id); + + /** + * 查询物料工序信息列表 + * + * @param pwGxProcess 物料工序信息 + * @return 物料工序信息集合 + */ + public List selectPwGxProcessList(PwGxProcess pwGxProcess); + + /** + * 新增物料工序信息 + * + * @param pwGxProcess 物料工序信息 + * @return 结果 + */ + public int insertPwGxProcess(PwGxProcess pwGxProcess); + + /** + * 修改物料工序信息 + * + * @param pwGxProcess 物料工序信息 + * @return 结果 + */ + public int updatePwGxProcess(PwGxProcess pwGxProcess); + + /** + * 删除物料工序信息 + * + * @param id 物料工序信息ID + * @return 结果 + */ + public int deletePwGxProcessById(Long id); + + /** + * 批量删除物料工序信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwGxProcessByIds(Long[] ids); + + /** + * 根据父ID查询 + * @param parentId + * @return + */ + public List selectPwGxProcessByParengId(Long parentId); + + /** + * 根据物料号查询系统 + * @param figureNumber + * @return + */ + public PwGxProcess queryPwGxProcesssByFigureNumber(String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwHeightPermittedInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwHeightPermittedInfoMapper.java new file mode 100644 index 0000000..dcd92ad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwHeightPermittedInfoMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwHeightPermittedInfo; + +/** + * 安全库存限制信息Mapper接口 + * + * @author zhukangchao + * @date 2023-03-29 + */ +public interface PwHeightPermittedInfoMapper +{ + /** + * 查询安全库存限制信息 + * + * @param id 安全库存限制信息ID + * @return 安全库存限制信息 + */ + public PwHeightPermittedInfo selectPwHeightPermittedInfoById(Long id); + + /** + * 查询安全库存限制信息列表 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 安全库存限制信息集合 + */ + public List selectPwHeightPermittedInfoList(PwHeightPermittedInfo pwHeightPermittedInfo); + + /** + * 新增安全库存限制信息 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 结果 + */ + public int insertPwHeightPermittedInfo(PwHeightPermittedInfo pwHeightPermittedInfo); + + /** + * 修改安全库存限制信息 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 结果 + */ + public int updatePwHeightPermittedInfo(PwHeightPermittedInfo pwHeightPermittedInfo); + + /** + * 删除安全库存限制信息 + * + * @param id 安全库存限制信息ID + * @return 结果 + */ + public int deletePwHeightPermittedInfoById(Long id); + + /** + * 批量删除安全库存限制信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwHeightPermittedInfoByIds(Long[] ids); + + public PwHeightPermittedInfo selectPwHeightPermittedInfoByNameAndFigureNumber(@Param("materialName") String materialName,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwInspectionCardDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInspectionCardDetailMapper.java new file mode 100644 index 0000000..a44c4bd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInspectionCardDetailMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwInspectionCardDetail; + +/** + * 检验单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-07-20 + */ +public interface PwInspectionCardDetailMapper +{ + /** + * 查询检验单详情 + * + * @param id 检验单详情ID + * @return 检验单详情 + */ + public PwInspectionCardDetail selectPwInspectionCardDetailById(Long id); + + /** + * 查询检验单详情列表 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 检验单详情集合 + */ + public List selectPwInspectionCardDetailList(PwInspectionCardDetail pwInspectionCardDetail); + + /** + * 新增检验单详情 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 结果 + */ + public int insertPwInspectionCardDetail(PwInspectionCardDetail pwInspectionCardDetail); + + /** + * 修改检验单详情 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 结果 + */ + public int updatePwInspectionCardDetail(PwInspectionCardDetail pwInspectionCardDetail); + + /** + * 删除检验单详情 + * + * @param id 检验单详情ID + * @return 结果 + */ + public int deletePwInspectionCardDetailById(Long id); + + /** + * 批量删除检验单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwInspectionCardDetailByIds(Long[] ids); + + public PwInspectionCardDetail selectPwInspectionCardDetailByNameAndType(@Param("name")String name,@Param("type") String type); + + public List selectPwInspectionCardDetailByCardId(@Param("id") Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwInspectionCardMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInspectionCardMapper.java new file mode 100644 index 0000000..6c65055 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInspectionCardMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwInspectionCard; + +/** + * 检验单Mapper接口 + * + * @author zhukangchao + * @date 2022-07-20 + */ +public interface PwInspectionCardMapper +{ + /** + * 查询检验单 + * + * @param id 检验单ID + * @return 检验单 + */ + public PwInspectionCard selectPwInspectionCardById(Long id); + + /** + * 查询检验单列表 + * + * @param pwInspectionCard 检验单 + * @return 检验单集合 + */ + public List selectPwInspectionCardList(PwInspectionCard pwInspectionCard); + + /** + * 新增检验单 + * + * @param pwInspectionCard 检验单 + * @return 结果 + */ + public int insertPwInspectionCard(PwInspectionCard pwInspectionCard); + + /** + * 修改检验单 + * + * @param pwInspectionCard 检验单 + * @return 结果 + */ + public int updatePwInspectionCard(PwInspectionCard pwInspectionCard); + + /** + * 删除检验单 + * + * @param id 检验单ID + * @return 结果 + */ + public int deletePwInspectionCardById(Long id); + + /** + * 批量删除检验单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwInspectionCardByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwInventoryComparisonMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInventoryComparisonMapper.java new file mode 100644 index 0000000..0aef575 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInventoryComparisonMapper.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.mapper; import java.util.List; import com.ruoyi.project.management.domain.PwInventoryComparison; /** * 盘库对比Mapper接口 * * @author zhukangchao * @date 2023-11-06 */ public interface PwInventoryComparisonMapper { /** * 查询盘库对比列表 * * @param pwInventoryComparison 盘库对比 * @return 盘库对比集合 */ public List selectPwInventoryComparisonList(PwInventoryComparison pwInventoryComparison); /** * 新增盘库对比 * * @param pwInventoryComparison 盘库对比 * @return 结果 */ public int insertPwInventoryComparison(PwInventoryComparison pwInventoryComparison); } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwInventoryDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInventoryDetailMapper.java new file mode 100644 index 0000000..0f12b01 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInventoryDetailMapper.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwInventoryDetail; + +/** + * 库存明细Mapper接口 + * + * @author zhukangchao + * @date 2020-07-18 + */ +public interface PwInventoryDetailMapper +{ + /** + * 查询库存明细 + * + * @param id 库存明细ID + * @return 库存明细 + */ + public PwInventoryDetail selectPwInventoryDetailById(Long id); + + /** + * 查询库存明细列表 + * + * @param pwInventoryDetail 库存明细 + * @return 库存明细集合 + */ + public List selectPwInventoryDetailList(PwInventoryDetail pwInventoryDetail); + + /** + * 新增库存明细 + * + * @param pwInventoryDetail 库存明细 + * @return 结果 + */ + public int insertPwInventoryDetail(PwInventoryDetail pwInventoryDetail); + + /** + * 修改库存明细 + * + * @param pwInventoryDetail 库存明细 + * @return 结果 + */ + public int updatePwInventoryDetail(PwInventoryDetail pwInventoryDetail); + + /** + * 删除库存明细 + * + * @param id 库存明细ID + * @return 结果 + */ + public int deletePwInventoryDetailById(Long id); + + /** + * 批量删除库存明细 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwInventoryDetailByIds(Long[] ids); + + /** + * 根据物品名称和型号查询物品 + * @param materialName + * @param specification + * @return + */ + public PwInventoryDetail selectPwInventoryDetailByNameAndTypeName(@Param("materialName") String materialName,@Param("specification") String specification); + + /** + * 根据物品名称和图号查询物品 + * @param materialName + * @param figureNumber + * @return + */ + public PwInventoryDetail selectPwInventoryDetailByNameAndFigureNumber(@Param("materialName") String materialName, @Param("figureNumber") String figureNumber); + + /** + * 根据图号查询库存 + * @param replace + * @return + */ + public PwInventoryDetail selectPwInventoryDetailByFigureNumber(@Param("replace") String replace); + + /** + * 清空表中所有数据 + */ + public void delete(); + + public int insertList(List list); + + /** + * 查询所有设置了最低和最高库存的信息 + * @return + */ + public List selectPwInventoryDetailByMinHig(); + + /**查询所有的原材料*/ + public List selectPwInventoryDetailByYuanCaiLiao(); + + public List selectPwInventoryDetailByFigureNumberAndAllGB(); + + public List selectPwInventoryDetailByWareHouserName(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwInvoiceInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInvoiceInfoMapper.java new file mode 100644 index 0000000..ac28337 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwInvoiceInfoMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwInvoiceInfo; + +/** + * 发票信息Mapper接口 + * + * @author zhukangchao + * @date 2023-04-09 + */ +public interface PwInvoiceInfoMapper +{ + /** + * 查询发票信息 + * + * @param id 发票信息ID + * @return 发票信息 + */ + public PwInvoiceInfo selectPwInvoiceInfoById(Long id); + + /** + * 查询发票信息列表 + * + * @param pwInvoiceInfo 发票信息 + * @return 发票信息集合 + */ + public List selectPwInvoiceInfoList(PwInvoiceInfo pwInvoiceInfo); + + /** + * 新增发票信息 + * + * @param pwInvoiceInfo 发票信息 + * @return 结果 + */ + public int insertPwInvoiceInfo(PwInvoiceInfo pwInvoiceInfo); + + /** + * 修改发票信息 + * + * @param pwInvoiceInfo 发票信息 + * @return 结果 + */ + public int updatePwInvoiceInfo(PwInvoiceInfo pwInvoiceInfo); + + /** + * 删除发票信息 + * + * @param id 发票信息ID + * @return 结果 + */ + public int deletePwInvoiceInfoById(Long id); + + /** + * 批量删除发票信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwInvoiceInfoByIds(Long[] ids); + + public PwInvoiceInfo selectPwInvoiceInfoByCodeAndName(@Param("code") String code,@Param("supplierName") String supplierName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceDetailsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceDetailsMapper.java new file mode 100644 index 0000000..9da753b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceDetailsMapper.java @@ -0,0 +1,76 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwLetterOfAdviceDetails; + +/** + * 产品发货通知单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-01 + */ +public interface PwLetterOfAdviceDetailsMapper +{ + /** + * 查询产品发货通知单详情 + * + * @param id 产品发货通知单详情ID + * @return 产品发货通知单详情 + */ + public PwLetterOfAdviceDetails selectPwLetterOfAdviceDetailsById(Long id); + + /** + * 查询产品发货通知单详情列表 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 产品发货通知单详情集合 + */ + public List selectPwLetterOfAdviceDetailsList(PwLetterOfAdviceDetails pwLetterOfAdviceDetails); + + /** + * 新增产品发货通知单详情 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 结果 + */ + public int insertPwLetterOfAdviceDetails(PwLetterOfAdviceDetails pwLetterOfAdviceDetails); + + /** + * 修改产品发货通知单详情 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 结果 + */ + public int updatePwLetterOfAdviceDetails(PwLetterOfAdviceDetails pwLetterOfAdviceDetails); + + /** + * 删除产品发货通知单详情 + * + * @param id 产品发货通知单详情ID + * @return 结果 + */ + public int deletePwLetterOfAdviceDetailsById(Long id); + + /** + * 批量删除产品发货通知单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwLetterOfAdviceDetailsByIds(Long[] ids); + + /** + * 根据令号和型号查询 + * @param productionBillCode + * @param productType + * @return + */ + public List selectPwLetterOfAdviceDetailsByCodeAndTypeName(@Param("productionBillCode") String productionBillCode,@Param("productType") String productType); + + public List selectPwLetterOfAdviceDetailsByLetterOfAdviceId(@Param("long1") Long long1); + + public PwLetterOfAdviceDetails selectPwLetterOfAdviceDetailsByLetterOfAdviceIdAndTypeName(@Param("id") Long id,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceMapper.java new file mode 100644 index 0000000..40ace9e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceMapper.java @@ -0,0 +1,73 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwLetterOfAdvice; + +/** + * 发运通知单Mapper接口 + * + * @author zhukangchao + * @date 2020-07-20 + */ +public interface PwLetterOfAdviceMapper +{ + /** + * 查询发运通知单 + * + * @param id 发运通知单ID + * @return 发运通知单 + */ + public PwLetterOfAdvice selectPwLetterOfAdviceById(Long id); + + /** + * 查询发运通知单列表 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 发运通知单集合 + */ + public List selectPwLetterOfAdviceList(PwLetterOfAdvice pwLetterOfAdvice); + + /** + * 新增发运通知单 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 结果 + */ + public int insertPwLetterOfAdvice(PwLetterOfAdvice pwLetterOfAdvice); + + /** + * 修改发运通知单 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 结果 + */ + public int updatePwLetterOfAdvice(PwLetterOfAdvice pwLetterOfAdvice); + + /** + * 删除发运通知单 + * + * @param id 发运通知单ID + * @return 结果 + */ + public int deletePwLetterOfAdviceById(Long id); + + /** + * 批量删除发运通知单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwLetterOfAdviceByIds(Long[] ids); + + /** + * 根据合同编号查询发运通知单信息 + * @param code + * @return + */ + public PwLetterOfAdvice selectPwLetterOfAdviceByCode(@Param("code") String code); + + public List selectPwLetterOfAdviceByCodeAndStatus(@Param("code") String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceProductMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceProductMapper.java new file mode 100644 index 0000000..980bd8d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwLetterOfAdviceProductMapper.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwLetterOfAdviceProduct; + +/** + * 产品发货通知单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface PwLetterOfAdviceProductMapper +{ + /** + * 查询产品发货通知单关联 + * + * @param id 产品发货通知单关联ID + * @return 产品发货通知单关联 + */ + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductById(Long id); + + /** + * 查询产品发货通知单关联列表 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 产品发货通知单关联集合 + */ + public List selectPwLetterOfAdviceProductList(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + /** + * 新增产品发货通知单关联 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 结果 + */ + public int insertPwLetterOfAdviceProduct(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + /** + * 修改产品发货通知单关联 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 结果 + */ + public int updatePwLetterOfAdviceProduct(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + /** + * 删除产品发货通知单关联 + * + * @param id 产品发货通知单关联ID + * @return 结果 + */ + public int deletePwLetterOfAdviceProductById(Long id); + + /** + * 批量删除产品发货通知单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwLetterOfAdviceProductByIds(Long[] ids); + + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductByCodeAndFigureNumber(@Param("productionCode") String productionCode,@Param("figureNumber") String figureNumber); + + public List selectPwLetterOfAdviceProductByLetterOfAdviceById(@Param("long1") Long long1); + + public List selectPwLetterOfAdviceProductListIsNull(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductByLetterOfAdviceByIdAndFigureNumber(@Param("id") Long id,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwMakeDocumentsDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMakeDocumentsDetailMapper.java new file mode 100644 index 0000000..0764b00 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMakeDocumentsDetailMapper.java @@ -0,0 +1,112 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; + +/** + * 库存制作单明细Mapper接口 + * + * @author zhukangchao + * @date 2020-11-11 + */ +public interface PwMakeDocumentsDetailMapper +{ + /** + * 查询库存制作单明细 + * + * @param id 库存制作单明细ID + * @return 库存制作单明细 + */ + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailById(Long id); + + /** + * 查询库存制作单明细列表 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 库存制作单明细集合 + */ + public List selectPwMakeDocumentsDetailList(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + /** + * 新增库存制作单明细 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 结果 + */ + public int insertPwMakeDocumentsDetail(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + /** + * 修改库存制作单明细 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 结果 + */ + public int updatePwMakeDocumentsDetail(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + /** + * 删除库存制作单明细 + * + * @param id 库存制作单明细ID + * @return 结果 + */ + public int deletePwMakeDocumentsDetailById(Long id); + + /** + * 批量删除库存制作单明细 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwMakeDocumentsDetailByIds(Long[] ids); + + public List selectPwMakeDocumentsDetailByNameAndFigureNumber(@Param("materialName") String materialName,@Param("specificationType") String specificationType); + + public List selectByMakeDocumentsCodeIsNull(); + + public List selectPwMakeDocumentsDetailByFigureNumberAndCode(@Param("string") String string); + + /** + * 根据code和名称和图号查询 + * @param makeDocumentsCode + * @param materialName + * @param specification + * @return + */ + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(@Param("makeDocumentsCode") String makeDocumentsCode,@Param("materialName") String materialName, @Param("specification") String specification); + + /** + * 根据名称和图号查询,按照code去重,查询未入库和入库中的数据 + */ + public List selectPwMakeDocumentsDetailByNameAndFigureNumberNoRepetition(@Param("name") String name,@Param("figureNumber") String figureNumber); + + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumber(@Param("makeDocumentsCode")String makeDocumentsCode,@Param("parentLevelName") String parentLevelName,@Param("parentLevelFigureNumber") String parentLevelFigureNumber); + + public List selectPwMakeDocumentsDetailByCodeAndSuperiorId(@Param("makeDocumentsCode") String makeDocumentsCode,@Param("id") Long id); + + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndFigureNumber(@Param("makeDocumentsCode") String makeDocumentsCode,@Param("figureNumber")String figureNumber); + + public List selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumbers(@Param("code") String code,@Param("parentLevelName") String parentLevelName,@Param("parentLevelFigureNumber") String parentLevelFigureNumber); + + public List selectPwMakeDocumentsDetailLists(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + public List selectPwMakeDocumentsDetailByCode(@Param("makeDocumentsCode") String makeDocumentsCode); + + public List selectPwMakeDocumentsDetailByCodeAndDeleteXu(String code); + + public List selectPwMakeDocumentsDetailByNameAndFigureNumberList(@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwMakeDocumentsDetailByMaterialId(@Param("materialId") Long id); + + public List selectPwMakeDocumentsDetailByAll(); + + public List selectPwMakeDocumentsDetailByCodeMoHu(@Param("makeDocumentsCode") String makeDocumentCode); + + public List selectPwMakeDocumentsDetailListAll(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + public List selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(@Param("makeDocumentsCode") String code,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwMakeDocumentsDetailByCodeAndMaterialIdIsNotNull(@Param("makeDocumentsCode") String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwMakeDocumentsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMakeDocumentsMapper.java new file mode 100644 index 0000000..fbdd74d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMakeDocumentsMapper.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMakeDocuments; + +/** + * 库存制作单Mapper接口 + * + * @author zhukangchao + * @date 2020-11-11 + */ +public interface PwMakeDocumentsMapper +{ + /** + * 查询库存制作单 + * + * @param id 库存制作单ID + * @return 库存制作单 + */ + public PwMakeDocuments selectPwMakeDocumentsById(Long id); + + /** + * 查询库存制作单列表 + * + * @param pwMakeDocuments 库存制作单 + * @return 库存制作单集合 + */ + public List selectPwMakeDocumentsList(PwMakeDocuments pwMakeDocuments); + + /** + * 新增库存制作单 + * + * @param pwMakeDocuments 库存制作单 + * @return 结果 + */ + public int insertPwMakeDocuments(PwMakeDocuments pwMakeDocuments); + + /** + * 修改库存制作单 + * + * @param pwMakeDocuments 库存制作单 + * @return 结果 + */ + public int updatePwMakeDocuments(PwMakeDocuments pwMakeDocuments); + + /** + * 删除库存制作单 + * + * @param id 库存制作单ID + * @return 结果 + */ + public int deletePwMakeDocumentsById(Long id); + + /** + * 批量删除库存制作单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwMakeDocumentsByIds(Long[] ids); + + public PwMakeDocuments selectPwMakeDocumentsByCode(String code); + + public PwMakeDocuments selectList(); + public List queryPwMakeDocumentsListByDeptName(PwMakeDocuments pwMakeDocuments); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialBorrowInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialBorrowInfoMapper.java new file mode 100644 index 0000000..636cb73 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialBorrowInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialBorrowInfo; + +/** + * 借用信息Mapper接口 + * + * @author zhukangchao + * @date 2023-11-24 + */ +public interface PwMaterialBorrowInfoMapper +{ + /** + * 查询借用信息 + * + * @param id 借用信息ID + * @return 借用信息 + */ + public PwMaterialBorrowInfo selectPwMaterialBorrowInfoById(Long id); + + /** + * 查询借用信息列表 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 借用信息集合 + */ + public List selectPwMaterialBorrowInfoList(PwMaterialBorrowInfo pwMaterialBorrowInfo); + + /** + * 新增借用信息 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 结果 + */ + public int insertPwMaterialBorrowInfo(PwMaterialBorrowInfo pwMaterialBorrowInfo); + + /** + * 修改借用信息 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 结果 + */ + public int updatePwMaterialBorrowInfo(PwMaterialBorrowInfo pwMaterialBorrowInfo); + + /** + * 删除借用信息 + * + * @param id 借用信息ID + * @return 结果 + */ + public int deletePwMaterialBorrowInfoById(Long id); + + /** + * 批量删除借用信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwMaterialBorrowInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialMaterialsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialMaterialsMapper.java new file mode 100644 index 0000000..86fbef1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialMaterialsMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialMaterials; + +/** + * 物料原材料Mapper接口 + * + * @author zhukangchao + * @date 2022-12-14 + */ +public interface PwMaterialMaterialsMapper +{ + /** + * 查询物料原材料 + * + * @param id 物料原材料ID + * @return 物料原材料 + */ + public PwMaterialMaterials selectPwMaterialMaterialsById(Long id); + + /** + * 查询物料原材料列表 + * + * @param pwMaterialMaterials 物料原材料 + * @return 物料原材料集合 + */ + public List selectPwMaterialMaterialsList(PwMaterialMaterials pwMaterialMaterials); + + /** + * 新增物料原材料 + * + * @param pwMaterialMaterials 物料原材料 + * @return 结果 + */ + public int insertPwMaterialMaterials(PwMaterialMaterials pwMaterialMaterials); + + /** + * 修改物料原材料 + * + * @param pwMaterialMaterials 物料原材料 + * @return 结果 + */ + public int updatePwMaterialMaterials(PwMaterialMaterials pwMaterialMaterials); + + /** + * 删除物料原材料 + * + * @param id 物料原材料ID + * @return 结果 + */ + public int deletePwMaterialMaterialsById(Long id); + + /** + * 批量删除物料原材料 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwMaterialMaterialsByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialParamsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialParamsMapper.java new file mode 100644 index 0000000..5948fed --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialParamsMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialParams; + +/** + * 物料参数Mapper接口 + * + * @author chenyongjiang + * @date 2024-04-16 + */ +public interface PwMaterialParamsMapper +{ + /** + * 查询物料参数 + * + * @param id 物料参数ID + * @return 物料参数 + */ + public PwMaterialParams selectPwMaterialParamsById(Long id); + + /** + * 查询物料参数列表 + * + * @param pwMaterialParams 物料参数 + * @return 物料参数集合 + */ + public List selectPwMaterialParamsList(PwMaterialParams pwMaterialParams); + + /** + * 新增物料参数 + * + * @param pwMaterialParams 物料参数 + * @return 结果 + */ + public int insertPwMaterialParams(PwMaterialParams pwMaterialParams); + + /** + * 修改物料参数 + * + * @param pwMaterialParams 物料参数 + * @return 结果 + */ + public int updatePwMaterialParams(PwMaterialParams pwMaterialParams); + + /** + * 删除物料参数 + * + * @param id 物料参数ID + * @return 结果 + */ + public int deletePwMaterialParamsById(Long id); + + /** + * 批量删除物料参数 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwMaterialParamsByIds(Long[] ids); + + public PwMaterialParams selectPwMaterialParamsByvalueAndFlag(String paramValue,String paramFlag); + /** + * 批量删除物料参数 + * + * @param value 类型参数 + * @return 结果 + */ + public int deletePwMaterialParamsByFlag(String value); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialPriceMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialPriceMapper.java new file mode 100644 index 0000000..db0fda0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialPriceMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwMaterialPrice; + +/** + * 物料价格校验Mapper接口 + * + * @author zhukangchao + * @date 2023-06-23 + */ +public interface PwMaterialPriceMapper +{ + /** + * 查询物料价格校验 + * + * @param id 物料价格校验ID + * @return 物料价格校验 + */ + public PwMaterialPrice selectPwMaterialPriceById(Long id); + + /** + * 查询物料价格校验列表 + * + * @param pwMaterialPrice 物料价格校验 + * @return 物料价格校验集合 + */ + public List selectPwMaterialPriceList(PwMaterialPrice pwMaterialPrice); + + /** + * 新增物料价格校验 + * + * @param pwMaterialPrice 物料价格校验 + * @return 结果 + */ + public int insertPwMaterialPrice(PwMaterialPrice pwMaterialPrice); + + /** + * 修改物料价格校验 + * + * @param pwMaterialPrice 物料价格校验 + * @return 结果 + */ + public int updatePwMaterialPrice(PwMaterialPrice pwMaterialPrice); + + /** + * 删除物料价格校验 + * + * @param id 物料价格校验ID + * @return 结果 + */ + public int deletePwMaterialPriceById(Long id); + + /** + * 批量删除物料价格校验 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwMaterialPriceByIds(Long[] ids); + + public PwMaterialPrice selectPwMaterialPriceByNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialProcessMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialProcessMapper.java new file mode 100644 index 0000000..3c03eb0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwMaterialProcessMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwMaterialProcess; + +/** + * 物料工序信息Mapper接口 + * + * @author zhukangchao + * @date 2021-12-04 + */ +public interface PwMaterialProcessMapper +{ + /** + * 查询物料工序信息 + * + * @param id 物料工序信息ID + * @return 物料工序信息 + */ + public PwMaterialProcess selectPwMaterialProcessById(Long id); + + /** + * 查询物料工序信息列表 + * + * @param pwMaterialProcess 物料工序信息 + * @return 物料工序信息集合 + */ + public List selectPwMaterialProcessList(PwMaterialProcess pwMaterialProcess); + + /** + * 新增物料工序信息 + * + * @param pwMaterialProcess 物料工序信息 + * @return 结果 + */ + public int insertPwMaterialProcess(PwMaterialProcess pwMaterialProcess); + + /** + * 修改物料工序信息 + * + * @param pwMaterialProcess 物料工序信息 + * @return 结果 + */ + public int updatePwMaterialProcess(PwMaterialProcess pwMaterialProcess); + + /** + * 删除物料工序信息 + * + * @param id 物料工序信息ID + * @return 结果 + */ + public int deletePwMaterialProcessById(String id); + + /** + * 批量删除物料工序信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwMaterialProcessByIds(Long[] ids); + + public List selectPwMaterialProcessByNameAndFigureNumber(@Param("name")String name,@Param("figureNumber") String figureNumber); + + public List queryPwMaterialProcesssByFigureNumber(String figureNumber); + + public List queryPwMaterialProcesssById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwModulePartMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwModulePartMapper.java new file mode 100644 index 0000000..1e34f52 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwModulePartMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwModulePart; + +/** + * 零部件关联Mapper接口 + * + * @author zhukangchao + * @date 2022-11-28 + */ +public interface PwModulePartMapper +{ + /** + * 查询零部件关联 + * + * @param id 零部件关联ID + * @return 零部件关联 + */ + public PwModulePart selectPwModulePartById(Long id); + + /** + * 查询零部件关联列表 + * + * @param pwModulePart 零部件关联 + * @return 零部件关联集合 + */ + public List selectPwModulePartList(PwModulePart pwModulePart); + + /** + * 新增零部件关联 + * + * @param pwModulePart 零部件关联 + * @return 结果 + */ + public int insertPwModulePart(PwModulePart pwModulePart); + + /** + * 修改零部件关联 + * + * @param pwModulePart 零部件关联 + * @return 结果 + */ + public int updatePwModulePart(PwModulePart pwModulePart); + + /** + * 删除零部件关联 + * + * @param id 零部件关联ID + * @return 结果 + */ + public int deletePwModulePartById(Long id); + + /** + * 批量删除零部件关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwModulePartByIds(Long[] ids); + + public List selectPwModulePartByMaterialId(@Param("materialId") Long id); + + public List selectPwModulePartByMaterialNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwOtherCorrespondentMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOtherCorrespondentMapper.java new file mode 100644 index 0000000..9ac89f4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOtherCorrespondentMapper.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwOtherCorrespondent; + +/** + * 其它往来单位信息Mapper接口 + * + * @author zhukangchao + * @date 2023-12-04 + */ +public interface PwOtherCorrespondentMapper +{ + /** + * 查询其它往来单位信息 + * + * @param id 其它往来单位信息ID + * @return 其它往来单位信息 + */ + public PwOtherCorrespondent selectPwOtherCorrespondentById(Long id); + + /** + * 查询其它往来单位信息列表 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 其它往来单位信息集合 + */ + public List selectPwOtherCorrespondentList(PwOtherCorrespondent pwOtherCorrespondent); + + /** + * 新增其它往来单位信息 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 结果 + */ + public int insertPwOtherCorrespondent(PwOtherCorrespondent pwOtherCorrespondent); + + /** + * 修改其它往来单位信息 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 结果 + */ + public int updatePwOtherCorrespondent(PwOtherCorrespondent pwOtherCorrespondent); + + /** + * 删除其它往来单位信息 + * + * @param id 其它往来单位信息ID + * @return 结果 + */ + public int deletePwOtherCorrespondentById(Long id); + + /** + * 批量删除其它往来单位信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwOtherCorrespondentByIds(Long[] ids); + + public PwOtherCorrespondent selectPwOtherCorrespondentByName(@Param("unitName") String unitName); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourceContractDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourceContractDetailMapper.java new file mode 100644 index 0000000..146943b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourceContractDetailMapper.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwOutsourceContractDetail; + +/** + * 外协合同详情信息Mapper接口 + * + * @author zhukangchao + * @date 2023-04-09 + */ +public interface PwOutsourceContractDetailMapper +{ + /** + * 查询外协合同详情信息 + * + * @param id 外协合同详情信息ID + * @return 外协合同详情信息 + */ + public PwOutsourceContractDetail selectPwOutsourceContractDetailById(Long id); + + /** + * 查询外协合同详情信息列表 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 外协合同详情信息集合 + */ + public List selectPwOutsourceContractDetailList(PwOutsourceContractDetail pwOutsourceContractDetail); + + /** + * 新增外协合同详情信息 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 结果 + */ + public int insertPwOutsourceContractDetail(PwOutsourceContractDetail pwOutsourceContractDetail); + + /** + * 修改外协合同详情信息 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 结果 + */ + public int updatePwOutsourceContractDetail(PwOutsourceContractDetail pwOutsourceContractDetail); + + /** + * 删除外协合同详情信息 + * + * @param id 外协合同详情信息ID + * @return 结果 + */ + public int deletePwOutsourceContractDetailById(Long id); + + /** + * 批量删除外协合同详情信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwOutsourceContractDetailByIds(Long[] ids); + + public List selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber(@Param("productionCode") String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwOutsourceContractDetailByOutsourceContractId(@Param("outsourceContractid") Long id); + + public List selectPwOutsourceContractDetailLists(PwOutsourceContractDetail pwOutsourceContractDetail); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourceContractMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourceContractMapper.java new file mode 100644 index 0000000..b66be28 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourceContractMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwOutsourceContract; + +/** + * 外协合同信息Mapper接口 + * + * @author zhukangchao + * @date 2023-04-09 + */ +public interface PwOutsourceContractMapper +{ + /** + * 查询外协合同信息 + * + * @param id 外协合同信息ID + * @return 外协合同信息 + */ + public PwOutsourceContract selectPwOutsourceContractById(Long id); + + /** + * 查询外协合同信息列表 + * + * @param pwOutsourceContract 外协合同信息 + * @return 外协合同信息集合 + */ + public List selectPwOutsourceContractList(PwOutsourceContract pwOutsourceContract); + + /** + * 新增外协合同信息 + * + * @param pwOutsourceContract 外协合同信息 + * @return 结果 + */ + public int insertPwOutsourceContract(PwOutsourceContract pwOutsourceContract); + + /** + * 修改外协合同信息 + * + * @param pwOutsourceContract 外协合同信息 + * @return 结果 + */ + public int updatePwOutsourceContract(PwOutsourceContract pwOutsourceContract); + + /** + * 删除外协合同信息 + * + * @param id 外协合同信息ID + * @return 结果 + */ + public int deletePwOutsourceContractById(Long id); + + /** + * 批量删除外协合同信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwOutsourceContractByIds(Long[] ids); + + public List selectPwOutsourceContractByInvoiceInfoId(@Param("invoiceInfoId") Long id); + + public PwOutsourceContract selectPwOutsourceContractByContractCode(@Param("contractCode") String contractCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourcingContractMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourcingContractMapper.java new file mode 100644 index 0000000..81bc67a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourcingContractMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwOutsourcingContract; + +/** + * 外协合同Mapper接口 + * + * @author zhukangchao + * @date 2020-07-01 + */ +public interface PwOutsourcingContractMapper +{ + /** + * 查询外协合同 + * + * @param id 外协合同ID + * @return 外协合同 + */ + public PwOutsourcingContract selectPwOutsourcingContractById(Long id); + + /** + * 查询外协合同列表 + * + * @param pwOutsourcingContract 外协合同 + * @return 外协合同集合 + */ + public List selectPwOutsourcingContractList(PwOutsourcingContract pwOutsourcingContract); + + /** + * 新增外协合同 + * + * @param pwOutsourcingContract 外协合同 + * @return 结果 + */ + public int insertPwOutsourcingContract(PwOutsourcingContract pwOutsourcingContract); + + /** + * 修改外协合同 + * + * @param pwOutsourcingContract 外协合同 + * @return 结果 + */ + public int updatePwOutsourcingContract(PwOutsourcingContract pwOutsourcingContract); + + /** + * 删除外协合同 + * + * @param id 外协合同ID + * @return 结果 + */ + public int deletePwOutsourcingContractById(Long id); + + /** + * 批量删除外协合同 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwOutsourcingContractByIds(Long[] ids); + + /** + * 根据外协合同code查询外协合同信息 + * @param worksheetCode + * @return + */ + public PwOutsourcingContract selectByOutsourcingContractCode(@Param("worksheetCode") String worksheetCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourcingContractMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourcingContractMaterialMapper.java new file mode 100644 index 0000000..96adbe8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwOutsourcingContractMaterialMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwOutsourcingContractMaterial; + +/** + * 零件和外协合同关联Mapper接口 + * + * @author zhukangchao + * @date 2020-07-01 + */ +public interface PwOutsourcingContractMaterialMapper +{ + /** + * 查询零件和外协合同关联 + * + * @param id 零件和外协合同关联ID + * @return 零件和外协合同关联 + */ + public PwOutsourcingContractMaterial selectPwOutsourcingContractMaterialById(Long id); + + /** + * 查询零件和外协合同关联列表 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 零件和外协合同关联集合 + */ + public List selectPwOutsourcingContractMaterialList(PwOutsourcingContractMaterial pwOutsourcingContractMaterial); + + /** + * 新增零件和外协合同关联 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 结果 + */ + public int insertPwOutsourcingContractMaterial(PwOutsourcingContractMaterial pwOutsourcingContractMaterial); + + /** + * 修改零件和外协合同关联 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 结果 + */ + public int updatePwOutsourcingContractMaterial(PwOutsourcingContractMaterial pwOutsourcingContractMaterial); + + /** + * 删除零件和外协合同关联 + * + * @param id 零件和外协合同关联ID + * @return 结果 + */ + public int deletePwOutsourcingContractMaterialById(Long id); + + /** + * 批量删除零件和外协合同关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwOutsourcingContractMaterialByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwPankuRecordMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPankuRecordMapper.java new file mode 100644 index 0000000..9390bf6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPankuRecordMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPankuRecord; + +/** + * 盘库记录Mapper接口 + * + * @author zhukangchao + * @date 2020-08-27 + */ +public interface PwPankuRecordMapper +{ + /** + * 查询盘库记录 + * + * @param id 盘库记录ID + * @return 盘库记录 + */ + public PwPankuRecord selectPwPankuRecordById(Long id); + + /** + * 查询盘库记录列表 + * + * @param pwPankuRecord 盘库记录 + * @return 盘库记录集合 + */ + public List selectPwPankuRecordList(PwPankuRecord pwPankuRecord); + + /** + * 新增盘库记录 + * + * @param pwPankuRecord 盘库记录 + * @return 结果 + */ + public int insertPwPankuRecord(PwPankuRecord pwPankuRecord); + + /** + * 修改盘库记录 + * + * @param pwPankuRecord 盘库记录 + * @return 结果 + */ + public int updatePwPankuRecord(PwPankuRecord pwPankuRecord); + + /** + * 删除盘库记录 + * + * @param id 盘库记录ID + * @return 结果 + */ + public int deletePwPankuRecordById(Long id); + + /** + * 批量删除盘库记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwPankuRecordByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwPredictPurchaseMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPredictPurchaseMapper.java new file mode 100644 index 0000000..184402b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPredictPurchaseMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwPredictPurchase; + +/** + * 预采购单Mapper接口 + * + * @author zhukangchao + * @date 2023-02-02 + */ +public interface PwPredictPurchaseMapper +{ + /** + * 查询预采购单 + * + * @param id 预采购单ID + * @return 预采购单 + */ + public PwPredictPurchase selectPwPredictPurchaseById(Long id); + + /** + * 查询预采购单列表 + * + * @param pwPredictPurchase 预采购单 + * @return 预采购单集合 + */ + public List selectPwPredictPurchaseList(PwPredictPurchase pwPredictPurchase); + + /** + * 新增预采购单 + * + * @param pwPredictPurchase 预采购单 + * @return 结果 + */ + public int insertPwPredictPurchase(PwPredictPurchase pwPredictPurchase); + + /** + * 修改预采购单 + * + * @param pwPredictPurchase 预采购单 + * @return 结果 + */ + public int updatePwPredictPurchase(PwPredictPurchase pwPredictPurchase); + + /** + * 删除预采购单 + * + * @param id 预采购单ID + * @return 结果 + */ + public int deletePwPredictPurchaseById(Long id); + + /** + * 批量删除预采购单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwPredictPurchaseByIds(Long[] ids); + + public PwPredictPurchase selectPwPredictPurchaseByCode(@Param("makeDocumentsCode") String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwPredictPurchaseTwoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPredictPurchaseTwoMapper.java new file mode 100644 index 0000000..2429c9d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPredictPurchaseTwoMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwPredictPurchaseTwo; + +/** + * 预采购单详情Mapper接口 + * + * @author zhukangchao + * @date 2023-02-02 + */ +public interface PwPredictPurchaseTwoMapper +{ + /** + * 查询预采购单详情 + * + * @param id 预采购单详情ID + * @return 预采购单详情 + */ + public PwPredictPurchaseTwo selectPwPredictPurchaseTwoById(Long id); + + /** + * 查询预采购单详情列表 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 预采购单详情集合 + */ + public List selectPwPredictPurchaseTwoList(PwPredictPurchaseTwo pwPredictPurchaseTwo); + + /** + * 新增预采购单详情 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 结果 + */ + public int insertPwPredictPurchaseTwo(PwPredictPurchaseTwo pwPredictPurchaseTwo); + + /** + * 修改预采购单详情 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 结果 + */ + public int updatePwPredictPurchaseTwo(PwPredictPurchaseTwo pwPredictPurchaseTwo); + + /** + * 删除预采购单详情 + * + * @param id 预采购单详情ID + * @return 结果 + */ + public int deletePwPredictPurchaseTwoById(Long id); + + /** + * 批量删除预采购单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwPredictPurchaseTwoByIds(Long[] ids); + + public PwPredictPurchaseTwo selectPwPredictPurchaseTwoByIdAndNameAndFigureNumber(@Param("id") Long id,@Param("materialName") String materialName,@Param("specification") String specification); + + public List selectPwPredictPurchaseTwoByPredictPurchaseId(@Param("predictPurchaseId") Long predictPurchaseId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProcessMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProcessMapper.java new file mode 100644 index 0000000..bf1bd89 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProcessMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwProcess; + +/** + * 工序Mapper接口 + * + * @author zhukangchao + * @date 2021-10-11 + */ +public interface PwProcessMapper +{ + /** + * 查询工序 + * + * @param id 工序ID + * @return 工序 + */ + public PwProcess selectPwProcessById(Long id); + + /** + * 查询工序列表 + * + * @param pwProcess 工序 + * @return 工序集合 + */ + public List selectPwProcessList(PwProcess pwProcess); + + /** + * 新增工序 + * + * @param pwProcess 工序 + * @return 结果 + */ + public int insertPwProcess(PwProcess pwProcess); + + /** + * 修改工序 + * + * @param pwProcess 工序 + * @return 结果 + */ + public int updatePwProcess(PwProcess pwProcess); + + /** + * 删除工序 + * + * @param id 工序ID + * @return 结果 + */ + public int deletePwProcessById(Long id); + + /** + * 批量删除工序 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProcessByIds(Long[] ids); + + public PwProcess selectPwProcessByName(@Param("string")String string); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProcessOrDeptMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProcessOrDeptMapper.java new file mode 100644 index 0000000..d891deb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProcessOrDeptMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProcessOrDept; + +/** + * 工序部门Mapper接口 + * + * @author chenyongjiang + * @date 2024-05-23 + */ +public interface PwProcessOrDeptMapper +{ + /** + * 查询工序部门 + * + * @param id 工序部门ID + * @return 工序部门 + */ + public PwProcessOrDept selectPwProcessOrDeptById(Long id); + + /** + * 查询工序部门列表 + * + * @param pwProcessOrDept 工序部门 + * @return 工序部门集合 + */ + public List selectPwProcessOrDeptList(PwProcessOrDept pwProcessOrDept); + + /** + * 新增工序部门 + * + * @param pwProcessOrDept 工序部门 + * @return 结果 + */ + public int insertPwProcessOrDept(PwProcessOrDept pwProcessOrDept); + + /** + * 修改工序部门 + * + * @param pwProcessOrDept 工序部门 + * @return 结果 + */ + public int updatePwProcessOrDept(PwProcessOrDept pwProcessOrDept); + + /** + * 删除工序部门 + * + * @param id 工序部门ID + * @return 结果 + */ + public int deletePwProcessOrDeptById(Long id); + + /** + * 批量删除工序部门 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProcessOrDeptByIds(Long[] ids); + + /** + * 查询工序部门 + * + * @param processName + * @return 结果 + */ + public PwProcessOrDept selectPwProcessOrDeptByProcessName(String processName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductBillBomMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductBillBomMapper.java new file mode 100644 index 0000000..cc53b35 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductBillBomMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductBillBom; + +/** + * 生产执行单bomMapper接口 + * + * @author zhukangchao + * @date 2020-08-17 + */ +public interface PwProductBillBomMapper +{ + /** + * 查询生产执行单bom + * + * @param id 生产执行单bomID + * @return 生产执行单bom + */ + public PwProductBillBom selectPwProductBillBomById(Long id); + + /** + * 查询生产执行单bom列表 + * + * @param pwProductBillBom 生产执行单bom + * @return 生产执行单bom集合 + */ + public List selectPwProductBillBomList(PwProductBillBom pwProductBillBom); + + /** + * 新增生产执行单bom + * + * @param pwProductBillBom 生产执行单bom + * @return 结果 + */ + public int insertPwProductBillBom(PwProductBillBom pwProductBillBom); + + /** + * 修改生产执行单bom + * + * @param pwProductBillBom 生产执行单bom + * @return 结果 + */ + public int updatePwProductBillBom(PwProductBillBom pwProductBillBom); + + /** + * 删除生产执行单bom + * + * @param id 生产执行单bomID + * @return 结果 + */ + public int deletePwProductBillBomById(Long id); + + /** + * 批量删除生产执行单bom + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductBillBomByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductDetailMapper.java new file mode 100644 index 0000000..c36c239 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductDetailMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductDetail; + +/** + * 金蝶生产详情Mapper接口 + * + * @author chenyongjiang + * @date 2024-04-23 + */ +public interface PwProductDetailMapper +{ + /** + * 查询金蝶生产详情 + * + * @param id 金蝶生产详情ID + * @return 金蝶生产详情 + */ + public PwProductDetail selectPwProductDetailById(Long id); + + /** + * 查询金蝶生产详情列表 + * + * @param pwProductDetail 金蝶生产详情 + * @return 金蝶生产详情集合 + */ + public List selectPwProductDetailList(PwProductDetail pwProductDetail); + + /** + * 新增金蝶生产详情 + * + * @param pwProductDetail 金蝶生产详情 + * @return 结果 + */ + public int insertPwProductDetail(PwProductDetail pwProductDetail); + + /** + * 修改金蝶生产详情 + * + * @param pwProductDetail 金蝶生产详情 + * @return 结果 + */ + public int updatePwProductDetail(PwProductDetail pwProductDetail); + + /** + * 删除金蝶生产详情 + * + * @param id 金蝶生产详情ID + * @return 结果 + */ + public int deletePwProductDetailById(Long id); + + /** + * 根据生产令号查询数据 + * + * @param productCode 金蝶生产令号 + * @return 金蝶生产详情 + */ + public List selectPwProductDetailByCode(String productCode); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductMapper.java new file mode 100644 index 0000000..6dc523e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductMapper.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProduct; + +/** + * 产品Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PwProductMapper +{ + /** + * 查询产品 + * + * @param id 产品ID + * @return 产品 + */ + public PwProduct selectPwProductById(Long id); + + /** + * 查询产品列表 + * + * @param pwProduct 产品 + * @return 产品集合 + */ + public List selectPwProductList(PwProduct pwProduct); + + /** + * 新增产品 + * + * @param pwProduct 产品 + * @return 结果 + */ + public int insertPwProduct(PwProduct pwProduct); + + /** + * 修改产品 + * + * @param pwProduct 产品 + * @return 结果 + */ + public int updatePwProduct(PwProduct pwProduct); + + /** + * 删除产品 + * + * @param id 产品ID + * @return 结果 + */ + public int deletePwProductById(Long id); + + /** + * 批量删除产品 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductByIds(Long[] ids); + + /** + * 根据产品名称查询 + * @param name + */ + public PwProduct selectByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductQuotationMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductQuotationMapper.java new file mode 100644 index 0000000..0ced1f8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductQuotationMapper.java @@ -0,0 +1,80 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwProductQuotation; + +/** + * 产品报价单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-07-07 + */ +public interface PwProductQuotationMapper +{ + /** + * 查询产品报价单关联 + * + * @param id 产品报价单关联ID + * @return 产品报价单关联 + */ + public PwProductQuotation selectPwProductQuotationById(Long id); + + /** + * 查询产品报价单关联列表 + * + * @param pwProductQuotation 产品报价单关联 + * @return 产品报价单关联集合 + */ + public List selectPwProductQuotationList(PwProductQuotation pwProductQuotation); + + /** + * 新增产品报价单关联 + * + * @param pwProductQuotation 产品报价单关联 + * @return 结果 + */ + public int insertPwProductQuotation(PwProductQuotation pwProductQuotation); + + /** + * 修改产品报价单关联 + * + * @param pwProductQuotation 产品报价单关联 + * @return 结果 + */ + public int updatePwProductQuotation(PwProductQuotation pwProductQuotation); + + /** + * 删除产品报价单关联 + * + * @param id 产品报价单关联ID + * @return 结果 + */ + public int deletePwProductQuotationById(Long id); + + /** + * 批量删除产品报价单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductQuotationByIds(Long[] ids); + + /** + * 根据名称和报价单id查询 + * @param ss + * @param valueOf + */ + public PwProductQuotation selectPwProductQuotationByNameAndQuotationId(@Param("ss") String ss, @Param("valueOf") Long valueOf); + + /** + * 根据报价单id查询当前报价单下所有的型号 + * @param valueOf + * @return + */ + public List selectPwProductQuotationByQuotationId(@Param("valueOf") Long valueOf); + + public PwProductQuotation selectPwProductQuotationByQuotationIdAndTypeName(@Param("quotationId") String quotationId,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillMapper.java new file mode 100644 index 0000000..4acd597 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillMapper.java @@ -0,0 +1,74 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwProductionBill; + +/** + * 生产执行单Mapper接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface PwProductionBillMapper +{ + /** + * 查询生产执行单 + * + * @param id 生产执行单ID + * @return 生产执行单 + */ + public PwProductionBill selectPwProductionBillById(Long id); + + /** + * 查询生产执行单列表 + * + * @param pwProductionBill 生产执行单 + * @return 生产执行单集合 + */ + public List selectPwProductionBillList(PwProductionBill pwProductionBill); + + /** + * 新增生产执行单 + * + * @param pwProductionBill 生产执行单 + * @return 结果 + */ + public int insertPwProductionBill(PwProductionBill pwProductionBill); + + /** + * 修改生产执行单 + * + * @param pwProductionBill 生产执行单 + * @return 结果 + */ + public int updatePwProductionBill(PwProductionBill pwProductionBill); + + /** + * 删除生产执行单 + * + * @param id 生产执行单ID + * @return 结果 + */ + public int deletePwProductionBillById(Long id); + + /** + * 批量删除生产执行单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductionBillByIds(Long[] ids); + + /** + * 根据生产令号查询生产执行信息 + * @param productionCode + */ + public PwProductionBill selectPwProductionBillByProductionCode(@Param("productionCode") String productionCode); + + public List selectPwProductionBillByStatus(@Param("string") String string); + + public int updatePwProductionBillByCode(String code,String commitFlag); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillNonstandardMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillNonstandardMapper.java new file mode 100644 index 0000000..5897e7a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillNonstandardMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionBillNonstandard; + +/** + * 产品非标生产执行单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface PwProductionBillNonstandardMapper +{ + /** + * 查询产品非标生产执行单关联 + * + * @param id 产品非标生产执行单关联ID + * @return 产品非标生产执行单关联 + */ + public PwProductionBillNonstandard selectPwProductionBillNonstandardById(Long id); + + /** + * 查询产品非标生产执行单关联列表 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 产品非标生产执行单关联集合 + */ + public List selectPwProductionBillNonstandardList(PwProductionBillNonstandard pwProductionBillNonstandard); + + /** + * 新增产品非标生产执行单关联 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 结果 + */ + public int insertPwProductionBillNonstandard(PwProductionBillNonstandard pwProductionBillNonstandard); + + /** + * 修改产品非标生产执行单关联 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 结果 + */ + public int updatePwProductionBillNonstandard(PwProductionBillNonstandard pwProductionBillNonstandard); + + /** + * 删除产品非标生产执行单关联 + * + * @param id 产品非标生产执行单关联ID + * @return 结果 + */ + public int deletePwProductionBillNonstandardById(Long id); + + /** + * 批量删除产品非标生产执行单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductionBillNonstandardByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillProductMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillProductMapper.java new file mode 100644 index 0000000..59ea424 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionBillProductMapper.java @@ -0,0 +1,80 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwProductQuotation; +import com.ruoyi.project.management.domain.PwProductionBillProduct; + +/** + * 销齿链生产执行单关联Mapper接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface PwProductionBillProductMapper +{ + /** + * 查询销齿链生产执行单关联 + * + * @param id 销齿链生产执行单关联ID + * @return 销齿链生产执行单关联 + */ + public PwProductionBillProduct selectPwProductionBillProductById(Long id); + + /** + * 查询销齿链生产执行单关联列表 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 销齿链生产执行单关联集合 + */ + public List selectPwProductionBillProductList(PwProductionBillProduct pwProductionBillProduct); + + /** + * 新增销齿链生产执行单关联 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 结果 + */ + public int insertPwProductionBillProduct(PwProductionBillProduct pwProductionBillProduct); + + /** + * 修改销齿链生产执行单关联 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 结果 + */ + public int updatePwProductionBillProduct(PwProductionBillProduct pwProductionBillProduct); + + /** + * 删除销齿链生产执行单关联 + * + * @param id 销齿链生产执行单关联ID + * @return 结果 + */ + public int deletePwProductionBillProductById(Long id); + + /** + * 批量删除销齿链生产执行单关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductionBillProductByIds(Long[] ids); + + public int deletePwProductionBillProductByProductionBillId(Long long1); + + /** + * 根据执行单id查询所有的型号 + * @param id + * @return + */ + public List selectPwProductionBillProductByProductionBillId(Long id); + + public PwProductionBillProduct selectPwProductionBillProductByProductionBillIdAndName(@Param("id") Long id, @Param("typeName") String typeName); + + public List selectPwProductionBillProductLists( + PwProductionBillProduct pwProductionBillProduct); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionOrderInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionOrderInfoMapper.java new file mode 100644 index 0000000..c003e56 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionOrderInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionOrderInfo; + +/** + * 生产订单详情信息Mapper接口 + * + * @author zhukangchao + * @date 2023-12-06 + */ +public interface PwProductionOrderInfoMapper +{ + /** + * 查询生产订单详情信息 + * + * @param id 生产订单详情信息ID + * @return 生产订单详情信息 + */ + public PwProductionOrderInfo selectPwProductionOrderInfoById(Long id); + + /** + * 查询生产订单详情信息列表 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 生产订单详情信息集合 + */ + public List selectPwProductionOrderInfoList(PwProductionOrderInfo pwProductionOrderInfo); + + /** + * 新增生产订单详情信息 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 结果 + */ + public int insertPwProductionOrderInfo(PwProductionOrderInfo pwProductionOrderInfo); + + /** + * 修改生产订单详情信息 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 结果 + */ + public int updatePwProductionOrderInfo(PwProductionOrderInfo pwProductionOrderInfo); + + /** + * 删除生产订单详情信息 + * + * @param id 生产订单详情信息ID + * @return 结果 + */ + public int deletePwProductionOrderInfoById(Long id); + + /** + * 批量删除生产订单详情信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductionOrderInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionOrderMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionOrderMapper.java new file mode 100644 index 0000000..0440dd4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionOrderMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwProductionOrder; + +/** + * 生产订单信息Mapper接口 + * + * @author zhukangchao + * @date 2023-12-06 + */ +public interface PwProductionOrderMapper +{ + /** + * 查询生产订单信息 + * + * @param id 生产订单信息ID + * @return 生产订单信息 + */ + public PwProductionOrder selectPwProductionOrderById(Long id); + + /** + * 查询生产订单信息列表 + * + * @param pwProductionOrder 生产订单信息 + * @return 生产订单信息集合 + */ + public List selectPwProductionOrderList(PwProductionOrder pwProductionOrder); + + /** + * 新增生产订单信息 + * + * @param pwProductionOrder 生产订单信息 + * @return 结果 + */ + public int insertPwProductionOrder(PwProductionOrder pwProductionOrder); + + /** + * 修改生产订单信息 + * + * @param pwProductionOrder 生产订单信息 + * @return 结果 + */ + public int updatePwProductionOrder(PwProductionOrder pwProductionOrder); + + /** + * 删除生产订单信息 + * + * @param id 生产订单信息ID + * @return 结果 + */ + public int deletePwProductionOrderById(Long id); + + /** + * 批量删除生产订单信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductionOrderByIds(Long[] ids); + + public PwProductionOrder selectPwProductionOrderByCode(@Param("code") String contractCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionSchedulingMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionSchedulingMapper.java new file mode 100644 index 0000000..a8a3837 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionSchedulingMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionScheduling; + +/** + * 排产信息Mapper接口 + * + * @author zhukangchao + * @date 2023-06-08 + */ +public interface PwProductionSchedulingMapper +{ + /** + * 查询排产信息 + * + * @param id 排产信息ID + * @return 排产信息 + */ + public PwProductionScheduling selectPwProductionSchedulingById(Long id); + + /** + * 查询排产信息列表 + * + * @param pwProductionScheduling 排产信息 + * @return 排产信息集合 + */ + public List selectPwProductionSchedulingList(PwProductionScheduling pwProductionScheduling); + + /** + * 新增排产信息 + * + * @param pwProductionScheduling 排产信息 + * @return 结果 + */ + public int insertPwProductionScheduling(PwProductionScheduling pwProductionScheduling); + + /** + * 修改排产信息 + * + * @param pwProductionScheduling 排产信息 + * @return 结果 + */ + public int updatePwProductionScheduling(PwProductionScheduling pwProductionScheduling); + + /** + * 删除排产信息 + * + * @param id 排产信息ID + * @return 结果 + */ + public int deletePwProductionSchedulingById(Long id); + + /** + * 批量删除排产信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductionSchedulingByIds(Long[] ids); + + public List selectPwProductionSchedulingLists(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionSchedulingNumberMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionSchedulingNumberMapper.java new file mode 100644 index 0000000..32b1603 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwProductionSchedulingNumberMapper.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwProductionSchedulingNumber; + +/** + * 排产缺料统计Mapper接口 + * + * @author zhukangchao + * @date 2023-06-08 + */ +public interface PwProductionSchedulingNumberMapper +{ + /** + * 查询排产缺料统计 + * + * @param id 排产缺料统计ID + * @return 排产缺料统计 + */ + public PwProductionSchedulingNumber selectPwProductionSchedulingNumberById(Long id); + + /** + * 查询排产缺料统计列表 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 排产缺料统计集合 + */ + public List selectPwProductionSchedulingNumberList(PwProductionSchedulingNumber pwProductionSchedulingNumber); + + /** + * 新增排产缺料统计 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 结果 + */ + public int insertPwProductionSchedulingNumber(PwProductionSchedulingNumber pwProductionSchedulingNumber); + + /** + * 修改排产缺料统计 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 结果 + */ + public int updatePwProductionSchedulingNumber(PwProductionSchedulingNumber pwProductionSchedulingNumber); + + /** + * 删除排产缺料统计 + * + * @param id 排产缺料统计ID + * @return 结果 + */ + public int deletePwProductionSchedulingNumberById(Long id); + + /** + * 批量删除排产缺料统计 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwProductionSchedulingNumberByIds(Long[] ids); + + public void celerPwProductionSchedulingNumber(); + + public void insertPwProductionSchedulingNumbers(List list3); + + public List selectPwProductionSchedulingNumberLists(); + + public PwProductionSchedulingNumber selectPwProductionSchedulingNumberByNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseContractMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseContractMapper.java new file mode 100644 index 0000000..0894af7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseContractMapper.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwPurchaseContract; + +/** + * 采购合同Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PwPurchaseContractMapper +{ + /** + * 查询采购合同 + * + * @param id 采购合同ID + * @return 采购合同 + */ + public PwPurchaseContract selectPwPurchaseContractById(Long id); + + /** + * 查询采购合同列表 + * + * @param pwPurchaseContract 采购合同 + * @return 采购合同集合 + */ + public List selectPwPurchaseContractList(PwPurchaseContract pwPurchaseContract); + + /** + * 新增采购合同 + * + * @param pwPurchaseContract 采购合同 + * @return 结果 + */ + public int insertPwPurchaseContract(PwPurchaseContract pwPurchaseContract); + + /** + * 修改采购合同 + * + * @param pwPurchaseContract 采购合同 + * @return 结果 + */ + public int updatePwPurchaseContract(PwPurchaseContract pwPurchaseContract); + + /** + * 删除采购合同 + * + * @param id 采购合同ID + * @return 结果 + */ + public int deletePwPurchaseContractById(Long id); + + /** + * 批量删除采购合同 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwPurchaseContractByIds(Long[] ids); + + /** + * 根据合同编号查询合同信息 + * @param makeDocumentsCode + * @return + */ + public PwPurchaseContract selectPwPurchaseContractByCode(@Param("makeDocumentsCode") String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseContractMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseContractMaterialMapper.java new file mode 100644 index 0000000..7cf6ac1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseContractMaterialMapper.java @@ -0,0 +1,89 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; + +/** + * 物料和采购合同关联Mapper接口 + * + * @author zhukangchao + * @date 2020-07-06 + */ +public interface PwPurchaseContractMaterialMapper +{ + /** + * 查询物料和采购合同关联 + * + * @param id 物料和采购合同关联ID + * @return 物料和采购合同关联 + */ + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialById(Long id); + + /** + * 查询物料和采购合同关联列表 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 物料和采购合同关联集合 + */ + public List selectPwPurchaseContractMaterialList(PwPurchaseContractMaterial pwPurchaseContractMaterial); + + /** + * 新增物料和采购合同关联 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 结果 + */ + public int insertPwPurchaseContractMaterial(PwPurchaseContractMaterial pwPurchaseContractMaterial); + + /** + * 修改物料和采购合同关联 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 结果 + */ + public int updatePwPurchaseContractMaterial(PwPurchaseContractMaterial pwPurchaseContractMaterial); + + /** + * 删除物料和采购合同关联 + * + * @param id 物料和采购合同关联ID + * @return 结果 + */ + public int deletePwPurchaseContractMaterialById(Long id); + + /** + * 批量删除物料和采购合同关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwPurchaseContractMaterialByIds(Long[] ids); + + /** + * 根据名称和规格型号查询 + * @param name + * @param all + */ + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByFnAndName(@Param("name") String name, @Param("all")String all); + + public List selectPwPurchaseContractMaterialByPurchaseContractId(@Param("purchaseContractId") Long purchaseContractId); + + public List selectPwPurchaseContractMaterialByPurchaseContractIdList(); + + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByPurchaseContractIdAndNameAndFigureNumber(@Param("id")Long id,@Param("materialName") String materialName,@Param("specification") String specification); + + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByNameAndFigureNumberAndPurchaseContractNotNull(@Param("code") String code,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByNameAndFigureNumberAndPurchaseContract(@Param("code") String code,@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwPurchaseContractMaterialByFigureNumberAndAllGB(); + + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByCodeAndNameAndFigureNumber(@Param("code") String code,@Param("name") String name,@Param("figureNumber") String figureNumber,@Param("string") String string); + + public List selectPwPurchaseContractMaterialByNameAndFigureNumber(@Param("name") String name,@Param("figureNumber") String figureNumber); + + public List selectPwPurchaseContractMaterialByName(@Param("name") String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseMapper.java new file mode 100644 index 0000000..88b479b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwPurchaseMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPurchase; + +/** + * 部件Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PwPurchaseMapper +{ + /** + * 查询部件 + * + * @param id 部件ID + * @return 部件 + */ + public PwPurchase selectPwPurchaseById(Long id); + + /** + * 查询部件列表 + * + * @param pwPurchase 部件 + * @return 部件集合 + */ + public List selectPwPurchaseList(PwPurchase pwPurchase); + + /** + * 新增部件 + * + * @param pwPurchase 部件 + * @return 结果 + */ + public int insertPwPurchase(PwPurchase pwPurchase); + + /** + * 修改部件 + * + * @param pwPurchase 部件 + * @return 结果 + */ + public int updatePwPurchase(PwPurchase pwPurchase); + + /** + * 删除部件 + * + * @param id 部件ID + * @return 结果 + */ + public int deletePwPurchaseById(Long id); + + /** + * 批量删除部件 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwPurchaseByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwQrcodeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwQrcodeMapper.java new file mode 100644 index 0000000..61cec39 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwQrcodeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwQrcode; + +/** + * 二维码信息Mapper接口 + * + * @author zhukangchao + * @date 2023-04-19 + */ +public interface PwQrcodeMapper +{ + /** + * 查询二维码信息 + * + * @param id 二维码信息ID + * @return 二维码信息 + */ + public PwQrcode selectPwQrcodeById(Long id); + + /** + * 查询二维码信息列表 + * + * @param pwQrcode 二维码信息 + * @return 二维码信息集合 + */ + public List selectPwQrcodeList(PwQrcode pwQrcode); + + /** + * 新增二维码信息 + * + * @param pwQrcode 二维码信息 + * @return 结果 + */ + public int insertPwQrcode(PwQrcode pwQrcode); + + /** + * 修改二维码信息 + * + * @param pwQrcode 二维码信息 + * @return 结果 + */ + public int updatePwQrcode(PwQrcode pwQrcode); + + /** + * 删除二维码信息 + * + * @param id 二维码信息ID + * @return 结果 + */ + public int deletePwQrcodeById(Long id); + + /** + * 批量删除二维码信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwQrcodeByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwQuotationMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwQuotationMapper.java new file mode 100644 index 0000000..57ec1c7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwQuotationMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwQuotation; + +/** + * 报价单Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PwQuotationMapper +{ + /** + * 查询报价单 + * + * @param id 报价单ID + * @return 报价单 + */ + public PwQuotation selectPwQuotationById(Long id); + + /** + * 查询报价单列表 + * + * @param pwQuotation 报价单 + * @return 报价单集合 + */ + public List selectPwQuotationList(PwQuotation pwQuotation); + + /** + * 新增报价单 + * + * @param pwQuotation 报价单 + * @return 结果 + */ + public int insertPwQuotation(PwQuotation pwQuotation); + + /** + * 修改报价单 + * + * @param pwQuotation 报价单 + * @return 结果 + */ + public int updatePwQuotation(PwQuotation pwQuotation); + + /** + * 删除报价单 + * + * @param id 报价单ID + * @return 结果 + */ + public int deletePwQuotationById(Long id); + + /** + * 批量删除报价单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwQuotationByIds(Long[] ids); + + /** + * 根据项目名称查询报价单信息 + * @param itemName + * @return + */ + public PwQuotation selectPwQuotationByItemName(String itemName); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwSafetyInventoryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSafetyInventoryMapper.java new file mode 100644 index 0000000..e28bde8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSafetyInventoryMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwSafetyInventory; + +/** + * 安全库存明细Mapper接口 + * + * @author zhukangchao + * @date 2022-12-31 + */ +public interface PwSafetyInventoryMapper +{ + /** + * 查询安全库存明细 + * + * @param id 安全库存明细ID + * @return 安全库存明细 + */ + public PwSafetyInventory selectPwSafetyInventoryById(Long id); + + /** + * 查询安全库存明细列表 + * + * @param pwSafetyInventory 安全库存明细 + * @return 安全库存明细集合 + */ + public List selectPwSafetyInventoryList(PwSafetyInventory pwSafetyInventory); + + /** + * 新增安全库存明细 + * + * @param pwSafetyInventory 安全库存明细 + * @return 结果 + */ + public int insertPwSafetyInventory(PwSafetyInventory pwSafetyInventory); + + /** + * 修改安全库存明细 + * + * @param pwSafetyInventory 安全库存明细 + * @return 结果 + */ + public int updatePwSafetyInventory(PwSafetyInventory pwSafetyInventory); + + /** + * 删除安全库存明细 + * + * @param id 安全库存明细ID + * @return 结果 + */ + public int deletePwSafetyInventoryById(Long id); + + /** + * 批量删除安全库存明细 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwSafetyInventoryByIds(Long[] ids); + + public PwSafetyInventory selectPwSafetyInventoryByNameAndFigureNumber(@Param("materialName") String materialName,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwSchemeMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSchemeMapper.java new file mode 100644 index 0000000..b31c262 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSchemeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwScheme; + +/** + * 方案Mapper接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface PwSchemeMapper +{ + /** + * 查询方案 + * + * @param id 方案ID + * @return 方案 + */ + public PwScheme selectPwSchemeById(Long id); + + /** + * 查询方案列表 + * + * @param pwScheme 方案 + * @return 方案集合 + */ + public List selectPwSchemeList(PwScheme pwScheme); + + /** + * 新增方案 + * + * @param pwScheme 方案 + * @return 结果 + */ + public int insertPwScheme(PwScheme pwScheme); + + /** + * 修改方案 + * + * @param pwScheme 方案 + * @return 结果 + */ + public int updatePwScheme(PwScheme pwScheme); + + /** + * 删除方案 + * + * @param id 方案ID + * @return 结果 + */ + public int deletePwSchemeById(Long id); + + /** + * 批量删除方案 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwSchemeByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwScrapInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwScrapInfoMapper.java new file mode 100644 index 0000000..80d4170 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwScrapInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwScrapInfo; + +/** + * 报废信息Mapper接口 + * + * @author zhukangchao + * @date 2023-04-01 + */ +public interface PwScrapInfoMapper +{ + /** + * 查询报废信息 + * + * @param id 报废信息ID + * @return 报废信息 + */ + public PwScrapInfo selectPwScrapInfoById(Long id); + + /** + * 查询报废信息列表 + * + * @param pwScrapInfo 报废信息 + * @return 报废信息集合 + */ + public List selectPwScrapInfoList(PwScrapInfo pwScrapInfo); + + /** + * 新增报废信息 + * + * @param pwScrapInfo 报废信息 + * @return 结果 + */ + public int insertPwScrapInfo(PwScrapInfo pwScrapInfo); + + /** + * 修改报废信息 + * + * @param pwScrapInfo 报废信息 + * @return 结果 + */ + public int updatePwScrapInfo(PwScrapInfo pwScrapInfo); + + /** + * 删除报废信息 + * + * @param id 报废信息ID + * @return 结果 + */ + public int deletePwScrapInfoById(Long id); + + /** + * 批量删除报废信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwScrapInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwSpectacularsInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSpectacularsInfoMapper.java new file mode 100644 index 0000000..095caaa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSpectacularsInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwSpectacularsInfo; + +/** + * 新生产看板信息Mapper接口 + * + * @author zhukangchao + * @date 2023-04-03 + */ +public interface PwSpectacularsInfoMapper +{ + /** + * 查询新生产看板信息 + * + * @param id 新生产看板信息ID + * @return 新生产看板信息 + */ + public PwSpectacularsInfo selectPwSpectacularsInfoById(Long id); + + /** + * 查询新生产看板信息列表 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 新生产看板信息集合 + */ + public List selectPwSpectacularsInfoList(PwSpectacularsInfo pwSpectacularsInfo); + + /** + * 新增新生产看板信息 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 结果 + */ + public int insertPwSpectacularsInfo(PwSpectacularsInfo pwSpectacularsInfo); + + /** + * 修改新生产看板信息 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 结果 + */ + public int updatePwSpectacularsInfo(PwSpectacularsInfo pwSpectacularsInfo); + + /** + * 删除新生产看板信息 + * + * @param id 新生产看板信息ID + * @return 结果 + */ + public int deletePwSpectacularsInfoById(Long id); + + /** + * 批量删除新生产看板信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwSpectacularsInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwSpectacularsMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSpectacularsMapper.java new file mode 100644 index 0000000..9ea53b4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwSpectacularsMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwSpectaculars; + +/** + * 生产看板Mapper接口 + * + * @author zhukangchao + * @date 2023-02-01 + */ +public interface PwSpectacularsMapper +{ + /** + * 查询生产看板 + * + * @param id 生产看板ID + * @return 生产看板 + */ + public PwSpectaculars selectPwSpectacularsById(Long id); + + /** + * 查询生产看板列表 + * + * @param pwSpectaculars 生产看板 + * @return 生产看板集合 + */ + public List selectPwSpectacularsList(PwSpectaculars pwSpectaculars); + + /** + * 新增生产看板 + * + * @param pwSpectaculars 生产看板 + * @return 结果 + */ + public int insertPwSpectaculars(PwSpectaculars pwSpectaculars); + + /** + * 修改生产看板 + * + * @param pwSpectaculars 生产看板 + * @return 结果 + */ + public int updatePwSpectaculars(PwSpectaculars pwSpectaculars); + + /** + * 删除生产看板 + * + * @param id 生产看板ID + * @return 结果 + */ + public int deletePwSpectacularsById(Long id); + + /** + * 批量删除生产看板 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwSpectacularsByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwStoresRequisitionMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwStoresRequisitionMapper.java new file mode 100644 index 0000000..abccfff --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwStoresRequisitionMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwStoresRequisition; + +/** + * 物品领料单Mapper接口 + * + * @author zhukangchao + * @date 2022-03-14 + */ +public interface PwStoresRequisitionMapper +{ + /** + * 查询物品领料单 + * + * @param id 物品领料单ID + * @return 物品领料单 + */ + public PwStoresRequisition selectPwStoresRequisitionById(Long id); + + /** + * 查询物品领料单列表 + * + * @param pwStoresRequisition 物品领料单 + * @return 物品领料单集合 + */ + public List selectPwStoresRequisitionList(PwStoresRequisition pwStoresRequisition); + + /** + * 新增物品领料单 + * + * @param pwStoresRequisition 物品领料单 + * @return 结果 + */ + public int insertPwStoresRequisition(PwStoresRequisition pwStoresRequisition); + + /** + * 修改物品领料单 + * + * @param pwStoresRequisition 物品领料单 + * @return 结果 + */ + public int updatePwStoresRequisition(PwStoresRequisition pwStoresRequisition); + + /** + * 删除物品领料单 + * + * @param id 物品领料单ID + * @return 结果 + */ + public int deletePwStoresRequisitionById(Long id); + + /** + * 批量删除物品领料单 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwStoresRequisitionByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwStoresRequistionDetailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwStoresRequistionDetailMapper.java new file mode 100644 index 0000000..1739e3a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwStoresRequistionDetailMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; + +/** + * 领料单详情Mapper接口 + * + * @author zhukangchao + * @date 2022-03-14 + */ +public interface PwStoresRequistionDetailMapper +{ + /** + * 查询领料单详情 + * + * @param id 领料单详情ID + * @return 领料单详情 + */ + public PwStoresRequistionDetail selectPwStoresRequistionDetailById(Long id); + + /** + * 查询领料单详情列表 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 领料单详情集合 + */ + public List selectPwStoresRequistionDetailList(PwStoresRequistionDetail pwStoresRequistionDetail); + + /** + * 新增领料单详情 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 结果 + */ + public int insertPwStoresRequistionDetail(PwStoresRequistionDetail pwStoresRequistionDetail); + + /** + * 修改领料单详情 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 结果 + */ + public int updatePwStoresRequistionDetail(PwStoresRequistionDetail pwStoresRequistionDetail); + + /** + * 删除领料单详情 + * + * @param id 领料单详情ID + * @return 结果 + */ + public int deletePwStoresRequistionDetailById(Long id); + + /** + * 批量删除领料单详情 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwStoresRequistionDetailByIds(Long[] ids); + + public List selectPwStoresRequistionDetailByStoresRequistionId(@Param("id") Long id); + + public List selectPwStoresRequistionDetailByName(@Param("materialName") String materialName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskBomMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskBomMapper.java new file mode 100644 index 0000000..64d1b4f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskBomMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTaskBom; + +/** + * 任务零部件关联Mapper接口 + * + * @author zhukangchao + * @date 2020-08-20 + */ +public interface PwTaskBomMapper +{ + /** + * 查询任务零部件关联 + * + * @param id 任务零部件关联ID + * @return 任务零部件关联 + */ + public PwTaskBom selectPwTaskBomById(Long id); + + /** + * 查询任务零部件关联列表 + * + * @param pwTaskBom 任务零部件关联 + * @return 任务零部件关联集合 + */ + public List selectPwTaskBomList(PwTaskBom pwTaskBom); + + /** + * 新增任务零部件关联 + * + * @param pwTaskBom 任务零部件关联 + * @return 结果 + */ + public int insertPwTaskBom(PwTaskBom pwTaskBom); + + /** + * 修改任务零部件关联 + * + * @param pwTaskBom 任务零部件关联 + * @return 结果 + */ + public int updatePwTaskBom(PwTaskBom pwTaskBom); + + /** + * 删除任务零部件关联 + * + * @param id 任务零部件关联ID + * @return 结果 + */ + public int deletePwTaskBomById(Long id); + + /** + * 批量删除任务零部件关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwTaskBomByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskMapper.java new file mode 100644 index 0000000..8e60f2e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskMapper.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTask; + +import io.lettuce.core.dynamic.annotation.Param; + +/** + * 任务Mapper接口 + * + * @author zhukangchao + * @date 2020-08-11 + */ +public interface PwTaskMapper +{ + /** + * 查询任务 + * + * @param id 任务ID + * @return 任务 + */ + public PwTask selectPwTaskById(Long id); + + /** + * 查询任务列表 + * + * @param pwTask 任务 + * @return 任务集合 + */ + public List selectPwTaskList(PwTask pwTask); + + /** + * 新增任务 + * + * @param pwTask 任务 + * @return 结果 + */ + public int insertPwTask(PwTask pwTask); + + /** + * 修改任务 + * + * @param pwTask 任务 + * @return 结果 + */ + public int updatePwTask(PwTask pwTask); + + /** + * 删除任务 + * + * @param id 任务ID + * @return 结果 + */ + public int deletePwTaskById(Long id); + + /** + * 批量删除任务 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwTaskByIds(Long[] ids); + + public PwTask selectPwTaskByTaskCode(@Param("productiveTaskCode") String productiveTaskCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskOverTimeInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskOverTimeInfoMapper.java new file mode 100644 index 0000000..bc4506b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTaskOverTimeInfoMapper.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTaskOverTimeInfo; + +/** + * 任务超时信息Mapper接口 + * + * @author zhukangchao + * @date 2023-09-01 + */ +public interface PwTaskOverTimeInfoMapper +{ + /** + * 查询任务超时信息 + * + * @param id 任务超时信息ID + * @return 任务超时信息 + */ + public PwTaskOverTimeInfo selectPwTaskOverTimeInfoById(Long id); + + /** + * 查询任务超时信息列表 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 任务超时信息集合 + */ + public List selectPwTaskOverTimeInfoList(PwTaskOverTimeInfo pwTaskOverTimeInfo); + + /** + * 新增任务超时信息 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 结果 + */ + public int insertPwTaskOverTimeInfo(PwTaskOverTimeInfo pwTaskOverTimeInfo); + + /** + * 修改任务超时信息 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 结果 + */ + public int updatePwTaskOverTimeInfo(PwTaskOverTimeInfo pwTaskOverTimeInfo); + + /** + * 删除任务超时信息 + * + * @param id 任务超时信息ID + * @return 结果 + */ + public int deletePwTaskOverTimeInfoById(Long id); + + /** + * 批量删除任务超时信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwTaskOverTimeInfoByIds(Long[] ids); + + public void insertPwTaskOverTimeInfos(List lists); + + public void eliminate(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwTicketInfoMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTicketInfoMapper.java new file mode 100644 index 0000000..359f8d6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwTicketInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTicketInfo; + +/** + * 处罚单信息Mapper接口 + * + * @author zhukangchao + * @date 2023-08-01 + */ +public interface PwTicketInfoMapper +{ + /** + * 查询处罚单信息 + * + * @param id 处罚单信息ID + * @return 处罚单信息 + */ + public PwTicketInfo selectPwTicketInfoById(Long id); + + /** + * 查询处罚单信息列表 + * + * @param pwTicketInfo 处罚单信息 + * @return 处罚单信息集合 + */ + public List selectPwTicketInfoList(PwTicketInfo pwTicketInfo); + + /** + * 新增处罚单信息 + * + * @param pwTicketInfo 处罚单信息 + * @return 结果 + */ + public int insertPwTicketInfo(PwTicketInfo pwTicketInfo); + + /** + * 修改处罚单信息 + * + * @param pwTicketInfo 处罚单信息 + * @return 结果 + */ + public int updatePwTicketInfo(PwTicketInfo pwTicketInfo); + + /** + * 删除处罚单信息 + * + * @param id 处罚单信息ID + * @return 结果 + */ + public int deletePwTicketInfoById(Long id); + + /** + * 批量删除处罚单信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwTicketInfoByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/PwUserEmailMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/PwUserEmailMapper.java new file mode 100644 index 0000000..bc5f465 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/PwUserEmailMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwUserEmail; + +/** + * 邮箱Mapper接口 + * + * @author zhukangchao + * @date 2022-09-24 + */ +public interface PwUserEmailMapper +{ + /** + * 查询邮箱 + * + * @param id 邮箱ID + * @return 邮箱 + */ + public PwUserEmail selectPwUserEmailById(Long id); + + /** + * 查询邮箱列表 + * + * @param pwUserEmail 邮箱 + * @return 邮箱集合 + */ + public List selectPwUserEmailList(PwUserEmail pwUserEmail); + + /** + * 新增邮箱 + * + * @param pwUserEmail 邮箱 + * @return 结果 + */ + public int insertPwUserEmail(PwUserEmail pwUserEmail); + + /** + * 修改邮箱 + * + * @param pwUserEmail 邮箱 + * @return 结果 + */ + public int updatePwUserEmail(PwUserEmail pwUserEmail); + + /** + * 删除邮箱 + * + * @param id 邮箱ID + * @return 结果 + */ + public int deletePwUserEmailById(Long id); + + /** + * 批量删除邮箱 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deletePwUserEmailByIds(Long[] ids); + + public PwUserEmail selectPwUserEmailByName(@Param("userName") String userName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/SysConfigIniMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/SysConfigIniMapper.java new file mode 100644 index 0000000..ebc982a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/SysConfigIniMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.SysConfigIni; + +/** + * 图纸配置 +Mapper接口 + * + * @author zhukangchao + * @date 2021-03-05 + */ +public interface SysConfigIniMapper +{ + /** + * 查询图纸配置 + + * + * @param id 图纸配置 +ID + * @return 图纸配置 + + */ + public SysConfigIni selectSysConfigIniById(Long id); + + /** + * 查询图纸配置 +列表 + * + * @param sysConfigIni 图纸配置 + + * @return 图纸配置 +集合 + */ + public List selectSysConfigIniList(SysConfigIni sysConfigIni); + + /** + * 新增图纸配置 + + * + * @param sysConfigIni 图纸配置 + + * @return 结果 + */ + public int insertSysConfigIni(SysConfigIni sysConfigIni); + + /** + * 修改图纸配置 + + * + * @param sysConfigIni 图纸配置 + + * @return 结果 + */ + public int updateSysConfigIni(SysConfigIni sysConfigIni); + + /** + * 删除图纸配置 + + * + * @param id 图纸配置 +ID + * @return 结果 + */ + public int deleteSysConfigIniById(Long id); + + /** + * 批量删除图纸配置 + + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysConfigIniByIds(Long[] ids); + + public SysConfigIni selectSysConfigIniByFileType(String fileType); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/YcBomNumberPreliminaryInquiryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/YcBomNumberPreliminaryInquiryMapper.java new file mode 100644 index 0000000..e716aba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/YcBomNumberPreliminaryInquiryMapper.java @@ -0,0 +1,82 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.YcBomNumberPreliminaryInquiry; + +/** + * 预查询点件Mapper接口 + * + * @author zhukangchao + * @date 2021-12-08 + */ +public interface YcBomNumberPreliminaryInquiryMapper +{ + /** + * 查询预查询点件 + * + * @param id 预查询点件ID + * @return 预查询点件 + */ + public YcBomNumberPreliminaryInquiry selectYcBomNumberPreliminaryInquiryById(Long id); + + /** + * 查询预查询点件列表 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 预查询点件集合 + */ + public List selectYcBomNumberPreliminaryInquiryList(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry); + + /** + * 新增预查询点件 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 结果 + */ + public int insertYcBomNumberPreliminaryInquiry(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry); + + /** + * 修改预查询点件 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 结果 + */ + public int updateYcBomNumberPreliminaryInquiry(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry); + + /** + * 删除预查询点件 + * + * @param id 预查询点件ID + * @return 结果 + */ + public int deleteYcBomNumberPreliminaryInquiryById(Long id); + + /** + * 批量删除预查询点件 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteYcBomNumberPreliminaryInquiryByIds(Long[] ids); + + /** + * 批量添加 + * @param list + * @return + */ + public int insertYcBomNumberPreliminaryInquirys(List list); + + /** + * 根据上级图号和型号及code查询 + * @param figureNumber + * @param typeName + * @param productionCode + * @param productionCode2 + * @param typeName2 + * @return + */ + public List selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(@Param("figureNumber")String figureNumber,@Param("figureNumber2")String figureNumber2,@Param("figureNumber3")String figureNumber3,@Param("typeName") String typeName,@Param("productionCode") String productionCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/YcBomNumberTwoPreliminaryInquiryMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/YcBomNumberTwoPreliminaryInquiryMapper.java new file mode 100644 index 0000000..7fc88ac --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/YcBomNumberTwoPreliminaryInquiryMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.YcBomNumberTwoPreliminaryInquiry; + +/** + * 预查询计算后的点件Mapper接口 + * + * @author zhukangchao + * @date 2021-12-08 + */ +public interface YcBomNumberTwoPreliminaryInquiryMapper +{ + /** + * 查询预查询计算后的点件 + * + * @param id 预查询计算后的点件ID + * @return 预查询计算后的点件 + */ + public YcBomNumberTwoPreliminaryInquiry selectYcBomNumberTwoPreliminaryInquiryById(Long id); + + /** + * 查询预查询计算后的点件列表 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 预查询计算后的点件集合 + */ + public List selectYcBomNumberTwoPreliminaryInquiryList(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry); + + /** + * 新增预查询计算后的点件 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 结果 + */ + public int insertYcBomNumberTwoPreliminaryInquiry(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry); + + /** + * 修改预查询计算后的点件 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 结果 + */ + public int updateYcBomNumberTwoPreliminaryInquiry(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry); + + /** + * 删除预查询计算后的点件 + * + * @param id 预查询计算后的点件ID + * @return 结果 + */ + public int deleteYcBomNumberTwoPreliminaryInquiryById(Long id); + + /** + * 批量删除预查询计算后的点件 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteYcBomNumberTwoPreliminaryInquiryByIds(Long[] ids); + + public YcBomNumberTwoPreliminaryInquiry selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(@Param("productionCode")String productionCode,@Param("name") String name,@Param("figureNumber") String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/mapper/YcProductMapper.java b/evo/src/main/java/com/ruoyi/project/management/mapper/YcProductMapper.java new file mode 100644 index 0000000..0d62af3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/mapper/YcProductMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.mapper; + +import java.util.List; +import com.ruoyi.project.management.domain.YcProduct; + +/** + * 预查询产品Mapper接口 + * + * @author zhukangchao + * @date 2021-12-08 + */ +public interface YcProductMapper +{ + /** + * 查询预查询产品 + * + * @param int 预查询产品ID + * @return 预查询产品 + */ + public YcProduct selectYcProductById(Long id); + + /** + * 查询预查询产品列表 + * + * @param ycProduct 预查询产品 + * @return 预查询产品集合 + */ + public List selectYcProductList(YcProduct ycProduct); + + /** + * 新增预查询产品 + * + * @param ycProduct 预查询产品 + * @return 结果 + */ + public int insertYcProduct(YcProduct ycProduct); + + /** + * 修改预查询产品 + * + * @param ycProduct 预查询产品 + * @return 结果 + */ + public int updateYcProduct(YcProduct ycProduct); + + /** + * 删除预查询产品 + * + * @param int 预查询产品ID + * @return 结果 + */ + public int deleteYcProductById(Long id); + + /** + * 批量删除预查询产品 + * + * @param ints 需要删除的数据ID + * @return 结果 + */ + public int deleteYcProductByIds(Long[] ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IAutoInventoryIssueService.java b/evo/src/main/java/com/ruoyi/project/management/service/IAutoInventoryIssueService.java new file mode 100644 index 0000000..57e8774 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IAutoInventoryIssueService.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.AutoInventoryIssue; + +/** + * 安全库存出单Service接口 + * + * @author chenyongjiang + * @date 2024-02-19 + */ +public interface IAutoInventoryIssueService +{ + /** + * 查询安全库存出单 + * + * @param id 安全库存出单ID + * @return 安全库存出单 + */ + public AutoInventoryIssue selectAutoInventoryIssueById(Long id); + + /** + * 查询安全库存出单列表 + * + * @param autoInventoryIssue 安全库存出单 + * @return 安全库存出单集合 + */ + public List selectAutoInventoryIssueList(AutoInventoryIssue autoInventoryIssue); + + /** + * 新增安全库存出单 + * + * @param autoInventoryIssue 安全库存出单 + * @return 结果 + */ + public int insertAutoInventoryIssue(AutoInventoryIssue autoInventoryIssue); + + /** + * 修改安全库存出单 + * + * @param autoInventoryIssue 安全库存出单 + * @return 结果 + */ + public int updateAutoInventoryIssue(AutoInventoryIssue autoInventoryIssue); + + /** + * 批量删除安全库存出单 + * + * @param ids 需要删除的安全库存出单ID + * @return 结果 + */ + public int deleteAutoInventoryIssueByIds(Long[] ids); + + /** + * 删除安全库存出单信息 + * + * @param id 安全库存出单ID + * @return 结果 + */ + public int deleteAutoInventoryIssueById(Long id); + + /** + * 根据图号查询安全库存出单 + * + * @param figureNumber 安全库存出单ID + * @return 安全库存出单 + */ + public AutoInventoryIssue selectAutoInventoryIssueByFigureNumber(String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IBaseQuestionService.java b/evo/src/main/java/com/ruoyi/project/management/service/IBaseQuestionService.java new file mode 100644 index 0000000..787c7a5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IBaseQuestionService.java @@ -0,0 +1,54 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.project.management.domain.BaseQuestion; + +/** + * 问题处理Service接口 + * + * @author zhukangchao + * @date 2023-10-07 + */ +public interface IBaseQuestionService +{ + /** + * 查询问题处理 + * + * @param questionId 问题处理ID + * @return 问题处理 + */ + public BaseQuestion selectBaseQuestionById(Long questionId); + + /** + * 查询问题处理列表 + * + * @param baseQuestion 问题处理 + * @return 问题处理集合 + */ + public List selectBaseQuestionList(BaseQuestion baseQuestion); + + /** + * 新增问题处理 + * + * @param baseQuestion 问题处理 + * @return 结果 + */ + public int insertBaseQuestion(BaseQuestion baseQuestion); + + /** + * 修改问题处理 + * + * @param baseQuestion 问题处理 + * @return 结果 + */ + public int updateBaseQuestion(BaseQuestion baseQuestion); + + /** + * 删除问题处理信息 + * + * @param questionId 问题处理ID + * @return 结果 + */ + public int deleteBaseQuestionById(Long questionId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICadMaterialInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICadMaterialInfoService.java new file mode 100644 index 0000000..e6acbef --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICadMaterialInfoService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CadMaterialInfo; + +/** + * CAD物料明细Service接口 + * + * @author zhukangchao + * @date 2023-06-13 + */ +public interface ICadMaterialInfoService +{ + /** + * 查询CAD物料明细 + * + * @param id CAD物料明细ID + * @return CAD物料明细 + */ + public CadMaterialInfo selectCadMaterialInfoById(Long id); + + /** + * 查询CAD物料明细列表 + * + * @param cadMaterialInfo CAD物料明细 + * @return CAD物料明细集合 + */ + public List selectCadMaterialInfoList(CadMaterialInfo cadMaterialInfo); + + /** + * 新增CAD物料明细 + * + * @param cadMaterialInfo CAD物料明细 + * @return 结果 + */ + public int insertCadMaterialInfo(CadMaterialInfo cadMaterialInfo); + + /** + * 修改CAD物料明细 + * + * @param cadMaterialInfo CAD物料明细 + * @return 结果 + */ + public int updateCadMaterialInfo(CadMaterialInfo cadMaterialInfo); + + /** + * 批量删除CAD物料明细 + * + * @param ids 需要删除的CAD物料明细ID + * @return 结果 + */ + public int deleteCadMaterialInfoByIds(Long[] ids); + + /** + * 删除CAD物料明细信息 + * + * @param id CAD物料明细ID + * @return 结果 + */ + public int deleteCadMaterialInfoById(Long id); + + public CadMaterialInfo selectCadMaterialInfoByNameAndFigureNumber(String name, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceRecordDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceRecordDetailService.java new file mode 100644 index 0000000..3030389 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceRecordDetailService.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetail; + +/** + * 考勤记录Service接口 + * + * @author zhukangchao + * @date 2022-10-21 + */ +public interface ICwAttendanceRecordDetailService +{ + /** + * 查询考勤记录 + * + * @param id 考勤记录ID + * @return 考勤记录 + */ + public CwAttendanceRecordDetail selectCwAttendanceRecordDetailById(Long id); + + /** + * 查询考勤记录列表 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 考勤记录集合 + */ + public List selectCwAttendanceRecordDetailList(CwAttendanceRecordDetail cwAttendanceRecordDetail); + + /** + * 新增考勤记录 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 结果 + */ + public int insertCwAttendanceRecordDetail(CwAttendanceRecordDetail cwAttendanceRecordDetail); + + /** + * 修改考勤记录 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 结果 + */ + public int updateCwAttendanceRecordDetail(CwAttendanceRecordDetail cwAttendanceRecordDetail); + + /** + * 批量删除考勤记录 + * + * @param ids 需要删除的考勤记录ID + * @return 结果 + */ + public int deleteCwAttendanceRecordDetailByIds(Long[] ids); + + /** + * 删除考勤记录信息 + * + * @param id 考勤记录ID + * @return 结果 + */ + public int deleteCwAttendanceRecordDetailById(Long id); + + public List selectCwAttendanceRecordDetailByCode(String userId); + + public List selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(String userId, Date date, String string); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceService.java new file mode 100644 index 0000000..9b1aa47 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceService.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwAttendance; + +/** + * 考勤记录Service接口 + * + * @author zhukangchao + * @date 2021-11-02 + */ +public interface ICwAttendanceService +{ + /** + * 查询考勤记录 + * + * @param id 考勤记录ID + * @return 考勤记录 + */ + public CwAttendance selectCwAttendanceById(Long id); + + /** + * 查询考勤记录列表 + * + * @param cwAttendance 考勤记录 + * @return 考勤记录集合 + */ + public List selectCwAttendanceList(CwAttendance cwAttendance); + + /** + * 新增考勤记录 + * + * @param cwAttendance 考勤记录 + * @return 结果 + */ + public int insertCwAttendance(CwAttendance cwAttendance); + + /** + * 修改考勤记录 + * + * @param cwAttendance 考勤记录 + * @return 结果 + */ + public int updateCwAttendance(CwAttendance cwAttendance); + + /** + * 批量删除考勤记录 + * + * @param ids 需要删除的考勤记录ID + * @return 结果 + */ + public int deleteCwAttendanceByIds(Long[] ids); + + /** + * 删除考勤记录信息 + * + * @param id 考勤记录ID + * @return 结果 + */ + public int deleteCwAttendanceById(Long id); + + /** + * 根据名称和日期查询信息记录 + * @param name + * @param riqi + * @return + */ + public CwAttendance selectCwAttendanceByNameAndBelongsToDate(String name, String riqi); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceUserService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceUserService.java new file mode 100644 index 0000000..5fa8a29 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwAttendanceUserService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwAttendanceUser; + +/** + * 员工信息Service接口 + * + * @author zhukangchao + * @date 2022-10-21 + */ +public interface ICwAttendanceUserService +{ + /** + * 查询员工信息 + * + * @param id 员工信息ID + * @return 员工信息 + */ + public CwAttendanceUser selectCwAttendanceUserById(Long id); + + /** + * 查询员工信息列表 + * + * @param cwAttendanceUser 员工信息 + * @return 员工信息集合 + */ + public List selectCwAttendanceUserList(CwAttendanceUser cwAttendanceUser); + + /** + * 新增员工信息 + * + * @param cwAttendanceUser 员工信息 + * @return 结果 + */ + public int insertCwAttendanceUser(CwAttendanceUser cwAttendanceUser); + + /** + * 修改员工信息 + * + * @param cwAttendanceUser 员工信息 + * @return 结果 + */ + public int updateCwAttendanceUser(CwAttendanceUser cwAttendanceUser); + + /** + * 批量删除员工信息 + * + * @param ids 需要删除的员工信息ID + * @return 结果 + */ + public int deleteCwAttendanceUserByIds(Long[] ids); + + /** + * 删除员工信息信息 + * + * @param id 员工信息ID + * @return 结果 + */ + public int deleteCwAttendanceUserById(Long id); + + public CwAttendanceUser selectCwAttendanceUserByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwButtonService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwButtonService.java new file mode 100644 index 0000000..aa65afa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwButtonService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwButton; + +/** + * 按钮信息Service接口 + * + * @author zhukangchao + * @date 2022-10-31 + */ +public interface ICwButtonService +{ + /** + * 查询按钮信息 + * + * @param id 按钮信息ID + * @return 按钮信息 + */ + public CwButton selectCwButtonById(Long id); + + /** + * 查询按钮信息列表 + * + * @param cwButton 按钮信息 + * @return 按钮信息集合 + */ + public List selectCwButtonList(CwButton cwButton); + + /** + * 新增按钮信息 + * + * @param cwButton 按钮信息 + * @return 结果 + */ + public int insertCwButton(CwButton cwButton); + + /** + * 修改按钮信息 + * + * @param cwButton 按钮信息 + * @return 结果 + */ + public int updateCwButton(CwButton cwButton); + + /** + * 批量删除按钮信息 + * + * @param ids 需要删除的按钮信息ID + * @return 结果 + */ + public int deleteCwButtonByIds(Long[] ids); + + /** + * 删除按钮信息信息 + * + * @param id 按钮信息ID + * @return 结果 + */ + public int deleteCwButtonById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwCostAnalysisService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwCostAnalysisService.java new file mode 100644 index 0000000..47eb157 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwCostAnalysisService.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwCostAnalysis; + +/** + * 成本分析信息Service接口 + * + * @author zhukangchao + * @date 2023-08-11 + */ +public interface ICwCostAnalysisService +{ + /** + * 查询成本分析信息 + * + * @param id 成本分析信息ID + * @return 成本分析信息 + */ + public CwCostAnalysis selectCwCostAnalysisById(Long id); + + /** + * 查询成本分析信息列表 + * + * @param cwCostAnalysis 成本分析信息 + * @return 成本分析信息集合 + */ + public List selectCwCostAnalysisList(CwCostAnalysis cwCostAnalysis); + + /** + * 新增成本分析信息 + * + * @param cwCostAnalysis 成本分析信息 + * @return 结果 + */ + public int insertCwCostAnalysis(CwCostAnalysis cwCostAnalysis); + + /** + * 修改成本分析信息 + * + * @param cwCostAnalysis 成本分析信息 + * @return 结果 + */ + public int updateCwCostAnalysis(CwCostAnalysis cwCostAnalysis); + + /** + * 批量删除成本分析信息 + * + * @param ids 需要删除的成本分析信息ID + * @return 结果 + */ + public int deleteCwCostAnalysisByIds(Long[] ids); + + /** + * 删除成本分析信息信息 + * + * @param id 成本分析信息ID + * @return 结果 + */ + public int deleteCwCostAnalysisById(Long id); + + public int insertCwCostAnalysiss(List list2); + + public int deleteCwCostAnalysisBySparedFour(Long long1); + + public List selectCwCostAnalysisByUuid(String uuid); + + public List selectCwCostAnalysisByStatisticsId(Long id); + + public int updateCwCostAnalysiss(List list2); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwCostStatisticsService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwCostStatisticsService.java new file mode 100644 index 0000000..c54bf95 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwCostStatisticsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwCostStatistics; + +/** + * 成本统计信息Service接口 + * + * @author zhukangchao + * @date 2023-08-12 + */ +public interface ICwCostStatisticsService +{ + /** + * 查询成本统计信息 + * + * @param id 成本统计信息ID + * @return 成本统计信息 + */ + public CwCostStatistics selectCwCostStatisticsById(Long id); + + /** + * 查询成本统计信息列表 + * + * @param cwCostStatistics 成本统计信息 + * @return 成本统计信息集合 + */ + public List selectCwCostStatisticsList(CwCostStatistics cwCostStatistics); + + /** + * 新增成本统计信息 + * + * @param cwCostStatistics 成本统计信息 + * @return 结果 + */ + public int insertCwCostStatistics(CwCostStatistics cwCostStatistics); + + /** + * 修改成本统计信息 + * + * @param cwCostStatistics 成本统计信息 + * @return 结果 + */ + public int updateCwCostStatistics(CwCostStatistics cwCostStatistics); + + /** + * 批量删除成本统计信息 + * + * @param ids 需要删除的成本统计信息ID + * @return 结果 + */ + public int deleteCwCostStatisticsByIds(Long[] ids); + + /** + * 删除成本统计信息信息 + * + * @param id 成本统计信息ID + * @return 结果 + */ + public int deleteCwCostStatisticsById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwDepartmentService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwDepartmentService.java new file mode 100644 index 0000000..030946d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwDepartmentService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwDepartment; + +/** + * 财务部门Service接口 + * + * @author zhukangchao + * @date 2021-10-25 + */ +public interface ICwDepartmentService +{ + /** + * 查询财务部门 + * + * @param id 财务部门ID + * @return 财务部门 + */ + public CwDepartment selectCwDepartmentById(Long id); + + /** + * 查询财务部门列表 + * + * @param cwDepartment 财务部门 + * @return 财务部门集合 + */ + public List selectCwDepartmentList(CwDepartment cwDepartment); + + /** + * 新增财务部门 + * + * @param cwDepartment 财务部门 + * @return 结果 + */ + public int insertCwDepartment(CwDepartment cwDepartment); + + /** + * 修改财务部门 + * + * @param cwDepartment 财务部门 + * @return 结果 + */ + public int updateCwDepartment(CwDepartment cwDepartment); + + /** + * 批量删除财务部门 + * + * @param ids 需要删除的财务部门ID + * @return 结果 + */ + public int deleteCwDepartmentByIds(Long[] ids); + + /** + * 删除财务部门信息 + * + * @param id 财务部门ID + * @return 结果 + */ + public int deleteCwDepartmentById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwDimissionService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwDimissionService.java new file mode 100644 index 0000000..0edc726 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwDimissionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwDimission; + +/** + * 员工离职单Service接口 + * + * @author zhukangchao + * @date 2022-04-09 + */ +public interface ICwDimissionService +{ + /** + * 查询员工离职单 + * + * @param id 员工离职单ID + * @return 员工离职单 + */ + public CwDimission selectCwDimissionById(Long id); + + /** + * 查询员工离职单列表 + * + * @param cwDimission 员工离职单 + * @return 员工离职单集合 + */ + public List selectCwDimissionList(CwDimission cwDimission); + + /** + * 新增员工离职单 + * + * @param cwDimission 员工离职单 + * @return 结果 + */ + public int insertCwDimission(CwDimission cwDimission); + + /** + * 修改员工离职单 + * + * @param cwDimission 员工离职单 + * @return 结果 + */ + public int updateCwDimission(CwDimission cwDimission); + + /** + * 批量删除员工离职单 + * + * @param ids 需要删除的员工离职单ID + * @return 结果 + */ + public int deleteCwDimissionByIds(Long[] ids); + + /** + * 删除员工离职单信息 + * + * @param id 员工离职单ID + * @return 结果 + */ + public int deleteCwDimissionById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwEmployeeInformationService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwEmployeeInformationService.java new file mode 100644 index 0000000..f110abd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwEmployeeInformationService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwEmployeeInformation; + +/** + * 员工信息Service接口 + * + * @author zhukangchao + * @date 2021-10-25 + */ +public interface ICwEmployeeInformationService +{ + /** + * 查询员工信息 + * + * @param id 员工信息ID + * @return 员工信息 + */ + public CwEmployeeInformation selectCwEmployeeInformationById(Long id); + + /** + * 查询员工信息列表 + * + * @param cwEmployeeInformation 员工信息 + * @return 员工信息集合 + */ + public List selectCwEmployeeInformationList(CwEmployeeInformation cwEmployeeInformation); + + /** + * 新增员工信息 + * + * @param cwEmployeeInformation 员工信息 + * @return 结果 + */ + public int insertCwEmployeeInformation(CwEmployeeInformation cwEmployeeInformation); + + /** + * 修改员工信息 + * + * @param cwEmployeeInformation 员工信息 + * @return 结果 + */ + public int updateCwEmployeeInformation(CwEmployeeInformation cwEmployeeInformation); + + /** + * 批量删除员工信息 + * + * @param ids 需要删除的员工信息ID + * @return 结果 + */ + public int deleteCwEmployeeInformationByIds(Long[] ids); + + /** + * 删除员工信息信息 + * + * @param id 员工信息ID + * @return 结果 + */ + public int deleteCwEmployeeInformationById(Long id); + + /** + * 根据员工姓名查询员工信息 + * @param name + * @return + */ + public CwEmployeeInformation selectCwEmployeeInformationByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwEvectionService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwEvectionService.java new file mode 100644 index 0000000..24a0982 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwEvectionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwEvection; + +/** + * 出差申请Service接口 + * + * @author zhukangchao + * @date 2021-12-28 + */ +public interface ICwEvectionService +{ + /** + * 查询出差申请 + * + * @param id 出差申请ID + * @return 出差申请 + */ + public CwEvection selectCwEvectionById(Long id); + + /** + * 查询出差申请列表 + * + * @param cwEvection 出差申请 + * @return 出差申请集合 + */ + public List selectCwEvectionList(CwEvection cwEvection); + + /** + * 新增出差申请 + * + * @param cwEvection 出差申请 + * @return 结果 + */ + public int insertCwEvection(CwEvection cwEvection); + + /** + * 修改出差申请 + * + * @param cwEvection 出差申请 + * @return 结果 + */ + public int updateCwEvection(CwEvection cwEvection); + + /** + * 批量删除出差申请 + * + * @param ids 需要删除的出差申请ID + * @return 结果 + */ + public int deleteCwEvectionByIds(Long[] ids); + + /** + * 删除出差申请信息 + * + * @param id 出差申请ID + * @return 结果 + */ + public int deleteCwEvectionById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwExpenseReimbursementService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwExpenseReimbursementService.java new file mode 100644 index 0000000..670a46e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwExpenseReimbursementService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwExpenseReimbursement; + +/** + * 费用报销信息Service接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface ICwExpenseReimbursementService +{ + /** + * 查询费用报销信息 + * + * @param id 费用报销信息ID + * @return 费用报销信息 + */ + public CwExpenseReimbursement selectCwExpenseReimbursementById(Long id); + + /** + * 查询费用报销信息列表 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 费用报销信息集合 + */ + public List selectCwExpenseReimbursementList(CwExpenseReimbursement cwExpenseReimbursement); + + /** + * 新增费用报销信息 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 结果 + */ + public int insertCwExpenseReimbursement(CwExpenseReimbursement cwExpenseReimbursement); + + /** + * 修改费用报销信息 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 结果 + */ + public int updateCwExpenseReimbursement(CwExpenseReimbursement cwExpenseReimbursement); + + /** + * 批量删除费用报销信息 + * + * @param ids 需要删除的费用报销信息ID + * @return 结果 + */ + public int deleteCwExpenseReimbursementByIds(Long[] ids); + + /** + * 删除费用报销信息信息 + * + * @param id 费用报销信息ID + * @return 结果 + */ + public int deleteCwExpenseReimbursementById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwJobsService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwJobsService.java new file mode 100644 index 0000000..77aa238 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwJobsService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwJobs; + +/** + * 岗位Service接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface ICwJobsService +{ + /** + * 查询岗位 + * + * @param id 岗位ID + * @return 岗位 + */ + public CwJobs selectCwJobsById(Long id); + + /** + * 查询岗位列表 + * + * @param cwJobs 岗位 + * @return 岗位集合 + */ + public List selectCwJobsList(CwJobs cwJobs); + + /** + * 新增岗位 + * + * @param cwJobs 岗位 + * @return 结果 + */ + public int insertCwJobs(CwJobs cwJobs); + + /** + * 修改岗位 + * + * @param cwJobs 岗位 + * @return 结果 + */ + public int updateCwJobs(CwJobs cwJobs); + + /** + * 批量删除岗位 + * + * @param ids 需要删除的岗位ID + * @return 结果 + */ + public int deleteCwJobsByIds(Long[] ids); + + /** + * 删除岗位信息 + * + * @param id 岗位ID + * @return 结果 + */ + public int deleteCwJobsById(Long id); + + /** + * 根据岗位名称获取岗位信息 + * @param jobs + * @param deptName + */ + public CwJobs selectCwJobsByJobsName(String jobs, String deptName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwLeaveRecordService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwLeaveRecordService.java new file mode 100644 index 0000000..0cfea2b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwLeaveRecordService.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwLeaveRecord; + +/** + * 请假记录Service接口 + * + * @author zhukangchao + * @date 2021-12-22 + */ +public interface ICwLeaveRecordService +{ + /** + * 查询请假记录 + * + * @param id 请假记录ID + * @return 请假记录 + */ + public CwLeaveRecord selectCwLeaveRecordById(Long id); + + /** + * 查询请假记录列表 + * + * @param cwLeaveRecord 请假记录 + * @return 请假记录集合 + */ + public List selectCwLeaveRecordList(CwLeaveRecord cwLeaveRecord); + + /** + * 新增请假记录 + * + * @param cwLeaveRecord 请假记录 + * @return 结果 + */ + public int insertCwLeaveRecord(CwLeaveRecord cwLeaveRecord); + + /** + * 修改请假记录 + * + * @param cwLeaveRecord 请假记录 + * @return 结果 + */ + public int updateCwLeaveRecord(CwLeaveRecord cwLeaveRecord); + + /** + * 批量删除请假记录 + * + * @param ids 需要删除的请假记录ID + * @return 结果 + */ + public int deleteCwLeaveRecordByIds(Long[] ids); + + /** + * 删除请假记录信息 + * + * @param id 请假记录ID + * @return 结果 + */ + public int deleteCwLeaveRecordById(Long id); + + /** + * 根据名称和日期查询请假记录 + * @param name + * @param date + * @return + */ + public List selectCwLeaveRecordByNameAndDate(String name, String date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwLevelOfEducationService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwLevelOfEducationService.java new file mode 100644 index 0000000..bf64e02 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwLevelOfEducationService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwLevelOfEducation; + +/** + * 补助Service接口 + * + * @author zhukangchao + * @date 2021-12-17 + */ +public interface ICwLevelOfEducationService +{ + /** + * 查询补助 + * + * @param id 补助ID + * @return 补助 + */ + public CwLevelOfEducation selectCwLevelOfEducationById(Long id); + + /** + * 查询补助列表 + * + * @param cwLevelOfEducation 补助 + * @return 补助集合 + */ + public List selectCwLevelOfEducationList(CwLevelOfEducation cwLevelOfEducation); + + /** + * 新增补助 + * + * @param cwLevelOfEducation 补助 + * @return 结果 + */ + public int insertCwLevelOfEducation(CwLevelOfEducation cwLevelOfEducation); + + /** + * 修改补助 + * + * @param cwLevelOfEducation 补助 + * @return 结果 + */ + public int updateCwLevelOfEducation(CwLevelOfEducation cwLevelOfEducation); + + /** + * 批量删除补助 + * + * @param ids 需要删除的补助ID + * @return 结果 + */ + public int deleteCwLevelOfEducationByIds(Long[] ids); + + /** + * 删除补助信息 + * + * @param id 补助ID + * @return 结果 + */ + public int deleteCwLevelOfEducationById(Long id); + + /** + * 根据补助项名称查询 + * @param levelOfEducation + * @return + */ + public CwLevelOfEducation selectCwLevelOfEducationBysubsidiesName(String levelOfEducation); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwLogisticsFeesInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwLogisticsFeesInfoService.java new file mode 100644 index 0000000..6ed229e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwLogisticsFeesInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwLogisticsFeesInfo; + +/** + * 物流费用信息Service接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface ICwLogisticsFeesInfoService +{ + /** + * 查询物流费用信息 + * + * @param id 物流费用信息ID + * @return 物流费用信息 + */ + public CwLogisticsFeesInfo selectCwLogisticsFeesInfoById(Long id); + + /** + * 查询物流费用信息列表 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 物流费用信息集合 + */ + public List selectCwLogisticsFeesInfoList(CwLogisticsFeesInfo cwLogisticsFeesInfo); + + /** + * 新增物流费用信息 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 结果 + */ + public int insertCwLogisticsFeesInfo(CwLogisticsFeesInfo cwLogisticsFeesInfo); + + /** + * 修改物流费用信息 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 结果 + */ + public int updateCwLogisticsFeesInfo(CwLogisticsFeesInfo cwLogisticsFeesInfo); + + /** + * 批量删除物流费用信息 + * + * @param ids 需要删除的物流费用信息ID + * @return 结果 + */ + public int deleteCwLogisticsFeesInfoByIds(Long[] ids); + + /** + * 删除物流费用信息信息 + * + * @param id 物流费用信息ID + * @return 结果 + */ + public int deleteCwLogisticsFeesInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwLogsotocsFeesMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwLogsotocsFeesMaterialService.java new file mode 100644 index 0000000..15d8e9d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwLogsotocsFeesMaterialService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwLogsotocsFeesMaterial; + +/** + * 物流费用和入库单关联Service接口 + * + * @author zhukangchao + * @date 2023-12-13 + */ +public interface ICwLogsotocsFeesMaterialService +{ + /** + * 查询物流费用和入库单关联 + * + * @param id 物流费用和入库单关联ID + * @return 物流费用和入库单关联 + */ + public CwLogsotocsFeesMaterial selectCwLogsotocsFeesMaterialById(Long id); + + /** + * 查询物流费用和入库单关联列表 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 物流费用和入库单关联集合 + */ + public List selectCwLogsotocsFeesMaterialList(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial); + + /** + * 新增物流费用和入库单关联 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 结果 + */ + public int insertCwLogsotocsFeesMaterial(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial); + + /** + * 修改物流费用和入库单关联 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 结果 + */ + public int updateCwLogsotocsFeesMaterial(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial); + + /** + * 批量删除物流费用和入库单关联 + * + * @param ids 需要删除的物流费用和入库单关联ID + * @return 结果 + */ + public int deleteCwLogsotocsFeesMaterialByIds(Long[] ids); + + /** + * 删除物流费用和入库单关联信息 + * + * @param id 物流费用和入库单关联ID + * @return 结果 + */ + public int deleteCwLogsotocsFeesMaterialById(Long id); + + /** + * 根据物料id查询 + * @param idTwo + * @return + */ + public List selectCwLogsotocsFeesMaterialByProductReceiptMaterialId(Long idTwo); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwNewAttendanceService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewAttendanceService.java new file mode 100644 index 0000000..115dc35 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewAttendanceService.java @@ -0,0 +1,103 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +import com.ruoyi.project.management.domain.CwNewAttendance; + +/** + * 新考勤记录Service接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface ICwNewAttendanceService +{ + /** + * 查询新考勤记录 + * + * @param id 新考勤记录ID + * @return 新考勤记录 + */ + public CwNewAttendance selectCwNewAttendanceById(Long id); + + /** + * 查询新考勤记录列表 + * + * @param cwNewAttendance 新考勤记录 + * @return 新考勤记录集合 + */ + public List selectCwNewAttendanceList(CwNewAttendance cwNewAttendance); + + /** + * 新增新考勤记录 + * + * @param cwNewAttendance 新考勤记录 + * @return 结果 + */ + public int insertCwNewAttendance(CwNewAttendance cwNewAttendance); + + /** + * 修改新考勤记录 + * + * @param cwNewAttendance 新考勤记录 + * @return 结果 + */ + public int updateCwNewAttendance(CwNewAttendance cwNewAttendance); + + /** + * 批量删除新考勤记录 + * + * @param ids 需要删除的新考勤记录ID + * @return 结果 + */ + public int deleteCwNewAttendanceByIds(Long[] ids); + + /** + * 删除新考勤记录信息 + * + * @param id 新考勤记录ID + * @return 结果 + */ + public int deleteCwNewAttendanceById(Long id); + + /** + * 批量添加 + * @param list + */ + public int insertCwNewAttendanceList(List list); + + /** + * 根据姓名和工资所属月查询当前月的考勤记录 + * @param name + * @param string + * @param string2 + * @return + */ + public List selectCwNewAttendanceByNameAndAttendanceDate(String name, String string); + + /** + * 根据考勤日期和考勤规则查询机加车间-12的数据 + * @param date + * @param string + */ + public List selectCwNewAttendanceByRulseAndAttDate(String d, String string); + + public CwNewAttendance selectCwNewAttendanceByNameAndAttendanceDateAndWorkEndTimeNull(String name, String format); + + /** + * 根据姓名和考勤记录日期查询 + * @param name + * @param format + */ + public CwNewAttendance selectCwNewAttendanceByNameAndAttendanceDateAndDay(String name, String format); + + public List selectCwNewAttendanceByDeptAndDate(String deptName, String format); + + public List selectCwNewAttendanceByName(String name); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwNewAttendanceStatisticalService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewAttendanceStatisticalService.java new file mode 100644 index 0000000..aa5ec61 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewAttendanceStatisticalService.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; + +/** + * 考勤记录统计Service接口 + * + * @author zhukangchao + * @date 2022-03-30 + */ +public interface ICwNewAttendanceStatisticalService +{ + /** + * 查询考勤记录统计 + * + * @param id 考勤记录统计ID + * @return 考勤记录统计 + */ + public CwNewAttendanceStatistical selectCwNewAttendanceStatisticalById(Long id); + + /** + * 查询考勤记录统计列表 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 考勤记录统计集合 + */ + public List selectCwNewAttendanceStatisticalList(CwNewAttendanceStatistical cwNewAttendanceStatistical); + + /** + * 新增考勤记录统计 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 结果 + */ + public int insertCwNewAttendanceStatistical(CwNewAttendanceStatistical cwNewAttendanceStatistical); + + /** + * 修改考勤记录统计 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 结果 + */ + public int updateCwNewAttendanceStatistical(CwNewAttendanceStatistical cwNewAttendanceStatistical); + + /** + * 批量删除考勤记录统计 + * + * @param ids 需要删除的考勤记录统计ID + * @return 结果 + */ + public int deleteCwNewAttendanceStatisticalByIds(Long[] ids); + + /** + * 删除考勤记录统计信息 + * + * @param id 考勤记录统计ID + * @return 结果 + */ + public int deleteCwNewAttendanceStatisticalById(Long id); + + /** + * 根据姓名和考勤所属月查询 + * @param name + * @param parse + * @return + */ + public CwNewAttendanceStatistical selectCwNewAttendanceStatisticalByNameAndDate(String name, String parse); + + public List selectCwNewAttendanceStatisticalByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwNewEmployeeInformationService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewEmployeeInformationService.java new file mode 100644 index 0000000..a4c1573 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewEmployeeInformationService.java @@ -0,0 +1,74 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; + +/** + * 新员工基本信息Service接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface ICwNewEmployeeInformationService +{ + /** + * 查询新员工基本信息 + * + * @param id 新员工基本信息ID + * @return 新员工基本信息 + */ + public CwNewEmployeeInformation selectCwNewEmployeeInformationById(Long id); + + /** + * 查询新员工基本信息列表 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 新员工基本信息集合 + */ + public List selectCwNewEmployeeInformationList(CwNewEmployeeInformation cwNewEmployeeInformation); + + /** + * 新增新员工基本信息 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 结果 + */ + public int insertCwNewEmployeeInformation(CwNewEmployeeInformation cwNewEmployeeInformation); + + /** + * 修改新员工基本信息 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 结果 + */ + public int updateCwNewEmployeeInformation(CwNewEmployeeInformation cwNewEmployeeInformation); + + /** + * 批量删除新员工基本信息 + * + * @param ids 需要删除的新员工基本信息ID + * @return 结果 + */ + public int deleteCwNewEmployeeInformationByIds(Long[] ids); + + /** + * 删除新员工基本信息信息 + * + * @param id 新员工基本信息ID + * @return 结果 + */ + public int deleteCwNewEmployeeInformationById(Long id); + + /** + * 根据员工姓名查询员工信息 + * @param name + * @return + */ + public CwNewEmployeeInformation selectCwNewEmployeeInformationByName(String name); + + public List selectCwNewEmployeeInformationByDateList(String string); + + public List selectCwNewEmployeeInformationListByName(CwNewEmployeeInformation cwNewEmployeeInformation); + + public int updateCwNewEmployeeInformationByBuZhu(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwNewPayrollService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewPayrollService.java new file mode 100644 index 0000000..54406d0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwNewPayrollService.java @@ -0,0 +1,82 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwNewPayroll; + +/** + * 新工资单Service接口 + * + * @author zhukangchao + * @date 2021-12-16 + */ +public interface ICwNewPayrollService +{ + /** + * 查询新工资单 + * + * @param id 新工资单ID + * @return 新工资单 + */ + public CwNewPayroll selectCwNewPayrollById(Long id); + + /** + * 查询新工资单列表 + * + * @param cwNewPayroll 新工资单 + * @return 新工资单集合 + */ + public List selectCwNewPayrollList(CwNewPayroll cwNewPayroll); + + /** + * 新增新工资单 + * + * @param cwNewPayroll 新工资单 + * @return 结果 + * @throws Exception + */ + public int insertCwNewPayroll(CwNewPayroll cwNewPayroll) throws Exception; + + /** + * 修改新工资单 + * + * @param cwNewPayroll 新工资单 + * @return 结果 + */ + public int updateCwNewPayroll(CwNewPayroll cwNewPayroll); + + /** + * 批量删除新工资单 + * + * @param ids 需要删除的新工资单ID + * @return 结果 + */ + public int deleteCwNewPayrollByIds(Long[] ids); + + /** + * 删除新工资单信息 + * + * @param id 新工资单ID + * @return 结果 + */ + public int deleteCwNewPayrollById(Long id); + + /** + * 根据名称查询 + * @param cwNewPayroll + * @return + */ + public List selectCwNewPayrollListByName(CwNewPayroll cwNewPayroll); + + /** + * 跟据工资所属月查询 + * @return + */ + public List selectCwNewPayrollByAffiliationMonth(String affiliationMonth); + + /** + * 查询河北伊特的数据 + * @return + */ + public List selectCwNewPayrollListByDepartmentName(CwNewPayroll cwNewPayroll); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwNonbusinessIncomeService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwNonbusinessIncomeService.java new file mode 100644 index 0000000..8fca64d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwNonbusinessIncomeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwNonbusinessIncome; + +/** + * 营业外收入信息Service接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface ICwNonbusinessIncomeService +{ + /** + * 查询营业外收入信息 + * + * @param id 营业外收入信息ID + * @return 营业外收入信息 + */ + public CwNonbusinessIncome selectCwNonbusinessIncomeById(Long id); + + /** + * 查询营业外收入信息列表 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 营业外收入信息集合 + */ + public List selectCwNonbusinessIncomeList(CwNonbusinessIncome cwNonbusinessIncome); + + /** + * 新增营业外收入信息 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 结果 + */ + public int insertCwNonbusinessIncome(CwNonbusinessIncome cwNonbusinessIncome); + + /** + * 修改营业外收入信息 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 结果 + */ + public int updateCwNonbusinessIncome(CwNonbusinessIncome cwNonbusinessIncome); + + /** + * 批量删除营业外收入信息 + * + * @param ids 需要删除的营业外收入信息ID + * @return 结果 + */ + public int deleteCwNonbusinessIncomeByIds(Long[] ids); + + /** + * 删除营业外收入信息信息 + * + * @param id 营业外收入信息ID + * @return 结果 + */ + public int deleteCwNonbusinessIncomeById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwOtherPaymentInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwOtherPaymentInfoService.java new file mode 100644 index 0000000..70257bb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwOtherPaymentInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwOtherPaymentInfo; + +/** + * 付款单合同关联信息Service接口 + * + * @author zhukangchao + * @date 2023-12-10 + */ +public interface ICwOtherPaymentInfoService +{ + /** + * 查询付款单合同关联信息 + * + * @param id 付款单合同关联信息ID + * @return 付款单合同关联信息 + */ + public CwOtherPaymentInfo selectCwOtherPaymentInfoById(Long id); + + /** + * 查询付款单合同关联信息列表 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 付款单合同关联信息集合 + */ + public List selectCwOtherPaymentInfoList(CwOtherPaymentInfo cwOtherPaymentInfo); + + /** + * 新增付款单合同关联信息 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 结果 + */ + public int insertCwOtherPaymentInfo(CwOtherPaymentInfo cwOtherPaymentInfo); + + /** + * 修改付款单合同关联信息 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 结果 + */ + public int updateCwOtherPaymentInfo(CwOtherPaymentInfo cwOtherPaymentInfo); + + /** + * 批量删除付款单合同关联信息 + * + * @param ids 需要删除的付款单合同关联信息ID + * @return 结果 + */ + public int deleteCwOtherPaymentInfoByIds(Long[] ids); + + /** + * 删除付款单合同关联信息信息 + * + * @param id 付款单合同关联信息ID + * @return 结果 + */ + public int deleteCwOtherPaymentInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwOtherPaymentService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwOtherPaymentService.java new file mode 100644 index 0000000..fe08327 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwOtherPaymentService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwOtherPayment; + +/** + * 其他付款申请单Service接口 + * + * @author zhukangchao + * @date 2023-11-30 + */ +public interface ICwOtherPaymentService +{ + /** + * 查询其他付款申请单 + * + * @param id 其他付款申请单ID + * @return 其他付款申请单 + */ + public CwOtherPayment selectCwOtherPaymentById(Long id); + + /** + * 查询其他付款申请单列表 + * + * @param cwOtherPayment 其他付款申请单 + * @return 其他付款申请单集合 + */ + public List selectCwOtherPaymentList(CwOtherPayment cwOtherPayment); + + /** + * 新增其他付款申请单 + * + * @param cwOtherPayment 其他付款申请单 + * @return 结果 + */ + public int insertCwOtherPayment(CwOtherPayment cwOtherPayment); + + /** + * 修改其他付款申请单 + * + * @param cwOtherPayment 其他付款申请单 + * @return 结果 + */ + public int updateCwOtherPayment(CwOtherPayment cwOtherPayment); + + /** + * 批量删除其他付款申请单 + * + * @param ids 需要删除的其他付款申请单ID + * @return 结果 + */ + public int deleteCwOtherPaymentByIds(Long[] ids); + + /** + * 删除其他付款申请单信息 + * + * @param id 其他付款申请单ID + * @return 结果 + */ + public int deleteCwOtherPaymentById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwPayrollService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwPayrollService.java new file mode 100644 index 0000000..bf3e3f8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwPayrollService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwPayroll; + +/** + * 工资单Service接口 + * + * @author zhukangchao + * @date 2021-10-25 + */ +public interface ICwPayrollService +{ + /** + * 查询工资单 + * + * @param id 工资单ID + * @return 工资单 + */ + public CwPayroll selectCwPayrollById(Long id); + + /** + * 查询工资单列表 + * + * @param cwPayroll 工资单 + * @return 工资单集合 + */ + public List selectCwPayrollList(CwPayroll cwPayroll); + + /** + * 新增工资单 + * + * @param cwPayroll 工资单 + * @return 结果 + */ + public int insertCwPayroll(CwPayroll cwPayroll); + + /** + * 修改工资单 + * + * @param cwPayroll 工资单 + * @return 结果 + */ + public int updateCwPayroll(CwPayroll cwPayroll); + + /** + * 批量删除工资单 + * + * @param ids 需要删除的工资单ID + * @return 结果 + */ + public int deleteCwPayrollByIds(Long[] ids); + + /** + * 删除工资单信息 + * + * @param id 工资单ID + * @return 结果 + */ + public int deleteCwPayrollById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwRulesService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwRulesService.java new file mode 100644 index 0000000..9c0fb78 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwRulesService.java @@ -0,0 +1,73 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwRules; + +/** + * 排班Service接口 + * + * @author zhukangchao + * @date 2021-12-25 + */ +public interface ICwRulesService +{ + /** + * 查询排班 + * + * @param id 排班ID + * @return 排班 + */ + public CwRules selectCwRulesById(Long id); + + /** + * 查询排班列表 + * + * @param cwRules 排班 + * @return 排班集合 + */ + public List selectCwRulesList(CwRules cwRules); + + /** + * 新增排班 + * + * @param cwRules 排班 + * @return 结果 + */ + public int insertCwRules(CwRules cwRules); + + /** + * 修改排班 + * + * @param cwRules 排班 + * @return 结果 + */ + public int updateCwRules(CwRules cwRules); + + /** + * 批量删除排班 + * + * @param ids 需要删除的排班ID + * @return 结果 + */ + public int deleteCwRulesByIds(Long[] ids); + + /** + * 删除排班信息 + * + * @param id 排班ID + * @return 结果 + */ + public int deleteCwRulesById(Long id); + + /** + * 批量添加班次 + * @param list + * @return + */ + public int insertCwRuless(List list); + + public List selectCwRulesByName(String name); + + public List selectCwRulesByNameAndDate(String name, String date); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwSnDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwSnDetailService.java new file mode 100644 index 0000000..ffe777c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwSnDetailService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwSnDetail; + +/** + * 考勤设备信息Service接口 + * + * @author zhukangchao + * @date 2022-11-01 + */ +public interface ICwSnDetailService +{ + /** + * 查询考勤设备信息 + * + * @param id 考勤设备信息ID + * @return 考勤设备信息 + */ + public CwSnDetail selectCwSnDetailById(Long id); + + /** + * 查询考勤设备信息列表 + * + * @param cwSnDetail 考勤设备信息 + * @return 考勤设备信息集合 + */ + public List selectCwSnDetailList(CwSnDetail cwSnDetail); + + /** + * 新增考勤设备信息 + * + * @param cwSnDetail 考勤设备信息 + * @return 结果 + */ + public int insertCwSnDetail(CwSnDetail cwSnDetail); + + /** + * 修改考勤设备信息 + * + * @param cwSnDetail 考勤设备信息 + * @return 结果 + */ + public int updateCwSnDetail(CwSnDetail cwSnDetail); + + /** + * 批量删除考勤设备信息 + * + * @param ids 需要删除的考勤设备信息ID + * @return 结果 + */ + public int deleteCwSnDetailByIds(Long[] ids); + + /** + * 删除考勤设备信息信息 + * + * @param id 考勤设备信息ID + * @return 结果 + */ + public int deleteCwSnDetailById(Long id); + + public CwSnDetail selectCwSnDetailBySn(String sn); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwTaxRateInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwTaxRateInfoService.java new file mode 100644 index 0000000..5121f5d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwTaxRateInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwTaxRateInfo; + +/** + * 税率信息Service接口 + * + * @author zhukangchao + * @date 2023-12-18 + */ +public interface ICwTaxRateInfoService +{ + /** + * 查询税率信息 + * + * @param id 税率信息ID + * @return 税率信息 + */ + public CwTaxRateInfo selectCwTaxRateInfoById(Long id); + + /** + * 查询税率信息列表 + * + * @param cwTaxRateInfo 税率信息 + * @return 税率信息集合 + */ + public List selectCwTaxRateInfoList(CwTaxRateInfo cwTaxRateInfo); + + /** + * 新增税率信息 + * + * @param cwTaxRateInfo 税率信息 + * @return 结果 + */ + public int insertCwTaxRateInfo(CwTaxRateInfo cwTaxRateInfo); + + /** + * 修改税率信息 + * + * @param cwTaxRateInfo 税率信息 + * @return 结果 + */ + public int updateCwTaxRateInfo(CwTaxRateInfo cwTaxRateInfo); + + /** + * 批量删除税率信息 + * + * @param ids 需要删除的税率信息ID + * @return 结果 + */ + public int deleteCwTaxRateInfoByIds(Long[] ids); + + /** + * 删除税率信息信息 + * + * @param id 税率信息ID + * @return 结果 + */ + public int deleteCwTaxRateInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwTypeTimeService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwTypeTimeService.java new file mode 100644 index 0000000..18903bb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwTypeTimeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwTypeTime; + +/** + * 状态等待时间Service接口 + * + * @author zhukangchao + * @date 2022-10-31 + */ +public interface ICwTypeTimeService +{ + /** + * 查询状态等待时间 + * + * @param id 状态等待时间ID + * @return 状态等待时间 + */ + public CwTypeTime selectCwTypeTimeById(Long id); + + /** + * 查询状态等待时间列表 + * + * @param cwTypeTime 状态等待时间 + * @return 状态等待时间集合 + */ + public List selectCwTypeTimeList(CwTypeTime cwTypeTime); + + /** + * 新增状态等待时间 + * + * @param cwTypeTime 状态等待时间 + * @return 结果 + */ + public int insertCwTypeTime(CwTypeTime cwTypeTime); + + /** + * 修改状态等待时间 + * + * @param cwTypeTime 状态等待时间 + * @return 结果 + */ + public int updateCwTypeTime(CwTypeTime cwTypeTime); + + /** + * 批量删除状态等待时间 + * + * @param ids 需要删除的状态等待时间ID + * @return 结果 + */ + public int deleteCwTypeTimeByIds(Long[] ids); + + /** + * 删除状态等待时间信息 + * + * @param id 状态等待时间ID + * @return 结果 + */ + public int deleteCwTypeTimeById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwWageSummaryService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwWageSummaryService.java new file mode 100644 index 0000000..01d1ad0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwWageSummaryService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwWageSummary; + +/** + * 工资汇总Service接口 + * + * @author zhukangchao + * @date 2021-12-23 + */ +public interface ICwWageSummaryService +{ + /** + * 查询工资汇总 + * + * @param id 工资汇总ID + * @return 工资汇总 + */ + public CwWageSummary selectCwWageSummaryById(Long id); + + /** + * 查询工资汇总列表 + * + * @param cwWageSummary 工资汇总 + * @return 工资汇总集合 + */ + public List selectCwWageSummaryList(CwWageSummary cwWageSummary); + + /** + * 新增工资汇总 + * + * @param cwWageSummary 工资汇总 + * @return 结果 + */ + public int insertCwWageSummary(CwWageSummary cwWageSummary); + + /** + * 修改工资汇总 + * + * @param cwWageSummary 工资汇总 + * @return 结果 + */ + public int updateCwWageSummary(CwWageSummary cwWageSummary); + + /** + * 批量删除工资汇总 + * + * @param ids 需要删除的工资汇总ID + * @return 结果 + */ + public int deleteCwWageSummaryByIds(Long[] ids); + + /** + * 删除工资汇总信息 + * + * @param id 工资汇总ID + * @return 结果 + */ + public int deleteCwWageSummaryById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwWorkOvertimeRecordService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwWorkOvertimeRecordService.java new file mode 100644 index 0000000..8027fe2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwWorkOvertimeRecordService.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwWorkOvertimeRecord; + +/** + * 加班申请Service接口 + * + * @author zhukangchao + * @date 2021-12-22 + */ +public interface ICwWorkOvertimeRecordService +{ + /** + * 查询加班申请 + * + * @param id 加班申请ID + * @return 加班申请 + */ + public CwWorkOvertimeRecord selectCwWorkOvertimeRecordById(Long id); + + /** + * 查询加班申请列表 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 加班申请集合 + */ + public List selectCwWorkOvertimeRecordList(CwWorkOvertimeRecord cwWorkOvertimeRecord); + + /** + * 新增加班申请 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 结果 + */ + public int insertCwWorkOvertimeRecord(CwWorkOvertimeRecord cwWorkOvertimeRecord); + + /** + * 修改加班申请 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 结果 + */ + public int updateCwWorkOvertimeRecord(CwWorkOvertimeRecord cwWorkOvertimeRecord); + + /** + * 批量删除加班申请 + * + * @param ids 需要删除的加班申请ID + * @return 结果 + */ + public int deleteCwWorkOvertimeRecordByIds(Long[] ids); + + /** + * 删除加班申请信息 + * + * @param id 加班申请ID + * @return 结果 + */ + public int deleteCwWorkOvertimeRecordById(Long id); + + /** + * 根据名称和日期查询 + * @param name + * @param date + * @return + */ + public List selectCwWorkOvertimeRecordByNameAndDate(String name, String date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICwWorkingDaysConfigurationService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICwWorkingDaysConfigurationService.java new file mode 100644 index 0000000..92ad6fb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICwWorkingDaysConfigurationService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CwWorkingDaysConfiguration; + +/** + * 工作日配置Service接口 + * + * @author zhukangchao + * @date 2021-12-21 + */ +public interface ICwWorkingDaysConfigurationService +{ + /** + * 查询工作日配置 + * + * @param id 工作日配置ID + * @return 工作日配置 + */ + public CwWorkingDaysConfiguration selectCwWorkingDaysConfigurationById(Long id); + + /** + * 查询工作日配置列表 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 工作日配置集合 + */ + public List selectCwWorkingDaysConfigurationList(CwWorkingDaysConfiguration cwWorkingDaysConfiguration); + + /** + * 新增工作日配置 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 结果 + */ + public int insertCwWorkingDaysConfiguration(CwWorkingDaysConfiguration cwWorkingDaysConfiguration); + + /** + * 修改工作日配置 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 结果 + */ + public int updateCwWorkingDaysConfiguration(CwWorkingDaysConfiguration cwWorkingDaysConfiguration); + + /** + * 批量删除工作日配置 + * + * @param ids 需要删除的工作日配置ID + * @return 结果 + */ + public int deleteCwWorkingDaysConfigurationByIds(Long[] ids); + + /** + * 删除工作日配置信息 + * + * @param id 工作日配置ID + * @return 结果 + */ + public int deleteCwWorkingDaysConfigurationById(Long id); + + /** + * 根据月份查询 + * @param affiliationMonth + * @return + */ + public CwWorkingDaysConfiguration selectCwWorkingDaysConfigurationByDate(String affiliationMonth); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICyConsumptionInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICyConsumptionInfoService.java new file mode 100644 index 0000000..8b1b5b9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICyConsumptionInfoService.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.CyConsumptionInfo; + +/** + * 餐饮消费明细Service接口 + * + * @author zhukangchao + * @date 2023-10-05 + */ +public interface ICyConsumptionInfoService +{ + /** + * 查询餐饮消费明细 + * + * @param id 餐饮消费明细ID + * @return 餐饮消费明细 + */ + public CyConsumptionInfo selectCyConsumptionInfoById(Long id); + + /** + * 查询餐饮消费明细列表 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 餐饮消费明细集合 + */ + public List selectCyConsumptionInfoList(CyConsumptionInfo cyConsumptionInfo); + + /** + * 新增餐饮消费明细 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 结果 + */ + public int insertCyConsumptionInfo(CyConsumptionInfo cyConsumptionInfo); + + /** + * 修改餐饮消费明细 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 结果 + */ + public int updateCyConsumptionInfo(CyConsumptionInfo cyConsumptionInfo); + + /** + * 批量删除餐饮消费明细 + * + * @param ids 需要删除的餐饮消费明细ID + * @return 结果 + */ + public int deleteCyConsumptionInfoByIds(Long[] ids); + + /** + * 删除餐饮消费明细信息 + * + * @param id 餐饮消费明细ID + * @return 结果 + */ + public int deleteCyConsumptionInfoById(Long id); + + public List selectCyConsumptionInfoByDate(Date date); + + public List selectCyConsumptionInfoByYue(Date date,String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICyFaceInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICyFaceInfoService.java new file mode 100644 index 0000000..ec552bc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICyFaceInfoService.java @@ -0,0 +1,74 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.CyFaceInfo; + +/** + * 餐饮刷脸详情信息Service接口 + * + * @author zhukangchao + * @date 2023-10-05 + */ +public interface ICyFaceInfoService +{ + /** + * 查询餐饮刷脸详情信息 + * + * @param id 餐饮刷脸详情信息ID + * @return 餐饮刷脸详情信息 + */ + public CyFaceInfo selectCyFaceInfoById(Long id); + + /** + * 查询餐饮刷脸详情信息列表 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 餐饮刷脸详情信息集合 + */ + public List selectCyFaceInfoList(CyFaceInfo cyFaceInfo); + + /** + * 新增餐饮刷脸详情信息 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 结果 + */ + public int insertCyFaceInfo(CyFaceInfo cyFaceInfo); + + /** + * 修改餐饮刷脸详情信息 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 结果 + */ + public int updateCyFaceInfo(CyFaceInfo cyFaceInfo); + + /** + * 批量删除餐饮刷脸详情信息 + * + * @param ids 需要删除的餐饮刷脸详情信息ID + * @return 结果 + */ + public int deleteCyFaceInfoByIds(Long[] ids); + + /** + * 删除餐饮刷脸详情信息信息 + * + * @param id 餐饮刷脸详情信息ID + * @return 结果 + */ + public int deleteCyFaceInfoById(Long id); + + /** + * 根据姓名查询1小时内的数据 + * @param name + * @return + */ + public List selectCyFaceInfoByNameAndTime(String name); + + public List selectCyFaceInfoByDate(Date format); + + public List selectCyFaceInfoByNameAndDate(String name, Date dateTime); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ICyStatisticsInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/ICyStatisticsInfoService.java new file mode 100644 index 0000000..7d902bf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ICyStatisticsInfoService.java @@ -0,0 +1,76 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.CyStatisticsInfo; + +/** + * 餐饮消费统计信息Service接口 + * + * @author zhukangchao + * @date 2023-10-05 + */ +public interface ICyStatisticsInfoService +{ + /** + * 查询餐饮消费统计信息 + * + * @param id 餐饮消费统计信息ID + * @return 餐饮消费统计信息 + */ + public CyStatisticsInfo selectCyStatisticsInfoById(Long id); + + /** + * 查询餐饮消费统计信息列表 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 餐饮消费统计信息集合 + */ + public List selectCyStatisticsInfoList(CyStatisticsInfo cyStatisticsInfo); + + /** + * 新增餐饮消费统计信息 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 结果 + */ + public int insertCyStatisticsInfo(CyStatisticsInfo cyStatisticsInfo); + + /** + * 修改餐饮消费统计信息 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 结果 + */ + public int updateCyStatisticsInfo(CyStatisticsInfo cyStatisticsInfo); + + /** + * 批量删除餐饮消费统计信息 + * + * @param ids 需要删除的餐饮消费统计信息ID + * @return 结果 + */ + public int deleteCyStatisticsInfoByIds(Long[] ids); + + /** + * 删除餐饮消费统计信息信息 + * + * @param id 餐饮消费统计信息ID + * @return 结果 + */ + public int deleteCyStatisticsInfoById(Long id); + + /** + * 根据姓名和月份查询 + * @param name + * @param yue + * @return + */ + public CyStatisticsInfo selectCyStatisticsInfoByNameAndDate(String name, String yue); + + /** + * 根据姓名和时间修改 + * @param cyStatisticsInfo + * @return + */ + public int updateCyStatisticsInfoByNameAndDate(List cyStatisticsInfo); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IEvoInOutStorageManagementService.java b/evo/src/main/java/com/ruoyi/project/management/service/IEvoInOutStorageManagementService.java new file mode 100644 index 0000000..0378f5d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IEvoInOutStorageManagementService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.EvoInOutStorageManagement; + +/** + * 物品出入库管理Service接口 + * + * @author chenyongjiang + * @date 2023-12-26 + */ +public interface IEvoInOutStorageManagementService +{ + /** + * 查询物品出入库管理 + * + * @param id 物品出入库管理ID + * @return 物品出入库管理 + */ + public EvoInOutStorageManagement selectEvoInOutStorageManagementById(Long id); + + /** + * 查询物品出入库管理列表 + * + * @param evoInOutStorageManagement 物品出入库管理 + * @return 物品出入库管理集合 + */ + public List selectEvoInOutStorageManagementList(EvoInOutStorageManagement evoInOutStorageManagement); + + /** + * 新增物品出入库管理 + * + * @param evoInOutStorageManagement 物品出入库管理 + * @return 结果 + */ + public AjaxResult insertEvoInOutStorageManagement(EvoInOutStorageManagement evoInOutStorageManagement); + + /** + * 删除物品出入库管理信息 + * + * @param id 物品出入库管理ID + * @return 结果 + */ + public AjaxResult deleteEvoInOutStorageManagementById(Long id); + + /** + * 审核 + * @param id + * @return + */ + public AjaxResult audit(Long id,String name); + + /** + * 出入库确定 + * @param id + * @return + */ + public AjaxResult determine(Long id,String name); + + /** + * 质检 + * @param id + * @return + */ + public AjaxResult materialReturn(Long id,String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IEvoInvalidLibraryService.java b/evo/src/main/java/com/ruoyi/project/management/service/IEvoInvalidLibraryService.java new file mode 100644 index 0000000..4b7e65a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IEvoInvalidLibraryService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.EvoInvalidLibrary; + +/** + * Service接口 + * + * @author zhukangchao + * @date 2024-01-12 + */ +public interface IEvoInvalidLibraryService +{ + /** + * 查询 + * + * @param id 不良库ID + * @return 不良库 + */ + public EvoInvalidLibrary selectEvoInvalidLibraryById(Long id); + + /** + * 查询不良库列表 + * + * @param evoInvalidLibrary 不良库 + * @return 不良库集合 + */ + public List selectEvoInvalidLibraryList(EvoInvalidLibrary evoInvalidLibrary); + + /** + * 新增不良库 + * + * @param evoInvalidLibrary 不良库 + * @return 结果 + */ + public int insertEvoInvalidLibrary(EvoInvalidLibrary evoInvalidLibrary); + + /** + * 修改不良库 + * + * @param evoInvalidLibrary 不良库 + * @return 结果 + */ + public int updateEvoInvalidLibrary(EvoInvalidLibrary evoInvalidLibrary); + + /** + * 批量删除不良库 + * + * @param ids 需要删除的不良库ID + * @return 结果 + */ + public int deleteEvoInvalidLibraryByIds(Long[] ids); + + /** + * 删除不良库信息 + * + * @param id 不良库ID + * @return 结果 + */ + public int deleteEvoInvalidLibraryById(Long id); + + public EvoInvalidLibrary selectEvoInvalidLibraryByFigureNumberAndProductBillCode(String figureNumber, String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IEvoOperatorTypeJdService.java b/evo/src/main/java/com/ruoyi/project/management/service/IEvoOperatorTypeJdService.java new file mode 100644 index 0000000..0183a19 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IEvoOperatorTypeJdService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.EvoOperatorTypeJd; + +/** + * 操作员类型Service接口 + * + * @author zhukangchao + * @date 2023-12-17 + */ +public interface IEvoOperatorTypeJdService +{ + /** + * 查询操作员类型 + * + * @param id 操作员类型ID + * @return 操作员类型 + */ + public EvoOperatorTypeJd selectEvoOperatorTypeJdById(Long id); + + /** + * 查询操作员类型列表 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 操作员类型集合 + */ + public List selectEvoOperatorTypeJdList(EvoOperatorTypeJd evoOperatorTypeJd); + + /** + * 新增操作员类型 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 结果 + */ + public int insertEvoOperatorTypeJd(EvoOperatorTypeJd evoOperatorTypeJd); + + /** + * 修改操作员类型 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 结果 + */ + public int updateEvoOperatorTypeJd(EvoOperatorTypeJd evoOperatorTypeJd); + + /** + * 批量删除操作员类型 + * + * @param ids 需要删除的操作员类型ID + * @return 结果 + */ + public int deleteEvoOperatorTypeJdByIds(Long[] ids); + + /** + * 删除操作员类型信息 + * + * @param id 操作员类型ID + * @return 结果 + */ + public int deleteEvoOperatorTypeJdById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IEvoStagnantStorageService.java b/evo/src/main/java/com/ruoyi/project/management/service/IEvoStagnantStorageService.java new file mode 100644 index 0000000..b0fd30a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IEvoStagnantStorageService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.EvoStagnantStorage; + +/** + * 呆滞库Service接口 + * + * @author zhukangchao + * @date 2023-12-27 + */ +public interface IEvoStagnantStorageService +{ + /** + * 查询呆滞库 + * + * @param id 呆滞库ID + * @return 呆滞库 + */ + public EvoStagnantStorage selectEvoStagnantStorageById(Long id); + + /** + * 查询呆滞库列表 + * + * @param evoStagnantStorage 呆滞库 + * @return 呆滞库集合 + */ + public List selectEvoStagnantStorageList(EvoStagnantStorage evoStagnantStorage); + + /** + * 新增呆滞库 + * + * @param evoStagnantStorage 呆滞库 + * @return 结果 + */ + public int insertEvoStagnantStorage(EvoStagnantStorage evoStagnantStorage); + + /** + * 修改呆滞库 + * + * @param evoStagnantStorage 呆滞库 + * @return 结果 + */ + public int updateEvoStagnantStorage(EvoStagnantStorage evoStagnantStorage); + + /** + * 批量删除呆滞库 + * + * @param ids 需要删除的呆滞库ID + * @return 结果 + */ + public int deleteEvoStagnantStorageByIds(Long[] ids); + + /** + * 删除呆滞库信息 + * + * @param id 呆滞库ID + * @return 结果 + */ + public int deleteEvoStagnantStorageById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImCustomerService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImCustomerService.java new file mode 100644 index 0000000..74da059 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImCustomerService.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.service; import java.util.List; import com.ruoyi.project.management.domain.ImCustomer; /** * 客户维护Service接口 * * @author chenyj * @date 2023-10-26 */ public interface IImCustomerService { /** * 查询客户维护 * * @param id 客户维护ID * @return 客户维护 */ public ImCustomer selectImCustomerById(Long id); public ImCustomer selectImCustomerByCustomerName(String customerName); /** * 查询客户维护列表 * * @param imCustomer 客户维护 * @return 客户维护集合 */ public List selectImCustomerList(ImCustomer imCustomer); /** * 新增客户维护 * * @param imCustomer 客户维护 * @return 结果 */ public int insertImCustomer(ImCustomer imCustomer); /** * 修改客户维护 * * @param imCustomer 客户维护 * @return 结果 */ public int updateImCustomer(ImCustomer imCustomer); /** * 批量删除客户维护 * * @param ids 需要删除的客户维护ID * @return 结果 */ public int deleteImCustomerByIds(Long[] ids); /** * 删除客户维护信息 * * @param id 客户维护ID * @return 结果 */ public int deleteImCustomerById(Long id); /** * 获取所有客户 * @return */ public List queryCustomers(); } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImCustomerTypeService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImCustomerTypeService.java new file mode 100644 index 0000000..aa941f0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImCustomerTypeService.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.service; import java.util.List; import com.ruoyi.project.management.domain.ImCustomerType; /** * 客户类型Service接口 * * @author zhukangchao * @date 2023-12-04 */ public interface IImCustomerTypeService { /** * 查询客户类型 * * @param id 客户类型ID * @return 客户类型 */ public ImCustomerType selectImCustomerTypeById(Long id); /** * 查询客户类型列表 * * @param imCustomerType 客户类型 * @return 客户类型集合 */ public List selectImCustomerTypeList(ImCustomerType imCustomerType); /** * 新增客户类型 * * @param imCustomerType 客户类型 * @return 结果 */ public int insertImCustomerType(ImCustomerType imCustomerType); /** * 修改客户类型 * * @param imCustomerType 客户类型 * @return 结果 */ public int updateImCustomerType(ImCustomerType imCustomerType); /** * 批量删除客户类型 * * @param ids 需要删除的客户类型ID * @return 结果 */ public int deleteImCustomerTypeByIds(Long[] ids); /** * 删除客户类型信息 * * @param id 客户类型ID * @return 结果 */ public int deleteImCustomerTypeById(Long id); /** * 查询客户分组 * @return */ public List queryImCustomerTypeList(); } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImDeliveryUnitService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImDeliveryUnitService.java new file mode 100644 index 0000000..5b2ce18 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImDeliveryUnitService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImDeliveryUnit; + +/** + * 交货单位Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImDeliveryUnitService +{ + /** + * 查询交货单位 + * + * @param id 交货单位ID + * @return 交货单位 + */ + public ImDeliveryUnit selectImDeliveryUnitById(Long id); + + /** + * 查询交货单位列表 + * + * @param imDeliveryUnit 交货单位 + * @return 交货单位集合 + */ + public List selectImDeliveryUnitList(ImDeliveryUnit imDeliveryUnit); + + /** + * 新增交货单位 + * + * @param imDeliveryUnit 交货单位 + * @return 结果 + */ + public int insertImDeliveryUnit(ImDeliveryUnit imDeliveryUnit); + + /** + * 修改交货单位 + * + * @param imDeliveryUnit 交货单位 + * @return 结果 + */ + public int updateImDeliveryUnit(ImDeliveryUnit imDeliveryUnit); + + /** + * 批量删除交货单位 + * + * @param ids 需要删除的交货单位ID + * @return 结果 + */ + public int deleteImDeliveryUnitByIds(Long[] ids); + + /** + * 删除交货单位信息 + * + * @param id 交货单位ID + * @return 结果 + */ + public int deleteImDeliveryUnitById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImLogisticsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImLogisticsService.java new file mode 100644 index 0000000..550aacb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImLogisticsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImLogistics; + +/** + * 物流Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImLogisticsService +{ + /** + * 查询物流 + * + * @param id 物流ID + * @return 物流 + */ + public ImLogistics selectImLogisticsById(Long id); + + /** + * 查询物流列表 + * + * @param imLogistics 物流 + * @return 物流集合 + */ + public List selectImLogisticsList(ImLogistics imLogistics); + + /** + * 新增物流 + * + * @param imLogistics 物流 + * @return 结果 + */ + public int insertImLogistics(ImLogistics imLogistics); + + /** + * 修改物流 + * + * @param imLogistics 物流 + * @return 结果 + */ + public int updateImLogistics(ImLogistics imLogistics); + + /** + * 批量删除物流 + * + * @param ids 需要删除的物流ID + * @return 结果 + */ + public int deleteImLogisticsByIds(Long[] ids); + + /** + * 删除物流信息 + * + * @param id 物流ID + * @return 结果 + */ + public int deleteImLogisticsById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialGroupService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialGroupService.java new file mode 100644 index 0000000..fc8702f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialGroupService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImMaterialGroup; + +/** + * 物料分组Service接口 + * + * @author zhukangchao + * @date 2023-12-15 + */ +public interface IImMaterialGroupService +{ + /** + * 查询物料分组 + * + * @param id 物料分组ID + * @return 物料分组 + */ + public ImMaterialGroup selectImMaterialGroupById(Long id); + + /** + * 查询物料分组列表 + * + * @param imMaterialGroup 物料分组 + * @return 物料分组集合 + */ + public List selectImMaterialGroupList(ImMaterialGroup imMaterialGroup); + + /** + * 新增物料分组 + * + * @param imMaterialGroup 物料分组 + * @return 结果 + */ + public int insertImMaterialGroup(ImMaterialGroup imMaterialGroup); + + /** + * 修改物料分组 + * + * @param imMaterialGroup 物料分组 + * @return 结果 + */ + public int updateImMaterialGroup(ImMaterialGroup imMaterialGroup); + + /** + * 批量删除物料分组 + * + * @param ids 需要删除的物料分组ID + * @return 结果 + */ + public int deleteImMaterialGroupByIds(Long[] ids); + + /** + * 删除物料分组信息 + * + * @param id 物料分组ID + * @return 结果 + */ + public int deleteImMaterialGroupById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialService.java new file mode 100644 index 0000000..58f8dab --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialService.java @@ -0,0 +1,131 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImMaterial; + +/** + * 物料(零件)Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImMaterialService +{ + /** + * 查询物料(零件) + * + * @param id 物料(零件)ID + * @return 物料(零件) + */ + public ImMaterial selectImMaterialById(Long id); + + /** + * 查询物料(零件)列表 + * + * @param imMaterial 物料(零件) + * @return 物料(零件)集合 + */ + public List selectImMaterialList(ImMaterial imMaterial); + + /** + * 新增物料(零件) + * + * @param imMaterial 物料(零件) + * @return 结果 + */ + public int insertImMaterial(ImMaterial imMaterial); + + /** + * 修改物料(零件) + * + * @param imMaterial 物料(零件) + * @return 结果 + */ + public int updateImMaterial(ImMaterial imMaterial); + + /** + * 批量删除物料(零件) + * + * @param ids 需要删除的物料(零件)ID + * @return 结果 + */ + public int deleteImMaterialByIds(Long[] ids); + + /** + * 删除物料(零件)信息 + * + * @param id 物料(零件)ID + * @return 结果 + */ + public int deleteImMaterialById(Long id); + + /** + * 根据图号查询 + * @param partGather + * @return + */ + public ImMaterial selectImMaterialBySpecificationType(String partGather); + + /** + * 查询物料表中设置了最低库存和最高库存的数据 + */ + public List selectByMinimumAndHighest(); + + /** + * 根据名称和图号查询 + * @param partGather + * @return + */ + public ImMaterial selectImMaterialByMaterialNameAndSpecificationType(String materialName, String figureNumber); + + /** + * 根据物料类型查询(采购单详情) + * @param imMaterial + * @return + */ + public List selectImMaterialListImMaterialByType(ImMaterial imMaterial); + + /** + * 查询原材料列表 + * @param imMaterial + * @return + */ + public List selectImMaterialListImMaterialByYuanCaiLiao(ImMaterial imMaterial); + + /** + * 查询基建材料列表 + * @param imMaterial + * @return + */ + public List selectImMaterialListImMaterialByJiJian(ImMaterial imMaterial); + + /** + * 查询易耗品 + * @param imMaterial + * @return + */ + public List selectImMaterialListImMaterialByYHP(ImMaterial imMaterial); + + public List selectByFigureNumberAndAllGB(); + + public List selectImMaterialListByTypeAndMinimum(); + + public List selectImMaterialListImMaterialByBuJianAndLingJian(); + + /** + * 查询设置了安全库存的物料 + */ + public List selectImMaterialListByMinimumAndHighest(); + + /** + * 根据图号查询物料信息 + * @param materialName + * @return + */ + public List getImMaterialByMaterialName(String materialName); + + /** + * 定时查询金蝶物料信息并入库 + */ + public void queryJdBaseInformation(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialTypeService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialTypeService.java new file mode 100644 index 0000000..4a78f22 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImMaterialTypeService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImMaterialType; + +/** + * 物料(零件)类型Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImMaterialTypeService +{ + /** + * 查询物料(零件)类型 + * + * @param id 物料(零件)类型ID + * @return 物料(零件)类型 + */ + public ImMaterialType selectImMaterialTypeById(Long id); + + /** + * 查询物料(零件)类型列表 + * + * @param imMaterialType 物料(零件)类型 + * @return 物料(零件)类型集合 + */ + public List selectImMaterialTypeList(ImMaterialType imMaterialType); + + /** + * 新增物料(零件)类型 + * + * @param imMaterialType 物料(零件)类型 + * @return 结果 + */ + public int insertImMaterialType(ImMaterialType imMaterialType); + + /** + * 修改物料(零件)类型 + * + * @param imMaterialType 物料(零件)类型 + * @return 结果 + */ + public int updateImMaterialType(ImMaterialType imMaterialType); + + /** + * 批量删除物料(零件)类型 + * + * @param ids 需要删除的物料(零件)类型ID + * @return 结果 + */ + public int deleteImMaterialTypeByIds(Long[] ids); + + /** + * 删除物料(零件)类型信息 + * + * @param id 物料(零件)类型ID + * @return 结果 + */ + public int deleteImMaterialTypeById(Long id); + + /** + * 根据物料类型名称查询 + * @param materialTypeName + * @return + */ + public ImMaterialType selectImMaterialTypeByName(String materialTypeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImMeteringUnitService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImMeteringUnitService.java new file mode 100644 index 0000000..141c0ab --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImMeteringUnitService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImMeteringUnit; + +/** + * 计量单位Service接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface IImMeteringUnitService +{ + /** + * 查询计量单位 + * + * @param id 计量单位ID + * @return 计量单位 + */ + public ImMeteringUnit selectImMeteringUnitById(String id); + + /** + * 查询计量单位列表 + * + * @param imMeteringUnit 计量单位 + * @return 计量单位集合 + */ + public List selectImMeteringUnitList(ImMeteringUnit imMeteringUnit); + + /** + * 新增计量单位 + * + * @param imMeteringUnit 计量单位 + * @return 结果 + */ + public int insertImMeteringUnit(ImMeteringUnit imMeteringUnit); + + /** + * 修改计量单位 + * + * @param imMeteringUnit 计量单位 + * @return 结果 + */ + public int updateImMeteringUnit(ImMeteringUnit imMeteringUnit); + + /** + * 批量删除计量单位 + * + * @param ids 需要删除的计量单位ID + * @return 结果 + */ + public int deleteImMeteringUnitByIds(Long[] ids); + + /** + * 删除计量单位信息 + * + * @param id 计量单位ID + * @return 结果 + */ + public int deleteImMeteringUnitById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImProductReceiptMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImProductReceiptMaterialService.java new file mode 100644 index 0000000..27c01f0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImProductReceiptMaterialService.java @@ -0,0 +1,98 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImProductReceiptMaterialTwo; +import org.apache.ibatis.annotations.Param; + +/** + * 物料产品入库单关联Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImProductReceiptMaterialService +{ + /** + * 查询物料产品入库单关联 + * + * @param id 物料产品入库单关联ID + * @return 物料产品入库单关联 + */ + public ImProductReceiptMaterial selectImProductReceiptMaterialById(Long id); + + /** + * 查询物料产品入库单关联列表 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 物料产品入库单关联集合 + */ + public List selectImProductReceiptMaterialList(ImProductReceiptMaterial imProductReceiptMaterial); + + /** + * 新增物料产品入库单关联 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 结果 + */ + public int insertImProductReceiptMaterial(ImProductReceiptMaterial imProductReceiptMaterial); + + /** + * 修改物料产品入库单关联 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 结果 + */ + public int updateImProductReceiptMaterial(ImProductReceiptMaterial imProductReceiptMaterial); + + /** + * 批量删除物料产品入库单关联 + * + * @param ids 需要删除的物料产品入库单关联ID + * @return 结果 + */ + public int deleteImProductReceiptMaterialByIds(Long[] ids); + + /** + * 删除物料产品入库单关联信息 + * + * @param id 物料产品入库单关联ID + * @return 结果 + */ + public int deleteImProductReceiptMaterialById(Long id); + + /** + * 根据入库单id查询 + * @param productReceiptId + * @return + */ + public List selectImProductReceiptMaterialByProductReceiptId(Long productReceiptId); + + public List selectImProductReceiptMaterialLists(ImProductReceiptMaterial im); + + public List selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(String makeDocumentsCode, String name, + String figureNumber); + + public int selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(String productionCode, String name, + String figureNumber); + + public List selectImProductReceiptMaterialListTwo( + ImProductReceiptMaterial imProductReceiptMaterial); + + public List selectImProductReceiptMaterialByFigureNumberAndAllGB(); + + public List selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber(Long id, String materialName, + String figureNumber); + + public List selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(String productionCode, + String name, String figureNumber); + + public List selectImProductReceiptMaterialByCode(String code); + + public List selectImProductReceiptMaterialByCodeAndFigureNumber(String productionCode, String figureNumber); + + public List selectImProductReceiptMaterialByCodeAndSparedFour(String code, Long id); + + public List queryImProductReceiptMaterialByNameAndFigureNumber(String name,String figureNumber, Date inDate); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImProductReceiptService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImProductReceiptService.java new file mode 100644 index 0000000..496f6ac --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImProductReceiptService.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImProductReceipt; + +/** + * 产品(半成品)入库单Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImProductReceiptService +{ + /** + * 查询产品(半成品)入库单 + * + * @param id 产品(半成品)入库单ID + * @return 产品(半成品)入库单 + */ + public ImProductReceipt selectImProductReceiptById(Long id); + + /** + * 查询产品(半成品)入库单列表 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 产品(半成品)入库单集合 + */ + public List selectImProductReceiptList(ImProductReceipt imProductReceipt); + + /** + * 新增产品(半成品)入库单 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 结果 + */ + public int insertImProductReceipt(ImProductReceipt imProductReceipt); + + /** + * 修改产品(半成品)入库单 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 结果 + */ + public int updateImProductReceipt(ImProductReceipt imProductReceipt); + + /** + * 批量删除产品(半成品)入库单 + * + * @param ids 需要删除的产品(半成品)入库单ID + * @return 结果 + */ + public int deleteImProductReceiptByIds(Long[] ids); + + /** + * 删除产品(半成品)入库单信息 + * + * @param id 产品(半成品)入库单ID + * @return 结果 + */ + public int deleteImProductReceiptById(Long id); + + /** + * 根据合同编号查询入库单信息 + * @param contractCode + */ + public ImProductReceipt selectImProductReceiptByContractCode(String contractCode); + + /** + * 根据企标单号查询 + * @param makeDocumentsCode + * @return + */ + public ImProductReceipt selectImProductReceiptByMakeDocumentsCode(String makeDocumentsCode); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImProductStockRequistionProductService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImProductStockRequistionProductService.java new file mode 100644 index 0000000..0efcfa3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImProductStockRequistionProductService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImProductStockRequistionProduct; + +/** + * 产品和产品出库单关联Service接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface IImProductStockRequistionProductService +{ + /** + * 查询产品和产品出库单关联 + * + * @param id 产品和产品出库单关联ID + * @return 产品和产品出库单关联 + */ + public ImProductStockRequistionProduct selectImProductStockRequistionProductById(Long id); + + /** + * 查询产品和产品出库单关联列表 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 产品和产品出库单关联集合 + */ + public List selectImProductStockRequistionProductList(ImProductStockRequistionProduct imProductStockRequistionProduct); + + /** + * 新增产品和产品出库单关联 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 结果 + */ + public int insertImProductStockRequistionProduct(ImProductStockRequistionProduct imProductStockRequistionProduct); + + /** + * 修改产品和产品出库单关联 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 结果 + */ + public int updateImProductStockRequistionProduct(ImProductStockRequistionProduct imProductStockRequistionProduct); + + /** + * 批量删除产品和产品出库单关联 + * + * @param ids 需要删除的产品和产品出库单关联ID + * @return 结果 + */ + public int deleteImProductStockRequistionProductByIds(Long[] ids); + + /** + * 删除产品和产品出库单关联信息 + * + * @param id 产品和产品出库单关联ID + * @return 结果 + */ + public int deleteImProductStockRequistionProductById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImProductStockRequistionService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImProductStockRequistionService.java new file mode 100644 index 0000000..853b196 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImProductStockRequistionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImProductStockRequistion; + +/** + * 销售出库单Service接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface IImProductStockRequistionService +{ + /** + * 查询销售出库单 + * + * @param id 销售出库单ID + * @return 销售出库单 + */ + public ImProductStockRequistion selectImProductStockRequistionById(Long id); + + /** + * 查询销售出库单列表 + * + * @param imProductStockRequistion 销售出库单 + * @return 销售出库单集合 + */ + public List selectImProductStockRequistionList(ImProductStockRequistion imProductStockRequistion); + + /** + * 新增销售出库单 + * + * @param imProductStockRequistion 销售出库单 + * @return 结果 + */ + public int insertImProductStockRequistion(ImProductStockRequistion imProductStockRequistion); + + /** + * 修改销售出库单 + * + * @param imProductStockRequistion 销售出库单 + * @return 结果 + */ + public int updateImProductStockRequistion(ImProductStockRequistion imProductStockRequistion); + + /** + * 批量删除销售出库单 + * + * @param ids 需要删除的销售出库单ID + * @return 结果 + */ + public int deleteImProductStockRequistionByIds(Long[] ids); + + /** + * 删除销售出库单信息 + * + * @param id 销售出库单ID + * @return 结果 + */ + public int deleteImProductStockRequistionById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImPurchaseReceiptMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImPurchaseReceiptMaterialService.java new file mode 100644 index 0000000..496158c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImPurchaseReceiptMaterialService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImPurchaseReceiptMaterial; + +/** + * 物料采购入库单关联Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImPurchaseReceiptMaterialService +{ + /** + * 查询物料采购入库单关联 + * + * @param id 物料采购入库单关联ID + * @return 物料采购入库单关联 + */ + public ImPurchaseReceiptMaterial selectImPurchaseReceiptMaterialById(Long id); + + /** + * 查询物料采购入库单关联列表 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 物料采购入库单关联集合 + */ + public List selectImPurchaseReceiptMaterialList(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial); + + /** + * 新增物料采购入库单关联 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 结果 + */ + public int insertImPurchaseReceiptMaterial(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial); + + /** + * 修改物料采购入库单关联 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 结果 + */ + public int updateImPurchaseReceiptMaterial(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial); + + /** + * 批量删除物料采购入库单关联 + * + * @param ids 需要删除的物料采购入库单关联ID + * @return 结果 + */ + public int deleteImPurchaseReceiptMaterialByIds(Long[] ids); + + /** + * 删除物料采购入库单关联信息 + * + * @param id 物料采购入库单关联ID + * @return 结果 + */ + public int deleteImPurchaseReceiptMaterialById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImPurchaseReceiptService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImPurchaseReceiptService.java new file mode 100644 index 0000000..d55d4b1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImPurchaseReceiptService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImPurchaseReceipt; + +/** + * 采购入库单Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImPurchaseReceiptService +{ + /** + * 查询采购入库单 + * + * @param id 采购入库单ID + * @return 采购入库单 + */ + public ImPurchaseReceipt selectImPurchaseReceiptById(Long id); + + /** + * 查询采购入库单列表 + * + * @param imPurchaseReceipt 采购入库单 + * @return 采购入库单集合 + */ + public List selectImPurchaseReceiptList(ImPurchaseReceipt imPurchaseReceipt); + + /** + * 新增采购入库单 + * + * @param imPurchaseReceipt 采购入库单 + * @return 结果 + */ + public int insertImPurchaseReceipt(ImPurchaseReceipt imPurchaseReceipt); + + /** + * 修改采购入库单 + * + * @param imPurchaseReceipt 采购入库单 + * @return 结果 + */ + public int updateImPurchaseReceipt(ImPurchaseReceipt imPurchaseReceipt); + + /** + * 批量删除采购入库单 + * + * @param ids 需要删除的采购入库单ID + * @return 结果 + */ + public int deleteImPurchaseReceiptByIds(Long[] ids); + + /** + * 删除采购入库单信息 + * + * @param id 采购入库单ID + * @return 结果 + */ + public int deleteImPurchaseReceiptById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImStockRequisitionMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImStockRequisitionMaterialService.java new file mode 100644 index 0000000..782d7b2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImStockRequisitionMaterialService.java @@ -0,0 +1,97 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterialTwo; + +/** + * 物料和物料出库单关联Service接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface IImStockRequisitionMaterialService +{ + /** + * 查询物料和物料出库单关联 + * + * @param id 物料和物料出库单关联ID + * @return 物料和物料出库单关联 + */ + public ImStockRequisitionMaterial selectImStockRequisitionMaterialById(Long id); + + /** + * 查询物料和物料出库单关联列表 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 物料和物料出库单关联集合 + */ + public List selectImStockRequisitionMaterialList(ImStockRequisitionMaterial imStockRequisitionMaterial); + + /** + * 新增物料和物料出库单关联 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 结果 + */ + public int insertImStockRequisitionMaterial(ImStockRequisitionMaterial imStockRequisitionMaterial); + + /** + * 修改物料和物料出库单关联 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 结果 + */ + public int updateImStockRequisitionMaterial(ImStockRequisitionMaterial imStockRequisitionMaterial); + + /** + * 批量删除物料和物料出库单关联 + * + * @param ids 需要删除的物料和物料出库单关联ID + * @return 结果 + */ + public int deleteImStockRequisitionMaterialByIds(Long[] ids); + + /** + * 删除物料和物料出库单关联信息 + * + * @param id 物料和物料出库单关联ID + * @return 结果 + */ + public int deleteImStockRequisitionMaterialById(Long id); + + /** + * 批量添加 + * @param lists + * @return + */ + public int insertImStockRequisitionMaterials(List lists); + + /** + * 根据code查询此单据下所有的物料 + * @param code + * @return + */ + public List selectImStockRequisitionMaterialByCode(String code); + + public List selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(String productionCode, String name,String figureNumber); + + public int deleteImStockRequisitionMaterialByCode(String code); + + public List selectImStockRequisitionMaterialByCodeAndFigureNumber(String productionCode,String figureNumber); + + public List selectImStockRequisitionMaterialListTwo( + ImStockRequisitionMaterial imStockRequisitionMaterial); + + public List selectImStockRequisitionMaterialBySparedThree(String productionCode,Long id); + + public List selectImStockRequisitionMaterialByFigureNumberAndAllGB(); + + public List selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId( + String productionCode, String name, String figureNumber, Long id); + + public List selectImStockRequisitionMaterialByNameAndFigureNumber(String materialName, String figureNumber); + + public List queryImStockRequisitionMaterialByNameAndFigureNumber(String name, String figureNumber, Date outdate); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImStockRequisitionService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImStockRequisitionService.java new file mode 100644 index 0000000..c66367b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImStockRequisitionService.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImStockRequisition; + +/** + * 领料单Service接口 + * + * @author zhukangchao + * @date 2020-06-23 + */ +public interface IImStockRequisitionService +{ + /** + * 查询领料单 + * + * @param id 领料单ID + * @return 领料单 + */ + public ImStockRequisition selectImStockRequisitionById(Long id); + + /** + * 查询领料单列表 + * + * @param imStockRequisition 领料单 + * @return 领料单集合 + */ + public List selectImStockRequisitionList(ImStockRequisition imStockRequisition); + + /** + * 新增领料单 + * + * @param imStockRequisition 领料单 + * @return 结果 + */ + public int insertImStockRequisition(ImStockRequisition imStockRequisition); + + /** + * 修改领料单 + * + * @param imStockRequisition 领料单 + * @return 结果 + */ + public int updateImStockRequisition(ImStockRequisition imStockRequisition); + + /** + * 批量删除领料单 + * + * @param ids 需要删除的领料单ID + * @return 结果 + */ + public int deleteImStockRequisitionByIds(Long[] ids); + + /** + * 删除领料单信息 + * + * @param id 领料单ID + * @return 结果 + */ + public int deleteImStockRequisitionById(Long id); + + /** + * 根据code查询,此单据是否已经申请领料(防止重复领料) + * @param code + */ + public ImStockRequisition selectImStockRequisitionByCode(String code); + + /** + * 根据执行单令号和产品型号查询 + * @param code + * @param productName + * @return + */ + public ImStockRequisition selectImStockRequisitionByCodeAndTypeName(String code, String productName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImSupplierService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImSupplierService.java new file mode 100644 index 0000000..a4df572 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImSupplierService.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImSupplier; + +/** + * 供应商Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImSupplierService +{ + /** + * 查询供应商 + * + * @param id 供应商ID + * @return 供应商 + */ + public ImSupplier selectImSupplierById(Long id); + + /** + * 查询供应商列表 + * + * @param imSupplier 供应商 + * @return 供应商集合 + */ + public List selectImSupplierList(ImSupplier imSupplier); + + /** + * 新增供应商 + * + * @param imSupplier 供应商 + * @return 结果 + */ + public int insertImSupplier(ImSupplier imSupplier); + + /** + * 修改供应商 + * + * @param imSupplier 供应商 + * @return 结果 + */ + public int updateImSupplier(ImSupplier imSupplier); + + /** + * 批量删除供应商 + * + * @param ids 需要删除的供应商ID + * @return 结果 + */ + public int deleteImSupplierByIds(Long[] ids); + + /** + * 删除供应商信息 + * + * @param id 供应商ID + * @return 结果 + */ + public int deleteImSupplierById(Long id); + + public ImSupplier selectImSupplierByName(String sellerName); + + public List getImSuppliers(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImSupplierTypeService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImSupplierTypeService.java new file mode 100644 index 0000000..dca89a9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImSupplierTypeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImSupplierType; + +/** + * 供应商类型Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImSupplierTypeService +{ + /** + * 查询供应商类型 + * + * @param id 供应商类型ID + * @return 供应商类型 + */ + public ImSupplierType selectImSupplierTypeById(Long id); + + /** + * 查询供应商类型列表 + * + * @param imSupplierType 供应商类型 + * @return 供应商类型集合 + */ + public List selectImSupplierTypeList(ImSupplierType imSupplierType); + + /** + * 新增供应商类型 + * + * @param imSupplierType 供应商类型 + * @return 结果 + */ + public int insertImSupplierType(ImSupplierType imSupplierType); + + /** + * 修改供应商类型 + * + * @param imSupplierType 供应商类型 + * @return 结果 + */ + public int updateImSupplierType(ImSupplierType imSupplierType); + + /** + * 批量删除供应商类型 + * + * @param ids 需要删除的供应商类型ID + * @return 结果 + */ + public int deleteImSupplierTypeByIds(Long[] ids); + + /** + * 删除供应商类型信息 + * + * @param id 供应商类型ID + * @return 结果 + */ + public int deleteImSupplierTypeById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IImWarehouseService.java b/evo/src/main/java/com/ruoyi/project/management/service/IImWarehouseService.java new file mode 100644 index 0000000..1a82f87 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IImWarehouseService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.ImWarehouse; + +/** + * 仓库Service接口 + * + * @author zhukangchao + * @date 2020-06-22 + */ +public interface IImWarehouseService +{ + /** + * 查询仓库 + * + * @param id 仓库ID + * @return 仓库 + */ + public ImWarehouse selectImWarehouseById(Long id); + + /** + * 查询仓库列表 + * + * @param imWarehouse 仓库 + * @return 仓库集合 + */ + public List selectImWarehouseList(ImWarehouse imWarehouse); + + /** + * 新增仓库 + * + * @param imWarehouse 仓库 + * @return 结果 + */ + public int insertImWarehouse(ImWarehouse imWarehouse); + + /** + * 修改仓库 + * + * @param imWarehouse 仓库 + * @return 结果 + */ + public int updateImWarehouse(ImWarehouse imWarehouse); + + /** + * 批量删除仓库 + * + * @param ids 需要删除的仓库ID + * @return 结果 + */ + public int deleteImWarehouseByIds(Long[] ids); + + /** + * 删除仓库信息 + * + * @param id 仓库ID + * @return 结果 + */ + public int deleteImWarehouseById(Long id); + + /** + * 根据名称查询仓库 + * @param name + * @return + */ + public ImWarehouse selectImWarehouseByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdBomMateriallsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdBomMateriallsService.java new file mode 100644 index 0000000..d73fb90 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdBomMateriallsService.java @@ -0,0 +1,30 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.JdBomMaterialls; + +/** + * 金蝶BOM物料信息Service接口 + * + * @author chenyongjiang + * @date 2024-05-17 + */ +public interface IJdBomMateriallsService +{ + /** + * 查询金蝶BOM物料信息列表 + * + * @param jdBomMaterialls 金蝶BOM物料信息 + * @return 金蝶BOM物料信息集合 + */ + public List selectJdBomMateriallsList(JdBomMaterialls jdBomMaterialls); + + /** + * 新增金蝶BOM物料信息 + * + * @param jdBomMaterialls 金蝶BOM物料信息 + * @return 结果 + */ + public int insertJdBomMaterialls(JdBomMaterialls jdBomMaterialls); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdBomNumberService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdBomNumberService.java new file mode 100644 index 0000000..cf3c8f8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdBomNumberService.java @@ -0,0 +1,38 @@ +package com.ruoyi.project.management.service; + +import com.ruoyi.project.management.domain.JdBomNumber; + +import java.util.List; + +/** + * 金蝶临时存储Service接口 + * + * @author chenyongjiang + * @date 2024-03-14 + */ +public interface IJdBomNumberService +{ + /** + * 查询金蝶临时存储 + * + * @param code 执行单号 + * @return 金蝶临时存储 + */ + public List selectJdBomNumberByCode(String code); + + /** + * 新增金蝶临时存储 + * + * @param list 金蝶临时存储 + * @return 结果 + */ + public int insertJdBomNumber(List list); + + /** + * 查询金蝶临时存储序数据 + * + * @param code 执行单号 + * @return 金蝶临时存储 + */ + public List queryJdBomNumberByCode(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdBomRecordService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdBomRecordService.java new file mode 100644 index 0000000..0bcb42a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdBomRecordService.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.JdBomRecord; + +/** + * 金蝶BOM记录Service接口 + * + * @author chenyongjiang + * @date 2024-04-24 + */ +public interface IJdBomRecordService +{ + /** + * 查询金蝶BOM记录 + * + * @param id 金蝶BOM记录ID + * @return 金蝶BOM记录 + */ + public AjaxResult pushJdProcesses(Long id); + + /** + * 查询金蝶BOM记录列表 + * + * @param jdBomRecord 金蝶BOM记录 + * @return 金蝶BOM记录集合 + */ + public List selectJdBomRecordList(JdBomRecord jdBomRecord); + + /** + * 新增金蝶BOM记录 + * + * @param jdBomRecord 金蝶BOM记录 + * @return 结果 + */ + public int insertJdBomRecord(JdBomRecord jdBomRecord); + + /** + * 修改金蝶BOM记录 + * + * @param jdBomRecord 金蝶BOM记录 + * @return 结果 + */ + public int updateJdBomRecord(JdBomRecord jdBomRecord); + + + /** + * 查询金蝶BOM记录 + * + * @param productCode ERP执行单号 + * @return 金蝶BOM记录 + */ + public List selectJdBomRecordByCode(String productCode); + + /** + * 打完成标识 + * + * @param id 金蝶BOM记录 + * @return 结果 + */ + public int updateJdBomRecordById(Long id); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdCurrencyService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdCurrencyService.java new file mode 100644 index 0000000..afdcaf2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdCurrencyService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.project.management.domain.JdCurrency; + +/** + * 币别Service接口 + * + * @author zhukangchao + * @date 2023-12-15 + */ +public interface IJdCurrencyService { + /** + * 查询币别 + * + * @param id 币别ID + * @return 币别 + */ + JdCurrency selectJdCurrencyById(Long id); + + /** + * 查询币别列表 + * + * @param jdCurrency 币别 + * @return 币别集合 + */ + List selectJdCurrencyList(JdCurrency jdCurrency); + + /** + * 新增币别 + * + * @param jdCurrency 币别 + * @return 结果 + */ + int insertJdCurrency(JdCurrency jdCurrency); + + /** + * 修改币别 + * + * @param jdCurrency 币别 + * @return 结果 + */ + int updateJdCurrency(JdCurrency jdCurrency); + + /** + * 批量删除币别 + * + * @param ids 需要删除的币别ID + * @return 结果 + */ + int deleteJdCurrencyByIds(Long[] ids); + + /** + * 删除币别信息 + * + * @param id 币别ID + * @return 结果 + */ + int deleteJdCurrencyById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdExpenseItemsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdExpenseItemsService.java new file mode 100644 index 0000000..1af8ac4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdExpenseItemsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.project.management.domain.JdExpenseItems; + +/** + * 费用项目Service接口 + * + * @author zhukangchao + * @date 2023-12-16 + */ +public interface IJdExpenseItemsService { + /** + * 查询费用项目 + * + * @param id 费用项目ID + * @return 费用项目 + */ + JdExpenseItems selectJdExpenseItemsById(Long id); + + /** + * 查询费用项目列表 + * + * @param jdExpenseItems 费用项目 + * @return 费用项目集合 + */ + List selectJdExpenseItemsList(JdExpenseItems jdExpenseItems); + + /** + * 新增费用项目 + * + * @param jdExpenseItems 费用项目 + * @return 结果 + */ + int insertJdExpenseItems(JdExpenseItems jdExpenseItems); + + /** + * 修改费用项目 + * + * @param jdExpenseItems 费用项目 + * @return 结果 + */ + int updateJdExpenseItems(JdExpenseItems jdExpenseItems); + + /** + * 批量删除费用项目 + * + * @param ids 需要删除的费用项目ID + * @return 结果 + */ + int deleteJdExpenseItemsByIds(Long[] ids); + + /** + * 删除费用项目信息 + * + * @param id 费用项目ID + * @return 结果 + */ + int deleteJdExpenseItemsById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdProcessBomRecordService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdProcessBomRecordService.java new file mode 100644 index 0000000..892e565 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdProcessBomRecordService.java @@ -0,0 +1,14 @@ +package com.ruoyi.project.management.service; + +import com.ruoyi.project.management.domain.JdProcessBomRecord; + +public interface IJdProcessBomRecordService { + + /** + * 新增金蝶工序BOM记录 + * + * @param jdProcessBomRecord 金蝶工序BOM记录 + * @return 结果 + */ + public int insertJdProcessBomAndRecord(JdProcessBomRecord jdProcessBomRecord); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdProcessBomService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdProcessBomService.java new file mode 100644 index 0000000..f59de0b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdProcessBomService.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.JdProcessBom; + +/** + * 金蝶工序BOM记录Service接口 + * + * @author chenyongjiang + * @date 2024-05-07 + */ +public interface IJdProcessBomService +{ + /** + * 查询金蝶工序BOM记录 + * + * @param id 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public JdProcessBom selectJdProcessBomById(Long id); + + /** + * 查询金蝶工序BOM记录列表 + * + * @param jdProcessBom 金蝶工序BOM记录 + * @return 金蝶工序BOM记录集合 + */ + public List selectJdProcessBomList(JdProcessBom jdProcessBom); + + /** + * 新增金蝶工序BOM记录 + * + * @param jdProcessBom 金蝶工序BOM记录 + * @return 结果 + */ + public int insertJdProcessBom(JdProcessBom jdProcessBom); + + /** + * 审核金蝶工序BOM记录 + * + * @param id 金蝶工序BOM记录 + * @return 结果 + */ + public int auditJdProcessBom(Long id); + + /** + * 修改金蝶工序BOM记录 + * + * @param jdProcessBom 金蝶工序BOM记录 + * @return 结果 + */ + public int updateJdProcessBom(JdProcessBom jdProcessBom); + + /** + * 查询金蝶工序BOM记录 + * + * @param figureNumber 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public JdProcessBom selectJdProcessBomByFigurenumber(String figureNumber); + + /** + * 根据id删除数据 + * @param id + * @return + */ + public int deleteJdProcessBomById(Long id); + + /** + * 根据生产令号查询所有工艺物料 + * + * @param productCode 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public List queryJdProcessByProductCode(String productCode); + + /** + * 根据父级图号模糊查询所有工艺 + * + * @param figureNumber 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public List queryJdProcessByFigurenumber(String figureNumber); + + /** + * 根据父级ID模糊查询所有工艺 + * + * @param parentId 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + public List queryJdProcessByPatentId(Long parentId); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IJdReceiptsDataInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IJdReceiptsDataInfoService.java new file mode 100644 index 0000000..41ed175 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IJdReceiptsDataInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.JdReceiptsDataInfo; + +/** + * 财务系统数据信息Service接口 + * + * @author zhukangchao + * @date 2023-11-27 + */ +public interface IJdReceiptsDataInfoService +{ + /** + * 查询财务系统数据信息 + * + * @param id 财务系统数据信息ID + * @return 财务系统数据信息 + */ + public JdReceiptsDataInfo selectJdReceiptsDataInfoById(Long id); + + /** + * 查询财务系统数据信息列表 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 财务系统数据信息集合 + */ + public List selectJdReceiptsDataInfoList(JdReceiptsDataInfo jdReceiptsDataInfo); + + /** + * 新增财务系统数据信息 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 结果 + */ + public int insertJdReceiptsDataInfo(JdReceiptsDataInfo jdReceiptsDataInfo); + + /** + * 修改财务系统数据信息 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 结果 + */ + public int updateJdReceiptsDataInfo(JdReceiptsDataInfo jdReceiptsDataInfo); + + /** + * 批量删除财务系统数据信息 + * + * @param ids 需要删除的财务系统数据信息ID + * @return 结果 + */ + public int deleteJdReceiptsDataInfoByIds(Long[] ids); + + /** + * 删除财务系统数据信息信息 + * + * @param id 财务系统数据信息ID + * @return 结果 + */ + public int deleteJdReceiptsDataInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IMaterialSecureService.java b/evo/src/main/java/com/ruoyi/project/management/service/IMaterialSecureService.java new file mode 100644 index 0000000..4e08c5a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IMaterialSecureService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.MaterialSecure; + +/** + * 安全库存设置Service接口 + * + * @author chenyongjiang + * @date 2024-02-19 + */ +public interface IMaterialSecureService +{ + /** + * 查询安全库存设置 + * + * @param id 安全库存设置ID + * @return 安全库存设置 + */ + public MaterialSecure selectMaterialSecureById(Long id); + + /** + * 查询安全库存设置列表 + * + * @param materialSecure 安全库存设置 + * @return 安全库存设置集合 + */ + public List selectMaterialSecureList(MaterialSecure materialSecure); + + /** + * 新增安全库存设置 + * + * @param materialSecure 安全库存设置 + * @return 结果 + */ + public int insertMaterialSecure(MaterialSecure materialSecure); + + /** + * 修改安全库存设置 + * + * @param materialSecure 安全库存设置 + * @return 结果 + */ + public int updateMaterialSecure(MaterialSecure materialSecure); + + /** + * 批量删除安全库存设置 + * + * @param ids 需要删除的安全库存设置ID + * @return 结果 + */ + public int deleteMaterialSecureByIds(Long[] ids); + + /** + * 删除安全库存设置信息 + * + * @param id 安全库存设置ID + * @return 结果 + */ + public int deleteMaterialSecureById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcCurtainMachineService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcCurtainMachineService.java new file mode 100644 index 0000000..3bae7b4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcCurtainMachineService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcCurtainMachine; + +/** + * 大幕机型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcCurtainMachineService +{ + /** + * 查询大幕机型号 + * + * @param id 大幕机型号ID + * @return 大幕机型号 + */ + public PcCurtainMachine selectPcCurtainMachineById(Long id); + + /** + * 查询大幕机型号列表 + * + * @param pcCurtainMachine 大幕机型号 + * @return 大幕机型号集合 + */ + public List selectPcCurtainMachineList(PcCurtainMachine pcCurtainMachine); + + /** + * 新增大幕机型号 + * + * @param pcCurtainMachine 大幕机型号 + * @return 结果 + */ + public int insertPcCurtainMachine(PcCurtainMachine pcCurtainMachine); + + /** + * 修改大幕机型号 + * + * @param pcCurtainMachine 大幕机型号 + * @return 结果 + */ + public int updatePcCurtainMachine(PcCurtainMachine pcCurtainMachine); + + /** + * 批量删除大幕机型号 + * + * @param ids 需要删除的大幕机型号ID + * @return 结果 + */ + public int deletePcCurtainMachineByIds(Long[] ids); + + /** + * 删除大幕机型号信息 + * + * @param id 大幕机型号ID + * @return 结果 + */ + public int deletePcCurtainMachineById(Long id); + + public PcCurtainMachine selectPcCurtainMachineByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcDetentService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcDetentService.java new file mode 100644 index 0000000..d510ac3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcDetentService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcDetent; + +/** + * 制动器型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcDetentService +{ + /** + * 查询制动器型号 + * + * @param id 制动器型号ID + * @return 制动器型号 + */ + public PcDetent selectPcDetentById(Long id); + + /** + * 查询制动器型号列表 + * + * @param pcDetent 制动器型号 + * @return 制动器型号集合 + */ + public List selectPcDetentList(PcDetent pcDetent); + + /** + * 新增制动器型号 + * + * @param pcDetent 制动器型号 + * @return 结果 + */ + public int insertPcDetent(PcDetent pcDetent); + + /** + * 修改制动器型号 + * + * @param pcDetent 制动器型号 + * @return 结果 + */ + public int updatePcDetent(PcDetent pcDetent); + + /** + * 批量删除制动器型号 + * + * @param ids 需要删除的制动器型号ID + * @return 结果 + */ + public int deletePcDetentByIds(Long[] ids); + + /** + * 删除制动器型号信息 + * + * @param id 制动器型号ID + * @return 结果 + */ + public int deletePcDetentById(Long id); + + public PcDetent selectPcDetentByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcElectricalMachineryAcService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcElectricalMachineryAcService.java new file mode 100644 index 0000000..90fe5f0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcElectricalMachineryAcService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcElectricalMachineryAc; + +/** + * 电机AC型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcElectricalMachineryAcService +{ + /** + * 查询电机AC型号 + * + * @param id 电机AC型号ID + * @return 电机AC型号 + */ + public PcElectricalMachineryAc selectPcElectricalMachineryAcById(Long id); + + /** + * 查询电机AC型号列表 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 电机AC型号集合 + */ + public List selectPcElectricalMachineryAcList(PcElectricalMachineryAc pcElectricalMachineryAc); + + /** + * 新增电机AC型号 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 结果 + */ + public int insertPcElectricalMachineryAc(PcElectricalMachineryAc pcElectricalMachineryAc); + + /** + * 修改电机AC型号 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 结果 + */ + public int updatePcElectricalMachineryAc(PcElectricalMachineryAc pcElectricalMachineryAc); + + /** + * 批量删除电机AC型号 + * + * @param ids 需要删除的电机AC型号ID + * @return 结果 + */ + public int deletePcElectricalMachineryAcByIds(Long[] ids); + + /** + * 删除电机AC型号信息 + * + * @param id 电机AC型号ID + * @return 结果 + */ + public int deletePcElectricalMachineryAcById(Long id); + + public PcElectricalMachineryAc selectPcElectricalMachineryAcByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcFTypeReducerService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcFTypeReducerService.java new file mode 100644 index 0000000..37cd3cb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcFTypeReducerService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcFTypeReducer; + +/** + * F型减速机型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcFTypeReducerService +{ + /** + * 查询F型减速机型号 + * + * @param id F型减速机型号ID + * @return F型减速机型号 + */ + public PcFTypeReducer selectPcFTypeReducerById(Long id); + + /** + * 查询F型减速机型号列表 + * + * @param pcFTypeReducer F型减速机型号 + * @return F型减速机型号集合 + */ + public List selectPcFTypeReducerList(PcFTypeReducer pcFTypeReducer); + + /** + * 新增F型减速机型号 + * + * @param pcFTypeReducer F型减速机型号 + * @return 结果 + */ + public int insertPcFTypeReducer(PcFTypeReducer pcFTypeReducer); + + /** + * 修改F型减速机型号 + * + * @param pcFTypeReducer F型减速机型号 + * @return 结果 + */ + public int updatePcFTypeReducer(PcFTypeReducer pcFTypeReducer); + + /** + * 批量删除F型减速机型号 + * + * @param ids 需要删除的F型减速机型号ID + * @return 结果 + */ + public int deletePcFTypeReducerByIds(Long[] ids); + + /** + * 删除F型减速机型号信息 + * + * @param id F型减速机型号ID + * @return 结果 + */ + public int deletePcFTypeReducerById(Long id); + + public PcFTypeReducer selectPcFTypeReducerByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcFireCurtainDampingDriveService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcFireCurtainDampingDriveService.java new file mode 100644 index 0000000..054ef5d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcFireCurtainDampingDriveService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcFireCurtainDampingDrive; + +/** + * 防火隔离幕阻尼驱动型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcFireCurtainDampingDriveService +{ + /** + * 查询防火隔离幕阻尼驱动型号 + * + * @param id 防火隔离幕阻尼驱动型号ID + * @return 防火隔离幕阻尼驱动型号 + */ + public PcFireCurtainDampingDrive selectPcFireCurtainDampingDriveById(Long id); + + /** + * 查询防火隔离幕阻尼驱动型号列表 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 防火隔离幕阻尼驱动型号集合 + */ + public List selectPcFireCurtainDampingDriveList(PcFireCurtainDampingDrive pcFireCurtainDampingDrive); + + /** + * 新增防火隔离幕阻尼驱动型号 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 结果 + */ + public int insertPcFireCurtainDampingDrive(PcFireCurtainDampingDrive pcFireCurtainDampingDrive); + + /** + * 修改防火隔离幕阻尼驱动型号 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 结果 + */ + public int updatePcFireCurtainDampingDrive(PcFireCurtainDampingDrive pcFireCurtainDampingDrive); + + /** + * 批量删除防火隔离幕阻尼驱动型号 + * + * @param ids 需要删除的防火隔离幕阻尼驱动型号ID + * @return 结果 + */ + public int deletePcFireCurtainDampingDriveByIds(Long[] ids); + + /** + * 删除防火隔离幕阻尼驱动型号信息 + * + * @param id 防火隔离幕阻尼驱动型号ID + * @return 结果 + */ + public int deletePcFireCurtainDampingDriveById(Long id); + + public PcFireCurtainDampingDrive selectPcFireCurtainDampingDriveByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcHooksCouplingService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcHooksCouplingService.java new file mode 100644 index 0000000..df465f2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcHooksCouplingService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcHooksCoupling; + +/** + * 万向连轴器型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcHooksCouplingService +{ + /** + * 查询万向连轴器型号 + * + * @param id 万向连轴器型号ID + * @return 万向连轴器型号 + */ + public PcHooksCoupling selectPcHooksCouplingById(Long id); + + /** + * 查询万向连轴器型号列表 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 万向连轴器型号集合 + */ + public List selectPcHooksCouplingList(PcHooksCoupling pcHooksCoupling); + + /** + * 新增万向连轴器型号 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 结果 + */ + public int insertPcHooksCoupling(PcHooksCoupling pcHooksCoupling); + + /** + * 修改万向连轴器型号 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 结果 + */ + public int updatePcHooksCoupling(PcHooksCoupling pcHooksCoupling); + + /** + * 批量删除万向连轴器型号 + * + * @param ids 需要删除的万向连轴器型号ID + * @return 结果 + */ + public int deletePcHooksCouplingByIds(Long[] ids); + + /** + * 删除万向连轴器型号信息 + * + * @param id 万向连轴器型号ID + * @return 结果 + */ + public int deletePcHooksCouplingById(Long id); + + public PcHooksCoupling selectPcHooksCouplingByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcRigidChainService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcRigidChainService.java new file mode 100644 index 0000000..3aefbf1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcRigidChainService.java @@ -0,0 +1,81 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcRigidChain; + +/** + * 销齿链型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcRigidChainService +{ + /** + * 查询销齿链型号 + * + * @param id 销齿链型号ID + * @return 销齿链型号 + */ + public PcRigidChain selectPcRigidChainById(Long id); + + /** + * 查询销齿链型号列表 + * + * @param pcRigidChain 销齿链型号 + * @return 销齿链型号集合 + */ + public List selectPcRigidChainList(PcRigidChain pcRigidChain); + + /** + * 新增销齿链型号 + * + * @param pcRigidChain 销齿链型号 + * @return 结果 + */ + public int insertPcRigidChain(PcRigidChain pcRigidChain); + + /** + * 修改销齿链型号 + * + * @param pcRigidChain 销齿链型号 + * @return 结果 + */ + public int updatePcRigidChain(PcRigidChain pcRigidChain); + + /** + * 批量删除销齿链型号 + * + * @param ids 需要删除的销齿链型号ID + * @return 结果 + */ + public int deletePcRigidChainByIds(Long[] ids); + + /** + * 删除销齿链型号信息 + * + * @param id 销齿链型号ID + * @return 结果 + */ + public int deletePcRigidChainById(Long id); + + /** + * 查询销齿链型号,按型号名称去重 + * @return + */ + public List selectPcRigidChainByTypeList(); + + /** + * 根据型号全称查询型号信息 + * @param typeName + */ + public PcRigidChain selectPcRigidChainByTypeName(String typeName); + + /** + * + * @return + */ + public List selectPcRigidChainByJourneyList(String type); + + public List selectPcRigidChainByType(String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcStrokeMeasurementService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcStrokeMeasurementService.java new file mode 100644 index 0000000..e097c1f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcStrokeMeasurementService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcStrokeMeasurement; + +/** + * 行程检测型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcStrokeMeasurementService +{ + /** + * 查询行程检测型号 + * + * @param id 行程检测型号ID + * @return 行程检测型号 + */ + public PcStrokeMeasurement selectPcStrokeMeasurementById(Long id); + + /** + * 查询行程检测型号列表 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 行程检测型号集合 + */ + public List selectPcStrokeMeasurementList(PcStrokeMeasurement pcStrokeMeasurement); + + /** + * 新增行程检测型号 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 结果 + */ + public int insertPcStrokeMeasurement(PcStrokeMeasurement pcStrokeMeasurement); + + /** + * 修改行程检测型号 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 结果 + */ + public int updatePcStrokeMeasurement(PcStrokeMeasurement pcStrokeMeasurement); + + /** + * 批量删除行程检测型号 + * + * @param ids 需要删除的行程检测型号ID + * @return 结果 + */ + public int deletePcStrokeMeasurementByIds(Long[] ids); + + /** + * 删除行程检测型号信息 + * + * @param id 行程检测型号ID + * @return 结果 + */ + public int deletePcStrokeMeasurementById(Long id); + + public PcStrokeMeasurement selectPcStrokeMeasurementByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcToothedCouplingService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcToothedCouplingService.java new file mode 100644 index 0000000..62f4d58 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcToothedCouplingService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcToothedCoupling; + +/** + * 齿形连轴器型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcToothedCouplingService +{ + /** + * 查询齿形连轴器型号 + * + * @param id 齿形连轴器型号ID + * @return 齿形连轴器型号 + */ + public PcToothedCoupling selectPcToothedCouplingById(Long id); + + /** + * 查询齿形连轴器型号列表 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 齿形连轴器型号集合 + */ + public List selectPcToothedCouplingList(PcToothedCoupling pcToothedCoupling); + + /** + * 新增齿形连轴器型号 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 结果 + */ + public int insertPcToothedCoupling(PcToothedCoupling pcToothedCoupling); + + /** + * 修改齿形连轴器型号 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 结果 + */ + public int updatePcToothedCoupling(PcToothedCoupling pcToothedCoupling); + + /** + * 批量删除齿形连轴器型号 + * + * @param ids 需要删除的齿形连轴器型号ID + * @return 结果 + */ + public int deletePcToothedCouplingByIds(Long[] ids); + + /** + * 删除齿形连轴器型号信息 + * + * @param id 齿形连轴器型号ID + * @return 结果 + */ + public int deletePcToothedCouplingById(Long id); + + public PcToothedCoupling selectPcToothedCouplingByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcTravelSwitchService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcTravelSwitchService.java new file mode 100644 index 0000000..dea7e1a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcTravelSwitchService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcTravelSwitch; + +/** + * 行程开关型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcTravelSwitchService +{ + /** + * 查询行程开关型号 + * + * @param id 行程开关型号ID + * @return 行程开关型号 + */ + public PcTravelSwitch selectPcTravelSwitchById(Long id); + + /** + * 查询行程开关型号列表 + * + * @param pcTravelSwitch 行程开关型号 + * @return 行程开关型号集合 + */ + public List selectPcTravelSwitchList(PcTravelSwitch pcTravelSwitch); + + /** + * 新增行程开关型号 + * + * @param pcTravelSwitch 行程开关型号 + * @return 结果 + */ + public int insertPcTravelSwitch(PcTravelSwitch pcTravelSwitch); + + /** + * 修改行程开关型号 + * + * @param pcTravelSwitch 行程开关型号 + * @return 结果 + */ + public int updatePcTravelSwitch(PcTravelSwitch pcTravelSwitch); + + /** + * 批量删除行程开关型号 + * + * @param ids 需要删除的行程开关型号ID + * @return 结果 + */ + public int deletePcTravelSwitchByIds(Long[] ids); + + /** + * 删除行程开关型号信息 + * + * @param id 行程开关型号ID + * @return 结果 + */ + public int deletePcTravelSwitchById(Long id); + + public PcTravelSwitch selectPcTravelSwitchByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcTwoStageReductionGearService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcTwoStageReductionGearService.java new file mode 100644 index 0000000..f070294 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcTwoStageReductionGearService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcTwoStageReductionGear; + +/** + * 二级减速器型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcTwoStageReductionGearService +{ + /** + * 查询二级减速器型号 + * + * @param id 二级减速器型号ID + * @return 二级减速器型号 + */ + public PcTwoStageReductionGear selectPcTwoStageReductionGearById(Long id); + + /** + * 查询二级减速器型号列表 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 二级减速器型号集合 + */ + public List selectPcTwoStageReductionGearList(PcTwoStageReductionGear pcTwoStageReductionGear); + + /** + * 新增二级减速器型号 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 结果 + */ + public int insertPcTwoStageReductionGear(PcTwoStageReductionGear pcTwoStageReductionGear); + + /** + * 修改二级减速器型号 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 结果 + */ + public int updatePcTwoStageReductionGear(PcTwoStageReductionGear pcTwoStageReductionGear); + + /** + * 批量删除二级减速器型号 + * + * @param ids 需要删除的二级减速器型号ID + * @return 结果 + */ + public int deletePcTwoStageReductionGearByIds(Long[] ids); + + /** + * 删除二级减速器型号信息 + * + * @param id 二级减速器型号ID + * @return 结果 + */ + public int deletePcTwoStageReductionGearById(Long id); + + public PcTwoStageReductionGear selectPcTwoStageReductionGearByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPcWindlassService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPcWindlassService.java new file mode 100644 index 0000000..86128af --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPcWindlassService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PcWindlass; + +/** + * 卷扬机型号Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPcWindlassService +{ + /** + * 查询卷扬机型号 + * + * @param id 卷扬机型号ID + * @return 卷扬机型号 + */ + public PcWindlass selectPcWindlassById(Long id); + + /** + * 查询卷扬机型号列表 + * + * @param pcWindlass 卷扬机型号 + * @return 卷扬机型号集合 + */ + public List selectPcWindlassList(PcWindlass pcWindlass); + + /** + * 新增卷扬机型号 + * + * @param pcWindlass 卷扬机型号 + * @return 结果 + */ + public int insertPcWindlass(PcWindlass pcWindlass); + + /** + * 修改卷扬机型号 + * + * @param pcWindlass 卷扬机型号 + * @return 结果 + */ + public int updatePcWindlass(PcWindlass pcWindlass); + + /** + * 批量删除卷扬机型号 + * + * @param ids 需要删除的卷扬机型号ID + * @return 结果 + */ + public int deletePcWindlassByIds(Long[] ids); + + /** + * 删除卷扬机型号信息 + * + * @param id 卷扬机型号ID + * @return 结果 + */ + public int deletePcWindlassById(Long id); + + public PcWindlass selectPcWindlassByTypeName(String typeName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwAlterationDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwAlterationDetailService.java new file mode 100644 index 0000000..b90b643 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwAlterationDetailService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwAlterationDetail; + +/** + * 变更单详情Service接口 + * + * @author zhukangchao + * @date 2022-04-14 + */ +public interface IPwAlterationDetailService +{ + /** + * 查询变更单详情 + * + * @param id 变更单详情ID + * @return 变更单详情 + */ + public PwAlterationDetail selectPwAlterationDetailById(Long id); + + /** + * 查询变更单详情列表 + * + * @param pwAlterationDetail 变更单详情 + * @return 变更单详情集合 + */ + public List selectPwAlterationDetailList(PwAlterationDetail pwAlterationDetail); + + /** + * 新增变更单详情 + * + * @param pwAlterationDetail 变更单详情 + * @return 结果 + */ + public int insertPwAlterationDetail(PwAlterationDetail pwAlterationDetail); + + /** + * 修改变更单详情 + * + * @param pwAlterationDetail 变更单详情 + * @return 结果 + */ + public int updatePwAlterationDetail(PwAlterationDetail pwAlterationDetail); + + /** + * 批量删除变更单详情 + * + * @param ids 需要删除的变更单详情ID + * @return 结果 + */ + public int deletePwAlterationDetailByIds(Long[] ids); + + /** + * 删除变更单详情信息 + * + * @param id 变更单详情ID + * @return 结果 + */ + public int deletePwAlterationDetailById(Long id); + + public List selectPwAlterationDetailByAlterationId(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwAlterationService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwAlterationService.java new file mode 100644 index 0000000..9c2bc50 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwAlterationService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwAlteration; + +/** + * 变更单Service接口 + * + * @author zhukangchao + * @date 2022-04-14 + */ +public interface IPwAlterationService +{ + /** + * 查询变更单 + * + * @param id 变更单ID + * @return 变更单 + */ + public PwAlteration selectPwAlterationById(Long id); + + /** + * 查询变更单列表 + * + * @param pwAlteration 变更单 + * @return 变更单集合 + */ + public List selectPwAlterationList(PwAlteration pwAlteration); + + /** + * 新增变更单 + * + * @param pwAlteration 变更单 + * @return 结果 + */ + public int insertPwAlteration(PwAlteration pwAlteration); + + /** + * 修改变更单 + * + * @param pwAlteration 变更单 + * @return 结果 + */ + public int updatePwAlteration(PwAlteration pwAlteration); + + /** + * 批量删除变更单 + * + * @param ids 需要删除的变更单ID + * @return 结果 + */ + public int deletePwAlterationByIds(Long[] ids); + + /** + * 删除变更单信息 + * + * @param id 变更单ID + * @return 结果 + */ + public int deletePwAlterationById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBacklogService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBacklogService.java new file mode 100644 index 0000000..62d4a3f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBacklogService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBacklog; + +/** + * 待办事项Service接口 + * + * @author zhukangchao + * @date 2023-02-05 + */ +public interface IPwBacklogService +{ + /** + * 查询待办事项 + * + * @param id 待办事项ID + * @return 待办事项 + */ + public PwBacklog selectPwBacklogById(Long id); + + /** + * 查询待办事项列表 + * + * @param pwBacklog 待办事项 + * @return 待办事项集合 + */ + public List selectPwBacklogList(PwBacklog pwBacklog); + + /** + * 新增待办事项 + * + * @param pwBacklog 待办事项 + * @return 结果 + */ + public int insertPwBacklog(PwBacklog pwBacklog); + + /** + * 修改待办事项 + * + * @param pwBacklog 待办事项 + * @return 结果 + */ + public int updatePwBacklog(PwBacklog pwBacklog); + + /** + * 批量删除待办事项 + * + * @param ids 需要删除的待办事项ID + * @return 结果 + */ + public int deletePwBacklogByIds(Long[] ids); + + /** + * 删除待办事项信息 + * + * @param id 待办事项ID + * @return 结果 + */ + public int deletePwBacklogById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberService.java new file mode 100644 index 0000000..89b5a4b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberService.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.ProdictBillBom; +import com.ruoyi.project.management.domain.PwBomNumber; +import com.ruoyi.project.management.domain.PwBomNumberTwo; + +/** + * 数量计算Service接口 + * + * @author zhukangchao + * @date 2021-03-22 + */ +public interface IPwBomNumberService +{ + /** + * 查询数量计算 + * + * @param id 数量计算ID + * @return 数量计算 + */ + public PwBomNumber selectPwBomNumberById(Long id); + + /** + * 查询数量计算列表 + * + * @param pwBomNumber 数量计算 + * @return 数量计算集合 + */ + public List selectPwBomNumberList(PwBomNumber pwBomNumber); + + /** + * 新增数量计算 + * + * @param pwBomNumber 数量计算 + * @return 结果 + */ + public int insertPwBomNumber(PwBomNumber pwBomNumber); + + /** + * 修改数量计算 + * + * @param pwBomNumber 数量计算 + * @return 结果 + */ + public int updatePwBomNumber(PwBomNumber pwBomNumber); + /** + * 根据上级图号查询上级信息 + * @param parentLevelFigureNumber + * @return + */ + public List selectPwBomNumberByParentLevelFigureNumber(String parentLevelFigureNumber,String typeName,String code); + + public List selectPwBomNumberByCode(String code); + + public List queryPwBomNumberByCode(String code); + + public int insertPwBoms(List list); + + public int deletePwBomNumberByCode(String code); + + /** + * 根据令号和型号查询 + * @param code + * @param typeName + * @return + */ + public List selectPwBomNumberByCodeAndTypeName(String code, String typeName); + + public List selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(String productionCode, + String name, String figureNumber, String sparedOne); + + public List selectPwBomNumberByCodeAndNameAndFigureNumber(String productionCode, String name, String figureNumber); + /** + * 根据执行单号查询所有总图 + * @param code + * @return + */ + public List queryPwBomNumberZTByCode(String code); + + /** + * 根据上级图号查询上级信息 + * @param parentLevelFigureNumber + * @return + */ + public List selectPwBomNumberByParentFigureNumber(String parentLevelFigureNumber,String code); + /** + * 根据生产单号,父级图号,序号查询 + * @param parentLevelFigureNumber 父级图号 + * @param code 生产单号 + * @param num 序号 + * @return + */ + public List queryPwBomNumberByParentFigureNumberAndNum(String parentLevelFigureNumber,String code,String num); + + /** + * 根据生产令号和图号修改属性 + * @param purchaseMark 属性 + * @param productCode 生产令号 + * @param figureNumber 图号 + * @return + */ + public int updatePwBomNumberByCodeAndFigureNumber(String purchaseMark,String productCode,String figureNumber); + + /** + * 根据生产令号查询BOM + * @param code + * @return + */ + public List queryBomList(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoFuService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoFuService.java new file mode 100644 index 0000000..dcea051 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoFuService.java @@ -0,0 +1,74 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoFu; + +/** + * 副BomService接口 + * + * @author zhukangchao + * @date 2023-04-17 + */ +public interface IPwBomNumberTwoFuService +{ + /** + * 查询副Bom + * + * @param id 副BomID + * @return 副Bom + */ + public PwBomNumberTwoFu selectPwBomNumberTwoFuById(Long id); + + /** + * 查询副Bom列表 + * + * @param pwBomNumberTwoFu 副Bom + * @return 副Bom集合 + */ + public List selectPwBomNumberTwoFuList(PwBomNumberTwoFu pwBomNumberTwoFu); + + /** + * 新增副Bom + * + * @param pwBomNumberTwoFu 副Bom + * @return 结果 + */ + public int insertPwBomNumberTwoFu(PwBomNumberTwoFu pwBomNumberTwoFu); + + /** + * 修改副Bom + * + * @param pwBomNumberTwoFu 副Bom + * @return 结果 + */ + public int updatePwBomNumberTwoFu(PwBomNumberTwoFu pwBomNumberTwoFu); + + /** + * 批量删除副Bom + * + * @param ids 需要删除的副BomID + * @return 结果 + */ + public int deletePwBomNumberTwoFuByIds(Long[] ids); + + /** + * 删除副Bom信息 + * + * @param id 副BomID + * @return 结果 + */ + public int deletePwBomNumberTwoFuById(Long id); + + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndParentLevelNameAndParentLevelFigureNumber( + String productionCode, String parentLevelName, String parentLevelFigureNumber); + + public List selectPwBomNumberTwoFuByCodeAndSuperiorId(String productionCode, Long id); + + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndFigureNumber(String productionCode, String figureNumber); + + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndNameAndFigureNumber(String productionCode, String name,String figureNumber); + + public List selectPwBomByCodeAndParentNameAndParentFigureNumbers(String productionCode, String name, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoGongxuService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoGongxuService.java new file mode 100644 index 0000000..46457e5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoGongxuService.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoGongxu; + +/** + * BOM工序引用Service接口 + * + * @author zhukangchao + * @date 2023-09-24 + */ +public interface IPwBomNumberTwoGongxuService +{ + /** + * 查询BOM工序引用 + * + * @param id BOM工序引用ID + * @return BOM工序引用 + */ + public PwBomNumberTwoGongxu selectPwBomNumberTwoGongxuById(Long id); + + /** + * 查询BOM工序引用列表 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return BOM工序引用集合 + */ + public List selectPwBomNumberTwoGongxuList(PwBomNumberTwoGongxu pwBomNumberTwoGongxu); + + /** + * 新增BOM工序引用 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return 结果 + */ + public int insertPwBomNumberTwoGongxu(PwBomNumberTwoGongxu pwBomNumberTwoGongxu); + + /** + * 修改BOM工序引用 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return 结果 + */ + public int updatePwBomNumberTwoGongxu(PwBomNumberTwoGongxu pwBomNumberTwoGongxu); + + /** + * 批量删除BOM工序引用 + * + * @param ids 需要删除的BOM工序引用ID + * @return 结果 + */ + public int deletePwBomNumberTwoGongxuByIds(Long[] ids); + + /** + * 删除BOM工序引用信息 + * + * @param id BOM工序引用ID + * @return 结果 + */ + public int deletePwBomNumberTwoGongxuById(Long id); + + public int insertPwBomNumberTwoGongxus(List list); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoLingliaoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoLingliaoService.java new file mode 100644 index 0000000..4a6b261 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoLingliaoService.java @@ -0,0 +1,79 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBomNumberTwoLingliao; + +/** + * 领料专用bomService接口 + * + * @author zhukangchao + * @date 2022-02-23 + */ +public interface IPwBomNumberTwoLingliaoService +{ + /** + * 查询领料专用bom + * + * @param id 领料专用bomID + * @return 领料专用bom + */ + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingliaoById(Long id); + + /** + * 查询领料专用bom列表 + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 领料专用bom集合 + */ + public List selectPwBomNumberTwoLingliaoList(PwBomNumberTwoLingliao pwBomNumberTwoLingliao); + + /** + * 新增领料专用bom + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 结果 + */ + public int insertPwBomNumberTwoLingliao(PwBomNumberTwoLingliao pwBomNumberTwoLingliao); + + /** + * 修改领料专用bom + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 结果 + */ + public int updatePwBomNumberTwoLingliao(PwBomNumberTwoLingliao pwBomNumberTwoLingliao); + + /** + * 批量删除领料专用bom + * + * @param ids 需要删除的领料专用bomID + * @return 结果 + */ + public int deletePwBomNumberTwoLingliaoByIds(Long[] ids); + + /** + * 删除领料专用bom信息 + * + * @param id 领料专用bomID + * @return 结果 + */ + public int deletePwBomNumberTwoLingliaoById(Long id); + + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(String productionCode,String type, String name, String figureNumber); + + public List selectPwBomNumberTwoLingliaoByCodeAndProductType(String code,String productType); + + /** + * 根据code删除领料专用bom信息 + * @param code + */ + public int deletePwBomNumberTwoLingliaoByCode(String code); + + public List selectPwBomNumberTwoLingliaoByFigureNumberAndAllGB(); + + public List selectPwBomNumberTwoLingliaoByCodeAndFigureNumber(String productionCode, String name, String figureNumber); + + public List selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(String productionCode,String name, String figureNumber,String type); + + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingLiaoByCodeAndNameAndFigureNumber(String productionCode, String name, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoService.java new file mode 100644 index 0000000..7c8c104 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomNumberTwoService.java @@ -0,0 +1,270 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.PwBomNumber; +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.management.domain.PwBom; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoVo; + +/** + * 数量保存Service接口 + * + * @author zhukangchao + * @date 2021-03-30 + */ +public interface IPwBomNumberTwoService +{ + /** + * 查询数量保存 + * + * @param id 数量保存ID + * @return 数量保存 + */ + public PwBomNumberTwo selectPwBomNumberTwoById(Long id); + + /** + * 查询数量保存列表 + * + * @param pwBomNumberTwo 数量保存 + * @return 数量保存集合 + */ + public List selectPwBomNumberTwoList(PwBomNumberTwo pwBomNumberTwo); + + /** + * 查询数量保存列表(去掉本批数量为0的数据) + * + * @param pwBomNumberTwo 数量保存 + * @return 数量保存集合 + */ + public List selectPwBomNumberTwoLists(PwBomNumberTwo pwBomNumberTwo); + + /** + * 新增数量保存 + * + * @param pwBomNumberTwo 数量保存 + * @return 结果 + */ + public int insertPwBomNumberTwo(PwBomNumberTwo pwBomNumberTwo); + + /** + * 修改数量保存 + * + * @param pwBomNumberTwo 数量保存 + * @return 结果 + */ + public int updatePwBomNumberTwo(PwBomNumberTwo pwBomNumberTwo); + + /** + * 批量删除数量保存 + * + * @param ids 需要删除的数量保存ID + * @return 结果 + */ + public int deletePwBomNumberTwoByIds(Long[] ids); + + /** + * 删除数量保存信息 + * + * @param id 数量保存ID + * @return 结果 + */ + public int deletePwBomNumberTwoById(Long id); + + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(String productionCode,String name, String figureNumber); + + /** + * 根据令号查询当前令号下非标准件和没有库存的图号 + * @param code + * @return + */ + public List selectPwBomNumberTwoByCode(String code); + + public int deletePwBomNumberTwoByCode(String code); + + /** + * 根据执行单令号和产品型号查询 + * @param code + * @param productType + * @return + */ + public List selectPwBomNumberTwoByCodeAndProductType(String code, String productType); + + /** + * 根据生产令号查询当前令号下所有的物料信息 + * @param code + * @return + */ + public List selectPwBomNumberTwoByProductionCode(String code); + + public List selectPwBomNumberTwoByNameAndFigureNumberNoRepetition(String name, String figureNumber); + + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndNameAndFigureNumber(String makeDocumentsCode, String materialName, + String specification); + + public List selectPwBomNumberTwoByCodeAndIsSpacing(String code); + + /** + * 根据令号和上级图号及上级名称查询 + * @param productionCode + * @param parentLevelName + * @param parentLevelFigureNumber + * @return + */ + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumber(String productionCode, String parentLevelName, String parentLevelFigureNumber); + + /** + * 根据令号和上级id查询 + * @param productionCode + * @param id + * @return + */ + public List selectPwBomNumberTwoByCodeAndSuperiorId(String productionCode, Long id); + + /** + * 根据令号和上级图号及上级名称查询其所有子集 + * @param code + * @param parentLevelName + * @param figureNumber + */ + public List selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumbers(String code, + String parentLevelName, String figureNumber); + + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndFigureNumber(String productionCode, String figureNumber); + + /** + * 查询铆焊工段的数据 + * @param productionCode + * @param id + * @return + */ + public List selectPwBomNumberTwoByCodeAndSuperiorIdAndDepartmentName(String productionCode, Long id); + + public List selectPwBomNumberTwoListToBom(PwBomNumberTwo two); + + public List selectPwBomNumberTwoListToBomVo(PwBomNumberTwoVo two); + + public List selectPwBomNumberTwoByProductionCodeALL(String code); + + /** + * 查询自制件 + * @param pwBomNumberTwo + * @return + */ + public List selectPwBomNumberTwoListHomeMade(PwBomNumberTwo pwBomNumberTwo); + + /** + * 查询标准件 + * @param pwBomNumberTwo + * @return + */ + public List selectPwBomNumberTwoListStandard(PwBomNumberTwo pwBomNumberTwo); + + /** + * 查询外购件 + * @param pwBomNumberTwo + * @return + */ + public List selectPwBomNumberTwoListOutsourcing(PwBomNumberTwo pwBomNumberTwo); + + /** + * 查询甲供件 + * @param pwBomNumberTwo + * @return + */ + public List selectPwBomNumberTwoListFirstParty(PwBomNumberTwo pwBomNumberTwo); + + /** + * + * 根据项目令号查询此项目下所有的物料信息(本批数量大于0的且不带工序的物料) + * @return + */ + public List selectPwBomNumberTwoByCodeByG(String code); + + /** + * 根据令号查询有工序的物料 + * @param productionCode + * @return + */ + public List selectPwBomNumberTwoByCodeAndSuperiorIdNotIsNull(String productionCode); + + public List selectPwBomNumberTwoVoByCodeAndSuperiorId(String productionCode, Long id); + + public List selectPwBomNumberTwoByCodeAndMuXiang(String code); + + public List selectPwBomNumberTwoByFigureNumberAndAllGB(); + + public List selectPwBomNumberTwoByDeptNameAndWeiWanCheng(PwBomNumberTwo pwBomNumberTwo); + + public List selectPwBomByCodeAndParentNameAndParentFigureNumbers(String productionCode, String name,String figureNumber); + + public List selectPwBomNumberTwoByCodeAndKanBan(String code); + + public List selectPwBomNumberTwoByCodeAndAll(String code); + + public List selectPwBomNumberTwoByNameAndFigureNumber(String name, String figureNumber); + + public List selectPwBomNumberTwoByMaterialId(Long id); + + public List selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(String code, String name,String figureNumber); + + public List selectBomTwoByCodeAndSparedOne(String code, String productType); + + public List selectPwBomNumberTwoByCodeAndMaterialIdIsNotNull(String productionCode); + + /** + * 根据令号和是否是成品标记查询 + * @param productionCode + * @param i + * @return + */ + public List selectbycodeAndSparedFive(String productionCode, int i); + + /** + * 批量新增数量保存 + * + * @param bomList 数量保存 + * @return 结果 + */ + public int insertBatchPwBomNumberTwo(List bomList); + + public AjaxResult importData(List list); + + /** + * 查询数量保存列表 + * + * @param productCode 数量保存 + * @return 数量保存集合 + */ + public List selectPwBomNumberTwoListForJd(String productCode); + + /** + * 根据图号和生产令号,查询本图号及其工艺 + * @param productionCode + * @param figureNumber + * @return + */ + public List queryPwBomNumberTwoProcessByCodeAndFigureNumber(String productionCode, String figureNumber); + /** + * 根据序号和生产令号,查询本图号及其工艺 + * @param productionCode + * @param num + * @return + */ + public List queryPwBomNumberTwoProcessByCodeAndNum(String productionCode, String num); + + /** + * 根据图号和生产令号,查询本图号及其工艺 + * @return + */ + public List queryProcessByCodeAndFigureNumber(Long id); + + /** + * 根据父级ID查询工序 + * @return + */ + public List queryProcessByParentId(Long parentId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBomService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomService.java new file mode 100644 index 0000000..2484f5f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBomService.java @@ -0,0 +1,91 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBom; +import com.ruoyi.project.management.domain.PwBomNumber; + +/** + * bomService接口 + * + * @author zhukangchao + * @date 2020-08-11 + */ +public interface IPwBomService +{ + /** + * 查询bom + * + * @param id bomID + * @return bom + */ + public PwBom selectPwBomById(Long id); + + /** + * 查询bom列表 + * + * @param pwBom bom + * @return bom集合 + */ + public List selectPwBomList(PwBom pwBom); + + /** + * 新增bom + * + * @param pwBom bom + * @return 结果 + */ + public int insertPwBom(PwBom pwBom); + + /** + * 修改bom + * + * @param pwBom bom + * @return 结果 + */ + public int updatePwBom(PwBom pwBom); + + /** + * 批量删除bom + * + * @param ids 需要删除的bomID + * @return 结果 + */ + public int deletePwBomByIds(Long[] ids); + + /** + * 删除bom信息 + * + * @param id bomID + * @return 结果 + */ + public int deletePwBomById(Long id); + + /** + * 批量添加 + * @param list + */ + public int insertPwBoms(List list); + + /** + * 根据零件图号和材料类型查询 + * @param partGather + * @return + */ + public List selectPwBomByFigureNumberAndProductType(String partGather,String productType); + + /** + * 根据零件图号查询 + * @param partGather + * @return + */ + public PwBom selectPwBomByFigureNumber(String partGather); + + /** + * 根据产品型号查询 + * @param productType + * @return + */ + public List selectPwBomByProductType(String productType); + + public List selectPwBomByCode(String code,String productType); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionJjService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionJjService.java new file mode 100644 index 0000000..14a5267 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionJjService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBuyingRequisitionJj; + +/** + * 基建请购申请单Service接口 + * + * @author zhukangchao + * @date 2022-06-28 + */ +public interface IPwBuyingRequisitionJjService +{ + /** + * 查询基建请购申请单 + * + * @param id 基建请购申请单ID + * @return 基建请购申请单 + */ + public PwBuyingRequisitionJj selectPwBuyingRequisitionJjById(Long id); + + /** + * 查询基建请购申请单列表 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 基建请购申请单集合 + */ + public List selectPwBuyingRequisitionJjList(PwBuyingRequisitionJj pwBuyingRequisitionJj); + + /** + * 新增基建请购申请单 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 结果 + */ + public int insertPwBuyingRequisitionJj(PwBuyingRequisitionJj pwBuyingRequisitionJj); + + /** + * 修改基建请购申请单 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 结果 + */ + public int updatePwBuyingRequisitionJj(PwBuyingRequisitionJj pwBuyingRequisitionJj); + + /** + * 批量删除基建请购申请单 + * + * @param ids 需要删除的基建请购申请单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionJjByIds(Long[] ids); + + /** + * 删除基建请购申请单信息 + * + * @param id 基建请购申请单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionJjById(Long id); + + /** + * 根据code查询 + * @param code + * @return + */ + public PwBuyingRequisitionJj selectPwBuyingRequisitionJjByCode(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialJjService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialJjService.java new file mode 100644 index 0000000..24eeb36 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialJjService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialJj; + +/** + * 基建请购单详情Service接口 + * + * @author zhukangchao + * @date 2022-06-28 + */ +public interface IPwBuyingRequisitionMaterialJjService +{ + /** + * 查询基建请购单详情 + * + * @param id 基建请购单详情ID + * @return 基建请购单详情 + */ + public PwBuyingRequisitionMaterialJj selectPwBuyingRequisitionMaterialJjById(Long id); + + /** + * 查询基建请购单详情列表 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 基建请购单详情集合 + */ + public List selectPwBuyingRequisitionMaterialJjList(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj); + + /** + * 新增基建请购单详情 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 结果 + */ + public int insertPwBuyingRequisitionMaterialJj(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj); + + /** + * 修改基建请购单详情 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 结果 + */ + public int updatePwBuyingRequisitionMaterialJj(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj); + + /** + * 批量删除基建请购单详情 + * + * @param ids 需要删除的基建请购单详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialJjByIds(Long[] ids); + + /** + * 删除基建请购单详情信息 + * + * @param id 基建请购单详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialJjById(Long id); + + /** + * 根据请购单id查询所有的物料 + * @param id + * @return + */ + public List selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialService.java new file mode 100644 index 0000000..d41af06 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialService.java @@ -0,0 +1,80 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; + +/** + * 请购单物料详情Service接口 + * + * @author zhukangchao + * @date 2021-10-18 + */ +public interface IPwBuyingRequisitionMaterialService +{ + /** + * 查询请购单物料详情 + * + * @param id 请购单物料详情ID + * @return 请购单物料详情 + */ + public PwBuyingRequisitionMaterial selectPwBuyingRequisitionMaterialById(Long id); + + /** + * 查询请购单物料详情列表 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 请购单物料详情集合 + */ + public List selectPwBuyingRequisitionMaterialList(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial); + + /** + * 新增请购单物料详情 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 结果 + */ + public int insertPwBuyingRequisitionMaterial(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial); + + /** + * 修改请购单物料详情 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 结果 + */ + public int updatePwBuyingRequisitionMaterial(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial); + + /** + * 批量删除请购单物料详情 + * + * @param ids 需要删除的请购单物料详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialByIds(Long[] ids); + + /** + * 删除请购单物料详情信息 + * + * @param id 请购单物料详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialById(Long id); + + /** + * 根据请购单id查询此单据下所有的物料信息 + * @param buyingRequisitionId + */ + public List selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(Long buyingRequisitionId); + + public PwBuyingRequisitionMaterial selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(Long id, String materialName, + String specification); + + public List selectPwBuyingRequisitionMaterialByNameAndSpecification(String name, String figureNumber); + + /** + * 根据名称模糊搜索 + * @param materialsName + * @return + */ + public List selectPwBuyingRequisitionMaterialByName(String materialsName); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialTwoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialTwoService.java new file mode 100644 index 0000000..6a30cb5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionMaterialTwoService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialTwo; + +/** + * 易耗品请购单详情Service接口 + * + * @author zhukangchao + * @date 2022-07-05 + */ +public interface IPwBuyingRequisitionMaterialTwoService +{ + /** + * 查询易耗品请购单详情 + * + * @param id 易耗品请购单详情ID + * @return 易耗品请购单详情 + */ + public PwBuyingRequisitionMaterialTwo selectPwBuyingRequisitionMaterialTwoById(Long id); + + /** + * 查询易耗品请购单详情列表 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 易耗品请购单详情集合 + */ + public List selectPwBuyingRequisitionMaterialTwoList(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo); + + /** + * 新增易耗品请购单详情 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 结果 + */ + public int insertPwBuyingRequisitionMaterialTwo(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo); + + /** + * 修改易耗品请购单详情 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 结果 + */ + public int updatePwBuyingRequisitionMaterialTwo(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo); + + /** + * 批量删除易耗品请购单详情 + * + * @param ids 需要删除的易耗品请购单详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialTwoByIds(Long[] ids); + + /** + * 删除易耗品请购单详情信息 + * + * @param id 易耗品请购单详情ID + * @return 结果 + */ + public int deletePwBuyingRequisitionMaterialTwoById(Long id); + + public List selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(Long buyingRequisitionId); + + public PwBuyingRequisitionMaterialTwo selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionIdAndName(Long id, String materialName, + String specification); + + public List selectPwBuyingRequisitionMaterialTwoByName(String materialName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionService.java new file mode 100644 index 0000000..3db6fd3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionService.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBuyingRequisition; + +/** + * 采购申请单Service接口 + * + * @author zhukangchao + * @date 2020-08-31 + */ +public interface IPwBuyingRequisitionService +{ + /** + * 查询采购申请单 + * + * @param id 采购申请单ID + * @return 采购申请单 + */ + public PwBuyingRequisition selectPwBuyingRequisitionById(Long id); + + /** + * 查询采购申请单列表 + * + * @param pwBuyingRequisition 采购申请单 + * @return 采购申请单集合 + */ + public List selectPwBuyingRequisitionList(PwBuyingRequisition pwBuyingRequisition); + + /** + * 新增采购申请单 + * + * @param pwBuyingRequisition 采购申请单 + * @return 结果 + */ + public int insertPwBuyingRequisition(PwBuyingRequisition pwBuyingRequisition); + + /** + * 修改采购申请单 + * + * @param pwBuyingRequisition 采购申请单 + * @return 结果 + */ + public int updatePwBuyingRequisition(PwBuyingRequisition pwBuyingRequisition); + + /** + * 批量删除采购申请单 + * + * @param ids 需要删除的采购申请单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionByIds(Long[] ids); + + /** + * 删除采购申请单信息 + * + * @param id 采购申请单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionById(Long id); + + public PwBuyingRequisition selectPwBuyingRequisitionByCode(String makeDocumentsCode); + + public List selectPwBuyingRequisitionByPurpose(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionTwoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionTwoService.java new file mode 100644 index 0000000..f548e43 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwBuyingRequisitionTwoService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwBuyingRequisitionTwo; + +/** + * 易耗品请购单Service接口 + * + * @author zhukangchao + * @date 2022-07-05 + */ +public interface IPwBuyingRequisitionTwoService +{ + /** + * 查询易耗品请购单 + * + * @param id 易耗品请购单ID + * @return 易耗品请购单 + */ + public PwBuyingRequisitionTwo selectPwBuyingRequisitionTwoById(Long id); + + /** + * 查询易耗品请购单列表 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 易耗品请购单集合 + */ + public List selectPwBuyingRequisitionTwoList(PwBuyingRequisitionTwo pwBuyingRequisitionTwo); + + /** + * 新增易耗品请购单 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 结果 + */ + public int insertPwBuyingRequisitionTwo(PwBuyingRequisitionTwo pwBuyingRequisitionTwo); + + /** + * 修改易耗品请购单 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 结果 + */ + public int updatePwBuyingRequisitionTwo(PwBuyingRequisitionTwo pwBuyingRequisitionTwo); + + /** + * 批量删除易耗品请购单 + * + * @param ids 需要删除的易耗品请购单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionTwoByIds(Long[] ids); + + /** + * 删除易耗品请购单信息 + * + * @param id 易耗品请购单ID + * @return 结果 + */ + public int deletePwBuyingRequisitionTwoById(Long id); + + public PwBuyingRequisitionTwo selectPwBuyingRequisitionTwoByCode(String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCompletionNoticeProductService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCompletionNoticeProductService.java new file mode 100644 index 0000000..adfcf55 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCompletionNoticeProductService.java @@ -0,0 +1,84 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; + +/** + * 产品完工通知单关联Service接口 + * + * @author zhukangchao + * @date 2020-07-20 + */ +public interface IPwCompletionNoticeProductService +{ + /** + * 查询产品完工通知单关联 + * + * @param id 产品完工通知单关联ID + * @return 产品完工通知单关联 + */ + public PwCompletionNoticeProduct selectPwCompletionNoticeProductById(Long id); + + /** + * 查询产品完工通知单关联列表 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 产品完工通知单关联集合 + */ + public List selectPwCompletionNoticeProductList(PwCompletionNoticeProduct pwCompletionNoticeProduct); + + /** + * 新增产品完工通知单关联 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 结果 + */ + public int insertPwCompletionNoticeProduct(PwCompletionNoticeProduct pwCompletionNoticeProduct); + + /** + * 修改产品完工通知单关联 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 结果 + */ + public int updatePwCompletionNoticeProduct(PwCompletionNoticeProduct pwCompletionNoticeProduct); + + /** + * 批量删除产品完工通知单关联 + * + * @param ids 需要删除的产品完工通知单关联ID + * @return 结果 + */ + public int deletePwCompletionNoticeProductByIds(Long[] ids); + + /** + * 删除产品完工通知单关联信息 + * + * @param id 产品完工通知单关联ID + * @return 结果 + */ + public int deletePwCompletionNoticeProductById(Long id); + + public List selectPwCompletionNoticeProductByCode(String productionCode); + + /** + * 根据令号和名称和图号查询 + * @param makeDocumentsCode + * @param name + * @param figureNumber + * @return + */ + public List selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(String makeDocumentsCode, String name, String figureNumber); + + /** + * 根据名称和图号和令号查询时间最近的一条记录 + * @param productionCode + * @param name + * @param figureNumber + */ + public int selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(String productionCode, String name,String figureNumber); + + public List selectPwCompletionNoticeProductByCnpId(Long id); + + public List selectPwCompletionNoticeProductByFigureNumberAndAllGB(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCompletionNoticeService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCompletionNoticeService.java new file mode 100644 index 0000000..bd1b3c2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCompletionNoticeService.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCompletionNotice; + +/** + * 完工通知单Service接口 + * + * @author zhukangchao + * @date 2020-07-20 + */ +public interface IPwCompletionNoticeService +{ + /** + * 查询完工通知单 + * + * @param id 完工通知单ID + * @return 完工通知单 + */ + public PwCompletionNotice selectPwCompletionNoticeById(Long id); + + /** + * 查询完工通知单列表 + * + * @param pwCompletionNotice 完工通知单 + * @return 完工通知单集合 + */ + public List selectPwCompletionNoticeList(PwCompletionNotice pwCompletionNotice); + + /** + * 新增完工通知单 + * + * @param pwCompletionNotice 完工通知单 + * @return 结果 + */ + public int insertPwCompletionNotice(PwCompletionNotice pwCompletionNotice); + + /** + * 修改完工通知单 + * + * @param pwCompletionNotice 完工通知单 + * @return 结果 + */ + public int updatePwCompletionNotice(PwCompletionNotice pwCompletionNotice); + + /** + * 批量删除完工通知单 + * + * @param ids 需要删除的完工通知单ID + * @return 结果 + */ + public int deletePwCompletionNoticeByIds(Long[] ids); + + /** + * 删除完工通知单信息 + * + * @param id 完工通知单ID + * @return 结果 + */ + public int deletePwCompletionNoticeById(Long id); + + public PwCompletionNotice selectPwCompletionNoticeByCode(String productionCode); + + /** + * 根据执行单号和时间查询最大数据 + * @param productionCode + * @param date + * @return + */ + public PwCompletionNotice selectPwCompletionNoticeByDateAndCode(String productionCode,String date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwContractInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwContractInfoService.java new file mode 100644 index 0000000..383265f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwContractInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwContractInfo; + +/** + * 合同信息明细Service接口 + * + * @author zhukangchao + * @date 2023-12-06 + */ +public interface IPwContractInfoService +{ + /** + * 查询合同信息明细 + * + * @param id 合同信息明细ID + * @return 合同信息明细 + */ + public PwContractInfo selectPwContractInfoById(Long id); + + /** + * 查询合同信息明细列表 + * + * @param pwContractInfo 合同信息明细 + * @return 合同信息明细集合 + */ + public List selectPwContractInfoList(PwContractInfo pwContractInfo); + + /** + * 新增合同信息明细 + * + * @param pwContractInfo 合同信息明细 + * @return 结果 + */ + public int insertPwContractInfo(PwContractInfo pwContractInfo); + + /** + * 修改合同信息明细 + * + * @param pwContractInfo 合同信息明细 + * @return 结果 + */ + public int updatePwContractInfo(PwContractInfo pwContractInfo); + + /** + * 批量删除合同信息明细 + * + * @param ids 需要删除的合同信息明细ID + * @return 结果 + */ + public int deletePwContractInfoByIds(Long[] ids); + + /** + * 删除合同信息明细信息 + * + * @param id 合同信息明细ID + * @return 结果 + */ + public int deletePwContractInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwContractService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwContractService.java new file mode 100644 index 0000000..35af4a7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwContractService.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.service; + +import java.util.Date; +import java.util.List; +import com.ruoyi.project.management.domain.PwContract; + +/** + * 合同Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPwContractService +{ + /** + * 查询合同 + * + * @param id 合同ID + * @return 合同 + */ + public PwContract selectPwContractById(Long id); + + /** + * 查询合同列表 + * + * @param pwContract 合同 + * @return 合同集合 + */ + public List selectPwContractList(PwContract pwContract); + + /** + * 新增合同 + * + * @param pwContract 合同 + * @return 结果 + */ + public int insertPwContract(PwContract pwContract); + + /** + * 修改合同 + * + * @param pwContract 合同 + * @return 结果 + */ + public int updatePwContract(PwContract pwContract); + + /** + * 批量删除合同 + * + * @param ids 需要删除的合同ID + * @return 结果 + */ + public int deletePwContractByIds(Long[] ids); + + /** + * 删除合同信息 + * + * @param id 合同ID + * @return 结果 + */ + public int deletePwContractById(Long id); + + /** + * 根据合同code查询合同 + * @param code + * @return + */ + public PwContract selectByContractCode(String code); + + public List selectPwContractDate(Date date); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolApplyDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolApplyDetailService.java new file mode 100644 index 0000000..ee647e2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolApplyDetailService.java @@ -0,0 +1,71 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; + +/** + * 刀具领用申请单详情Service接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface IPwCuttingToolApplyDetailService +{ + /** + * 查询刀具领用申请单详情 + * + * @param id 刀具领用申请单详情ID + * @return 刀具领用申请单详情 + */ + public PwCuttingToolApplyDetail selectPwCuttingToolApplyDetailById(Long id); + + /** + * 查询刀具领用申请单详情列表 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 刀具领用申请单详情集合 + */ + public List selectPwCuttingToolApplyDetailList(PwCuttingToolApplyDetail pwCuttingToolApplyDetail); + + /** + * 新增刀具领用申请单详情 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 结果 + */ + public int insertPwCuttingToolApplyDetail(PwCuttingToolApplyDetail pwCuttingToolApplyDetail); + + /** + * 修改刀具领用申请单详情 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 结果 + */ + public int updatePwCuttingToolApplyDetail(PwCuttingToolApplyDetail pwCuttingToolApplyDetail); + + /** + * 批量删除刀具领用申请单详情 + * + * @param ids 需要删除的刀具领用申请单详情ID + * @return 结果 + */ + public int deletePwCuttingToolApplyDetailByIds(Long[] ids); + + /** + * 删除刀具领用申请单详情信息 + * + * @param id 刀具领用申请单详情ID + * @return 结果 + */ + public int deletePwCuttingToolApplyDetailById(Long id); + + public List selectPwCuttingToolApplyDetailByApplyDetailId(Long id); + + public PwCuttingToolApplyDetail selectPwCuttingToolApplyDetailByApplyDetailIdAndNameAndType(Long id, String name, String type); + + /** + * 根据名称查询 + * + * */ + public List selectPwCuttingToolApplyDetailByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolApplyService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolApplyService.java new file mode 100644 index 0000000..702a442 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolApplyService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolApply; + +/** + * 刀具领用申请单Service接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface IPwCuttingToolApplyService +{ + /** + * 查询刀具领用申请单 + * + * @param id 刀具领用申请单ID + * @return 刀具领用申请单 + */ + public PwCuttingToolApply selectPwCuttingToolApplyById(Long id); + + /** + * 查询刀具领用申请单列表 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 刀具领用申请单集合 + */ + public List selectPwCuttingToolApplyList(PwCuttingToolApply pwCuttingToolApply); + + /** + * 新增刀具领用申请单 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 结果 + */ + public int insertPwCuttingToolApply(PwCuttingToolApply pwCuttingToolApply); + + /** + * 修改刀具领用申请单 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 结果 + */ + public int updatePwCuttingToolApply(PwCuttingToolApply pwCuttingToolApply); + + /** + * 批量删除刀具领用申请单 + * + * @param ids 需要删除的刀具领用申请单ID + * @return 结果 + */ + public int deletePwCuttingToolApplyByIds(Long[] ids); + + /** + * 删除刀具领用申请单信息 + * + * @param id 刀具领用申请单ID + * @return 结果 + */ + public int deletePwCuttingToolApplyById(Long id); + + public PwCuttingToolApply selectPwCuttingToolApplyByCode(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolDeliveryDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolDeliveryDetailService.java new file mode 100644 index 0000000..f2c5fce --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolDeliveryDetailService.java @@ -0,0 +1,80 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; + +/** + * 刀具出库单详情Service接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface IPwCuttingToolDeliveryDetailService +{ + /** + * 查询刀具出库单详情 + * + * @param id 刀具出库单详情ID + * @return 刀具出库单详情 + */ + public PwCuttingToolDeliveryDetail selectPwCuttingToolDeliveryDetailById(Long id); + + /** + * 查询刀具出库单详情列表 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 刀具出库单详情集合 + */ + public List selectPwCuttingToolDeliveryDetailList(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail); + + /** + * 新增刀具出库单详情 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 结果 + */ + public int insertPwCuttingToolDeliveryDetail(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail); + + /** + * 修改刀具出库单详情 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 结果 + */ + public int updatePwCuttingToolDeliveryDetail(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail); + + /** + * 批量删除刀具出库单详情 + * + * @param ids 需要删除的刀具出库单详情ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryDetailByIds(Long[] ids); + + /** + * 删除刀具出库单详情信息 + * + * @param id 刀具出库单详情ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryDetailById(Long id); + + public List selectPwCuttingToolDeliveryDetailByDeliveryId(Long deliveryId); + + /** + * 根据入库单id和名称和品牌和型号查询入库单详情信息 + * @param id + * @param name + * @param brand + * @param type + * @return + */ + public PwCuttingToolDeliveryDetail selectPwCuttingToolDeliveryDetailByDeliveryIdAndNameAndBrandAndType(Long id, String name, String brand,String type); + + /** + * 根据名称模糊搜索 + * @param name + * @return + */ + public List selectPwCuttingToolDeliveryDetailByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolDeliveryService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolDeliveryService.java new file mode 100644 index 0000000..bb60b2a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolDeliveryService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; + +/** + * 刀具出库单Service接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface IPwCuttingToolDeliveryService +{ + /** + * 查询刀具出库单 + * + * @param id 刀具出库单ID + * @return 刀具出库单 + */ + public PwCuttingToolDelivery selectPwCuttingToolDeliveryById(Long id); + + /** + * 查询刀具出库单列表 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 刀具出库单集合 + */ + public List selectPwCuttingToolDeliveryList(PwCuttingToolDelivery pwCuttingToolDelivery); + + /** + * 新增刀具出库单 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 结果 + */ + public int insertPwCuttingToolDelivery(PwCuttingToolDelivery pwCuttingToolDelivery); + + /** + * 修改刀具出库单 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 结果 + */ + public int updatePwCuttingToolDelivery(PwCuttingToolDelivery pwCuttingToolDelivery); + + /** + * 批量删除刀具出库单 + * + * @param ids 需要删除的刀具出库单ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryByIds(Long[] ids); + + /** + * 删除刀具出库单信息 + * + * @param id 刀具出库单ID + * @return 结果 + */ + public int deletePwCuttingToolDeliveryById(Long id); + + public PwCuttingToolDelivery selectPwCuttingToolDeliveryByCode(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolGodownEntryDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolGodownEntryDetailService.java new file mode 100644 index 0000000..462a8f9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolGodownEntryDetailService.java @@ -0,0 +1,81 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntryDetail; + +/** + * 刀具入库详情Service接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface IPwCuttingToolGodownEntryDetailService +{ + /** + * 查询刀具入库详情 + * + * @param id 刀具入库详情ID + * @return 刀具入库详情 + */ + public PwCuttingToolGodownEntryDetail selectPwCuttingToolGodownEntryDetailById(Long id); + + /** + * 查询刀具入库详情列表 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 刀具入库详情集合 + */ + public List selectPwCuttingToolGodownEntryDetailList(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail); + + /** + * 新增刀具入库详情 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 结果 + */ + public int insertPwCuttingToolGodownEntryDetail(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail); + + /** + * 修改刀具入库详情 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 结果 + */ + public int updatePwCuttingToolGodownEntryDetail(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail); + + /** + * 批量删除刀具入库详情 + * + * @param ids 需要删除的刀具入库详情ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryDetailByIds(Long[] ids); + + /** + * 删除刀具入库详情信息 + * + * @param id 刀具入库详情ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryDetailById(Long id); + + public List selectPwCuttingToolGodownEntryDetailByGosownEntryId(Long gosownEntryId); + + /** + * 根据名称模糊查询 + * @param name + * @return + */ + public List selectPwCuttingToolGodownEntryDetailByName(String name); + + + /** + * 根据入库单id和名称和品牌和图号查询 + * @param id + * @param name + * @param brand + * @param type + * @return + */ + public List selectPwCuttingToolGodownEntryDetailByIdAndNameAndBrandAndType(Long id,String name, String brand, String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolGodownEntryService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolGodownEntryService.java new file mode 100644 index 0000000..3ee67ce --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolGodownEntryService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntry; + +/** + * 刀具入库单Service接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface IPwCuttingToolGodownEntryService +{ + /** + * 查询刀具入库单 + * + * @param id 刀具入库单ID + * @return 刀具入库单 + */ + public PwCuttingToolGodownEntry selectPwCuttingToolGodownEntryById(Long id); + + /** + * 查询刀具入库单列表 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 刀具入库单集合 + */ + public List selectPwCuttingToolGodownEntryList(PwCuttingToolGodownEntry pwCuttingToolGodownEntry); + + /** + * 新增刀具入库单 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 结果 + */ + public int insertPwCuttingToolGodownEntry(PwCuttingToolGodownEntry pwCuttingToolGodownEntry); + + /** + * 修改刀具入库单 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 结果 + */ + public int updatePwCuttingToolGodownEntry(PwCuttingToolGodownEntry pwCuttingToolGodownEntry); + + /** + * 批量删除刀具入库单 + * + * @param ids 需要删除的刀具入库单ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryByIds(Long[] ids); + + /** + * 删除刀具入库单信息 + * + * @param id 刀具入库单ID + * @return 结果 + */ + public int deletePwCuttingToolGodownEntryById(Long id); + + public PwCuttingToolGodownEntry selectPwCuttingToolGodownEntryByContractCode(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolInventoryDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolInventoryDetailService.java new file mode 100644 index 0000000..5d25d33 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolInventoryDetailService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolInventoryDetail; + +/** + * 刀具库存Service接口 + * + * @author zhukangchao + * @date 2022-01-27 + */ +public interface IPwCuttingToolInventoryDetailService +{ + /** + * 查询刀具库存 + * + * @param id 刀具库存ID + * @return 刀具库存 + */ + public PwCuttingToolInventoryDetail selectPwCuttingToolInventoryDetailById(Long id); + + /** + * 查询刀具库存列表 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 刀具库存集合 + */ + public List selectPwCuttingToolInventoryDetailList(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail); + + /** + * 新增刀具库存 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 结果 + */ + public int insertPwCuttingToolInventoryDetail(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail); + + /** + * 修改刀具库存 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 结果 + */ + public int updatePwCuttingToolInventoryDetail(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail); + + /** + * 批量删除刀具库存 + * + * @param ids 需要删除的刀具库存ID + * @return 结果 + */ + public int deletePwCuttingToolInventoryDetailByIds(Long[] ids); + + /** + * 删除刀具库存信息 + * + * @param id 刀具库存ID + * @return 结果 + */ + public int deletePwCuttingToolInventoryDetailById(Long id); + + /** + * 根据刀具名称和品牌和规格型号查询库存信息表中数据 + * @param name + * @param brand + * @param type + * @return + */ + public PwCuttingToolInventoryDetail selectPwCuttingToolInventoryDetailByNameAndBrandAndType(String name, String brand, String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolMaintainDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolMaintainDetailService.java new file mode 100644 index 0000000..35799c0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolMaintainDetailService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolMaintainDetail; + +/** + * 刀具维修申请单详情Service接口 + * + * @author zhukangchao + * @date 2022-03-21 + */ +public interface IPwCuttingToolMaintainDetailService +{ + /** + * 查询刀具维修申请单详情 + * + * @param id 刀具维修申请单详情ID + * @return 刀具维修申请单详情 + */ + public PwCuttingToolMaintainDetail selectPwCuttingToolMaintainDetailById(Long id); + + /** + * 查询刀具维修申请单详情列表 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 刀具维修申请单详情集合 + */ + public List selectPwCuttingToolMaintainDetailList(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail); + + /** + * 新增刀具维修申请单详情 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 结果 + */ + public int insertPwCuttingToolMaintainDetail(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail); + + /** + * 修改刀具维修申请单详情 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 结果 + */ + public int updatePwCuttingToolMaintainDetail(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail); + + /** + * 批量删除刀具维修申请单详情 + * + * @param ids 需要删除的刀具维修申请单详情ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainDetailByIds(Long[] ids); + + /** + * 删除刀具维修申请单详情信息 + * + * @param id 刀具维修申请单详情ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainDetailById(Long id); + + public List selectPwCuttingToolMaintainDetailByMaintainId(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolMaintainService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolMaintainService.java new file mode 100644 index 0000000..2eef541 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolMaintainService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolMaintain; + +/** + * 刀具维修申请单Service接口 + * + * @author zhukangchao + * @date 2022-03-21 + */ +public interface IPwCuttingToolMaintainService +{ + /** + * 查询刀具维修申请单 + * + * @param id 刀具维修申请单ID + * @return 刀具维修申请单 + */ + public PwCuttingToolMaintain selectPwCuttingToolMaintainById(Long id); + + /** + * 查询刀具维修申请单列表 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 刀具维修申请单集合 + */ + public List selectPwCuttingToolMaintainList(PwCuttingToolMaintain pwCuttingToolMaintain); + + /** + * 新增刀具维修申请单 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 结果 + */ + public int insertPwCuttingToolMaintain(PwCuttingToolMaintain pwCuttingToolMaintain); + + /** + * 修改刀具维修申请单 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 结果 + */ + public int updatePwCuttingToolMaintain(PwCuttingToolMaintain pwCuttingToolMaintain); + + /** + * 批量删除刀具维修申请单 + * + * @param ids 需要删除的刀具维修申请单ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainByIds(Long[] ids); + + /** + * 删除刀具维修申请单信息 + * + * @param id 刀具维修申请单ID + * @return 结果 + */ + public int deletePwCuttingToolMaintainById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolPurchaseDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolPurchaseDetailService.java new file mode 100644 index 0000000..3cc7074 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolPurchaseDetailService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; + +/** + * 刀具采购详情Service接口 + * + * @author zhukangchao + * @date 2022-03-09 + */ +public interface IPwCuttingToolPurchaseDetailService +{ + /** + * 查询刀具采购详情 + * + * @param id 刀具采购详情ID + * @return 刀具采购详情 + */ + public PwCuttingToolPurchaseDetail selectPwCuttingToolPurchaseDetailById(Long id); + + /** + * 查询刀具采购详情列表 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 刀具采购详情集合 + */ + public List selectPwCuttingToolPurchaseDetailList(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail); + + /** + * 新增刀具采购详情 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 结果 + */ + public int insertPwCuttingToolPurchaseDetail(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail); + + /** + * 修改刀具采购详情 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 结果 + */ + public int updatePwCuttingToolPurchaseDetail(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail); + + /** + * 批量删除刀具采购详情 + * + * @param ids 需要删除的刀具采购详情ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseDetailByIds(Long[] ids); + + /** + * 删除刀具采购详情信息 + * + * @param id 刀具采购详情ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseDetailById(Long id); + + public List selectPwCuttingToolPurchaseDetailByPurchaseId(Long id); + + /** + * 根据名称模糊搜索 + * @param name + * @return + */ + public List selectPwCuttingToolPurchaseDetailByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolPurchaseService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolPurchaseService.java new file mode 100644 index 0000000..9c027b3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolPurchaseService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; + +/** + * 刀具采购申请单Service接口 + * + * @author zhukangchao + * @date 2022-03-10 + */ +public interface IPwCuttingToolPurchaseService +{ + /** + * 查询刀具采购申请单 + * + * @param id 刀具采购申请单ID + * @return 刀具采购申请单 + */ + public PwCuttingToolPurchase selectPwCuttingToolPurchaseById(Long id); + + /** + * 查询刀具采购申请单列表 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 刀具采购申请单集合 + */ + public List selectPwCuttingToolPurchaseList(PwCuttingToolPurchase pwCuttingToolPurchase); + + /** + * 新增刀具采购申请单 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 结果 + */ + public int insertPwCuttingToolPurchase(PwCuttingToolPurchase pwCuttingToolPurchase); + + /** + * 修改刀具采购申请单 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 结果 + */ + public int updatePwCuttingToolPurchase(PwCuttingToolPurchase pwCuttingToolPurchase); + + /** + * 批量删除刀具采购申请单 + * + * @param ids 需要删除的刀具采购申请单ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseByIds(Long[] ids); + + /** + * 删除刀具采购申请单信息 + * + * @param id 刀具采购申请单ID + * @return 结果 + */ + public int deletePwCuttingToolPurchaseById(Long id); + + public int updatePwCuttingToolPurchaseByCode(PwCuttingToolPurchase pwCuttingToolPurchase); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapDetailService.java new file mode 100644 index 0000000..deb9eb0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapDetailService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolScrapDetail; + +/** + * 刀具报废详情Service接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface IPwCuttingToolScrapDetailService +{ + /** + * 查询刀具报废详情 + * + * @param id 刀具报废详情ID + * @return 刀具报废详情 + */ + public PwCuttingToolScrapDetail selectPwCuttingToolScrapDetailById(Long id); + + /** + * 查询刀具报废详情列表 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 刀具报废详情集合 + */ + public List selectPwCuttingToolScrapDetailList(PwCuttingToolScrapDetail pwCuttingToolScrapDetail); + + /** + * 新增刀具报废详情 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 结果 + */ + public int insertPwCuttingToolScrapDetail(PwCuttingToolScrapDetail pwCuttingToolScrapDetail); + + /** + * 修改刀具报废详情 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 结果 + */ + public int updatePwCuttingToolScrapDetail(PwCuttingToolScrapDetail pwCuttingToolScrapDetail); + + /** + * 批量删除刀具报废详情 + * + * @param ids 需要删除的刀具报废详情ID + * @return 结果 + */ + public int deletePwCuttingToolScrapDetailByIds(Long[] ids); + + /** + * 删除刀具报废详情信息 + * + * @param id 刀具报废详情ID + * @return 结果 + */ + public int deletePwCuttingToolScrapDetailById(Long id); + + /** + * 根据报废单id查询报废单下所有的刀具信息 + * @param id + * @return + */ + public List selectPwCuttingToolScrapDetailByScrapId(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapGodownEntryDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapGodownEntryDetailService.java new file mode 100644 index 0000000..285808f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapGodownEntryDetailService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntryDetail; + +/** + * 刀具报废入库详情Service接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface IPwCuttingToolScrapGodownEntryDetailService +{ + /** + * 查询刀具报废入库详情 + * + * @param id 刀具报废入库详情ID + * @return 刀具报废入库详情 + */ + public PwCuttingToolScrapGodownEntryDetail selectPwCuttingToolScrapGodownEntryDetailById(Long id); + + /** + * 查询刀具报废入库详情列表 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 刀具报废入库详情集合 + */ + public List selectPwCuttingToolScrapGodownEntryDetailList(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail); + + /** + * 新增刀具报废入库详情 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 结果 + */ + public int insertPwCuttingToolScrapGodownEntryDetail(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail); + + /** + * 修改刀具报废入库详情 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 结果 + */ + public int updatePwCuttingToolScrapGodownEntryDetail(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail); + + /** + * 批量删除刀具报废入库详情 + * + * @param ids 需要删除的刀具报废入库详情ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryDetailByIds(Long[] ids); + + /** + * 删除刀具报废入库详情信息 + * + * @param id 刀具报废入库详情ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryDetailById(Long id); + + public List selectPwCuttingToolGodownEntryDetailByGosownEntryId(Long gosownEntryId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapGodownEntryService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapGodownEntryService.java new file mode 100644 index 0000000..5f6aa81 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapGodownEntryService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntry; + +/** + * 刀具报废入库单Service接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface IPwCuttingToolScrapGodownEntryService +{ + /** + * 查询刀具报废入库单 + * + * @param id 刀具报废入库单ID + * @return 刀具报废入库单 + */ + public PwCuttingToolScrapGodownEntry selectPwCuttingToolScrapGodownEntryById(Long id); + + /** + * 查询刀具报废入库单列表 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 刀具报废入库单集合 + */ + public List selectPwCuttingToolScrapGodownEntryList(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry); + + /** + * 新增刀具报废入库单 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 结果 + */ + public int insertPwCuttingToolScrapGodownEntry(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry); + + /** + * 修改刀具报废入库单 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 结果 + */ + public int updatePwCuttingToolScrapGodownEntry(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry); + + /** + * 批量删除刀具报废入库单 + * + * @param ids 需要删除的刀具报废入库单ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryByIds(Long[] ids); + + /** + * 删除刀具报废入库单信息 + * + * @param id 刀具报废入库单ID + * @return 结果 + */ + public int deletePwCuttingToolScrapGodownEntryById(Long id); + + public PwCuttingToolScrapGodownEntry selectPwCuttingToolScrapGodownEntryByCode(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapService.java new file mode 100644 index 0000000..81b5a39 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolScrapService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingToolScrap; + +/** + * 刀具报废申请单Service接口 + * + * @author zhukangchao + * @date 2022-03-19 + */ +public interface IPwCuttingToolScrapService +{ + /** + * 查询刀具报废申请单 + * + * @param id 刀具报废申请单ID + * @return 刀具报废申请单 + */ + public PwCuttingToolScrap selectPwCuttingToolScrapById(Long id); + + /** + * 查询刀具报废申请单列表 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 刀具报废申请单集合 + */ + public List selectPwCuttingToolScrapList(PwCuttingToolScrap pwCuttingToolScrap); + + /** + * 新增刀具报废申请单 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 结果 + */ + public int insertPwCuttingToolScrap(PwCuttingToolScrap pwCuttingToolScrap); + + /** + * 修改刀具报废申请单 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 结果 + */ + public int updatePwCuttingToolScrap(PwCuttingToolScrap pwCuttingToolScrap); + + /** + * 批量删除刀具报废申请单 + * + * @param ids 需要删除的刀具报废申请单ID + * @return 结果 + */ + public int deletePwCuttingToolScrapByIds(Long[] ids); + + /** + * 删除刀具报废申请单信息 + * + * @param id 刀具报废申请单ID + * @return 结果 + */ + public int deletePwCuttingToolScrapById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolService.java new file mode 100644 index 0000000..c967358 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwCuttingToolService.java @@ -0,0 +1,81 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwCuttingTool; + +/** + * 刀具Service接口 + * + * @author zhukangchao + * @date 2022-01-27 + */ +public interface IPwCuttingToolService +{ + /** + * 查询刀具 + * + * @param id 刀具ID + * @return 刀具 + */ + public PwCuttingTool selectPwCuttingToolById(Long id); + + /** + * 查询刀具列表 + * + * @param pwCuttingTool 刀具 + * @return 刀具集合 + */ + public List selectPwCuttingToolList(PwCuttingTool pwCuttingTool); + + /** + * 新增刀具 + * + * @param pwCuttingTool 刀具 + * @return 结果 + */ + public int insertPwCuttingTool(PwCuttingTool pwCuttingTool); + + /** + * 修改刀具 + * + * @param pwCuttingTool 刀具 + * @return 结果 + */ + public int updatePwCuttingTool(PwCuttingTool pwCuttingTool); + + /** + * 批量删除刀具 + * + * @param ids 需要删除的刀具ID + * @return 结果 + */ + public int deletePwCuttingToolByIds(Long[] ids); + + /** + * 删除刀具信息 + * + * @param id 刀具ID + * @return 结果 + */ + public int deletePwCuttingToolById(Long id); + + /** + * 根据名称、品牌、规格型号、厂商查询 + * @param name + * @param brand + * @param type + * @param supplier + */ + public PwCuttingTool selectPwCuttingToolByName(String name, String brand, String type, String supplier); + + /** + * 查询检测日期和检测周期不为null的数据 + */ + public List selectPwCuttingToolByPeriodNotIsNull(); + + /** + * 根据名称规格查询 + * @param string + */ + public List selectPwCuttingToolByNameAndType(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwDanceNotStandardService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwDanceNotStandardService.java new file mode 100644 index 0000000..9ac3d39 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwDanceNotStandardService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwDanceNotStandard; + +/** + * 舞非型号Service接口 + * + * @author zhukangchao + * @date 2021-08-02 + */ +public interface IPwDanceNotStandardService +{ + /** + * 查询舞非型号 + * + * @param id 舞非型号ID + * @return 舞非型号 + */ + public PwDanceNotStandard selectPwDanceNotStandardById(Long id); + + /** + * 查询舞非型号列表 + * + * @param pwDanceNotStandard 舞非型号 + * @return 舞非型号集合 + */ + public List selectPwDanceNotStandardList(PwDanceNotStandard pwDanceNotStandard); + + /** + * 新增舞非型号 + * + * @param pwDanceNotStandard 舞非型号 + * @return 结果 + */ + public int insertPwDanceNotStandard(PwDanceNotStandard pwDanceNotStandard); + + /** + * 修改舞非型号 + * + * @param pwDanceNotStandard 舞非型号 + * @return 结果 + */ + public int updatePwDanceNotStandard(PwDanceNotStandard pwDanceNotStandard); + + /** + * 批量删除舞非型号 + * + * @param ids 需要删除的舞非型号ID + * @return 结果 + */ + public int deletePwDanceNotStandardByIds(Long[] ids); + + /** + * 删除舞非型号信息 + * + * @param id 舞非型号ID + * @return 结果 + */ + public int deletePwDanceNotStandardById(Long id); + + /** + * 根据型号查询详细信息 + * @param type + * @return + */ + public PwDanceNotStandard selectPwDanceNotStandardByType(String type); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwDefectiveMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwDefectiveMaterialService.java new file mode 100644 index 0000000..e69246a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwDefectiveMaterialService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwDefectiveMaterial; + +/** + * 残料Service接口 + * + * @author zhukangchao + * @date 2022-12-14 + */ +public interface IPwDefectiveMaterialService +{ + /** + * 查询残料 + * + * @param id 残料ID + * @return 残料 + */ + public PwDefectiveMaterial selectPwDefectiveMaterialById(Long id); + + /** + * 查询残料列表 + * + * @param pwDefectiveMaterial 残料 + * @return 残料集合 + */ + public List selectPwDefectiveMaterialList(PwDefectiveMaterial pwDefectiveMaterial); + + /** + * 新增残料 + * + * @param pwDefectiveMaterial 残料 + * @return 结果 + */ + public int insertPwDefectiveMaterial(PwDefectiveMaterial pwDefectiveMaterial); + + /** + * 修改残料 + * + * @param pwDefectiveMaterial 残料 + * @return 结果 + */ + public int updatePwDefectiveMaterial(PwDefectiveMaterial pwDefectiveMaterial); + + /** + * 批量删除残料 + * + * @param ids 需要删除的残料ID + * @return 结果 + */ + public int deletePwDefectiveMaterialByIds(Long[] ids); + + /** + * 删除残料信息 + * + * @param id 残料ID + * @return 结果 + */ + public int deletePwDefectiveMaterialById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwEquipmentInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwEquipmentInfoService.java new file mode 100644 index 0000000..7c50dda --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwEquipmentInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwEquipmentInfo; + +/** + * 生产设备信息Service接口 + * + * @author zhukangchao + * @date 2023-08-01 + */ +public interface IPwEquipmentInfoService +{ + /** + * 查询生产设备信息 + * + * @param id 生产设备信息ID + * @return 生产设备信息 + */ + public PwEquipmentInfo selectPwEquipmentInfoById(Long id); + + /** + * 查询生产设备信息列表 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 生产设备信息集合 + */ + public List selectPwEquipmentInfoList(PwEquipmentInfo pwEquipmentInfo); + + /** + * 新增生产设备信息 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 结果 + */ + public int insertPwEquipmentInfo(PwEquipmentInfo pwEquipmentInfo); + + /** + * 修改生产设备信息 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 结果 + */ + public int updatePwEquipmentInfo(PwEquipmentInfo pwEquipmentInfo); + + /** + * 批量删除生产设备信息 + * + * @param ids 需要删除的生产设备信息ID + * @return 结果 + */ + public int deletePwEquipmentInfoByIds(Long[] ids); + + /** + * 删除生产设备信息信息 + * + * @param id 生产设备信息ID + * @return 结果 + */ + public int deletePwEquipmentInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersDetailService.java new file mode 100644 index 0000000..9f6d9d9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersDetailService.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetail; + +/** + * 预采购单明细Service接口 + * + * @author zhukangchao + * @date 2022-06-22 + */ +public interface IPwFuturesOrdersDetailService +{ + /** + * 查询预采购单明细 + * + * @param id 预采购单明细ID + * @return 预采购单明细 + */ + public PwFuturesOrdersDetail selectPwFuturesOrdersDetailById(Long id); + + /** + * 查询预采购单明细列表 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 预采购单明细集合 + */ + public List selectPwFuturesOrdersDetailList(PwFuturesOrdersDetail pwFuturesOrdersDetail); + + /** + * 新增预采购单明细 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 结果 + */ + public int insertPwFuturesOrdersDetail(PwFuturesOrdersDetail pwFuturesOrdersDetail); + + /** + * 修改预采购单明细 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 结果 + */ + public int updatePwFuturesOrdersDetail(PwFuturesOrdersDetail pwFuturesOrdersDetail); + + /** + * 批量删除预采购单明细 + * + * @param ids 需要删除的预采购单明细ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailByIds(Long[] ids); + + /** + * 删除预采购单明细信息 + * + * @param id 预采购单明细ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailById(Long id); + + public List selectPwFuturesOrdersDetailByCode(String makeDocumentsCode); + + public PwFuturesOrdersDetail selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(String productionCode, String materialsName, + String materialsSpecification); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersDetailTwoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersDetailTwoService.java new file mode 100644 index 0000000..a463272 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersDetailTwoService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetailTwo; + +/** + * 预采购单明细详情Service接口 + * + * @author zhukangchao + * @date 2022-06-27 + */ +public interface IPwFuturesOrdersDetailTwoService +{ + /** + * 查询预采购单明细详情 + * + * @param id 预采购单明细详情ID + * @return 预采购单明细详情 + */ + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoById(Long id); + + /** + * 查询预采购单明细详情列表 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 预采购单明细详情集合 + */ + public List selectPwFuturesOrdersDetailTwoList(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo); + + /** + * 新增预采购单明细详情 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 结果 + */ + public int insertPwFuturesOrdersDetailTwo(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo); + + /** + * 修改预采购单明细详情 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 结果 + */ + public int updatePwFuturesOrdersDetailTwo(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo); + + /** + * 批量删除预采购单明细详情 + * + * @param ids 需要删除的预采购单明细详情ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailTwoByIds(Long[] ids); + + /** + * 删除预采购单明细详情信息 + * + * @param id 预采购单明细详情ID + * @return 结果 + */ + public int deletePwFuturesOrdersDetailTwoById(Long id); + + public List selectPwFuturesOrdersDetailTwoByCode(String code); + + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoByMatenaisId(Long id); + + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoByMatenaisIdAndNameAndFigureNumber(Long id, + String materialsName, String materialsSpecification); + + public int deletePwFuturesOrdersDetailTwoByOrdersDetailId(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersService.java new file mode 100644 index 0000000..bc1e8f1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwFuturesOrdersService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwFuturesOrders; + +/** + * 预采购单Service接口 + * + * @author zhukangchao + * @date 2022-06-22 + */ +public interface IPwFuturesOrdersService +{ + /** + * 查询预采购单 + * + * @param id 预采购单ID + * @return 预采购单 + */ + public PwFuturesOrders selectPwFuturesOrdersById(Long id); + + /** + * 查询预采购单列表 + * + * @param pwFuturesOrders 预采购单 + * @return 预采购单集合 + */ + public List selectPwFuturesOrdersList(PwFuturesOrders pwFuturesOrders); + + /** + * 新增预采购单 + * + * @param pwFuturesOrders 预采购单 + * @return 结果 + */ + public int insertPwFuturesOrders(PwFuturesOrders pwFuturesOrders); + + /** + * 修改预采购单 + * + * @param pwFuturesOrders 预采购单 + * @return 结果 + */ + public int updatePwFuturesOrders(PwFuturesOrders pwFuturesOrders); + + /** + * 批量删除预采购单 + * + * @param ids 需要删除的预采购单ID + * @return 结果 + */ + public int deletePwFuturesOrdersByIds(Long[] ids); + + /** + * 删除预采购单信息 + * + * @param id 预采购单ID + * @return 结果 + */ + public int deletePwFuturesOrdersById(Long id); + + public PwFuturesOrders selectPwFuturesOrdersByCode(String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwGxProcessService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwGxProcessService.java new file mode 100644 index 0000000..ea5f783 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwGxProcessService.java @@ -0,0 +1,85 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.GxProcessVo; +import com.ruoyi.project.management.domain.PwGxProcess; + +/** + * 物料工序信息Service接口 + * + * @author chenyongjiang + * @date 2024-08-06 + */ +public interface IPwGxProcessService +{ + /** + * 查询物料工序信息 + * + * @param id 物料工序信息ID + * @return 物料工序信息 + */ + public PwGxProcess selectPwMaterialProcessById(Long id); + + /** + * 查询物料工序信息列表 + * + * @param pwGxProcess 物料工序信息 + * @return 物料工序信息集合 + */ + public List selectPwMaterialProcessList(PwGxProcess pwGxProcess); + + /** + * 新增物料工序信息 + * + * @param pwGxProcess 物料工序信息 + * @return 结果 + */ + public AjaxResult insertPwMaterialProcess(PwGxProcess pwGxProcess); + + /** + * 修改物料工序信息 + * + * @param pwGxProcess 物料工序信息 + * @return 结果 + */ + public int updatePwMaterialProcess(PwGxProcess pwGxProcess); + + /** + * 删除物料工序信息信息 + * + * @param id 物料工序信息ID + * @return 结果 + */ + public int deletePwMaterialProcessById(Long id); + + /** + * 根据物料号查询系统 + * @param figureNumber + * @return + */ + public PwGxProcess queryPwGxProcesssByFigureNumber(String figureNumber); + + /** + * 根据父ID查询 + * @param parentId + * @return + */ + public List selectPwGxProcessByParengId(Long parentId); + + /** + * 导入工艺路线 + * @param list + * @param operName + * @return + */ + public String importGxProcesses(List list,String operName); + + /** + * 新增物料工序信息 + * + * @param pwGxProcess 物料工序信息 + * @return 结果 + */ + public int insertPwGxProcess(PwGxProcess pwGxProcess); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwHeightPermittedInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwHeightPermittedInfoService.java new file mode 100644 index 0000000..42d8b34 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwHeightPermittedInfoService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwHeightPermittedInfo; + +/** + * 安全库存限制信息Service接口 + * + * @author zhukangchao + * @date 2023-03-29 + */ +public interface IPwHeightPermittedInfoService +{ + /** + * 查询安全库存限制信息 + * + * @param id 安全库存限制信息ID + * @return 安全库存限制信息 + */ + public PwHeightPermittedInfo selectPwHeightPermittedInfoById(Long id); + + /** + * 查询安全库存限制信息列表 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 安全库存限制信息集合 + */ + public List selectPwHeightPermittedInfoList(PwHeightPermittedInfo pwHeightPermittedInfo); + + /** + * 新增安全库存限制信息 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 结果 + */ + public int insertPwHeightPermittedInfo(PwHeightPermittedInfo pwHeightPermittedInfo); + + /** + * 修改安全库存限制信息 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 结果 + */ + public int updatePwHeightPermittedInfo(PwHeightPermittedInfo pwHeightPermittedInfo); + + /** + * 批量删除安全库存限制信息 + * + * @param ids 需要删除的安全库存限制信息ID + * @return 结果 + */ + public int deletePwHeightPermittedInfoByIds(Long[] ids); + + /** + * 删除安全库存限制信息信息 + * + * @param id 安全库存限制信息ID + * @return 结果 + */ + public int deletePwHeightPermittedInfoById(Long id); + + public PwHeightPermittedInfo selectPwHeightPermittedInfoByNameAndFigureNumber(String materialName, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwInspectionCardDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwInspectionCardDetailService.java new file mode 100644 index 0000000..829332c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwInspectionCardDetailService.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwInspectionCardDetail; + +/** + * 检验单详情Service接口 + * + * @author zhukangchao + * @date 2022-07-20 + */ +public interface IPwInspectionCardDetailService +{ + /** + * 查询检验单详情 + * + * @param id 检验单详情ID + * @return 检验单详情 + */ + public PwInspectionCardDetail selectPwInspectionCardDetailById(Long id); + + /** + * 查询检验单详情列表 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 检验单详情集合 + */ + public List selectPwInspectionCardDetailList(PwInspectionCardDetail pwInspectionCardDetail); + + /** + * 新增检验单详情 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 结果 + */ + public int insertPwInspectionCardDetail(PwInspectionCardDetail pwInspectionCardDetail); + + /** + * 修改检验单详情 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 结果 + */ + public int updatePwInspectionCardDetail(PwInspectionCardDetail pwInspectionCardDetail); + + /** + * 批量删除检验单详情 + * + * @param ids 需要删除的检验单详情ID + * @return 结果 + */ + public int deletePwInspectionCardDetailByIds(Long[] ids); + + /** + * 删除检验单详情信息 + * + * @param id 检验单详情ID + * @return 结果 + */ + public int deletePwInspectionCardDetailById(Long id); + + public PwInspectionCardDetail selectPwInspectionCardDetailByNameAndType(String name, String type); + + public List selectPwInspectionCardDetailByCardId(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwInspectionCardService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwInspectionCardService.java new file mode 100644 index 0000000..247282e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwInspectionCardService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwInspectionCard; + +/** + * 检验单Service接口 + * + * @author zhukangchao + * @date 2022-07-20 + */ +public interface IPwInspectionCardService +{ + /** + * 查询检验单 + * + * @param id 检验单ID + * @return 检验单 + */ + public PwInspectionCard selectPwInspectionCardById(Long id); + + /** + * 查询检验单列表 + * + * @param pwInspectionCard 检验单 + * @return 检验单集合 + */ + public List selectPwInspectionCardList(PwInspectionCard pwInspectionCard); + + /** + * 新增检验单 + * + * @param pwInspectionCard 检验单 + * @return 结果 + */ + public int insertPwInspectionCard(PwInspectionCard pwInspectionCard); + + /** + * 修改检验单 + * + * @param pwInspectionCard 检验单 + * @return 结果 + */ + public int updatePwInspectionCard(PwInspectionCard pwInspectionCard); + + /** + * 批量删除检验单 + * + * @param ids 需要删除的检验单ID + * @return 结果 + */ + public int deletePwInspectionCardByIds(Long[] ids); + + /** + * 删除检验单信息 + * + * @param id 检验单ID + * @return 结果 + */ + public int deletePwInspectionCardById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwInventoryComparisonService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwInventoryComparisonService.java new file mode 100644 index 0000000..8e8cef4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwInventoryComparisonService.java @@ -0,0 +1 @@ +package com.ruoyi.project.management.service; import java.util.List; import com.ruoyi.project.management.domain.PwInventoryComparison; /** * 盘库对比Service接口 * * @author zhukangchao * @date 2023-11-06 */ public interface IPwInventoryComparisonService { /** * 查询盘库对比列表 * * @param pwInventoryComparison 盘库对比 * @return 盘库对比集合 */ public List selectPwInventoryComparisonList(PwInventoryComparison pwInventoryComparison); /** * 新增盘库对比 * * @param pwInventoryComparison 盘库对比 * @return 结果 */ public int insertPwInventoryComparison(PwInventoryComparison pwInventoryComparison); } \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwInventoryDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwInventoryDetailService.java new file mode 100644 index 0000000..79ff841 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwInventoryDetailService.java @@ -0,0 +1,92 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwInventoryDetail; + +/** + * 库存明细Service接口 + * + * @author zhukangchao + * @date 2020-07-18 + */ +public interface IPwInventoryDetailService +{ + /** + * 查询库存明细 + * + * @param id 库存明细ID + * @return 库存明细 + */ + public PwInventoryDetail selectPwInventoryDetailById(Long id); + + /** + * 查询库存明细列表 + * + * @param pwInventoryDetail 库存明细 + * @return 库存明细集合 + */ + public List selectPwInventoryDetailList(PwInventoryDetail pwInventoryDetail); + + /** + * 新增库存明细 + * + * @param pwInventoryDetail 库存明细 + * @return 结果 + */ + public int insertPwInventoryDetail(PwInventoryDetail pwInventoryDetail); + + /** + * 修改库存明细 + * + * @param pwInventoryDetail 库存明细 + * @return 结果 + */ + public int updatePwInventoryDetail(PwInventoryDetail pwInventoryDetail); + + /** + * 批量删除库存明细 + * + * @param ids 需要删除的库存明细ID + * @return 结果 + */ + public int deletePwInventoryDetailByIds(Long[] ids); + + /** + * 删除库存明细信息 + * + * @param id 库存明细ID + * @return 结果 + */ + public int deletePwInventoryDetailById(Long id); + + /** + * 根据物品名称和物品型号查询库中是否有此物品 + * @param materialName + * @param specification + * @return + */ + public PwInventoryDetail selectPwInventoryDetailByNameAndTypeName(String materialName, String specification); + + /** + * 根据物品名称和图号查询库中是否有此物品 + * @param materialName + * @param specification + * @return + */ + public PwInventoryDetail selectPwInventoryDetailByNameAndFigureNumber(String materialName, String figureNumber); + + /** + * 根据图号查询库存 + * @param replace + */ + public PwInventoryDetail selectPwInventoryDetailByFigureNumber(String replace); + + public List selectPwInventoryDetailByMinHig(); + + public List selectPwInventoryDetailByYuanCaiLiao(); + + public List selectPwInventoryDetailByFigureNumberAndAllGB(); + + public List selectPwInventoryDetailByWareHouserName(); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwInvoiceInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwInvoiceInfoService.java new file mode 100644 index 0000000..a68785e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwInvoiceInfoService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwInvoiceInfo; + +/** + * 发票信息Service接口 + * + * @author zhukangchao + * @date 2023-04-09 + */ +public interface IPwInvoiceInfoService +{ + /** + * 查询发票信息 + * + * @param id 发票信息ID + * @return 发票信息 + */ + public PwInvoiceInfo selectPwInvoiceInfoById(Long id); + + /** + * 查询发票信息列表 + * + * @param pwInvoiceInfo 发票信息 + * @return 发票信息集合 + */ + public List selectPwInvoiceInfoList(PwInvoiceInfo pwInvoiceInfo); + + /** + * 新增发票信息 + * + * @param pwInvoiceInfo 发票信息 + * @return 结果 + */ + public int insertPwInvoiceInfo(PwInvoiceInfo pwInvoiceInfo); + + /** + * 修改发票信息 + * + * @param pwInvoiceInfo 发票信息 + * @return 结果 + */ + public int updatePwInvoiceInfo(PwInvoiceInfo pwInvoiceInfo); + + /** + * 批量删除发票信息 + * + * @param ids 需要删除的发票信息ID + * @return 结果 + */ + public int deletePwInvoiceInfoByIds(Long[] ids); + + /** + * 删除发票信息信息 + * + * @param id 发票信息ID + * @return 结果 + */ + public int deletePwInvoiceInfoById(Long id); + + public PwInvoiceInfo selectPwInvoiceInfoByCodeAndName(String code, String supplierName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceDetailsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceDetailsService.java new file mode 100644 index 0000000..07b143c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceDetailsService.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwLetterOfAdviceDetails; + +/** + * 产品发货通知单详情Service接口 + * + * @author zhukangchao + * @date 2022-03-01 + */ +public interface IPwLetterOfAdviceDetailsService +{ + /** + * 查询产品发货通知单详情 + * + * @param id 产品发货通知单详情ID + * @return 产品发货通知单详情 + */ + public PwLetterOfAdviceDetails selectPwLetterOfAdviceDetailsById(Long id); + + /** + * 查询产品发货通知单详情列表 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 产品发货通知单详情集合 + */ + public List selectPwLetterOfAdviceDetailsList(PwLetterOfAdviceDetails pwLetterOfAdviceDetails); + + /** + * 新增产品发货通知单详情 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 结果 + */ + public int insertPwLetterOfAdviceDetails(PwLetterOfAdviceDetails pwLetterOfAdviceDetails); + + /** + * 修改产品发货通知单详情 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 结果 + */ + public int updatePwLetterOfAdviceDetails(PwLetterOfAdviceDetails pwLetterOfAdviceDetails); + + /** + * 批量删除产品发货通知单详情 + * + * @param ids 需要删除的产品发货通知单详情ID + * @return 结果 + */ + public int deletePwLetterOfAdviceDetailsByIds(Long[] ids); + + /** + * 删除产品发货通知单详情信息 + * + * @param id 产品发货通知单详情ID + * @return 结果 + */ + public int deletePwLetterOfAdviceDetailsById(Long id); + + public List selectPwLetterOfAdviceDetailsByCodeAndTypeName(String productionBillCode, String productType); + + public List selectPwLetterOfAdviceDetailsByLetterOfAdviceId(Long long1); + + public PwLetterOfAdviceDetails selectPwLetterOfAdviceDetailsByLetterOfAdviceIdAndTypeName(Long id, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceProductService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceProductService.java new file mode 100644 index 0000000..8e038ce --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceProductService.java @@ -0,0 +1,91 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwLetterOfAdviceProduct; + +/** + * 产品发货通知单关联Service接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface IPwLetterOfAdviceProductService +{ + /** + * 查询产品发货通知单关联 + * + * @param id 产品发货通知单关联ID + * @return 产品发货通知单关联 + */ + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductById(Long id); + + /** + * 查询产品发货通知单关联列表 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 产品发货通知单关联集合 + */ + public List selectPwLetterOfAdviceProductList(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + /** + * 新增产品发货通知单关联 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 结果 + */ + public int insertPwLetterOfAdviceProduct(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + /** + * 修改产品发货通知单关联 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 结果 + */ + public int updatePwLetterOfAdviceProduct(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + /** + * 批量删除产品发货通知单关联 + * + * @param ids 需要删除的产品发货通知单关联ID + * @return 结果 + */ + public int deletePwLetterOfAdviceProductByIds(Long[] ids); + + /** + * 删除产品发货通知单关联信息 + * + * @param id 产品发货通知单关联ID + * @return 结果 + */ + public int deletePwLetterOfAdviceProductById(Long id); + + /** + * 根据令号和图号查询发运单明细 + * @param productionCode + * @param figureNumber + * @return + */ + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductByCodeAndFigureNumber(String productionCode, String figureNumber); + + /** + * 根据发运单id查询发运单详情信息 + * @param long1 + * @return + */ + public List selectPwLetterOfAdviceProductByLetterOfAdviceById(Long long1); + + /** + * 查寻发运单id为null的数据 + * @param pwLetterOfAdviceProduct + * @return + */ + public List selectPwLetterOfAdviceProductListIsNull(PwLetterOfAdviceProduct pwLetterOfAdviceProduct); + + /** + * 根据发运单id和型号查询 + * @param id + * @param figureNumber + * @return + */ + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductByLetterOfAdviceByIdAndFigureNumber(Long id,String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceService.java new file mode 100644 index 0000000..b7b7024 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwLetterOfAdviceService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwLetterOfAdvice; + +/** + * 发运通知单Service接口 + * + * @author zhukangchao + * @date 2020-07-20 + */ +public interface IPwLetterOfAdviceService +{ + /** + * 查询发运通知单 + * + * @param id 发运通知单ID + * @return 发运通知单 + */ + public PwLetterOfAdvice selectPwLetterOfAdviceById(Long id); + + /** + * 查询发运通知单列表 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 发运通知单集合 + */ + public List selectPwLetterOfAdviceList(PwLetterOfAdvice pwLetterOfAdvice); + + /** + * 新增发运通知单 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 结果 + */ + public int insertPwLetterOfAdvice(PwLetterOfAdvice pwLetterOfAdvice); + + /** + * 修改发运通知单 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 结果 + */ + public int updatePwLetterOfAdvice(PwLetterOfAdvice pwLetterOfAdvice); + + /** + * 批量删除发运通知单 + * + * @param ids 需要删除的发运通知单ID + * @return 结果 + */ + public int deletePwLetterOfAdviceByIds(Long[] ids); + + /** + * 删除发运通知单信息 + * + * @param id 发运通知单ID + * @return 结果 + */ + public int deletePwLetterOfAdviceById(Long id); + + /** + * 根据合同编号查询发运通知单信息 + * @param code + * @return + */ + public PwLetterOfAdvice selectPwLetterOfAdviceByCode(String code); + + public List selectPwLetterOfAdviceByCodeAndStatus(String code); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwMakeDocumentsDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwMakeDocumentsDetailService.java new file mode 100644 index 0000000..65c9454 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwMakeDocumentsDetailService.java @@ -0,0 +1,123 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; + +/** + * 库存制作单明细Service接口 + * + * @author zhukangchao + * @date 2020-11-11 + */ +public interface IPwMakeDocumentsDetailService +{ + /** + * 查询库存制作单明细 + * + * @param id 库存制作单明细ID + * @return 库存制作单明细 + */ + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailById(Long id); + + /** + * 查询库存制作单明细列表 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 库存制作单明细集合 + */ + public List selectPwMakeDocumentsDetailList(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + /** + * 新增库存制作单明细 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 结果 + */ + public int insertPwMakeDocumentsDetail(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + /** + * 修改库存制作单明细 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 结果 + */ + public int updatePwMakeDocumentsDetail(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + /** + * 批量删除库存制作单明细 + * + * @param ids 需要删除的库存制作单明细ID + * @return 结果 + */ + public int deletePwMakeDocumentsDetailByIds(Long[] ids); + + /** + * 删除库存制作单明细信息 + * + * @param id 库存制作单明细ID + * @return 结果 + */ + public int deletePwMakeDocumentsDetailById(Long id); + + /** + * 根据名称和图号查询 + * @param materialName + * @param specificationType + * @return + */ + public List selectPwMakeDocumentsDetailByNameAndFigureNumber(String materialName, String specificationType); + + /** + * 根据code和名称和图号查询 + * @param makeDocumentsCode + * @param materialName + * @param specification + */ + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(String makeDocumentsCode, String materialName,String specification); + + /** + * 根据名称和图号查询,按照code去重,查询未入库和入库中的数据 + */ + public List selectPwMakeDocumentsDetailByNameAndFigureNumberNoRepetition(String name, String figureNumber); + + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumber(String makeDocumentsCode, + String parentLevelName, String parentLevelFigureNumber); + + public List selectPwMakeDocumentsDetailByCodeAndSuperiorId(String makeDocumentsCode, Long id); + + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndFigureNumber(String makeDocumentsCode, String figureNumber); + + public List selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumbers(String code, + String parentLevelName, String parentLevelFigureNumber); + + public List selectPwMakeDocumentsDetailLists(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + /** + * 根据code查询 + * @param makeDocumentsCode + * @return + */ + public List selectPwMakeDocumentsDetailByCode(String makeDocumentsCode); + + /** + * 根据令号查询不带序的物料 + * @param code + * @return + */ + public List selectPwMakeDocumentsDetailByCodeAndDeleteXu(String code); + + public List selectPwMakeDocumentsDetailByNameAndFigureNumberList(String name,String figureNumber); + + public List selectPwMakeDocumentsDetailByMaterialId(Long id); + + public List selectPwMakeDocumentsDetailByAll(); + + public List selectPwMakeDocumentsDetailByCodeMoHu(String makeDocumentCode); + + public List selectPwMakeDocumentsDetailListAll(PwMakeDocumentsDetail pwMakeDocumentsDetail); + + public List selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(String code, + String name, String figureNumber); + + public List selectPwMakeDocumentsDetailByCodeAndMaterialIdIsNotNull(String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwMakeDocumentsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwMakeDocumentsService.java new file mode 100644 index 0000000..e84b9ca --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwMakeDocumentsService.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMakeDocuments; + +/** + * 库存制作单Service接口 + * + * @author zhukangchao + * @date 2020-11-11 + */ +public interface IPwMakeDocumentsService +{ + /** + * 查询库存制作单 + * + * @param id 库存制作单ID + * @return 库存制作单 + */ + public PwMakeDocuments selectPwMakeDocumentsById(Long id); + + /** + * 查询库存制作单列表 + * + * @param pwMakeDocuments 库存制作单 + * @return 库存制作单集合 + */ + public List selectPwMakeDocumentsList(PwMakeDocuments pwMakeDocuments); + + /** + * 新增库存制作单 + * + * @param pwMakeDocuments 库存制作单 + * @return 结果 + */ + public int insertPwMakeDocuments(PwMakeDocuments pwMakeDocuments); + + /** + * 修改库存制作单 + * + * @param pwMakeDocuments 库存制作单 + * @return 结果 + */ + public int updatePwMakeDocuments(PwMakeDocuments pwMakeDocuments); + + /** + * 批量删除库存制作单 + * + * @param ids 需要删除的库存制作单ID + * @return 结果 + */ + public int deletePwMakeDocumentsByIds(Long[] ids); + + /** + * 删除库存制作单信息 + * + * @param id 库存制作单ID + * @return 结果 + */ + public int deletePwMakeDocumentsById(Long id); + + public PwMakeDocuments selectPwMakeDocumentsByCode(String code); + + public PwMakeDocuments selectList(); + + public int newInsertPwMakeDocuments(PwMakeDocuments pwMakeDocuments); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialBorrowInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialBorrowInfoService.java new file mode 100644 index 0000000..52a2ce8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialBorrowInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialBorrowInfo; + +/** + * 借用信息Service接口 + * + * @author zhukangchao + * @date 2023-11-24 + */ +public interface IPwMaterialBorrowInfoService +{ + /** + * 查询借用信息 + * + * @param id 借用信息ID + * @return 借用信息 + */ + public PwMaterialBorrowInfo selectPwMaterialBorrowInfoById(Long id); + + /** + * 查询借用信息列表 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 借用信息集合 + */ + public List selectPwMaterialBorrowInfoList(PwMaterialBorrowInfo pwMaterialBorrowInfo); + + /** + * 新增借用信息 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 结果 + */ + public int insertPwMaterialBorrowInfo(PwMaterialBorrowInfo pwMaterialBorrowInfo); + + /** + * 修改借用信息 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 结果 + */ + public int updatePwMaterialBorrowInfo(PwMaterialBorrowInfo pwMaterialBorrowInfo); + + /** + * 批量删除借用信息 + * + * @param ids 需要删除的借用信息ID + * @return 结果 + */ + public int deletePwMaterialBorrowInfoByIds(Long[] ids); + + /** + * 删除借用信息信息 + * + * @param id 借用信息ID + * @return 结果 + */ + public int deletePwMaterialBorrowInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialMaterialsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialMaterialsService.java new file mode 100644 index 0000000..871be90 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialMaterialsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialMaterials; + +/** + * 物料原材料Service接口 + * + * @author zhukangchao + * @date 2022-12-14 + */ +public interface IPwMaterialMaterialsService +{ + /** + * 查询物料原材料 + * + * @param id 物料原材料ID + * @return 物料原材料 + */ + public PwMaterialMaterials selectPwMaterialMaterialsById(Long id); + + /** + * 查询物料原材料列表 + * + * @param pwMaterialMaterials 物料原材料 + * @return 物料原材料集合 + */ + public List selectPwMaterialMaterialsList(PwMaterialMaterials pwMaterialMaterials); + + /** + * 新增物料原材料 + * + * @param pwMaterialMaterials 物料原材料 + * @return 结果 + */ + public int insertPwMaterialMaterials(PwMaterialMaterials pwMaterialMaterials); + + /** + * 修改物料原材料 + * + * @param pwMaterialMaterials 物料原材料 + * @return 结果 + */ + public int updatePwMaterialMaterials(PwMaterialMaterials pwMaterialMaterials); + + /** + * 批量删除物料原材料 + * + * @param ids 需要删除的物料原材料ID + * @return 结果 + */ + public int deletePwMaterialMaterialsByIds(Long[] ids); + + /** + * 删除物料原材料信息 + * + * @param id 物料原材料ID + * @return 结果 + */ + public int deletePwMaterialMaterialsById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialParamsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialParamsService.java new file mode 100644 index 0000000..4478c0a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialParamsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialParams; + +/** + * 物料参数Service接口 + * + * @author chenyongjiang + * @date 2024-04-16 + */ +public interface IPwMaterialParamsService +{ + /** + * 查询物料参数 + * + * @param id 物料参数ID + * @return 物料参数 + */ + public PwMaterialParams selectPwMaterialParamsById(Long id); + + /** + * 查询物料参数列表 + * + * @param pwMaterialParams 物料参数 + * @return 物料参数集合 + */ + public List selectPwMaterialParamsList(PwMaterialParams pwMaterialParams); + + /** + * 新增物料参数 + * + * @param pwMaterialParams 物料参数 + * @return 结果 + */ + public int insertPwMaterialParams(PwMaterialParams pwMaterialParams); + + /** + * 修改物料参数 + * + * @param pwMaterialParams 物料参数 + * @return 结果 + */ + public int updatePwMaterialParams(PwMaterialParams pwMaterialParams); + + /** + * 批量删除物料参数 + * + * @param ids 需要删除的物料参数ID + * @return 结果 + */ + public int deletePwMaterialParamsByIds(Long[] ids); + + /** + * 删除物料参数信息 + * + * @param id 物料参数ID + * @return 结果 + */ + public int deletePwMaterialParamsById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialPriceService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialPriceService.java new file mode 100644 index 0000000..5485fd0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialPriceService.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialPrice; + +/** + * 物料价格校验Service接口 + * + * @author zhukangchao + * @date 2023-06-23 + */ +public interface IPwMaterialPriceService +{ + /** + * 查询物料价格校验 + * + * @param id 物料价格校验ID + * @return 物料价格校验 + */ + public PwMaterialPrice selectPwMaterialPriceById(Long id); + + /** + * 查询物料价格校验列表 + * + * @param pwMaterialPrice 物料价格校验 + * @return 物料价格校验集合 + */ + public List selectPwMaterialPriceList(PwMaterialPrice pwMaterialPrice); + + /** + * 新增物料价格校验 + * + * @param pwMaterialPrice 物料价格校验 + * @return 结果 + */ + public int insertPwMaterialPrice(PwMaterialPrice pwMaterialPrice); + + /** + * 修改物料价格校验 + * + * @param pwMaterialPrice 物料价格校验 + * @return 结果 + */ + public int updatePwMaterialPrice(PwMaterialPrice pwMaterialPrice); + + /** + * 批量删除物料价格校验 + * + * @param ids 需要删除的物料价格校验ID + * @return 结果 + */ + public int deletePwMaterialPriceByIds(Long[] ids); + + /** + * 删除物料价格校验信息 + * + * @param id 物料价格校验ID + * @return 结果 + */ + public int deletePwMaterialPriceById(Long id); + + /** + * 根据名称和图号查询 + * @param name + * @param figureNumber + * @return + */ + public PwMaterialPrice selectPwMaterialPriceByNameAndFigureNumber(String name, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialProcessService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialProcessService.java new file mode 100644 index 0000000..f8834ea --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwMaterialProcessService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwMaterialProcess; + +/** + * 物料工序信息Service接口 + * + * @author zhukangchao + * @date 2021-12-04 + */ +public interface IPwMaterialProcessService +{ + /** + * 查询物料工序信息 + * + * @param id 物料工序信息ID + * @return 物料工序信息 + */ + public PwMaterialProcess selectPwMaterialProcessById(Long id); + + /** + * 查询物料工序信息列表 + * + * @param pwMaterialProcess 物料工序信息 + * @return 物料工序信息集合 + */ + public List selectPwMaterialProcessList(PwMaterialProcess pwMaterialProcess); + + /** + * 新增物料工序信息 + * + * @param pwMaterialProcess 物料工序信息 + * @return 结果 + */ + public int insertPwMaterialProcess(PwMaterialProcess pwMaterialProcess); + + /** + * 修改物料工序信息 + * + * @param pwMaterialProcess 物料工序信息 + * @return 结果 + */ + public int updatePwMaterialProcess(PwMaterialProcess pwMaterialProcess); + + /** + * 批量删除物料工序信息 + * + * @param ids 需要删除的物料工序信息ID + * @return 结果 + */ + public int deletePwMaterialProcessByIds(Long[] ids); + + /** + * 删除物料工序信息信息 + * + * @param id 物料工序信息ID + * @return 结果 + */ + public int deletePwMaterialProcessById(String id); + + /** + * 根据名称和图号查询 + */ + public List selectPwMaterialProcessByNameAndFigureNumber(String name, String figureNumber); + + public List queryPwMaterialProcesssByFigureNumber(String figureNumber); + + public List queryPwMaterialProcesssById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwModulePartService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwModulePartService.java new file mode 100644 index 0000000..ab5a31d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwModulePartService.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwModulePart; + +/** + * 零部件关联Service接口 + * + * @author zhukangchao + * @date 2022-11-28 + */ +public interface IPwModulePartService +{ + /** + * 查询零部件关联 + * + * @param id 零部件关联ID + * @return 零部件关联 + */ + public PwModulePart selectPwModulePartById(Long id); + + /** + * 查询零部件关联列表 + * + * @param pwModulePart 零部件关联 + * @return 零部件关联集合 + */ + public List selectPwModulePartList(PwModulePart pwModulePart); + + /** + * 新增零部件关联 + * + * @param pwModulePart 零部件关联 + * @return 结果 + */ + public int insertPwModulePart(PwModulePart pwModulePart); + + /** + * 修改零部件关联 + * + * @param pwModulePart 零部件关联 + * @return 结果 + */ + public int updatePwModulePart(PwModulePart pwModulePart); + + /** + * 批量删除零部件关联 + * + * @param ids 需要删除的零部件关联ID + * @return 结果 + */ + public int deletePwModulePartByIds(Long[] ids); + + /** + * 删除零部件关联信息 + * + * @param id 零部件关联ID + * @return 结果 + */ + public int deletePwModulePartById(Long id); + + public List selectPwModulePartByMaterialId(Long id); + + public List selectPwModulePartByMaterialNameAndFigureNumber(String name, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwOtherCorrespondentService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwOtherCorrespondentService.java new file mode 100644 index 0000000..af4d280 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwOtherCorrespondentService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwOtherCorrespondent; + +/** + * 其它往来单位信息Service接口 + * + * @author zhukangchao + * @date 2023-12-04 + */ +public interface IPwOtherCorrespondentService +{ + /** + * 查询其它往来单位信息 + * + * @param id 其它往来单位信息ID + * @return 其它往来单位信息 + */ + public PwOtherCorrespondent selectPwOtherCorrespondentById(Long id); + + /** + * 查询其它往来单位信息列表 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 其它往来单位信息集合 + */ + public List selectPwOtherCorrespondentList(PwOtherCorrespondent pwOtherCorrespondent); + + /** + * 新增其它往来单位信息 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 结果 + */ + public int insertPwOtherCorrespondent(PwOtherCorrespondent pwOtherCorrespondent); + + /** + * 修改其它往来单位信息 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 结果 + */ + public int updatePwOtherCorrespondent(PwOtherCorrespondent pwOtherCorrespondent); + + /** + * 批量删除其它往来单位信息 + * + * @param ids 需要删除的其它往来单位信息ID + * @return 结果 + */ + public int deletePwOtherCorrespondentByIds(Long[] ids); + + /** + * 删除其它往来单位信息信息 + * + * @param id 其它往来单位信息ID + * @return 结果 + */ + public int deletePwOtherCorrespondentById(Long id); + + public PwOtherCorrespondent selectPwOtherCorrespondentByName(String unitName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourceContractDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourceContractDetailService.java new file mode 100644 index 0000000..d3a5735 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourceContractDetailService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwOutsourceContractDetail; + +/** + * 外协合同详情信息Service接口 + * + * @author zhukangchao + * @date 2023-04-09 + */ +public interface IPwOutsourceContractDetailService +{ + /** + * 查询外协合同详情信息 + * + * @param id 外协合同详情信息ID + * @return 外协合同详情信息 + */ + public PwOutsourceContractDetail selectPwOutsourceContractDetailById(Long id); + + /** + * 查询外协合同详情信息列表 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 外协合同详情信息集合 + */ + public List selectPwOutsourceContractDetailList(PwOutsourceContractDetail pwOutsourceContractDetail); + + /** + * 新增外协合同详情信息 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 结果 + */ + public int insertPwOutsourceContractDetail(PwOutsourceContractDetail pwOutsourceContractDetail); + + /** + * 修改外协合同详情信息 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 结果 + */ + public int updatePwOutsourceContractDetail(PwOutsourceContractDetail pwOutsourceContractDetail); + + /** + * 批量删除外协合同详情信息 + * + * @param ids 需要删除的外协合同详情信息ID + * @return 结果 + */ + public int deletePwOutsourceContractDetailByIds(Long[] ids); + + /** + * 删除外协合同详情信息信息 + * + * @param id 外协合同详情信息ID + * @return 结果 + */ + public int deletePwOutsourceContractDetailById(Long id); + + public List selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber( + String productionCode, String name, String figureNumber); + + public List selectPwOutsourceContractDetailByOutsourceContractId(Long id); + + public List selectPwOutsourceContractDetailLists(PwOutsourceContractDetail pwOutsourceContractDetail); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourceContractService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourceContractService.java new file mode 100644 index 0000000..4c1fb9f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourceContractService.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwOutsourceContract; + +/** + * 外协合同信息Service接口 + * + * @author zhukangchao + * @date 2023-04-09 + */ +public interface IPwOutsourceContractService +{ + /** + * 查询外协合同信息 + * + * @param id 外协合同信息ID + * @return 外协合同信息 + */ + public PwOutsourceContract selectPwOutsourceContractById(Long id); + + /** + * 查询外协合同信息列表 + * + * @param pwOutsourceContract 外协合同信息 + * @return 外协合同信息集合 + */ + public List selectPwOutsourceContractList(PwOutsourceContract pwOutsourceContract); + + /** + * 新增外协合同信息 + * + * @param pwOutsourceContract 外协合同信息 + * @return 结果 + */ + public int insertPwOutsourceContract(PwOutsourceContract pwOutsourceContract); + + /** + * 修改外协合同信息 + * + * @param pwOutsourceContract 外协合同信息 + * @return 结果 + */ + public int updatePwOutsourceContract(PwOutsourceContract pwOutsourceContract); + + /** + * 批量删除外协合同信息 + * + * @param ids 需要删除的外协合同信息ID + * @return 结果 + */ + public int deletePwOutsourceContractByIds(Long[] ids); + + /** + * 删除外协合同信息信息 + * + * @param id 外协合同信息ID + * @return 结果 + */ + public int deletePwOutsourceContractById(Long id); + + /** + * 根据发票id查询合同信息 + * @param id + */ + public List selectPwOutsourceContractByInvoiceInfoId(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourcingContractMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourcingContractMaterialService.java new file mode 100644 index 0000000..5459fc7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourcingContractMaterialService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwOutsourcingContractMaterial; + +/** + * 零件和外协合同关联Service接口 + * + * @author zhukangchao + * @date 2020-07-01 + */ +public interface IPwOutsourcingContractMaterialService +{ + /** + * 查询零件和外协合同关联 + * + * @param id 零件和外协合同关联ID + * @return 零件和外协合同关联 + */ + public PwOutsourcingContractMaterial selectPwOutsourcingContractMaterialById(Long id); + + /** + * 查询零件和外协合同关联列表 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 零件和外协合同关联集合 + */ + public List selectPwOutsourcingContractMaterialList(PwOutsourcingContractMaterial pwOutsourcingContractMaterial); + + /** + * 新增零件和外协合同关联 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 结果 + */ + public int insertPwOutsourcingContractMaterial(PwOutsourcingContractMaterial pwOutsourcingContractMaterial); + + /** + * 修改零件和外协合同关联 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 结果 + */ + public int updatePwOutsourcingContractMaterial(PwOutsourcingContractMaterial pwOutsourcingContractMaterial); + + /** + * 批量删除零件和外协合同关联 + * + * @param ids 需要删除的零件和外协合同关联ID + * @return 结果 + */ + public int deletePwOutsourcingContractMaterialByIds(Long[] ids); + + /** + * 删除零件和外协合同关联信息 + * + * @param id 零件和外协合同关联ID + * @return 结果 + */ + public int deletePwOutsourcingContractMaterialById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourcingContractService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourcingContractService.java new file mode 100644 index 0000000..bf0f337 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwOutsourcingContractService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwOutsourcingContract; + +/** + * 外协合同Service接口 + * + * @author zhukangchao + * @date 2020-07-01 + */ +public interface IPwOutsourcingContractService +{ + /** + * 查询外协合同 + * + * @param id 外协合同ID + * @return 外协合同 + */ + public PwOutsourcingContract selectPwOutsourcingContractById(Long id); + + /** + * 查询外协合同列表 + * + * @param pwOutsourcingContract 外协合同 + * @return 外协合同集合 + */ + public List selectPwOutsourcingContractList(PwOutsourcingContract pwOutsourcingContract); + + /** + * 新增外协合同 + * + * @param pwOutsourcingContract 外协合同 + * @return 结果 + */ + public int insertPwOutsourcingContract(PwOutsourcingContract pwOutsourcingContract); + + /** + * 修改外协合同 + * + * @param pwOutsourcingContract 外协合同 + * @return 结果 + */ + public int updatePwOutsourcingContract(PwOutsourcingContract pwOutsourcingContract); + + /** + * 批量删除外协合同 + * + * @param ids 需要删除的外协合同ID + * @return 结果 + */ + public int deletePwOutsourcingContractByIds(Long[] ids); + + /** + * 删除外协合同信息 + * + * @param id 外协合同ID + * @return 结果 + */ + public int deletePwOutsourcingContractById(Long id); + + /** + * 根据外协合同code查询外协合同信息 + * @param worksheetCode + * @return + */ + public PwOutsourcingContract selectByOutsourcingContractCode(String worksheetCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwPankuRecordService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwPankuRecordService.java new file mode 100644 index 0000000..d881868 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwPankuRecordService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPankuRecord; + +/** + * 盘库记录Service接口 + * + * @author zhukangchao + * @date 2020-08-27 + */ +public interface IPwPankuRecordService +{ + /** + * 查询盘库记录 + * + * @param id 盘库记录ID + * @return 盘库记录 + */ + public PwPankuRecord selectPwPankuRecordById(Long id); + + /** + * 查询盘库记录列表 + * + * @param pwPankuRecord 盘库记录 + * @return 盘库记录集合 + */ + public List selectPwPankuRecordList(PwPankuRecord pwPankuRecord); + + /** + * 新增盘库记录 + * + * @param pwPankuRecord 盘库记录 + * @return 结果 + */ + public int insertPwPankuRecord(PwPankuRecord pwPankuRecord); + + /** + * 修改盘库记录 + * + * @param pwPankuRecord 盘库记录 + * @return 结果 + */ + public int updatePwPankuRecord(PwPankuRecord pwPankuRecord); + + /** + * 批量删除盘库记录 + * + * @param ids 需要删除的盘库记录ID + * @return 结果 + */ + public int deletePwPankuRecordByIds(Long[] ids); + + /** + * 删除盘库记录信息 + * + * @param id 盘库记录ID + * @return 结果 + */ + public int deletePwPankuRecordById(Long id); + + /** + * 添加盘库记录,修改库存信息 + * @param pwPankuRecord + * @return + */ + public int addCollateInventory(PwPankuRecord pwPankuRecord); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwPredictPurchaseService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwPredictPurchaseService.java new file mode 100644 index 0000000..32f4c70 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwPredictPurchaseService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPredictPurchase; + +/** + * 预采购单Service接口 + * + * @author zhukangchao + * @date 2023-02-02 + */ +public interface IPwPredictPurchaseService +{ + /** + * 查询预采购单 + * + * @param id 预采购单ID + * @return 预采购单 + */ + public PwPredictPurchase selectPwPredictPurchaseById(Long id); + + /** + * 查询预采购单列表 + * + * @param pwPredictPurchase 预采购单 + * @return 预采购单集合 + */ + public List selectPwPredictPurchaseList(PwPredictPurchase pwPredictPurchase); + + /** + * 新增预采购单 + * + * @param pwPredictPurchase 预采购单 + * @return 结果 + */ + public int insertPwPredictPurchase(PwPredictPurchase pwPredictPurchase); + + /** + * 修改预采购单 + * + * @param pwPredictPurchase 预采购单 + * @return 结果 + */ + public int updatePwPredictPurchase(PwPredictPurchase pwPredictPurchase); + + /** + * 批量删除预采购单 + * + * @param ids 需要删除的预采购单ID + * @return 结果 + */ + public int deletePwPredictPurchaseByIds(Long[] ids); + + /** + * 删除预采购单信息 + * + * @param id 预采购单ID + * @return 结果 + */ + public int deletePwPredictPurchaseById(Long id); + /** + * 更新预采购单信息 + * + * @param id 预采购单ID + * @return 结果 + */ + public int updatePwPredictPurchaseTotalPrices(Long id); + + public PwPredictPurchase selectPwPredictPurchaseByCode(String makeDocumentsCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwPredictPurchaseTwoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwPredictPurchaseTwoService.java new file mode 100644 index 0000000..00cced4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwPredictPurchaseTwoService.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPredictPurchaseTwo; + +/** + * 预采购单详情Service接口 + * + * @author zhukangchao + * @date 2023-02-02 + */ +public interface IPwPredictPurchaseTwoService +{ + /** + * 查询预采购单详情 + * + * @param id 预采购单详情ID + * @return 预采购单详情 + */ + public PwPredictPurchaseTwo selectPwPredictPurchaseTwoById(Long id); + + /** + * 查询预采购单详情列表 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 预采购单详情集合 + */ + public List selectPwPredictPurchaseTwoList(PwPredictPurchaseTwo pwPredictPurchaseTwo); + + /** + * 新增预采购单详情 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 结果 + */ + public int insertPwPredictPurchaseTwo(PwPredictPurchaseTwo pwPredictPurchaseTwo); + + /** + * 修改预采购单详情 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 结果 + */ + public int updatePwPredictPurchaseTwo(PwPredictPurchaseTwo pwPredictPurchaseTwo); + + /** + * 批量删除预采购单详情 + * + * @param ids 需要删除的预采购单详情ID + * @return 结果 + */ + public int deletePwPredictPurchaseTwoByIds(Long[] ids); + + /** + * 删除预采购单详情信息 + * + * @param id 预采购单详情ID + * @return 结果 + */ + public int deletePwPredictPurchaseTwoById(Long id); + + public PwPredictPurchaseTwo selectPwPredictPurchaseTwoByIdAndNameAndFigureNumber(Long id, String materialName,String specification); + + public List selectPwPredictPurchaseTwoByPredictPurchaseId(Long predictPurchaseId); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProcessOrDeptService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProcessOrDeptService.java new file mode 100644 index 0000000..cb0081a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProcessOrDeptService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProcessOrDept; + +/** + * 工序部门Service接口 + * + * @author chenyongjiang + * @date 2024-05-23 + */ +public interface IPwProcessOrDeptService +{ + /** + * 查询工序部门 + * + * @param id 工序部门ID + * @return 工序部门 + */ + public PwProcessOrDept selectPwProcessOrDeptById(Long id); + + /** + * 查询工序部门列表 + * + * @param pwProcessOrDept 工序部门 + * @return 工序部门集合 + */ + public List selectPwProcessOrDeptList(PwProcessOrDept pwProcessOrDept); + + /** + * 新增工序部门 + * + * @param pwProcessOrDept 工序部门 + * @return 结果 + */ + public int insertPwProcessOrDept(PwProcessOrDept pwProcessOrDept); + + /** + * 修改工序部门 + * + * @param pwProcessOrDept 工序部门 + * @return 结果 + */ + public int updatePwProcessOrDept(PwProcessOrDept pwProcessOrDept); + + /** + * 批量删除工序部门 + * + * @param ids 需要删除的工序部门ID + * @return 结果 + */ + public int deletePwProcessOrDeptByIds(Long[] ids); + + /** + * 查询工序部门 + * + * @param processName + * @return 结果 + */ + public PwProcessOrDept selectPwProcessOrDeptByProcessName(String processName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProcessService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProcessService.java new file mode 100644 index 0000000..a1eef3c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProcessService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProcess; + +/** + * 工序Service接口 + * + * @author zhukangchao + * @date 2021-10-11 + */ +public interface IPwProcessService +{ + /** + * 查询工序 + * + * @param id 工序ID + * @return 工序 + */ + public PwProcess selectPwProcessById(Long id); + + /** + * 查询工序列表 + * + * @param pwProcess 工序 + * @return 工序集合 + */ + public List selectPwProcessList(PwProcess pwProcess); + + /** + * 新增工序 + * + * @param pwProcess 工序 + * @return 结果 + */ + public int insertPwProcess(PwProcess pwProcess); + + /** + * 修改工序 + * + * @param pwProcess 工序 + * @return 结果 + */ + public int updatePwProcess(PwProcess pwProcess); + + /** + * 批量删除工序 + * + * @param ids 需要删除的工序ID + * @return 结果 + */ + public int deletePwProcessByIds(Long[] ids); + + /** + * 删除工序信息 + * + * @param id 工序ID + * @return 结果 + */ + public int deletePwProcessById(Long id); + + /** + * 根据名称查询工序信息 + * @param string + * @return + */ + public PwProcess selectPwProcessByName(String string); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductBillBomService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductBillBomService.java new file mode 100644 index 0000000..7055d09 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductBillBomService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductBillBom; + +/** + * 生产执行单bomService接口 + * + * @author zhukangchao + * @date 2020-08-17 + */ +public interface IPwProductBillBomService +{ + /** + * 查询生产执行单bom + * + * @param id 生产执行单bomID + * @return 生产执行单bom + */ + public PwProductBillBom selectPwProductBillBomById(Long id); + + /** + * 查询生产执行单bom列表 + * + * @param pwProductBillBom 生产执行单bom + * @return 生产执行单bom集合 + */ + public List selectPwProductBillBomList(PwProductBillBom pwProductBillBom); + + /** + * 新增生产执行单bom + * + * @param pwProductBillBom 生产执行单bom + * @return 结果 + */ + public int insertPwProductBillBom(PwProductBillBom pwProductBillBom); + + /** + * 修改生产执行单bom + * + * @param pwProductBillBom 生产执行单bom + * @return 结果 + */ + public int updatePwProductBillBom(PwProductBillBom pwProductBillBom); + + /** + * 批量删除生产执行单bom + * + * @param ids 需要删除的生产执行单bomID + * @return 结果 + */ + public int deletePwProductBillBomByIds(Long[] ids); + + /** + * 删除生产执行单bom信息 + * + * @param id 生产执行单bomID + * @return 结果 + */ + public int deletePwProductBillBomById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductDetailService.java new file mode 100644 index 0000000..d039983 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductDetailService.java @@ -0,0 +1,53 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductDetail; + +/** + * 金蝶生产详情Service接口 + * + * @author chenyongjiang + * @date 2024-04-23 + */ +public interface IPwProductDetailService +{ + /** + * 查询金蝶生产详情 + * + * @param id 金蝶生产详情ID + * @return 金蝶生产详情 + */ + public PwProductDetail selectPwProductDetailById(Long id); + + /** + * 查询金蝶生产详情列表 + * + * @param pwProductDetail 金蝶生产详情 + * @return 金蝶生产详情集合 + */ + public List selectPwProductDetailList(PwProductDetail pwProductDetail); + + /** + * 新增金蝶生产详情 + * + * @param pwProductDetail 金蝶生产详情 + * @return 结果 + */ + public int insertPwProductDetail(PwProductDetail pwProductDetail); + + /** + * 修改金蝶生产详情 + * + * @param pwProductDetail 金蝶生产详情 + * @return 结果 + */ + public int updatePwProductDetail(PwProductDetail pwProductDetail); + + /** + * 删除金蝶生产详情信息 + * + * @param id 金蝶生产详情ID + * @return 结果 + */ + public int deletePwProductDetailById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductQuotationService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductQuotationService.java new file mode 100644 index 0000000..3e6e86c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductQuotationService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductQuotation; + +/** + * 产品报价单关联Service接口 + * + * @author zhukangchao + * @date 2020-07-07 + */ +public interface IPwProductQuotationService +{ + /** + * 查询产品报价单关联 + * + * @param id 产品报价单关联ID + * @return 产品报价单关联 + */ + public PwProductQuotation selectPwProductQuotationById(Long id); + + /** + * 查询产品报价单关联列表 + * + * @param pwProductQuotation 产品报价单关联 + * @return 产品报价单关联集合 + */ + public List selectPwProductQuotationList(PwProductQuotation pwProductQuotation); + + /** + * 新增产品报价单关联 + * + * @param pwProductQuotation 产品报价单关联 + * @return 结果 + */ + public int insertPwProductQuotation(PwProductQuotation pwProductQuotation); + + /** + * 修改产品报价单关联 + * + * @param pwProductQuotation 产品报价单关联 + * @return 结果 + */ + public int updatePwProductQuotation(PwProductQuotation pwProductQuotation); + + /** + * 批量删除产品报价单关联 + * + * @param ids 需要删除的产品报价单关联ID + * @return 结果 + */ + public int deletePwProductQuotationByIds(Long[] ids); + + /** + * 删除产品报价单关联信息 + * + * @param id 产品报价单关联ID + * @return 结果 + */ + public int deletePwProductQuotationById(Long id); + + /** + * 根据报价单id和型号查询 + * @param quotationId + * @param figureNumber + */ + public PwProductQuotation selectPwProductQuotationByNameAndQuotationId(String figureNumber,Long quotationId); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductService.java new file mode 100644 index 0000000..fa02aa7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProduct; + +/** + * 产品Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPwProductService +{ + /** + * 查询产品 + * + * @param id 产品ID + * @return 产品 + */ + public PwProduct selectPwProductById(Long id); + + /** + * 查询产品列表 + * + * @param pwProduct 产品 + * @return 产品集合 + */ + public List selectPwProductList(PwProduct pwProduct); + + /** + * 新增产品 + * + * @param pwProduct 产品 + * @return 结果 + */ + public int insertPwProduct(PwProduct pwProduct); + + /** + * 修改产品 + * + * @param pwProduct 产品 + * @return 结果 + */ + public int updatePwProduct(PwProduct pwProduct); + + /** + * 批量删除产品 + * + * @param ids 需要删除的产品ID + * @return 结果 + */ + public int deletePwProductByIds(Long[] ids); + + /** + * 删除产品信息 + * + * @param id 产品ID + * @return 结果 + */ + public int deletePwProductById(Long id); + + /** + * 根据产品名称查询 + * @param name + * @return + */ + public PwProduct selectByName(String name); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillNonstandardService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillNonstandardService.java new file mode 100644 index 0000000..0842a5f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillNonstandardService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionBillNonstandard; + +/** + * 产品非标生产执行单关联Service接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface IPwProductionBillNonstandardService +{ + /** + * 查询产品非标生产执行单关联 + * + * @param id 产品非标生产执行单关联ID + * @return 产品非标生产执行单关联 + */ + public PwProductionBillNonstandard selectPwProductionBillNonstandardById(Long id); + + /** + * 查询产品非标生产执行单关联列表 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 产品非标生产执行单关联集合 + */ + public List selectPwProductionBillNonstandardList(PwProductionBillNonstandard pwProductionBillNonstandard); + + /** + * 新增产品非标生产执行单关联 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 结果 + */ + public int insertPwProductionBillNonstandard(PwProductionBillNonstandard pwProductionBillNonstandard); + + /** + * 修改产品非标生产执行单关联 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 结果 + */ + public int updatePwProductionBillNonstandard(PwProductionBillNonstandard pwProductionBillNonstandard); + + /** + * 批量删除产品非标生产执行单关联 + * + * @param ids 需要删除的产品非标生产执行单关联ID + * @return 结果 + */ + public int deletePwProductionBillNonstandardByIds(Long[] ids); + + /** + * 删除产品非标生产执行单关联信息 + * + * @param id 产品非标生产执行单关联ID + * @return 结果 + */ + public int deletePwProductionBillNonstandardById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillProductService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillProductService.java new file mode 100644 index 0000000..9136315 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillProductService.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionBillProduct; + +/** + * 销齿链生产执行单关联Service接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface IPwProductionBillProductService +{ + /** + * 查询销齿链生产执行单关联 + * + * @param id 销齿链生产执行单关联ID + * @return 销齿链生产执行单关联 + */ + public PwProductionBillProduct selectPwProductionBillProductById(Long id); + + /** + * 查询销齿链生产执行单关联列表 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 销齿链生产执行单关联集合 + */ + public List selectPwProductionBillProductList(PwProductionBillProduct pwProductionBillProduct); + + /** + * 新增销齿链生产执行单关联 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 结果 + */ + public int insertPwProductionBillProduct(PwProductionBillProduct pwProductionBillProduct); + + /** + * 修改销齿链生产执行单关联 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 结果 + */ + public int updatePwProductionBillProduct(PwProductionBillProduct pwProductionBillProduct); + + /** + * 批量删除销齿链生产执行单关联 + * + * @param ids 需要删除的销齿链生产执行单关联ID + * @return 结果 + */ + public int deletePwProductionBillProductByIds(Long[] ids); + + /** + * 删除销齿链生产执行单关联信息 + * + * @param id 销齿链生产执行单关联ID + * @return 结果 + */ + public int deletePwProductionBillProductById(Long id); + + /** + * 根据执行单id查询所有的型号 + * @param id + */ + public List selectPwProductionBillProductByProductionBillId(Long id); + + public PwProductionBillProduct selectPwProductionBillProductByProductionBillIdAndName(Long id, String typeName); + + public List selectPwProductionBillProductLists( + PwProductionBillProduct pwProductionBillProduct); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillService.java new file mode 100644 index 0000000..05c880c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionBillService.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service; + +import java.util.List; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.ProdictBillBom; +import com.ruoyi.project.management.domain.PwProductionBill; + +/** + * 生产执行单Service接口 + * + * @author zhukangchao + * @date 2020-07-21 + */ +public interface IPwProductionBillService +{ + /** + * 查询生产执行单 + * + * @param id 生产执行单ID + * @return 生产执行单 + */ + public PwProductionBill selectPwProductionBillById(Long id); + + /** + * 查询生产执行单列表 + * + * @param pwProductionBill 生产执行单 + * @return 生产执行单集合 + */ + public List selectPwProductionBillList(PwProductionBill pwProductionBill); + + /** + * 新增生产执行单 + * + * @param pwProductionBill 生产执行单 + * @return 结果 + * @throws Exception + */ + public int insertPwProductionBill(PwProductionBill pwProductionBill) throws Exception; + + /** + * 修改生产执行单 + * + * @param pwProductionBill 生产执行单 + * @return 结果 + */ + public int updatePwProductionBill(PwProductionBill pwProductionBill); + + /** + * 批量删除生产执行单 + * + * @param ids 需要删除的生产执行单ID + * @return 结果 + */ + public int deletePwProductionBillByIds(Long[] ids); + + /** + * 删除生产执行单信息 + * + * @param id 生产执行单ID + * @return 结果 + */ + public int deletePwProductionBillById(Long id); + + /** + * 根据生产令号查询生产执行信息 + * @param productionCode + */ + public PwProductionBill selectPwProductionBillByProductionCode(String productionCode); + + /** + * 添加生产执行单 + * @param pwProductionBill + * @return + */ + public int insertPwProductionBillWF(PwProductionBill pwProductionBill); + + /** + * 查询所有未完成的执行单 + * @param string + * @return + */ + public List selectPwProductionBillByStatus(String string); + + /** + * 新程序出图 + * @param pwProductionBill + * @return + */ + public AjaxResult insertPwProductionBillNew(PwProductionBill pwProductionBill); + + public String importProductBill(List list); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionOrderInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionOrderInfoService.java new file mode 100644 index 0000000..9c57cda --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionOrderInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionOrderInfo; + +/** + * 生产订单详情信息Service接口 + * + * @author zhukangchao + * @date 2023-12-06 + */ +public interface IPwProductionOrderInfoService +{ + /** + * 查询生产订单详情信息 + * + * @param id 生产订单详情信息ID + * @return 生产订单详情信息 + */ + public PwProductionOrderInfo selectPwProductionOrderInfoById(Long id); + + /** + * 查询生产订单详情信息列表 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 生产订单详情信息集合 + */ + public List selectPwProductionOrderInfoList(PwProductionOrderInfo pwProductionOrderInfo); + + /** + * 新增生产订单详情信息 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 结果 + */ + public int insertPwProductionOrderInfo(PwProductionOrderInfo pwProductionOrderInfo); + + /** + * 修改生产订单详情信息 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 结果 + */ + public int updatePwProductionOrderInfo(PwProductionOrderInfo pwProductionOrderInfo); + + /** + * 批量删除生产订单详情信息 + * + * @param ids 需要删除的生产订单详情信息ID + * @return 结果 + */ + public int deletePwProductionOrderInfoByIds(Long[] ids); + + /** + * 删除生产订单详情信息信息 + * + * @param id 生产订单详情信息ID + * @return 结果 + */ + public int deletePwProductionOrderInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionOrderService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionOrderService.java new file mode 100644 index 0000000..7d94240 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionOrderService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionOrder; + +/** + * 生产订单信息Service接口 + * + * @author zhukangchao + * @date 2023-12-06 + */ +public interface IPwProductionOrderService +{ + /** + * 查询生产订单信息 + * + * @param id 生产订单信息ID + * @return 生产订单信息 + */ + public PwProductionOrder selectPwProductionOrderById(Long id); + + /** + * 查询生产订单信息列表 + * + * @param pwProductionOrder 生产订单信息 + * @return 生产订单信息集合 + */ + public List selectPwProductionOrderList(PwProductionOrder pwProductionOrder); + + /** + * 新增生产订单信息 + * + * @param pwProductionOrder 生产订单信息 + * @return 结果 + */ + public int insertPwProductionOrder(PwProductionOrder pwProductionOrder); + + /** + * 修改生产订单信息 + * + * @param pwProductionOrder 生产订单信息 + * @return 结果 + */ + public int updatePwProductionOrder(PwProductionOrder pwProductionOrder); + + /** + * 批量删除生产订单信息 + * + * @param ids 需要删除的生产订单信息ID + * @return 结果 + */ + public int deletePwProductionOrderByIds(Long[] ids); + + /** + * 删除生产订单信息信息 + * + * @param id 生产订单信息ID + * @return 结果 + */ + public int deletePwProductionOrderById(Long id); + + public PwProductionOrder selectPwProductionOrderByCode(String contractCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionSchedulingNumberService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionSchedulingNumberService.java new file mode 100644 index 0000000..54518bd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionSchedulingNumberService.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionSchedulingNumber; + +/** + * 排产缺料统计Service接口 + * + * @author zhukangchao + * @date 2023-06-08 + */ +public interface IPwProductionSchedulingNumberService +{ + /** + * 查询排产缺料统计 + * + * @param id 排产缺料统计ID + * @return 排产缺料统计 + */ + public PwProductionSchedulingNumber selectPwProductionSchedulingNumberById(Long id); + + /** + * 查询排产缺料统计列表 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 排产缺料统计集合 + */ + public List selectPwProductionSchedulingNumberList(PwProductionSchedulingNumber pwProductionSchedulingNumber); + + /** + * 新增排产缺料统计 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 结果 + */ + public int insertPwProductionSchedulingNumber(PwProductionSchedulingNumber pwProductionSchedulingNumber); + + /** + * 修改排产缺料统计 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 结果 + */ + public int updatePwProductionSchedulingNumber(PwProductionSchedulingNumber pwProductionSchedulingNumber); + + /** + * 批量删除排产缺料统计 + * + * @param ids 需要删除的排产缺料统计ID + * @return 结果 + */ + public int deletePwProductionSchedulingNumberByIds(Long[] ids); + + /** + * 删除排产缺料统计信息 + * + * @param id 排产缺料统计ID + * @return 结果 + */ + public int deletePwProductionSchedulingNumberById(Long id); + + public void insertPwProductionSchedulingNumbers(List list3); + + public void celerPwProductionSchedulingNumber(); + + public List selectPwProductionSchedulingNumberLists(); + + public PwProductionSchedulingNumber selectPwProductionSchedulingNumberByNameAndFigureNumber(String name, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionSchedulingService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionSchedulingService.java new file mode 100644 index 0000000..19e4a3f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwProductionSchedulingService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwProductionScheduling; + +/** + * 排产信息Service接口 + * + * @author zhukangchao + * @date 2023-06-08 + */ +public interface IPwProductionSchedulingService +{ + /** + * 查询排产信息 + * + * @param id 排产信息ID + * @return 排产信息 + */ + public PwProductionScheduling selectPwProductionSchedulingById(Long id); + + /** + * 查询排产信息列表 + * + * @param pwProductionScheduling 排产信息 + * @return 排产信息集合 + */ + public List selectPwProductionSchedulingList(PwProductionScheduling pwProductionScheduling); + + /** + * 新增排产信息 + * + * @param pwProductionScheduling 排产信息 + * @return 结果 + */ + public int insertPwProductionScheduling(PwProductionScheduling pwProductionScheduling); + + /** + * 修改排产信息 + * + * @param pwProductionScheduling 排产信息 + * @return 结果 + */ + public int updatePwProductionScheduling(PwProductionScheduling pwProductionScheduling); + + /** + * 批量删除排产信息 + * + * @param ids 需要删除的排产信息ID + * @return 结果 + */ + public int deletePwProductionSchedulingByIds(Long[] ids); + + /** + * 删除排产信息信息 + * + * @param id 排产信息ID + * @return 结果 + */ + public int deletePwProductionSchedulingById(Long id); + + public List selectPwProductionSchedulingLists(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseContractMaterialService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseContractMaterialService.java new file mode 100644 index 0000000..44bb940 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseContractMaterialService.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; + +/** + * 物料和采购合同关联Service接口 + * + * @author zhukangchao + * @date 2020-07-06 + */ +public interface IPwPurchaseContractMaterialService +{ + /** + * 查询物料和采购合同关联 + * + * @param id 物料和采购合同关联ID + * @return 物料和采购合同关联 + */ + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialById(Long id); + + /** + * 查询物料和采购合同关联列表 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 物料和采购合同关联集合 + */ + public List selectPwPurchaseContractMaterialList(PwPurchaseContractMaterial pwPurchaseContractMaterial); + + /** + * 新增物料和采购合同关联 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 结果 + */ + public int insertPwPurchaseContractMaterial(PwPurchaseContractMaterial pwPurchaseContractMaterial); + + /** + * 修改物料和采购合同关联 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 结果 + */ + public int updatePwPurchaseContractMaterial(PwPurchaseContractMaterial pwPurchaseContractMaterial); + + /** + * 批量删除物料和采购合同关联 + * + * @param ids 需要删除的物料和采购合同关联ID + * @return 结果 + */ + public int deletePwPurchaseContractMaterialByIds(Long[] ids); + + /** + * 删除物料和采购合同关联信息 + * + * @param id 物料和采购合同关联ID + * @return 结果 + */ + public int deletePwPurchaseContractMaterialById(Long id); + + /** + * 根据名称和规格型号查询 + * @param name + * @param all + * @return + */ + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByFnAndName(String name, String all); + + /** + * 生成采购合同 + * @param ids + * @return + */ + public int createPurchaseContract(Long[] ids); + + public List selectPwPurchaseContractMaterialByPurchaseContractId(Long purchaseContractId); + + /** + * 查询所有未生成采购合同的数据 + * @return + */ + public List selectPwPurchaseContractMaterialByPurchaseContractIdList(); + + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByPurchaseContractIdAndNameAndFigureNumber(Long id, String materialName, + String specification); + + public List selectPwPurchaseContractMaterialByFigureNumberAndAllGB(); + + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByCodeAndNameAndFigureNumber(String productionCode, String name,String figureNumber, String measure ); + + public List selectPwPurchaseContractMaterialByNameAndFigureNumber(String name, String figureNumber); + + /** + * 根据名称模糊搜索 + * @param name + * @return + */ + public List selectPwPurchaseContractMaterialByName(String name); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseContractService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseContractService.java new file mode 100644 index 0000000..26fa591 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseContractService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPurchaseContract; + +/** + * 采购合同Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPwPurchaseContractService +{ + /** + * 查询采购合同 + * + * @param id 采购合同ID + * @return 采购合同 + */ + public PwPurchaseContract selectPwPurchaseContractById(Long id); + + /** + * 查询采购合同列表 + * + * @param pwPurchaseContract 采购合同 + * @return 采购合同集合 + */ + public List selectPwPurchaseContractList(PwPurchaseContract pwPurchaseContract); + + /** + * 新增采购合同 + * + * @param pwPurchaseContract 采购合同 + * @return 结果 + */ + public int insertPwPurchaseContract(PwPurchaseContract pwPurchaseContract); + + /** + * 修改采购合同 + * + * @param pwPurchaseContract 采购合同 + * @return 结果 + */ + public int updatePwPurchaseContract(PwPurchaseContract pwPurchaseContract); + + /** + * 批量删除采购合同 + * + * @param ids 需要删除的采购合同ID + * @return 结果 + */ + public int deletePwPurchaseContractByIds(Long[] ids); + + /** + * 删除采购合同信息 + * + * @param id 采购合同ID + * @return 结果 + */ + public int deletePwPurchaseContractById(Long id); + + /** + * 根据合同编号查询合同信息 + * @param makeDocumentsCode + */ + public PwPurchaseContract selectPwPurchaseContractByCode(String makeDocumentsCode); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseService.java new file mode 100644 index 0000000..3cadb3b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwPurchaseService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwPurchase; + +/** + * 部件Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPwPurchaseService +{ + /** + * 查询部件 + * + * @param id 部件ID + * @return 部件 + */ + public PwPurchase selectPwPurchaseById(Long id); + + /** + * 查询部件列表 + * + * @param pwPurchase 部件 + * @return 部件集合 + */ + public List selectPwPurchaseList(PwPurchase pwPurchase); + + /** + * 新增部件 + * + * @param pwPurchase 部件 + * @return 结果 + */ + public int insertPwPurchase(PwPurchase pwPurchase); + + /** + * 修改部件 + * + * @param pwPurchase 部件 + * @return 结果 + */ + public int updatePwPurchase(PwPurchase pwPurchase); + + /** + * 批量删除部件 + * + * @param ids 需要删除的部件ID + * @return 结果 + */ + public int deletePwPurchaseByIds(Long[] ids); + + /** + * 删除部件信息 + * + * @param id 部件ID + * @return 结果 + */ + public int deletePwPurchaseById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwQrcodeService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwQrcodeService.java new file mode 100644 index 0000000..220e0a8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwQrcodeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwQrcode; + +/** + * 二维码信息Service接口 + * + * @author zhukangchao + * @date 2023-04-19 + */ +public interface IPwQrcodeService +{ + /** + * 查询二维码信息 + * + * @param id 二维码信息ID + * @return 二维码信息 + */ + public PwQrcode selectPwQrcodeById(Long id); + + /** + * 查询二维码信息列表 + * + * @param pwQrcode 二维码信息 + * @return 二维码信息集合 + */ + public List selectPwQrcodeList(PwQrcode pwQrcode); + + /** + * 新增二维码信息 + * + * @param pwQrcode 二维码信息 + * @return 结果 + */ + public int insertPwQrcode(PwQrcode pwQrcode); + + /** + * 修改二维码信息 + * + * @param pwQrcode 二维码信息 + * @return 结果 + */ + public int updatePwQrcode(PwQrcode pwQrcode); + + /** + * 批量删除二维码信息 + * + * @param ids 需要删除的二维码信息ID + * @return 结果 + */ + public int deletePwQrcodeByIds(Long[] ids); + + /** + * 删除二维码信息信息 + * + * @param id 二维码信息ID + * @return 结果 + */ + public int deletePwQrcodeById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwQuotationService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwQuotationService.java new file mode 100644 index 0000000..52cb9ad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwQuotationService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwQuotation; + +/** + * 报价单Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPwQuotationService +{ + /** + * 查询报价单 + * + * @param id 报价单ID + * @return 报价单 + */ + public PwQuotation selectPwQuotationById(Long id); + + /** + * 查询报价单列表 + * + * @param pwQuotation 报价单 + * @return 报价单集合 + */ + public List selectPwQuotationList(PwQuotation pwQuotation); + + /** + * 新增报价单 + * + * @param pwQuotation 报价单 + * @return 结果 + * @throws Exception + */ + public int insertPwQuotation(PwQuotation pwQuotation); + + /** + * 修改报价单 + * + * @param pwQuotation 报价单 + * @return 结果 + */ + public int updatePwQuotation(PwQuotation pwQuotation); + + /** + * 批量删除报价单 + * + * @param ids 需要删除的报价单ID + * @return 结果 + */ + public int deletePwQuotationByIds(Long[] ids); + + /** + * 删除报价单信息 + * + * @param id 报价单ID + * @return 结果 + */ + public int deletePwQuotationById(Long id); + + /** + * 根据项目名称查询报价单信息 + * @param itemName + * @return + */ + public PwQuotation selectPwQuotationByItemName(String itemName); + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwSafetyInventoryService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwSafetyInventoryService.java new file mode 100644 index 0000000..dc535cc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwSafetyInventoryService.java @@ -0,0 +1,69 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwSafetyInventory; + +/** + * 安全库存明细Service接口 + * + * @author zhukangchao + * @date 2022-12-31 + */ +public interface IPwSafetyInventoryService +{ + /** + * 查询安全库存明细 + * + * @param id 安全库存明细ID + * @return 安全库存明细 + */ + public PwSafetyInventory selectPwSafetyInventoryById(Long id); + + /** + * 查询安全库存明细列表 + * + * @param pwSafetyInventory 安全库存明细 + * @return 安全库存明细集合 + */ + public List selectPwSafetyInventoryList(PwSafetyInventory pwSafetyInventory); + + /** + * 新增安全库存明细 + * + * @param pwSafetyInventory 安全库存明细 + * @return 结果 + */ + public int insertPwSafetyInventory(PwSafetyInventory pwSafetyInventory); + + /** + * 修改安全库存明细 + * + * @param pwSafetyInventory 安全库存明细 + * @return 结果 + */ + public int updatePwSafetyInventory(PwSafetyInventory pwSafetyInventory); + + /** + * 批量删除安全库存明细 + * + * @param ids 需要删除的安全库存明细ID + * @return 结果 + */ + public int deletePwSafetyInventoryByIds(Long[] ids); + + /** + * 删除安全库存明细信息 + * + * @param id 安全库存明细ID + * @return 结果 + */ + public int deletePwSafetyInventoryById(Long id); + + /** + * 根据物料的名称和图号查询 + * @param materialName + * @param figureNumber + * @return + */ + public PwSafetyInventory selectPwSafetyInventoryByNameAndFigureNumber(String materialName, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwSchemeService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwSchemeService.java new file mode 100644 index 0000000..b7b3896 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwSchemeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwScheme; + +/** + * 方案Service接口 + * + * @author zhukangchao + * @date 2020-06-09 + */ +public interface IPwSchemeService +{ + /** + * 查询方案 + * + * @param id 方案ID + * @return 方案 + */ + public PwScheme selectPwSchemeById(Long id); + + /** + * 查询方案列表 + * + * @param pwScheme 方案 + * @return 方案集合 + */ + public List selectPwSchemeList(PwScheme pwScheme); + + /** + * 新增方案 + * + * @param pwScheme 方案 + * @return 结果 + */ + public int insertPwScheme(PwScheme pwScheme); + + /** + * 修改方案 + * + * @param pwScheme 方案 + * @return 结果 + */ + public int updatePwScheme(PwScheme pwScheme); + + /** + * 批量删除方案 + * + * @param ids 需要删除的方案ID + * @return 结果 + */ + public int deletePwSchemeByIds(Long[] ids); + + /** + * 删除方案信息 + * + * @param id 方案ID + * @return 结果 + */ + public int deletePwSchemeById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwScrapInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwScrapInfoService.java new file mode 100644 index 0000000..25b4df6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwScrapInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwScrapInfo; + +/** + * 报废信息Service接口 + * + * @author zhukangchao + * @date 2023-04-01 + */ +public interface IPwScrapInfoService +{ + /** + * 查询报废信息 + * + * @param id 报废信息ID + * @return 报废信息 + */ + public PwScrapInfo selectPwScrapInfoById(Long id); + + /** + * 查询报废信息列表 + * + * @param pwScrapInfo 报废信息 + * @return 报废信息集合 + */ + public List selectPwScrapInfoList(PwScrapInfo pwScrapInfo); + + /** + * 新增报废信息 + * + * @param pwScrapInfo 报废信息 + * @return 结果 + */ + public int insertPwScrapInfo(PwScrapInfo pwScrapInfo); + + /** + * 修改报废信息 + * + * @param pwScrapInfo 报废信息 + * @return 结果 + */ + public int updatePwScrapInfo(PwScrapInfo pwScrapInfo); + + /** + * 批量删除报废信息 + * + * @param ids 需要删除的报废信息ID + * @return 结果 + */ + public int deletePwScrapInfoByIds(Long[] ids); + + /** + * 删除报废信息信息 + * + * @param id 报废信息ID + * @return 结果 + */ + public int deletePwScrapInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwSpectacularsInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwSpectacularsInfoService.java new file mode 100644 index 0000000..3b3a08a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwSpectacularsInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwSpectacularsInfo; + +/** + * 新生产看板信息Service接口 + * + * @author zhukangchao + * @date 2023-04-03 + */ +public interface IPwSpectacularsInfoService +{ + /** + * 查询新生产看板信息 + * + * @param id 新生产看板信息ID + * @return 新生产看板信息 + */ + public PwSpectacularsInfo selectPwSpectacularsInfoById(Long id); + + /** + * 查询新生产看板信息列表 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 新生产看板信息集合 + */ + public List selectPwSpectacularsInfoList(PwSpectacularsInfo pwSpectacularsInfo); + + /** + * 新增新生产看板信息 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 结果 + */ + public int insertPwSpectacularsInfo(PwSpectacularsInfo pwSpectacularsInfo); + + /** + * 修改新生产看板信息 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 结果 + */ + public int updatePwSpectacularsInfo(PwSpectacularsInfo pwSpectacularsInfo); + + /** + * 批量删除新生产看板信息 + * + * @param ids 需要删除的新生产看板信息ID + * @return 结果 + */ + public int deletePwSpectacularsInfoByIds(Long[] ids); + + /** + * 删除新生产看板信息信息 + * + * @param id 新生产看板信息ID + * @return 结果 + */ + public int deletePwSpectacularsInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwSpectacularsService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwSpectacularsService.java new file mode 100644 index 0000000..7c57831 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwSpectacularsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwSpectaculars; + +/** + * 生产看板Service接口 + * + * @author zhukangchao + * @date 2023-02-01 + */ +public interface IPwSpectacularsService +{ + /** + * 查询生产看板 + * + * @param id 生产看板ID + * @return 生产看板 + */ + public PwSpectaculars selectPwSpectacularsById(Long id); + + /** + * 查询生产看板列表 + * + * @param pwSpectaculars 生产看板 + * @return 生产看板集合 + */ + public List selectPwSpectacularsList(PwSpectaculars pwSpectaculars); + + /** + * 新增生产看板 + * + * @param pwSpectaculars 生产看板 + * @return 结果 + */ + public int insertPwSpectaculars(PwSpectaculars pwSpectaculars); + + /** + * 修改生产看板 + * + * @param pwSpectaculars 生产看板 + * @return 结果 + */ + public int updatePwSpectaculars(PwSpectaculars pwSpectaculars); + + /** + * 批量删除生产看板 + * + * @param ids 需要删除的生产看板ID + * @return 结果 + */ + public int deletePwSpectacularsByIds(Long[] ids); + + /** + * 删除生产看板信息 + * + * @param id 生产看板ID + * @return 结果 + */ + public int deletePwSpectacularsById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwStoresRequisitionService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwStoresRequisitionService.java new file mode 100644 index 0000000..69a496d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwStoresRequisitionService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwStoresRequisition; + +/** + * 物品领料单Service接口 + * + * @author zhukangchao + * @date 2022-03-14 + */ +public interface IPwStoresRequisitionService +{ + /** + * 查询物品领料单 + * + * @param id 物品领料单ID + * @return 物品领料单 + */ + public PwStoresRequisition selectPwStoresRequisitionById(Long id); + + /** + * 查询物品领料单列表 + * + * @param pwStoresRequisition 物品领料单 + * @return 物品领料单集合 + */ + public List selectPwStoresRequisitionList(PwStoresRequisition pwStoresRequisition); + + /** + * 新增物品领料单 + * + * @param pwStoresRequisition 物品领料单 + * @return 结果 + */ + public int insertPwStoresRequisition(PwStoresRequisition pwStoresRequisition); + + /** + * 修改物品领料单 + * + * @param pwStoresRequisition 物品领料单 + * @return 结果 + */ + public int updatePwStoresRequisition(PwStoresRequisition pwStoresRequisition); + + /** + * 批量删除物品领料单 + * + * @param ids 需要删除的物品领料单ID + * @return 结果 + */ + public int deletePwStoresRequisitionByIds(Long[] ids); + + /** + * 删除物品领料单信息 + * + * @param id 物品领料单ID + * @return 结果 + */ + public int deletePwStoresRequisitionById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwStoresRequistionDetailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwStoresRequistionDetailService.java new file mode 100644 index 0000000..59cf735 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwStoresRequistionDetailService.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; + +/** + * 领料单详情Service接口 + * + * @author zhukangchao + * @date 2022-03-14 + */ +public interface IPwStoresRequistionDetailService +{ + /** + * 查询领料单详情 + * + * @param id 领料单详情ID + * @return 领料单详情 + */ + public PwStoresRequistionDetail selectPwStoresRequistionDetailById(Long id); + + /** + * 查询领料单详情列表 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 领料单详情集合 + */ + public List selectPwStoresRequistionDetailList(PwStoresRequistionDetail pwStoresRequistionDetail); + + /** + * 新增领料单详情 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 结果 + */ + public int insertPwStoresRequistionDetail(PwStoresRequistionDetail pwStoresRequistionDetail); + + /** + * 修改领料单详情 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 结果 + */ + public int updatePwStoresRequistionDetail(PwStoresRequistionDetail pwStoresRequistionDetail); + + /** + * 批量删除领料单详情 + * + * @param ids 需要删除的领料单详情ID + * @return 结果 + */ + public int deletePwStoresRequistionDetailByIds(Long[] ids); + + /** + * 删除领料单详情信息 + * + * @param id 领料单详情ID + * @return 结果 + */ + public int deletePwStoresRequistionDetailById(Long id); + + public List selectPwStoresRequistionDetailByStoresRequistionId(Long id); + + /** + * 根据名称查询 + * @param materialName + * @return + */ + public List selectPwStoresRequistionDetailByName(String materialName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskBomService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskBomService.java new file mode 100644 index 0000000..dba1fba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskBomService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTaskBom; + +/** + * 任务零部件关联Service接口 + * + * @author zhukangchao + * @date 2020-08-20 + */ +public interface IPwTaskBomService +{ + /** + * 查询任务零部件关联 + * + * @param id 任务零部件关联ID + * @return 任务零部件关联 + */ + public PwTaskBom selectPwTaskBomById(Long id); + + /** + * 查询任务零部件关联列表 + * + * @param pwTaskBom 任务零部件关联 + * @return 任务零部件关联集合 + */ + public List selectPwTaskBomList(PwTaskBom pwTaskBom); + + /** + * 新增任务零部件关联 + * + * @param pwTaskBom 任务零部件关联 + * @return 结果 + */ + public int insertPwTaskBom(PwTaskBom pwTaskBom); + + /** + * 修改任务零部件关联 + * + * @param pwTaskBom 任务零部件关联 + * @return 结果 + */ + public int updatePwTaskBom(PwTaskBom pwTaskBom); + + /** + * 批量删除任务零部件关联 + * + * @param ids 需要删除的任务零部件关联ID + * @return 结果 + */ + public int deletePwTaskBomByIds(Long[] ids); + + /** + * 删除任务零部件关联信息 + * + * @param id 任务零部件关联ID + * @return 结果 + */ + public int deletePwTaskBomById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskOverTimeInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskOverTimeInfoService.java new file mode 100644 index 0000000..ffa11f2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskOverTimeInfoService.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTaskOverTimeInfo; + +/** + * 任务超时信息Service接口 + * + * @author zhukangchao + * @date 2023-09-01 + */ +public interface IPwTaskOverTimeInfoService +{ + /** + * 查询任务超时信息 + * + * @param id 任务超时信息ID + * @return 任务超时信息 + */ + public PwTaskOverTimeInfo selectPwTaskOverTimeInfoById(Long id); + + /** + * 查询任务超时信息列表 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 任务超时信息集合 + */ + public List selectPwTaskOverTimeInfoList(PwTaskOverTimeInfo pwTaskOverTimeInfo); + + /** + * 新增任务超时信息 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 结果 + */ + public int insertPwTaskOverTimeInfo(PwTaskOverTimeInfo pwTaskOverTimeInfo); + + /** + * 修改任务超时信息 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 结果 + */ + public int updatePwTaskOverTimeInfo(PwTaskOverTimeInfo pwTaskOverTimeInfo); + + /** + * 批量删除任务超时信息 + * + * @param ids 需要删除的任务超时信息ID + * @return 结果 + */ + public int deletePwTaskOverTimeInfoByIds(Long[] ids); + + /** + * 删除任务超时信息信息 + * + * @param id 任务超时信息ID + * @return 结果 + */ + public int deletePwTaskOverTimeInfoById(Long id); + + public void insertPwTaskOverTimeInfos(List lists); + + /** + * 添加之前先清除表数据 + */ + public void eliminate(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskService.java new file mode 100644 index 0000000..cf5fb15 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwTaskService.java @@ -0,0 +1,72 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTask; + +/** + * 任务Service接口 + * + * @author zhukangchao + * @date 2020-08-11 + */ +public interface IPwTaskService +{ + /** + * 查询任务 + * + * @param id 任务ID + * @return 任务 + */ + public PwTask selectPwTaskById(Long id); + + /** + * 查询任务列表 + * + * @param pwTask 任务 + * @return 任务集合 + */ + public List selectPwTaskList(PwTask pwTask); + + /** + * 新增任务 + * + * @param pwTask 任务 + * @return 结果 + */ + public int insertPwTask(PwTask pwTask); + + /** + * 修改任务 + * + * @param pwTask 任务 + * @return 结果 + */ + public int updatePwTask(PwTask pwTask); + + /** + * 批量删除任务 + * + * @param ids 需要删除的任务ID + * @return 结果 + */ + public int deletePwTaskByIds(Long[] ids); + + /** + * 删除任务信息 + * + * @param id 任务ID + * @return 结果 + */ + public int deletePwTaskById(Long id); + + /** + * 完成任务按钮 + */ + public int accomplishTask(Long id); + + /** + * 根据任务编号查询 + * @param productiveTaskCode + */ + public PwTask selectPwTaskByTaskCode(String productiveTaskCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwTicketInfoService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwTicketInfoService.java new file mode 100644 index 0000000..43f66e5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwTicketInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwTicketInfo; + +/** + * 处罚单信息Service接口 + * + * @author zhukangchao + * @date 2023-08-01 + */ +public interface IPwTicketInfoService +{ + /** + * 查询处罚单信息 + * + * @param id 处罚单信息ID + * @return 处罚单信息 + */ + public PwTicketInfo selectPwTicketInfoById(Long id); + + /** + * 查询处罚单信息列表 + * + * @param pwTicketInfo 处罚单信息 + * @return 处罚单信息集合 + */ + public List selectPwTicketInfoList(PwTicketInfo pwTicketInfo); + + /** + * 新增处罚单信息 + * + * @param pwTicketInfo 处罚单信息 + * @return 结果 + */ + public int insertPwTicketInfo(PwTicketInfo pwTicketInfo); + + /** + * 修改处罚单信息 + * + * @param pwTicketInfo 处罚单信息 + * @return 结果 + */ + public int updatePwTicketInfo(PwTicketInfo pwTicketInfo); + + /** + * 批量删除处罚单信息 + * + * @param ids 需要删除的处罚单信息ID + * @return 结果 + */ + public int deletePwTicketInfoByIds(Long[] ids); + + /** + * 删除处罚单信息信息 + * + * @param id 处罚单信息ID + * @return 结果 + */ + public int deletePwTicketInfoById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IPwUserEmailService.java b/evo/src/main/java/com/ruoyi/project/management/service/IPwUserEmailService.java new file mode 100644 index 0000000..f2ba651 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IPwUserEmailService.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.PwUserEmail; + +/** + * 邮箱Service接口 + * + * @author zhukangchao + * @date 2022-09-24 + */ +public interface IPwUserEmailService +{ + /** + * 查询邮箱 + * + * @param id 邮箱ID + * @return 邮箱 + */ + public PwUserEmail selectPwUserEmailById(Long id); + + /** + * 查询邮箱列表 + * + * @param pwUserEmail 邮箱 + * @return 邮箱集合 + */ + public List selectPwUserEmailList(PwUserEmail pwUserEmail); + + /** + * 新增邮箱 + * + * @param pwUserEmail 邮箱 + * @return 结果 + */ + public int insertPwUserEmail(PwUserEmail pwUserEmail); + + /** + * 修改邮箱 + * + * @param pwUserEmail 邮箱 + * @return 结果 + */ + public int updatePwUserEmail(PwUserEmail pwUserEmail); + + /** + * 批量删除邮箱 + * + * @param ids 需要删除的邮箱ID + * @return 结果 + */ + public int deletePwUserEmailByIds(Long[] ids); + + /** + * 删除邮箱信息 + * + * @param id 邮箱ID + * @return 结果 + */ + public int deletePwUserEmailById(Long id); + + public PwUserEmail selectPwUserEmailByName(String userName); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/ISysConfigIniService.java b/evo/src/main/java/com/ruoyi/project/management/service/ISysConfigIniService.java new file mode 100644 index 0000000..6ff0e0f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/ISysConfigIniService.java @@ -0,0 +1,78 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.SysConfigIni; + +/** + * 图纸配置 +Service接口 + * + * @author zhukangchao + * @date 2021-03-05 + */ +public interface ISysConfigIniService +{ + /** + * 查询图纸配置 + + * + * @param id 图纸配置 +ID + * @return 图纸配置 + + */ + public SysConfigIni selectSysConfigIniById(Long id); + + /** + * 查询图纸配置 +列表 + * + * @param sysConfigIni 图纸配置 + + * @return 图纸配置 +集合 + */ + public List selectSysConfigIniList(SysConfigIni sysConfigIni); + + /** + * 新增图纸配置 + + * + * @param sysConfigIni 图纸配置 + + * @return 结果 + */ + public int insertSysConfigIni(SysConfigIni sysConfigIni); + + /** + * 修改图纸配置 + + * + * @param sysConfigIni 图纸配置 + + * @return 结果 + */ + public int updateSysConfigIni(SysConfigIni sysConfigIni); + + /** + * 批量删除图纸配置 + + * + * @param ids 需要删除的图纸配置 +ID + * @return 结果 + */ + public int deleteSysConfigIniByIds(Long[] ids); + + /** + * 删除图纸配置 +信息 + * + * @param id 图纸配置 +ID + * @return 结果 + */ + public int deleteSysConfigIniById(Long id); + + public SysConfigIni selectSysConfigIniByFileType(String fileType); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IYcBomNumberPreliminaryInquiryService.java b/evo/src/main/java/com/ruoyi/project/management/service/IYcBomNumberPreliminaryInquiryService.java new file mode 100644 index 0000000..bb9034d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IYcBomNumberPreliminaryInquiryService.java @@ -0,0 +1,77 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.YcBomNumberPreliminaryInquiry; + +/** + * 预查询点件Service接口 + * + * @author zhukangchao + * @date 2021-12-08 + */ +public interface IYcBomNumberPreliminaryInquiryService +{ + /** + * 查询预查询点件 + * + * @param id 预查询点件ID + * @return 预查询点件 + */ + public YcBomNumberPreliminaryInquiry selectYcBomNumberPreliminaryInquiryById(Long id); + + /** + * 查询预查询点件列表 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 预查询点件集合 + */ + public List selectYcBomNumberPreliminaryInquiryList(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry); + + /** + * 新增预查询点件 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 结果 + */ + public int insertYcBomNumberPreliminaryInquiry(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry); + + /** + * 修改预查询点件 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 结果 + */ + public int updateYcBomNumberPreliminaryInquiry(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry); + + /** + * 批量删除预查询点件 + * + * @param ids 需要删除的预查询点件ID + * @return 结果 + */ + public int deleteYcBomNumberPreliminaryInquiryByIds(Long[] ids); + + /** + * 删除预查询点件信息 + * + * @param id 预查询点件ID + * @return 结果 + */ + public int deleteYcBomNumberPreliminaryInquiryById(Long id); + + /** + * 批量添加 + * @param list + * @return + */ + public int insertYcBomNumberPreliminaryInquirys(List list); + + /** + * 根据上级图号查询上级信息 + * @param figureNumber + * @param typeName + * @param productionCode + * @return + */ + public List selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(String figureNumber, String typeName, String productionCode); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IYcBomNumberTwoPreliminaryInquiryService.java b/evo/src/main/java/com/ruoyi/project/management/service/IYcBomNumberTwoPreliminaryInquiryService.java new file mode 100644 index 0000000..889dcba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IYcBomNumberTwoPreliminaryInquiryService.java @@ -0,0 +1,64 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.YcBomNumberTwoPreliminaryInquiry; + +/** + * 预查询计算后的点件Service接口 + * + * @author zhukangchao + * @date 2021-12-08 + */ +public interface IYcBomNumberTwoPreliminaryInquiryService +{ + /** + * 查询预查询计算后的点件 + * + * @param id 预查询计算后的点件ID + * @return 预查询计算后的点件 + */ + public YcBomNumberTwoPreliminaryInquiry selectYcBomNumberTwoPreliminaryInquiryById(Long id); + + /** + * 查询预查询计算后的点件列表 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 预查询计算后的点件集合 + */ + public List selectYcBomNumberTwoPreliminaryInquiryList(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry); + + /** + * 新增预查询计算后的点件 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 结果 + */ + public int insertYcBomNumberTwoPreliminaryInquiry(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry); + + /** + * 修改预查询计算后的点件 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 结果 + */ + public int updateYcBomNumberTwoPreliminaryInquiry(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry); + + /** + * 批量删除预查询计算后的点件 + * + * @param ids 需要删除的预查询计算后的点件ID + * @return 结果 + */ + public int deleteYcBomNumberTwoPreliminaryInquiryByIds(Long[] ids); + + /** + * 删除预查询计算后的点件信息 + * + * @param id 预查询计算后的点件ID + * @return 结果 + */ + public int deleteYcBomNumberTwoPreliminaryInquiryById(Long id); + + public YcBomNumberTwoPreliminaryInquiry selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber( + String productionCode, String name, String figureNumber); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/IYcProductService.java b/evo/src/main/java/com/ruoyi/project/management/service/IYcProductService.java new file mode 100644 index 0000000..f6ca281 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/IYcProductService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.service; + +import java.util.List; +import com.ruoyi.project.management.domain.YcProduct; + +/** + * 预查询产品Service接口 + * + * @author zhukangchao + * @date 2021-12-08 + */ +public interface IYcProductService +{ + /** + * 查询预查询产品 + * + * @param int 预查询产品ID + * @return 预查询产品 + */ + public YcProduct selectYcProductById(Long id); + + /** + * 查询预查询产品列表 + * + * @param ycProduct 预查询产品 + * @return 预查询产品集合 + */ + public List selectYcProductList(YcProduct ycProduct); + + /** + * 新增预查询产品 + * + * @param ycProduct 预查询产品 + * @return 结果 + */ + public int insertYcProduct(YcProduct ycProduct); + + /** + * 修改预查询产品 + * + * @param ycProduct 预查询产品 + * @return 结果 + */ + public int updateYcProduct(YcProduct ycProduct); + + /** + * 批量删除预查询产品 + * + * @param ints 需要删除的预查询产品ID + * @return 结果 + */ + public int deleteYcProductByIds(Long[] ids); + + /** + * 删除预查询产品信息 + * + * @param int 预查询产品ID + * @return 结果 + */ + public int deleteYcProductById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/PlannedOrderService.java b/evo/src/main/java/com/ruoyi/project/management/service/PlannedOrderService.java new file mode 100644 index 0000000..86b378e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/PlannedOrderService.java @@ -0,0 +1,8 @@ +package com.ruoyi.project.management.service; + +public interface PlannedOrderService { + /** + * 查询所有的未投放的订单 + */ + public void queryPlannedOrders(); +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/AutoInventoryIssueServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/AutoInventoryIssueServiceImpl.java new file mode 100644 index 0000000..ca48d62 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/AutoInventoryIssueServiceImpl.java @@ -0,0 +1,100 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.AutoInventoryIssueMapper; +import com.ruoyi.project.management.domain.AutoInventoryIssue; +import com.ruoyi.project.management.service.IAutoInventoryIssueService; + +/** + * 安全库存出单Service业务层处理 + * + * @author chenyongjiang + * @date 2024-02-19 + */ +@Service +public class AutoInventoryIssueServiceImpl implements IAutoInventoryIssueService +{ + @Autowired + private AutoInventoryIssueMapper autoInventoryIssueMapper; + + /** + * 查询安全库存出单 + * + * @param id 安全库存出单ID + * @return 安全库存出单 + */ + @Override + public AutoInventoryIssue selectAutoInventoryIssueById(Long id) + { + return autoInventoryIssueMapper.selectAutoInventoryIssueById(id); + } + + /** + * 查询安全库存出单列表 + * + * @param autoInventoryIssue 安全库存出单 + * @return 安全库存出单 + */ + @Override + public List selectAutoInventoryIssueList(AutoInventoryIssue autoInventoryIssue) + { + return autoInventoryIssueMapper.selectAutoInventoryIssueList(autoInventoryIssue); + } + + /** + * 新增安全库存出单 + * + * @param autoInventoryIssue 安全库存出单 + * @return 结果 + */ + @Override + public int insertAutoInventoryIssue(AutoInventoryIssue autoInventoryIssue) + { + autoInventoryIssue.setCreateTime(DateUtils.getNowDate()); + return autoInventoryIssueMapper.insertAutoInventoryIssue(autoInventoryIssue); + } + + /** + * 修改安全库存出单 + * + * @param autoInventoryIssue 安全库存出单 + * @return 结果 + */ + @Override + public int updateAutoInventoryIssue(AutoInventoryIssue autoInventoryIssue) + { + autoInventoryIssue.setUpdateTime(DateUtils.getNowDate()); + return autoInventoryIssueMapper.updateAutoInventoryIssue(autoInventoryIssue); + } + + /** + * 批量删除安全库存出单 + * + * @param ids 需要删除的安全库存出单ID + * @return 结果 + */ + @Override + public int deleteAutoInventoryIssueByIds(Long[] ids) + { + return autoInventoryIssueMapper.deleteAutoInventoryIssueByIds(ids); + } + + /** + * 删除安全库存出单信息 + * + * @param id 安全库存出单ID + * @return 结果 + */ + @Override + public int deleteAutoInventoryIssueById(Long id) + { + return autoInventoryIssueMapper.deleteAutoInventoryIssueById(id); + } + @Override + public AutoInventoryIssue selectAutoInventoryIssueByFigureNumber(String figureNumber){ + return autoInventoryIssueMapper.selectAutoInventoryIssueByFigureNumber(figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/BaseQuestionServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/BaseQuestionServiceImpl.java new file mode 100644 index 0000000..4cb1445 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/BaseQuestionServiceImpl.java @@ -0,0 +1,91 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.BaseQuestion; +import com.ruoyi.project.management.mapper.BaseQuestionMapper; +import com.ruoyi.project.management.service.IBaseQuestionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 问题处理Service业务层处理 + * + * @author zhukangchao + * @date 2023-10-07 + */ +@Service +public class BaseQuestionServiceImpl implements IBaseQuestionService +{ + @Autowired + private BaseQuestionMapper baseQuestionMapper; + + /** + * 查询问题处理 + * + * @param questionId 问题处理ID + * @return 问题处理 + */ + @Override + public BaseQuestion selectBaseQuestionById(Long questionId) + { + return baseQuestionMapper.selectBaseQuestionById(questionId); + } + + /** + * 查询问题处理列表 + * + * @param baseQuestion 问题处理 + * @return 问题处理 + */ + @Override + public List selectBaseQuestionList(BaseQuestion baseQuestion) + { + return baseQuestionMapper.selectBaseQuestionList(baseQuestion); + } + + /** + * 新增问题处理 + * + * @param baseQuestion 问题处理 + * @return 结果 + */ + @Override + public int insertBaseQuestion(BaseQuestion baseQuestion) + { + baseQuestion.setCreateTime(DateUtils.getNowDate()); + baseQuestion.setQuestionTime(DateUtils.getNowDate()); + return baseQuestionMapper.insertBaseQuestion(baseQuestion); + } + + /** + * 修改问题处理 + * + * @param baseQuestion 问题处理 + * @return 结果 + */ + @Override + public int updateBaseQuestion(BaseQuestion baseQuestion) + { + //判断是处理问题,还是填写预估时间 + if(StringUtils.isNotEmpty(baseQuestion.getQuestionMethod())){ + baseQuestion.setQuestionHandleTime(DateUtils.getNowDate()); + baseQuestion.setQuestionUsedDays(DateUtils.getDatePoor(DateUtils.getNowDate(),baseQuestion.getQuestionTime())); + } + baseQuestion.setUpdateTime(DateUtils.getNowDate()); + return baseQuestionMapper.updateBaseQuestion(baseQuestion); + } + + /** + * 删除问题处理信息 + * + * @param questionId 问题处理ID + * @return 结果 + */ + @Override + public int deleteBaseQuestionById(Long questionId) + { + return baseQuestionMapper.deleteBaseQuestionById(questionId); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CadMaterialInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CadMaterialInfoServiceImpl.java new file mode 100644 index 0000000..172f383 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CadMaterialInfoServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CadMaterialInfoMapper; +import com.ruoyi.project.management.domain.CadMaterialInfo; +import com.ruoyi.project.management.service.ICadMaterialInfoService; + +/** + * CAD物料明细Service业务层处理 + * + * @author zhukangchao + * @date 2023-06-13 + */ +@Service +public class CadMaterialInfoServiceImpl implements ICadMaterialInfoService +{ + @Autowired + private CadMaterialInfoMapper cadMaterialInfoMapper; + + /** + * 查询CAD物料明细 + * + * @param id CAD物料明细ID + * @return CAD物料明细 + */ + @Override + public CadMaterialInfo selectCadMaterialInfoById(Long id) + { + return cadMaterialInfoMapper.selectCadMaterialInfoById(id); + } + + /** + * 查询CAD物料明细列表 + * + * @param cadMaterialInfo CAD物料明细 + * @return CAD物料明细 + */ + @Override + public List selectCadMaterialInfoList(CadMaterialInfo cadMaterialInfo) + { + return cadMaterialInfoMapper.selectCadMaterialInfoList(cadMaterialInfo); + } + + /** + * 新增CAD物料明细 + * + * @param cadMaterialInfo CAD物料明细 + * @return 结果 + */ + @Override + public int insertCadMaterialInfo(CadMaterialInfo cadMaterialInfo) + { + cadMaterialInfo.setCreateTime(DateUtils.getNowDate()); + return cadMaterialInfoMapper.insertCadMaterialInfo(cadMaterialInfo); + } + + /** + * 修改CAD物料明细 + * + * @param cadMaterialInfo CAD物料明细 + * @return 结果 + */ + @Override + public int updateCadMaterialInfo(CadMaterialInfo cadMaterialInfo) + { + return cadMaterialInfoMapper.updateCadMaterialInfo(cadMaterialInfo); + } + + /** + * 批量删除CAD物料明细 + * + * @param ids 需要删除的CAD物料明细ID + * @return 结果 + */ + @Override + public int deleteCadMaterialInfoByIds(Long[] ids) + { + return cadMaterialInfoMapper.deleteCadMaterialInfoByIds(ids); + } + + /** + * 删除CAD物料明细信息 + * + * @param id CAD物料明细ID + * @return 结果 + */ + @Override + public int deleteCadMaterialInfoById(Long id) + { + return cadMaterialInfoMapper.deleteCadMaterialInfoById(id); + } + + @Override + public CadMaterialInfo selectCadMaterialInfoByNameAndFigureNumber(String name, String figureNumber) { + // TODO Auto-generated method stub + return cadMaterialInfoMapper.selectCadMaterialInfoByNameAndFigureNumber(name,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceRecordDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceRecordDetailServiceImpl.java new file mode 100644 index 0000000..a669c13 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceRecordDetailServiceImpl.java @@ -0,0 +1,109 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwAttendanceRecordDetailMapper; +import com.ruoyi.project.management.domain.CwAttendanceRecordDetail; +import com.ruoyi.project.management.service.ICwAttendanceRecordDetailService; + +/** + * 考勤记录Service业务层处理 + * + * @author zhukangchao + * @date 2022-10-21 + */ +@Service +public class CwAttendanceRecordDetailServiceImpl implements ICwAttendanceRecordDetailService +{ + @Autowired + private CwAttendanceRecordDetailMapper cwAttendanceRecordDetailMapper; + + /** + * 查询考勤记录 + * + * @param id 考勤记录ID + * @return 考勤记录 + */ + @Override + public CwAttendanceRecordDetail selectCwAttendanceRecordDetailById(Long id) + { + return cwAttendanceRecordDetailMapper.selectCwAttendanceRecordDetailById(id); + } + + /** + * 查询考勤记录列表 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 考勤记录 + */ + @Override + public List selectCwAttendanceRecordDetailList(CwAttendanceRecordDetail cwAttendanceRecordDetail) + { + return cwAttendanceRecordDetailMapper.selectCwAttendanceRecordDetailList(cwAttendanceRecordDetail); + } + + /** + * 新增考勤记录 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 结果 + */ + @Override + public int insertCwAttendanceRecordDetail(CwAttendanceRecordDetail cwAttendanceRecordDetail) + { + cwAttendanceRecordDetail.setCreateTime(DateUtils.getNowDate()); + return cwAttendanceRecordDetailMapper.insertCwAttendanceRecordDetail(cwAttendanceRecordDetail); + } + + /** + * 修改考勤记录 + * + * @param cwAttendanceRecordDetail 考勤记录 + * @return 结果 + */ + @Override + public int updateCwAttendanceRecordDetail(CwAttendanceRecordDetail cwAttendanceRecordDetail) + { + return cwAttendanceRecordDetailMapper.updateCwAttendanceRecordDetail(cwAttendanceRecordDetail); + } + + /** + * 批量删除考勤记录 + * + * @param ids 需要删除的考勤记录ID + * @return 结果 + */ + @Override + public int deleteCwAttendanceRecordDetailByIds(Long[] ids) + { + return cwAttendanceRecordDetailMapper.deleteCwAttendanceRecordDetailByIds(ids); + } + + /** + * 删除考勤记录信息 + * + * @param id 考勤记录ID + * @return 结果 + */ + @Override + public int deleteCwAttendanceRecordDetailById(Long id) + { + return cwAttendanceRecordDetailMapper.deleteCwAttendanceRecordDetailById(id); + } + + @Override + public List selectCwAttendanceRecordDetailByCode(String userId) { + // TODO Auto-generated method stub + return cwAttendanceRecordDetailMapper.selectCwAttendanceRecordDetailByCode(userId); + } + + @Override + public List selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(String userId, + Date date, String string) { + // TODO Auto-generated method stub + return cwAttendanceRecordDetailMapper.selectCwAttendanceRecordDetailByCodeAndDateTimeAndButtonType(userId,date,string); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceServiceImpl.java new file mode 100644 index 0000000..7c037bf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwAttendanceMapper; +import com.ruoyi.project.management.domain.CwAttendance; +import com.ruoyi.project.management.service.ICwAttendanceService; + +/** + * 考勤记录Service业务层处理 + * + * @author zhukangchao + * @date 2021-11-02 + */ +@Service +public class CwAttendanceServiceImpl implements ICwAttendanceService +{ + @Autowired + private CwAttendanceMapper cwAttendanceMapper; + + /** + * 查询考勤记录 + * + * @param id 考勤记录ID + * @return 考勤记录 + */ + @Override + public CwAttendance selectCwAttendanceById(Long id) + { + return cwAttendanceMapper.selectCwAttendanceById(id); + } + + /** + * 查询考勤记录列表 + * + * @param cwAttendance 考勤记录 + * @return 考勤记录 + */ + @Override + public List selectCwAttendanceList(CwAttendance cwAttendance) + { + return cwAttendanceMapper.selectCwAttendanceList(cwAttendance); + } + + /** + * 新增考勤记录 + * + * @param cwAttendance 考勤记录 + * @return 结果 + */ + @Override + public int insertCwAttendance(CwAttendance cwAttendance) + { + cwAttendance.setCreateTime(DateUtils.getNowDate()); + return cwAttendanceMapper.insertCwAttendance(cwAttendance); + } + + /** + * 修改考勤记录 + * + * @param cwAttendance 考勤记录 + * @return 结果 + */ + @Override + public int updateCwAttendance(CwAttendance cwAttendance) + { + return cwAttendanceMapper.updateCwAttendance(cwAttendance); + } + + /** + * 批量删除考勤记录 + * + * @param ids 需要删除的考勤记录ID + * @return 结果 + */ + @Override + public int deleteCwAttendanceByIds(Long[] ids) + { + return cwAttendanceMapper.deleteCwAttendanceByIds(ids); + } + + /** + * 删除考勤记录信息 + * + * @param id 考勤记录ID + * @return 结果 + */ + @Override + public int deleteCwAttendanceById(Long id) + { + return cwAttendanceMapper.deleteCwAttendanceById(id); + } + + @Override + public CwAttendance selectCwAttendanceByNameAndBelongsToDate(String name, String riqi) { + // TODO Auto-generated method stub + return cwAttendanceMapper.selectCwAttendanceByNameAndBelongsToDate(name,riqi); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceUserServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceUserServiceImpl.java new file mode 100644 index 0000000..19bdb62 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwAttendanceUserServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwAttendanceUserMapper; +import com.ruoyi.project.management.domain.CwAttendanceUser; +import com.ruoyi.project.management.service.ICwAttendanceUserService; + +/** + * 员工信息Service业务层处理 + * + * @author zhukangchao + * @date 2022-10-21 + */ +@Service +public class CwAttendanceUserServiceImpl implements ICwAttendanceUserService +{ + @Autowired + private CwAttendanceUserMapper cwAttendanceUserMapper; + + /** + * 查询员工信息 + * + * @param id 员工信息ID + * @return 员工信息 + */ + @Override + public CwAttendanceUser selectCwAttendanceUserById(Long id) + { + return cwAttendanceUserMapper.selectCwAttendanceUserById(id); + } + + /** + * 查询员工信息列表 + * + * @param cwAttendanceUser 员工信息 + * @return 员工信息 + */ + @Override + public List selectCwAttendanceUserList(CwAttendanceUser cwAttendanceUser) + { + return cwAttendanceUserMapper.selectCwAttendanceUserList(cwAttendanceUser); + } + + /** + * 新增员工信息 + * + * @param cwAttendanceUser 员工信息 + * @return 结果 + */ + @Override + public int insertCwAttendanceUser(CwAttendanceUser cwAttendanceUser) + { + cwAttendanceUser.setCreateTime(DateUtils.getNowDate()); + return cwAttendanceUserMapper.insertCwAttendanceUser(cwAttendanceUser); + } + + /** + * 修改员工信息 + * + * @param cwAttendanceUser 员工信息 + * @return 结果 + */ + @Override + public int updateCwAttendanceUser(CwAttendanceUser cwAttendanceUser) + { + return cwAttendanceUserMapper.updateCwAttendanceUser(cwAttendanceUser); + } + + /** + * 批量删除员工信息 + * + * @param ids 需要删除的员工信息ID + * @return 结果 + */ + @Override + public int deleteCwAttendanceUserByIds(Long[] ids) + { + return cwAttendanceUserMapper.deleteCwAttendanceUserByIds(ids); + } + + /** + * 删除员工信息信息 + * + * @param id 员工信息ID + * @return 结果 + */ + @Override + public int deleteCwAttendanceUserById(Long id) + { + return cwAttendanceUserMapper.deleteCwAttendanceUserById(id); + } + + @Override + public CwAttendanceUser selectCwAttendanceUserByName(String name) { + // TODO Auto-generated method stub + return cwAttendanceUserMapper.selectCwAttendanceUserByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwButtonServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwButtonServiceImpl.java new file mode 100644 index 0000000..11b5bd5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwButtonServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwButtonMapper; +import com.ruoyi.project.management.domain.CwButton; +import com.ruoyi.project.management.service.ICwButtonService; + +/** + * 按钮信息Service业务层处理 + * + * @author zhukangchao + * @date 2022-10-31 + */ +@Service +public class CwButtonServiceImpl implements ICwButtonService +{ + @Autowired + private CwButtonMapper cwButtonMapper; + + /** + * 查询按钮信息 + * + * @param id 按钮信息ID + * @return 按钮信息 + */ + @Override + public CwButton selectCwButtonById(Long id) + { + return cwButtonMapper.selectCwButtonById(id); + } + + /** + * 查询按钮信息列表 + * + * @param cwButton 按钮信息 + * @return 按钮信息 + */ + @Override + public List selectCwButtonList(CwButton cwButton) + { + return cwButtonMapper.selectCwButtonList(cwButton); + } + + /** + * 新增按钮信息 + * + * @param cwButton 按钮信息 + * @return 结果 + */ + @Override + public int insertCwButton(CwButton cwButton) + { + cwButton.setCreateTime(DateUtils.getNowDate()); + return cwButtonMapper.insertCwButton(cwButton); + } + + /** + * 修改按钮信息 + * + * @param cwButton 按钮信息 + * @return 结果 + */ + @Override + public int updateCwButton(CwButton cwButton) + { + return cwButtonMapper.updateCwButton(cwButton); + } + + /** + * 批量删除按钮信息 + * + * @param ids 需要删除的按钮信息ID + * @return 结果 + */ + @Override + public int deleteCwButtonByIds(Long[] ids) + { + return cwButtonMapper.deleteCwButtonByIds(ids); + } + + /** + * 删除按钮信息信息 + * + * @param id 按钮信息ID + * @return 结果 + */ + @Override + public int deleteCwButtonById(Long id) + { + return cwButtonMapper.deleteCwButtonById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwCostAnalysisServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwCostAnalysisServiceImpl.java new file mode 100644 index 0000000..92e2a57 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwCostAnalysisServiceImpl.java @@ -0,0 +1,125 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwCostAnalysisMapper; +import com.ruoyi.project.management.domain.CwCostAnalysis; +import com.ruoyi.project.management.service.ICwCostAnalysisService; + +/** + * 成本分析信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-08-11 + */ +@Service +public class CwCostAnalysisServiceImpl implements ICwCostAnalysisService +{ + @Autowired + private CwCostAnalysisMapper cwCostAnalysisMapper; + + /** + * 查询成本分析信息 + * + * @param id 成本分析信息ID + * @return 成本分析信息 + */ + @Override + public CwCostAnalysis selectCwCostAnalysisById(Long id) + { + return cwCostAnalysisMapper.selectCwCostAnalysisById(id); + } + + /** + * 查询成本分析信息列表 + * + * @param cwCostAnalysis 成本分析信息 + * @return 成本分析信息 + */ + @Override + public List selectCwCostAnalysisList(CwCostAnalysis cwCostAnalysis) + { + return cwCostAnalysisMapper.selectCwCostAnalysisList(cwCostAnalysis); + } + + /** + * 新增成本分析信息 + * + * @param cwCostAnalysis 成本分析信息 + * @return 结果 + */ + @Override + public int insertCwCostAnalysis(CwCostAnalysis cwCostAnalysis) + { + cwCostAnalysis.setCreateTime(DateUtils.getNowDate()); + return cwCostAnalysisMapper.insertCwCostAnalysis(cwCostAnalysis); + } + + /** + * 修改成本分析信息 + * + * @param cwCostAnalysis 成本分析信息 + * @return 结果 + */ + @Override + public int updateCwCostAnalysis(CwCostAnalysis cwCostAnalysis) + { + return cwCostAnalysisMapper.updateCwCostAnalysis(cwCostAnalysis); + } + + /** + * 批量删除成本分析信息 + * + * @param ids 需要删除的成本分析信息ID + * @return 结果 + */ + @Override + public int deleteCwCostAnalysisByIds(Long[] ids) + { + return cwCostAnalysisMapper.deleteCwCostAnalysisByIds(ids); + } + + /** + * 删除成本分析信息信息 + * + * @param id 成本分析信息ID + * @return 结果 + */ + @Override + public int deleteCwCostAnalysisById(Long id) + { + return cwCostAnalysisMapper.deleteCwCostAnalysisById(id); + } + + @Override + public int insertCwCostAnalysiss(List list2) { + // TODO Auto-generated method stub + return cwCostAnalysisMapper.insertCwCostAnalysiss(list2); + } + + @Override + public int deleteCwCostAnalysisBySparedFour(Long long1) { + // TODO Auto-generated method stub + return cwCostAnalysisMapper.deleteCwCostAnalysisBySparedFour(long1); + } + + @Override + public List selectCwCostAnalysisByUuid(String uuid) { + // TODO Auto-generated method stub + return cwCostAnalysisMapper.selectCwCostAnalysisByUuid(uuid); + } + + @Override + public List selectCwCostAnalysisByStatisticsId(Long id) { + // TODO Auto-generated method stub + return cwCostAnalysisMapper.selectCwCostAnalysisByStatisticsId(id); + } + + @Override + public int updateCwCostAnalysiss(List list2) { + // TODO Auto-generated method stub + return cwCostAnalysisMapper.updateCwCostAnalysiss(list2); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwCostStatisticsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwCostStatisticsServiceImpl.java new file mode 100644 index 0000000..6dadc6a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwCostStatisticsServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwCostStatisticsMapper; +import com.ruoyi.project.management.domain.CwCostStatistics; +import com.ruoyi.project.management.service.ICwCostStatisticsService; + +/** + * 成本统计信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-08-12 + */ +@Service +public class CwCostStatisticsServiceImpl implements ICwCostStatisticsService +{ + @Autowired + private CwCostStatisticsMapper cwCostStatisticsMapper; + + /** + * 查询成本统计信息 + * + * @param id 成本统计信息ID + * @return 成本统计信息 + */ + @Override + public CwCostStatistics selectCwCostStatisticsById(Long id) + { + return cwCostStatisticsMapper.selectCwCostStatisticsById(id); + } + + /** + * 查询成本统计信息列表 + * + * @param cwCostStatistics 成本统计信息 + * @return 成本统计信息 + */ + @Override + public List selectCwCostStatisticsList(CwCostStatistics cwCostStatistics) + { + return cwCostStatisticsMapper.selectCwCostStatisticsList(cwCostStatistics); + } + + /** + * 新增成本统计信息 + * + * @param cwCostStatistics 成本统计信息 + * @return 结果 + */ + @Override + public int insertCwCostStatistics(CwCostStatistics cwCostStatistics) + { + cwCostStatistics.setCreateTime(DateUtils.getNowDate()); + return cwCostStatisticsMapper.insertCwCostStatistics(cwCostStatistics); + } + + /** + * 修改成本统计信息 + * + * @param cwCostStatistics 成本统计信息 + * @return 结果 + */ + @Override + public int updateCwCostStatistics(CwCostStatistics cwCostStatistics) + { + return cwCostStatisticsMapper.updateCwCostStatistics(cwCostStatistics); + } + + /** + * 批量删除成本统计信息 + * + * @param ids 需要删除的成本统计信息ID + * @return 结果 + */ + @Override + public int deleteCwCostStatisticsByIds(Long[] ids) + { + return cwCostStatisticsMapper.deleteCwCostStatisticsByIds(ids); + } + + /** + * 删除成本统计信息信息 + * + * @param id 成本统计信息ID + * @return 结果 + */ + @Override + public int deleteCwCostStatisticsById(Long id) + { + return cwCostStatisticsMapper.deleteCwCostStatisticsById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwDepartmentServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwDepartmentServiceImpl.java new file mode 100644 index 0000000..3e74a2a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwDepartmentServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwDepartmentMapper; +import com.ruoyi.project.management.domain.CwDepartment; +import com.ruoyi.project.management.service.ICwDepartmentService; + +/** + * 财务部门Service业务层处理 + * + * @author zhukangchao + * @date 2021-10-25 + */ +@Service +public class CwDepartmentServiceImpl implements ICwDepartmentService +{ + @Autowired + private CwDepartmentMapper cwDepartmentMapper; + + /** + * 查询财务部门 + * + * @param id 财务部门ID + * @return 财务部门 + */ + @Override + public CwDepartment selectCwDepartmentById(Long id) + { + return cwDepartmentMapper.selectCwDepartmentById(id); + } + + /** + * 查询财务部门列表 + * + * @param cwDepartment 财务部门 + * @return 财务部门 + */ + @Override + public List selectCwDepartmentList(CwDepartment cwDepartment) + { + return cwDepartmentMapper.selectCwDepartmentList(cwDepartment); + } + + /** + * 新增财务部门 + * + * @param cwDepartment 财务部门 + * @return 结果 + */ + @Override + public int insertCwDepartment(CwDepartment cwDepartment) + { + cwDepartment.setCreateTime(DateUtils.getNowDate()); + return cwDepartmentMapper.insertCwDepartment(cwDepartment); + } + + /** + * 修改财务部门 + * + * @param cwDepartment 财务部门 + * @return 结果 + */ + @Override + public int updateCwDepartment(CwDepartment cwDepartment) + { + return cwDepartmentMapper.updateCwDepartment(cwDepartment); + } + + /** + * 批量删除财务部门 + * + * @param ids 需要删除的财务部门ID + * @return 结果 + */ + @Override + public int deleteCwDepartmentByIds(Long[] ids) + { + return cwDepartmentMapper.deleteCwDepartmentByIds(ids); + } + + /** + * 删除财务部门信息 + * + * @param id 财务部门ID + * @return 结果 + */ + @Override + public int deleteCwDepartmentById(Long id) + { + return cwDepartmentMapper.deleteCwDepartmentById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwDimissionServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwDimissionServiceImpl.java new file mode 100644 index 0000000..2377cae --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwDimissionServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwDimissionMapper; +import com.ruoyi.project.management.domain.CwDimission; +import com.ruoyi.project.management.service.ICwDimissionService; + +/** + * 员工离职单Service业务层处理 + * + * @author zhukangchao + * @date 2022-04-09 + */ +@Service +public class CwDimissionServiceImpl implements ICwDimissionService +{ + @Autowired + private CwDimissionMapper cwDimissionMapper; + + /** + * 查询员工离职单 + * + * @param id 员工离职单ID + * @return 员工离职单 + */ + @Override + public CwDimission selectCwDimissionById(Long id) + { + return cwDimissionMapper.selectCwDimissionById(id); + } + + /** + * 查询员工离职单列表 + * + * @param cwDimission 员工离职单 + * @return 员工离职单 + */ + @Override + public List selectCwDimissionList(CwDimission cwDimission) + { + return cwDimissionMapper.selectCwDimissionList(cwDimission); + } + + /** + * 新增员工离职单 + * + * @param cwDimission 员工离职单 + * @return 结果 + */ + @Override + public int insertCwDimission(CwDimission cwDimission) + { + cwDimission.setCreateTime(DateUtils.getNowDate()); + return cwDimissionMapper.insertCwDimission(cwDimission); + } + + /** + * 修改员工离职单 + * + * @param cwDimission 员工离职单 + * @return 结果 + */ + @Override + public int updateCwDimission(CwDimission cwDimission) + { + return cwDimissionMapper.updateCwDimission(cwDimission); + } + + /** + * 批量删除员工离职单 + * + * @param ids 需要删除的员工离职单ID + * @return 结果 + */ + @Override + public int deleteCwDimissionByIds(Long[] ids) + { + return cwDimissionMapper.deleteCwDimissionByIds(ids); + } + + /** + * 删除员工离职单信息 + * + * @param id 员工离职单ID + * @return 结果 + */ + @Override + public int deleteCwDimissionById(Long id) + { + return cwDimissionMapper.deleteCwDimissionById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwEmployeeInformationServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwEmployeeInformationServiceImpl.java new file mode 100644 index 0000000..aa18405 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwEmployeeInformationServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwEmployeeInformationMapper; +import com.ruoyi.project.management.domain.CwEmployeeInformation; +import com.ruoyi.project.management.service.ICwEmployeeInformationService; + +/** + * 员工信息Service业务层处理 + * + * @author zhukangchao + * @date 2021-10-25 + */ +@Service +public class CwEmployeeInformationServiceImpl implements ICwEmployeeInformationService +{ + @Autowired + private CwEmployeeInformationMapper cwEmployeeInformationMapper; + + /** + * 查询员工信息 + * + * @param id 员工信息ID + * @return 员工信息 + */ + @Override + public CwEmployeeInformation selectCwEmployeeInformationById(Long id) + { + return cwEmployeeInformationMapper.selectCwEmployeeInformationById(id); + } + + /** + * 查询员工信息列表 + * + * @param cwEmployeeInformation 员工信息 + * @return 员工信息 + */ + @Override + public List selectCwEmployeeInformationList(CwEmployeeInformation cwEmployeeInformation) + { + return cwEmployeeInformationMapper.selectCwEmployeeInformationList(cwEmployeeInformation); + } + + /** + * 新增员工信息 + * + * @param cwEmployeeInformation 员工信息 + * @return 结果 + */ + @Override + public int insertCwEmployeeInformation(CwEmployeeInformation cwEmployeeInformation) + { + cwEmployeeInformation.setCreateTime(DateUtils.getNowDate()); + return cwEmployeeInformationMapper.insertCwEmployeeInformation(cwEmployeeInformation); + } + + /** + * 修改员工信息 + * + * @param cwEmployeeInformation 员工信息 + * @return 结果 + */ + @Override + public int updateCwEmployeeInformation(CwEmployeeInformation cwEmployeeInformation) + { + return cwEmployeeInformationMapper.updateCwEmployeeInformation(cwEmployeeInformation); + } + + /** + * 批量删除员工信息 + * + * @param ids 需要删除的员工信息ID + * @return 结果 + */ + @Override + public int deleteCwEmployeeInformationByIds(Long[] ids) + { + return cwEmployeeInformationMapper.deleteCwEmployeeInformationByIds(ids); + } + + /** + * 删除员工信息信息 + * + * @param id 员工信息ID + * @return 结果 + */ + @Override + public int deleteCwEmployeeInformationById(Long id) + { + return cwEmployeeInformationMapper.deleteCwEmployeeInformationById(id); + } + + @Override + public CwEmployeeInformation selectCwEmployeeInformationByName(String name) { + + return cwEmployeeInformationMapper.selectCwEmployeeInformationByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwEvectionServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwEvectionServiceImpl.java new file mode 100644 index 0000000..0798311 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwEvectionServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwEvectionMapper; +import com.ruoyi.project.management.domain.CwEvection; +import com.ruoyi.project.management.service.ICwEvectionService; + +/** + * 出差申请Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-28 + */ +@Service +public class CwEvectionServiceImpl implements ICwEvectionService +{ + @Autowired + private CwEvectionMapper cwEvectionMapper; + + /** + * 查询出差申请 + * + * @param id 出差申请ID + * @return 出差申请 + */ + @Override + public CwEvection selectCwEvectionById(Long id) + { + return cwEvectionMapper.selectCwEvectionById(id); + } + + /** + * 查询出差申请列表 + * + * @param cwEvection 出差申请 + * @return 出差申请 + */ + @Override + public List selectCwEvectionList(CwEvection cwEvection) + { + return cwEvectionMapper.selectCwEvectionList(cwEvection); + } + + /** + * 新增出差申请 + * + * @param cwEvection 出差申请 + * @return 结果 + */ + @Override + public int insertCwEvection(CwEvection cwEvection) + { + cwEvection.setCreateTime(DateUtils.getNowDate()); + return cwEvectionMapper.insertCwEvection(cwEvection); + } + + /** + * 修改出差申请 + * + * @param cwEvection 出差申请 + * @return 结果 + */ + @Override + public int updateCwEvection(CwEvection cwEvection) + { + return cwEvectionMapper.updateCwEvection(cwEvection); + } + + /** + * 批量删除出差申请 + * + * @param ids 需要删除的出差申请ID + * @return 结果 + */ + @Override + public int deleteCwEvectionByIds(Long[] ids) + { + return cwEvectionMapper.deleteCwEvectionByIds(ids); + } + + /** + * 删除出差申请信息 + * + * @param id 出差申请ID + * @return 结果 + */ + @Override + public int deleteCwEvectionById(Long id) + { + return cwEvectionMapper.deleteCwEvectionById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwExpenseReimbursementServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwExpenseReimbursementServiceImpl.java new file mode 100644 index 0000000..a94f9cb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwExpenseReimbursementServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwExpenseReimbursementMapper; +import com.ruoyi.project.management.domain.CwExpenseReimbursement; +import com.ruoyi.project.management.service.ICwExpenseReimbursementService; + +/** + * 费用报销信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-11-30 + */ +@Service +public class CwExpenseReimbursementServiceImpl implements ICwExpenseReimbursementService +{ + @Autowired + private CwExpenseReimbursementMapper cwExpenseReimbursementMapper; + + /** + * 查询费用报销信息 + * + * @param id 费用报销信息ID + * @return 费用报销信息 + */ + @Override + public CwExpenseReimbursement selectCwExpenseReimbursementById(Long id) + { + return cwExpenseReimbursementMapper.selectCwExpenseReimbursementById(id); + } + + /** + * 查询费用报销信息列表 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 费用报销信息 + */ + @Override + public List selectCwExpenseReimbursementList(CwExpenseReimbursement cwExpenseReimbursement) + { + return cwExpenseReimbursementMapper.selectCwExpenseReimbursementList(cwExpenseReimbursement); + } + + /** + * 新增费用报销信息 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 结果 + */ + @Override + public int insertCwExpenseReimbursement(CwExpenseReimbursement cwExpenseReimbursement) + { + cwExpenseReimbursement.setCreateTime(DateUtils.getNowDate()); + return cwExpenseReimbursementMapper.insertCwExpenseReimbursement(cwExpenseReimbursement); + } + + /** + * 修改费用报销信息 + * + * @param cwExpenseReimbursement 费用报销信息 + * @return 结果 + */ + @Override + public int updateCwExpenseReimbursement(CwExpenseReimbursement cwExpenseReimbursement) + { + return cwExpenseReimbursementMapper.updateCwExpenseReimbursement(cwExpenseReimbursement); + } + + /** + * 批量删除费用报销信息 + * + * @param ids 需要删除的费用报销信息ID + * @return 结果 + */ + @Override + public int deleteCwExpenseReimbursementByIds(Long[] ids) + { + return cwExpenseReimbursementMapper.deleteCwExpenseReimbursementByIds(ids); + } + + /** + * 删除费用报销信息信息 + * + * @param id 费用报销信息ID + * @return 结果 + */ + @Override + public int deleteCwExpenseReimbursementById(Long id) + { + return cwExpenseReimbursementMapper.deleteCwExpenseReimbursementById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwJobsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwJobsServiceImpl.java new file mode 100644 index 0000000..7373dca --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwJobsServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwJobsMapper; +import com.ruoyi.project.management.domain.CwJobs; +import com.ruoyi.project.management.service.ICwJobsService; + +/** + * 岗位Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-16 + */ +@Service +public class CwJobsServiceImpl implements ICwJobsService +{ + @Autowired + private CwJobsMapper cwJobsMapper; + + /** + * 查询岗位 + * + * @param id 岗位ID + * @return 岗位 + */ + @Override + public CwJobs selectCwJobsById(Long id) + { + return cwJobsMapper.selectCwJobsById(id); + } + + /** + * 查询岗位列表 + * + * @param cwJobs 岗位 + * @return 岗位 + */ + @Override + public List selectCwJobsList(CwJobs cwJobs) + { + return cwJobsMapper.selectCwJobsList(cwJobs); + } + + /** + * 新增岗位 + * + * @param cwJobs 岗位 + * @return 结果 + */ + @Override + public int insertCwJobs(CwJobs cwJobs) + { + cwJobs.setCreateTime(DateUtils.getNowDate()); + return cwJobsMapper.insertCwJobs(cwJobs); + } + + /** + * 修改岗位 + * + * @param cwJobs 岗位 + * @return 结果 + */ + @Override + public int updateCwJobs(CwJobs cwJobs) + { + return cwJobsMapper.updateCwJobs(cwJobs); + } + + /** + * 批量删除岗位 + * + * @param ids 需要删除的岗位ID + * @return 结果 + */ + @Override + public int deleteCwJobsByIds(Long[] ids) + { + return cwJobsMapper.deleteCwJobsByIds(ids); + } + + /** + * 删除岗位信息 + * + * @param id 岗位ID + * @return 结果 + */ + @Override + public int deleteCwJobsById(Long id) + { + return cwJobsMapper.deleteCwJobsById(id); + } + + @Override + public CwJobs selectCwJobsByJobsName(String jobs,String deptName) { + // TODO Auto-generated method stub + return cwJobsMapper.selectCwJobsByJobsName(jobs,deptName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLeaveRecordServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLeaveRecordServiceImpl.java new file mode 100644 index 0000000..5614786 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLeaveRecordServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwLeaveRecordMapper; +import com.ruoyi.project.management.domain.CwLeaveRecord; +import com.ruoyi.project.management.service.ICwLeaveRecordService; + +/** + * 请假记录Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-22 + */ +@Service +public class CwLeaveRecordServiceImpl implements ICwLeaveRecordService +{ + @Autowired + private CwLeaveRecordMapper cwLeaveRecordMapper; + + /** + * 查询请假记录 + * + * @param id 请假记录ID + * @return 请假记录 + */ + @Override + public CwLeaveRecord selectCwLeaveRecordById(Long id) + { + return cwLeaveRecordMapper.selectCwLeaveRecordById(id); + } + + /** + * 查询请假记录列表 + * + * @param cwLeaveRecord 请假记录 + * @return 请假记录 + */ + @Override + public List selectCwLeaveRecordList(CwLeaveRecord cwLeaveRecord) + { + return cwLeaveRecordMapper.selectCwLeaveRecordList(cwLeaveRecord); + } + + /** + * 新增请假记录 + * + * @param cwLeaveRecord 请假记录 + * @return 结果 + */ + @Override + public int insertCwLeaveRecord(CwLeaveRecord cwLeaveRecord) + { + cwLeaveRecord.setCreateTime(DateUtils.getNowDate()); + return cwLeaveRecordMapper.insertCwLeaveRecord(cwLeaveRecord); + } + + /** + * 修改请假记录 + * + * @param cwLeaveRecord 请假记录 + * @return 结果 + */ + @Override + public int updateCwLeaveRecord(CwLeaveRecord cwLeaveRecord) + { + return cwLeaveRecordMapper.updateCwLeaveRecord(cwLeaveRecord); + } + + /** + * 批量删除请假记录 + * + * @param ids 需要删除的请假记录ID + * @return 结果 + */ + @Override + public int deleteCwLeaveRecordByIds(Long[] ids) + { + return cwLeaveRecordMapper.deleteCwLeaveRecordByIds(ids); + } + + /** + * 删除请假记录信息 + * + * @param id 请假记录ID + * @return 结果 + */ + @Override + public int deleteCwLeaveRecordById(Long id) + { + return cwLeaveRecordMapper.deleteCwLeaveRecordById(id); + } + + @Override + public List selectCwLeaveRecordByNameAndDate(String name, String date) { + // TODO Auto-generated method stub + return cwLeaveRecordMapper.selectCwLeaveRecordByNameAndDate(name, date); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLevelOfEducationServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLevelOfEducationServiceImpl.java new file mode 100644 index 0000000..ee1ecb6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLevelOfEducationServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwLevelOfEducationMapper; +import com.ruoyi.project.management.domain.CwLevelOfEducation; +import com.ruoyi.project.management.service.ICwLevelOfEducationService; + +/** + * 补助Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-17 + */ +@Service +public class CwLevelOfEducationServiceImpl implements ICwLevelOfEducationService +{ + @Autowired + private CwLevelOfEducationMapper cwLevelOfEducationMapper; + + /** + * 查询补助 + * + * @param id 补助ID + * @return 补助 + */ + @Override + public CwLevelOfEducation selectCwLevelOfEducationById(Long id) + { + return cwLevelOfEducationMapper.selectCwLevelOfEducationById(id); + } + + /** + * 查询补助列表 + * + * @param cwLevelOfEducation 补助 + * @return 补助 + */ + @Override + public List selectCwLevelOfEducationList(CwLevelOfEducation cwLevelOfEducation) + { + return cwLevelOfEducationMapper.selectCwLevelOfEducationList(cwLevelOfEducation); + } + + /** + * 新增补助 + * + * @param cwLevelOfEducation 补助 + * @return 结果 + */ + @Override + public int insertCwLevelOfEducation(CwLevelOfEducation cwLevelOfEducation) + { + cwLevelOfEducation.setCreateTime(DateUtils.getNowDate()); + return cwLevelOfEducationMapper.insertCwLevelOfEducation(cwLevelOfEducation); + } + + /** + * 修改补助 + * + * @param cwLevelOfEducation 补助 + * @return 结果 + */ + @Override + public int updateCwLevelOfEducation(CwLevelOfEducation cwLevelOfEducation) + { + return cwLevelOfEducationMapper.updateCwLevelOfEducation(cwLevelOfEducation); + } + + /** + * 批量删除补助 + * + * @param ids 需要删除的补助ID + * @return 结果 + */ + @Override + public int deleteCwLevelOfEducationByIds(Long[] ids) + { + return cwLevelOfEducationMapper.deleteCwLevelOfEducationByIds(ids); + } + + /** + * 删除补助信息 + * + * @param id 补助ID + * @return 结果 + */ + @Override + public int deleteCwLevelOfEducationById(Long id) + { + return cwLevelOfEducationMapper.deleteCwLevelOfEducationById(id); + } + + @Override + public CwLevelOfEducation selectCwLevelOfEducationBysubsidiesName(String levelOfEducation) { + // TODO Auto-generated method stub + return cwLevelOfEducationMapper.selectCwLevelOfEducationBysubsidiesName(levelOfEducation); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLogisticsFeesInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLogisticsFeesInfoServiceImpl.java new file mode 100644 index 0000000..0d8eacd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLogisticsFeesInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwLogisticsFeesInfoMapper; +import com.ruoyi.project.management.domain.CwLogisticsFeesInfo; +import com.ruoyi.project.management.service.ICwLogisticsFeesInfoService; + +/** + * 物流费用信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-11-30 + */ +@Service +public class CwLogisticsFeesInfoServiceImpl implements ICwLogisticsFeesInfoService +{ + @Autowired + private CwLogisticsFeesInfoMapper cwLogisticsFeesInfoMapper; + + /** + * 查询物流费用信息 + * + * @param id 物流费用信息ID + * @return 物流费用信息 + */ + @Override + public CwLogisticsFeesInfo selectCwLogisticsFeesInfoById(Long id) + { + return cwLogisticsFeesInfoMapper.selectCwLogisticsFeesInfoById(id); + } + + /** + * 查询物流费用信息列表 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 物流费用信息 + */ + @Override + public List selectCwLogisticsFeesInfoList(CwLogisticsFeesInfo cwLogisticsFeesInfo) + { + return cwLogisticsFeesInfoMapper.selectCwLogisticsFeesInfoList(cwLogisticsFeesInfo); + } + + /** + * 新增物流费用信息 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 结果 + */ + @Override + public int insertCwLogisticsFeesInfo(CwLogisticsFeesInfo cwLogisticsFeesInfo) + { + cwLogisticsFeesInfo.setCreateTime(DateUtils.getNowDate()); + return cwLogisticsFeesInfoMapper.insertCwLogisticsFeesInfo(cwLogisticsFeesInfo); + } + + /** + * 修改物流费用信息 + * + * @param cwLogisticsFeesInfo 物流费用信息 + * @return 结果 + */ + @Override + public int updateCwLogisticsFeesInfo(CwLogisticsFeesInfo cwLogisticsFeesInfo) + { + return cwLogisticsFeesInfoMapper.updateCwLogisticsFeesInfo(cwLogisticsFeesInfo); + } + + /** + * 批量删除物流费用信息 + * + * @param ids 需要删除的物流费用信息ID + * @return 结果 + */ + @Override + public int deleteCwLogisticsFeesInfoByIds(Long[] ids) + { + return cwLogisticsFeesInfoMapper.deleteCwLogisticsFeesInfoByIds(ids); + } + + /** + * 删除物流费用信息信息 + * + * @param id 物流费用信息ID + * @return 结果 + */ + @Override + public int deleteCwLogisticsFeesInfoById(Long id) + { + return cwLogisticsFeesInfoMapper.deleteCwLogisticsFeesInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLogsotocsFeesMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLogsotocsFeesMaterialServiceImpl.java new file mode 100644 index 0000000..e3b6bb4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwLogsotocsFeesMaterialServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwLogsotocsFeesMaterialMapper; +import com.ruoyi.project.management.domain.CwLogsotocsFeesMaterial; +import com.ruoyi.project.management.service.ICwLogsotocsFeesMaterialService; + +/** + * 物流费用和入库单关联Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-13 + */ +@Service +public class CwLogsotocsFeesMaterialServiceImpl implements ICwLogsotocsFeesMaterialService +{ + @Autowired + private CwLogsotocsFeesMaterialMapper cwLogsotocsFeesMaterialMapper; + + /** + * 查询物流费用和入库单关联 + * + * @param id 物流费用和入库单关联ID + * @return 物流费用和入库单关联 + */ + @Override + public CwLogsotocsFeesMaterial selectCwLogsotocsFeesMaterialById(Long id) + { + return cwLogsotocsFeesMaterialMapper.selectCwLogsotocsFeesMaterialById(id); + } + + /** + * 查询物流费用和入库单关联列表 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 物流费用和入库单关联 + */ + @Override + public List selectCwLogsotocsFeesMaterialList(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial) + { + return cwLogsotocsFeesMaterialMapper.selectCwLogsotocsFeesMaterialList(cwLogsotocsFeesMaterial); + } + + /** + * 新增物流费用和入库单关联 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 结果 + */ + @Override + public int insertCwLogsotocsFeesMaterial(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial) + { + cwLogsotocsFeesMaterial.setCreateTime(DateUtils.getNowDate()); + return cwLogsotocsFeesMaterialMapper.insertCwLogsotocsFeesMaterial(cwLogsotocsFeesMaterial); + } + + /** + * 修改物流费用和入库单关联 + * + * @param cwLogsotocsFeesMaterial 物流费用和入库单关联 + * @return 结果 + */ + @Override + public int updateCwLogsotocsFeesMaterial(CwLogsotocsFeesMaterial cwLogsotocsFeesMaterial) + { + return cwLogsotocsFeesMaterialMapper.updateCwLogsotocsFeesMaterial(cwLogsotocsFeesMaterial); + } + + /** + * 批量删除物流费用和入库单关联 + * + * @param ids 需要删除的物流费用和入库单关联ID + * @return 结果 + */ + @Override + public int deleteCwLogsotocsFeesMaterialByIds(Long[] ids) + { + return cwLogsotocsFeesMaterialMapper.deleteCwLogsotocsFeesMaterialByIds(ids); + } + + /** + * 删除物流费用和入库单关联信息 + * + * @param id 物流费用和入库单关联ID + * @return 结果 + */ + @Override + public int deleteCwLogsotocsFeesMaterialById(Long id) + { + return cwLogsotocsFeesMaterialMapper.deleteCwLogsotocsFeesMaterialById(id); + } + + @Override + public List selectCwLogsotocsFeesMaterialByProductReceiptMaterialId(Long idTwo) { + // TODO Auto-generated method stub + return cwLogsotocsFeesMaterialMapper.selectCwLogsotocsFeesMaterialByProductReceiptMaterialId(idTwo); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewAttendanceServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewAttendanceServiceImpl.java new file mode 100644 index 0000000..d42f12a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewAttendanceServiceImpl.java @@ -0,0 +1,139 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwNewAttendanceMapper; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.service.ICwNewAttendanceService; + +/** + * 新考勤记录Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-16 + */ +@Service +public class CwNewAttendanceServiceImpl implements ICwNewAttendanceService +{ + @Autowired + private CwNewAttendanceMapper cwNewAttendanceMapper; + + /** + * 查询新考勤记录 + * + * @param id 新考勤记录ID + * @return 新考勤记录 + */ + @Override + public CwNewAttendance selectCwNewAttendanceById(Long id) + { + return cwNewAttendanceMapper.selectCwNewAttendanceById(id); + } + + /** + * 查询新考勤记录列表 + * + * @param cwNewAttendance 新考勤记录 + * @return 新考勤记录 + */ + @Override + public List selectCwNewAttendanceList(CwNewAttendance cwNewAttendance) + { + return cwNewAttendanceMapper.selectCwNewAttendanceList(cwNewAttendance); + } + + /** + * 新增新考勤记录 + * + * @param cwNewAttendance 新考勤记录 + * @return 结果 + */ + @Override + public int insertCwNewAttendance(CwNewAttendance cwNewAttendance) + { + cwNewAttendance.setCreateTime(DateUtils.getNowDate()); + return cwNewAttendanceMapper.insertCwNewAttendance(cwNewAttendance); + } + + /** + * 修改新考勤记录 + * + * @param cwNewAttendance 新考勤记录 + * @return 结果 + */ + @Override + public int updateCwNewAttendance(CwNewAttendance cwNewAttendance) + { + return cwNewAttendanceMapper.updateCwNewAttendance(cwNewAttendance); + } + + /** + * 批量删除新考勤记录 + * + * @param ids 需要删除的新考勤记录ID + * @return 结果 + */ + @Override + public int deleteCwNewAttendanceByIds(Long[] ids) + { + return cwNewAttendanceMapper.deleteCwNewAttendanceByIds(ids); + } + + /** + * 删除新考勤记录信息 + * + * @param id 新考勤记录ID + * @return 结果 + */ + @Override + public int deleteCwNewAttendanceById(Long id) + { + return cwNewAttendanceMapper.deleteCwNewAttendanceById(id); + } + + @Override + public int insertCwNewAttendanceList(List list) { + // TODO Auto-generated method stub + return cwNewAttendanceMapper.insertCwNewAttendanceList(list); + } + + @Override + public List selectCwNewAttendanceByNameAndAttendanceDate(String name, String string) { + // TODO Auto-generated method stub + return cwNewAttendanceMapper.selectCwNewAttendanceByNameAndAttendanceDate(name,string); + } + + @Override + public List selectCwNewAttendanceByRulseAndAttDate(String d, String string) { + // TODO Auto-generated method stub + return cwNewAttendanceMapper.selectCwNewAttendanceByRulseAndAttDate(d,string); + } + + @Override + public CwNewAttendance selectCwNewAttendanceByNameAndAttendanceDateAndWorkEndTimeNull(String name, String format) { + // TODO Auto-generated method stub + return cwNewAttendanceMapper.selectCwNewAttendanceByNameAndAttendanceDateAndWorkEndTimeNull(name,format); + } + + @Override + public CwNewAttendance selectCwNewAttendanceByNameAndAttendanceDateAndDay(String name, String format) { + // TODO Auto-generated method stub + return cwNewAttendanceMapper.selectCwNewAttendanceByNameAndAttendanceDateAndDay(name,format); + } + + @Override + public List selectCwNewAttendanceByDeptAndDate(String deptName, String format) { + // TODO Auto-generated method stub + return cwNewAttendanceMapper.selectCwNewAttendanceByDeptAndDate(deptName,format); + } + + @Override + public List selectCwNewAttendanceByName(String name) { + // TODO Auto-generated method stub + return cwNewAttendanceMapper.selectCwNewAttendanceByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewAttendanceStatisticalServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewAttendanceStatisticalServiceImpl.java new file mode 100644 index 0000000..e033334 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewAttendanceStatisticalServiceImpl.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwNewAttendanceStatisticalMapper; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; + +/** + * 考勤记录统计Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-30 + */ +@Service +public class CwNewAttendanceStatisticalServiceImpl implements ICwNewAttendanceStatisticalService +{ + @Autowired + private CwNewAttendanceStatisticalMapper cwNewAttendanceStatisticalMapper; + + /** + * 查询考勤记录统计 + * + * @param id 考勤记录统计ID + * @return 考勤记录统计 + */ + @Override + public CwNewAttendanceStatistical selectCwNewAttendanceStatisticalById(Long id) + { + return cwNewAttendanceStatisticalMapper.selectCwNewAttendanceStatisticalById(id); + } + + /** + * 查询考勤记录统计列表 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 考勤记录统计 + */ + @Override + public List selectCwNewAttendanceStatisticalList(CwNewAttendanceStatistical cwNewAttendanceStatistical) + { + return cwNewAttendanceStatisticalMapper.selectCwNewAttendanceStatisticalList(cwNewAttendanceStatistical); + } + + /** + * 新增考勤记录统计 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 结果 + */ + @Override + public int insertCwNewAttendanceStatistical(CwNewAttendanceStatistical cwNewAttendanceStatistical) + { + cwNewAttendanceStatistical.setCreateTime(DateUtils.getNowDate()); + return cwNewAttendanceStatisticalMapper.insertCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + + /** + * 修改考勤记录统计 + * + * @param cwNewAttendanceStatistical 考勤记录统计 + * @return 结果 + */ + @Override + public int updateCwNewAttendanceStatistical(CwNewAttendanceStatistical cwNewAttendanceStatistical) + { + return cwNewAttendanceStatisticalMapper.updateCwNewAttendanceStatistical(cwNewAttendanceStatistical); + } + + /** + * 批量删除考勤记录统计 + * + * @param ids 需要删除的考勤记录统计ID + * @return 结果 + */ + @Override + public int deleteCwNewAttendanceStatisticalByIds(Long[] ids) + { + return cwNewAttendanceStatisticalMapper.deleteCwNewAttendanceStatisticalByIds(ids); + } + + /** + * 删除考勤记录统计信息 + * + * @param id 考勤记录统计ID + * @return 结果 + */ + @Override + public int deleteCwNewAttendanceStatisticalById(Long id) + { + return cwNewAttendanceStatisticalMapper.deleteCwNewAttendanceStatisticalById(id); + } + + @Override + public CwNewAttendanceStatistical selectCwNewAttendanceStatisticalByNameAndDate(String name, String parse) { + // TODO Auto-generated method stub + return cwNewAttendanceStatisticalMapper.selectCwNewAttendanceStatisticalByNameAndDate(name,parse); + } + + @Override + public List selectCwNewAttendanceStatisticalByName(String name) { + // TODO Auto-generated method stub + return cwNewAttendanceStatisticalMapper.selectCwNewAttendanceStatisticalByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewEmployeeInformationServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewEmployeeInformationServiceImpl.java new file mode 100644 index 0000000..9fdf2a8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewEmployeeInformationServiceImpl.java @@ -0,0 +1,120 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwNewEmployeeInformationMapper; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; + +/** + * 新员工基本信息Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-16 + */ +@Service +public class CwNewEmployeeInformationServiceImpl implements ICwNewEmployeeInformationService +{ + @Autowired + private CwNewEmployeeInformationMapper cwNewEmployeeInformationMapper; + + /** + * 查询新员工基本信息 + * + * @param id 新员工基本信息ID + * @return 新员工基本信息 + */ + @Override + public CwNewEmployeeInformation selectCwNewEmployeeInformationById(Long id) + { + return cwNewEmployeeInformationMapper.selectCwNewEmployeeInformationById(id); + } + + /** + * 查询新员工基本信息列表 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 新员工基本信息 + */ + @Override + public List selectCwNewEmployeeInformationList(CwNewEmployeeInformation cwNewEmployeeInformation) + { + return cwNewEmployeeInformationMapper.selectCwNewEmployeeInformationList(cwNewEmployeeInformation); + } + + /** + * 新增新员工基本信息 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 结果 + */ + @Override + public int insertCwNewEmployeeInformation(CwNewEmployeeInformation cwNewEmployeeInformation) + { + cwNewEmployeeInformation.setCreateTime(DateUtils.getNowDate()); + return cwNewEmployeeInformationMapper.insertCwNewEmployeeInformation(cwNewEmployeeInformation); + } + + /** + * 修改新员工基本信息 + * + * @param cwNewEmployeeInformation 新员工基本信息 + * @return 结果 + */ + @Override + public int updateCwNewEmployeeInformation(CwNewEmployeeInformation cwNewEmployeeInformation) + { + return cwNewEmployeeInformationMapper.updateCwNewEmployeeInformation(cwNewEmployeeInformation); + } + + /** + * 批量删除新员工基本信息 + * + * @param ids 需要删除的新员工基本信息ID + * @return 结果 + */ + @Override + public int deleteCwNewEmployeeInformationByIds(Long[] ids) + { + return cwNewEmployeeInformationMapper.deleteCwNewEmployeeInformationByIds(ids); + } + + /** + * 删除新员工基本信息信息 + * + * @param id 新员工基本信息ID + * @return 结果 + */ + @Override + public int deleteCwNewEmployeeInformationById(Long id) + { + return cwNewEmployeeInformationMapper.deleteCwNewEmployeeInformationById(id); + } + + @Override + public CwNewEmployeeInformation selectCwNewEmployeeInformationByName(String name) { + // TODO Auto-generated method stub + return cwNewEmployeeInformationMapper.selectCwNewEmployeeInformationByName(name); + } + + @Override + public List selectCwNewEmployeeInformationByDateList(String string) { + // TODO Auto-generated method stub + return cwNewEmployeeInformationMapper.selectCwNewEmployeeInformationByDateList(string); + } + + @Override + public List selectCwNewEmployeeInformationListByName( + CwNewEmployeeInformation cwNewEmployeeInformation) { + // TODO Auto-generated method stub + return cwNewEmployeeInformationMapper.selectCwNewEmployeeInformationListByName(cwNewEmployeeInformation); + } + + @Override + public int updateCwNewEmployeeInformationByBuZhu() { + // TODO Auto-generated method stub + return cwNewEmployeeInformationMapper.updateCwNewEmployeeInformationByBuZhu(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewPayrollServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewPayrollServiceImpl.java new file mode 100644 index 0000000..d0b20ca --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNewPayrollServiceImpl.java @@ -0,0 +1,955 @@ +package com.ruoyi.project.management.service.impl; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.framework.web.domain.AjaxResult; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.project.management.mapper.CwEvectionMapper; +import com.ruoyi.project.management.mapper.CwLeaveRecordMapper; +import com.ruoyi.project.management.mapper.CwNewPayrollMapper; +import com.ruoyi.project.management.mapper.CwRulesMapper; +import com.ruoyi.project.management.mapper.CwWorkOvertimeRecordMapper; +import com.ruoyi.project.management.domain.CwEvection; +import com.ruoyi.project.management.domain.CwLeaveRecord; +import com.ruoyi.project.management.domain.CwNewAttendance; +import com.ruoyi.project.management.domain.CwNewAttendanceStatistical; +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CwNewPayroll; +import com.ruoyi.project.management.domain.CwRules; +import com.ruoyi.project.management.domain.CwWageSummary; +import com.ruoyi.project.management.domain.CwWorkOvertimeRecord; +import com.ruoyi.project.management.domain.CwWorkingDaysConfiguration; +import com.ruoyi.project.management.domain.CyStatisticsInfo; +import com.ruoyi.project.management.service.ICwLevelOfEducationService; +import com.ruoyi.project.management.service.ICwNewAttendanceService; +import com.ruoyi.project.management.service.ICwNewAttendanceStatisticalService; +import com.ruoyi.project.management.service.ICwNewEmployeeInformationService; +import com.ruoyi.project.management.service.ICwNewPayrollService; +import com.ruoyi.project.management.service.ICwWageSummaryService; +import com.ruoyi.project.management.service.ICwWorkingDaysConfigurationService; +import com.ruoyi.project.management.service.ICyStatisticsInfoService; + +/** + * 新工资单Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-16 + */ +@Service +public class CwNewPayrollServiceImpl implements ICwNewPayrollService { + @Autowired + private CwNewPayrollMapper cwNewPayrollMapper; + // 员工信息 + @Autowired + private ICwNewEmployeeInformationService cwNewEmployeeInformationService; + // 补助信息 + @Autowired + private ICwLevelOfEducationService cwLevelOfEducationService; + // 考勤信息 + @Autowired + private ICwNewAttendanceService cwNewAttendanceService; + // 工作日配置信息 + @Autowired + private ICwWorkingDaysConfigurationService cwWorkingDaysConfigurationService; + // 加班申请信息 + @Autowired + private CwWorkOvertimeRecordMapper cwWorkOvertimeRecordMapper; + // 请假记录信息 + @Autowired + private CwLeaveRecordMapper cwLeaveRecordMapper; + //工资汇总信息 + @Autowired + private ICwWageSummaryService cwWageSummaryService; + //排班信息 + @Autowired + private CwRulesMapper cwRulesMapper; + //出差日期 + @Autowired + private CwEvectionMapper cwEvectionMapper; + //考勤统计信息 + @Autowired + private ICwNewAttendanceStatisticalService cwNewAttendanceStatisticalService; + //餐饮统计信息 + @Autowired + private ICyStatisticsInfoService cyStatisticsInfoService; + + /** + * 查询新工资单 + * + * @param id + * 新工资单ID + * @return 新工资单 + */ + @Override + public CwNewPayroll selectCwNewPayrollById(Long id) { + return cwNewPayrollMapper.selectCwNewPayrollById(id); + } + + /** + * 查询新工资单列表 + * + * @param cwNewPayroll + * 新工资单 + * @return 新工资单 + */ + @Override + public List selectCwNewPayrollList(CwNewPayroll cwNewPayroll) { + return cwNewPayrollMapper.selectCwNewPayrollList(cwNewPayroll); + } + + /** + * 新增新工资单 + * + * @param cwNewPayroll + * 新工资单 + * @return 结果 + */ + @Override + @Transactional + public int insertCwNewPayroll(CwNewPayroll cwNewPayroll) throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 获取工资所属月份,根据工资所属月份获取当前月的应出勤天数 + String affiliationMonth = cwNewPayroll.getAffiliationMonth(); + //日期加上一个月 + Calendar calendars = Calendar.getInstance(); + calendars.setTime(sdf.parse(affiliationMonth+"-01")); + calendars.add(Calendar.MONTH, 1); + String string = sdf.format(calendars.getTime()); + int i = 0; + // 获取员工信息表中的所有工资所属月之前入职的员工(如:工资所属月为2022-03,就获取2022-04-01之前入职的员工信息) + List list = cwNewEmployeeInformationService.selectCwNewEmployeeInformationByDateList(string); + if (list.size() == 0) { + return 205; + } + //获取本月的天数 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(sdf.parse(affiliationMonth+"-01")); + int yuetianshu = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); + //获取本月应出勤天数 + CwWorkingDaysConfiguration workingDaysConfiguration = cwWorkingDaysConfigurationService.selectCwWorkingDaysConfigurationByDate(affiliationMonth); + //岗位工资扣除天数 + Long gangweikouchu = 0L; + //判断当月是否有岗位工资扣除天数 + if(null!=workingDaysConfiguration.getPostWage()&&workingDaysConfiguration.getPostWage()>0){ + gangweikouchu = workingDaysConfiguration.getPostWage(); + } + //分割工资所属月份,获取当前年和当前月 + String[] strings = cwNewPayroll.getAffiliationMonth().split("-"); + //创建工资汇总信息对象 + CwWageSummary cwWageSummar = new CwWageSummary(); + //工资所属月份 + cwWageSummar.setAffiliationMonth(affiliationMonth); + //审核1 + cwWageSummar.setReviewOne("未审核"); + //审核2 + cwWageSummar.setReviewTwo("未审核"); + //审核3 + cwWageSummar.setReviewThree("未审核"); + //审核4 + cwWageSummar.setReviewFour("未审核"); + //添加保存工资汇总信息 + cwWageSummaryService.insertCwWageSummary(cwWageSummar); + // 循环计算所有员工的工资 + for (CwNewEmployeeInformation cwNewEmployeeInformation2 : list) { + + //计算工龄 + //获取入职日期(计算工龄) + //获取入职日期,计算入职日期到当前日期的年份,用于计算工龄 + Date entryDatea = cwNewEmployeeInformation2.getEntryDate(); + Calendar bef = Calendar.getInstance(); + Calendar aft = Calendar.getInstance(); + //入职日期 + bef.setTime(entryDatea); + //工资所属日期 + aft.setTime(sdf.parse(cwNewPayroll.getAffiliationMonth()+"-01")); + int surplus = aft.get(Calendar.DATE) - bef.get(Calendar.DATE);//天数差 + int result = aft.get(Calendar.MONTH) - bef.get(Calendar.MONTH);//月份差 + int year = aft.get(Calendar.YEAR) - bef.get(Calendar.YEAR);//年份差 + long ii = 0; + if(result<0){ + ii = --year; + }else if(result == 0){ + if(surplus>0){ + ii = year; + }else{ + ii = --year; + } + }else{ + ii = year; + } + if(ii<0){ + ii = 0; + } + cwNewEmployeeInformation2.setSeniority(ii); + + //根据员工姓名和工资所属月查询考勤统计信息 + CwNewAttendanceStatistical newAttendanceStatistical = cwNewAttendanceStatisticalService.selectCwNewAttendanceStatisticalByNameAndDate(cwNewEmployeeInformation2.getName(), affiliationMonth); + //创建工资单对象 + cwNewPayroll = new CwNewPayroll(); + cwNewPayroll.setCreateTime(DateUtils.getNowDate()); + // 获取员工姓名 + String name = cwNewEmployeeInformation2.getName(); + // 所属部门 + cwNewPayroll.setDepartmentName(cwNewEmployeeInformation2.getDeptName()); + //工资所属月 + cwNewPayroll.setAffiliationMonth(affiliationMonth); + // 保存员工姓名 + cwNewPayroll.setName(name); + // 判断此员工是否是需要考勤参与计算工资的(是否是真实岗位) + //真实岗位(需要计算考勤) + if (cwNewEmployeeInformation2.getVirtualWorkstation() == 0) { + //计算试用期 + // 获取入职日期 + Date entryDate = cwNewEmployeeInformation2.getEntryDate(); + // 获取当前员工的试用期月数 + int probationPeriod = cwNewEmployeeInformation2.getProbationPeriod().intValue(); + // 计算试用期结束的日期 + Calendar cals = Calendar.getInstance(); + cals.setTime(entryDate); + cals.add(cals.MONTH, probationPeriod); + + //日期减一天,否则会多扣一天的试用期工资,比如6月1号入职,则试用期结束日期应为6月30日,加一个月的话,则为7月1日了 + cals.add(Calendar.DAY_OF_MONTH, -1); + + // 试用期结束日期 + Date newTime = cals.getTime(); + Calendar calsa = Calendar.getInstance(); + calsa.setTime(newTime); + // 试用期结束的年份 + int nian = calsa.get(Calendar.YEAR); + // 试用期结束的月份 + int yue = calsa.get(Calendar.MONTH); + yue = yue + 1; + // 试用期结束的天 + int tian = calsa.get(Calendar.DAY_OF_MONTH); + //获取当前员工的出差天数 + List chuchaiList = cwEvectionMapper.selectCwEvectionByNameAndAttendanceDate(name,affiliationMonth + "-01"); + //获取当前员工的排班表 +// List list4 = cwRulesMapper.selectCwRulesByNameAndDate(name, affiliationMonth + "-01"); + //请假时长 + long qingjia = 0; + //加班时长 + long jiaban = 0; + //出差天数 + double chuchai = 0; + for (CwEvection cwEvection : chuchaiList) { + //这里的出差默认为天数 + chuchai += cwEvection.getEvectionNumber(); + } + String banzhi = ""; + long paiban = 0L; + long paiban2 = 0L; + if(null != newAttendanceStatistical){ + //排班记录 + paiban = newAttendanceStatistical.getNightNumber(); //三班制夜班 + paiban2 = newAttendanceStatistical.getMiddleShiftNumber(); //两班制夜班 + } + //获取三班制的夜班次数和两班制的夜班次数 +// for (CwRules cwRules : list4) { +// if("三班两倒制".equals(cwRules.getRules())){ +// if("夜班".equals(cwRules.getSequence())){ +// paiban++; +// } +// }else{ +// if("夜班".equals(cwRules.getSequence())){ +// paiban2++; +// } +// } +// } + if(null != newAttendanceStatistical){ + cwNewPayroll.setShouldAttendanceNumber(newAttendanceStatistical.getShouldAttendanceNumber()); + //如果没有排班记录,则实出勤为排班记录*时长 + // 实出勤(实出勤+加班时长-请假时长+出差天数*8) + cwNewPayroll.setRealAttendanceNumber(newAttendanceStatistical.getRealAttendance().doubleValue()+chuchai*8); + //请假时长 + qingjia = newAttendanceStatistical.getAbsenteeism(); + //加班时长 + jiaban = newAttendanceStatistical.getWorkOvertimeNumber(); + }else{ + cwNewPayroll.setShouldAttendanceNumber(0L); + cwNewPayroll.setRealAttendanceNumber(0.0); + } + // 判断工资结构(时薪、日薪、月薪) + if(cwNewEmployeeInformation2.getHoursSalary().longValue() != 0){ + // 时薪的计算方式 + //获取时薪 + cwNewPayroll.setHoursSalary(cwNewEmployeeInformation2.getHoursSalary()); + // 合算成月工资(时薪*应出勤小时数) +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getHoursSalary().multiply(new BigDecimal(cwNewPayroll.getShouldAttendanceNumber()))); + cwNewPayroll.setBasicMonthlySalary(new BigDecimal(0)); + //计算是否有全勤奖 时薪和日薪的员工判断是否有全勤奖,直接判断有没有请假记录,如果有请假记录,则没有全勤(如果没有请假且出勤天数大于15天则有全勤) + if (qingjia == 0 && cwNewPayroll.getRealAttendanceNumber()>=120) { + // 判断实出勤是否大于等于应出勤(大于等于应出勤,则说明有全勤奖,则直接计算工资) + // 缺勤工资扣款(因考勤不参与工资计算所以不需要扣款) + cwNewPayroll.setAbsenteeismSalary(new BigDecimal("0")); + // 缺勤补助扣款 + cwNewPayroll.setAbsenteeismSubsidies(new BigDecimal("0")); + // 全勤奖 + cwNewPayroll.setFullFrequentlySubsidies(cwNewEmployeeInformation2.getFullFrequentlySubsidies()); + } else { + // 说明没有全勤奖(需要处理补助扣款情况)时薪的没有缺勤扣款 + // 计算缺勤补助扣款(请假天数为1时扣款补助总额的百分之10,请假天数为0.5时,扣款补助总额的百分之5) + // 各项补助总额 + long gongling = 0; + if (cwNewEmployeeInformation2.getSeniority() > 10) { + gongling = 10; + }else{ + gongling = cwNewEmployeeInformation2.getSeniority(); + } + BigDecimal r = cwNewEmployeeInformation2.getLevelOfEducationSubsidies().add(cwNewEmployeeInformation2.getContractSubsidies()).add(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(gongling))).add(cwNewEmployeeInformation2.getSocialSecuritySubsidies()); + // 计算扣除百分比 + //请假时长/(班次时长/2)请半天假扣补助的百分之5,一天假扣百分之10,依次类推 + double s = 0; + if(qingjia>=4){ + s = (Double.valueOf(qingjia) / 8) / 10; + if (s > 1) { + s = 1; + } + } + // 缺勤工资扣款(因为已合成月基本工资,所以这里显示扣款工资,扣款工资为请假时长*时薪) +// cwNewPayroll.setAbsenteeismSalary(cwNewPayroll.getHoursSalary().multiply(new BigDecimal(qingjia))); + cwNewPayroll.setAbsenteeismSalary(new BigDecimal(0)); + // 缺勤补助扣款 + cwNewPayroll.setAbsenteeismSubsidies(r.multiply(new BigDecimal(s))); + // 全勤奖置为0 + cwNewPayroll.setFullFrequentlySubsidies(new BigDecimal("0")); + } + // 学历补助 + cwNewPayroll.setLevelOfEducationSubsidies(cwNewEmployeeInformation2.getLevelOfEducationSubsidies()); + // 合同补助 + cwNewPayroll.setContractSubsidies(cwNewEmployeeInformation2.getContractSubsidies()); + if(cwNewEmployeeInformation2.getSeniority()>10){ + // 工龄工资 + cwNewPayroll.setSenioritySalary(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(10))); + }else{ + // 工龄工资 + cwNewPayroll.setSenioritySalary(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(cwNewEmployeeInformation2.getSeniority()))); + } + // 社保补助 + cwNewPayroll.setSocialSecuritySubsidies(cwNewEmployeeInformation2.getSocialSecuritySubsidies()); + //判断当前员工是否有加班费 + if(cwNewEmployeeInformation2.getIsOvertimePay().equals("是")){ + //加班工资 + cwNewPayroll.setOvertimeSalary(cwNewPayroll.getHoursSalary().multiply(new BigDecimal(jiaban))); + }else{ + //加班工资 + cwNewPayroll.setOvertimeSalary(new BigDecimal(0)); + } +// if("三班两倒制".equals(banzhi)){ +// // 夜班补助 +// cwNewPayroll.setNightShiftSubsidies(cwNewEmployeeInformation2.getNightShiftSubsidies().multiply(new BigDecimal(paiban))); +// // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(cwNewEmployeeInformation2.getDinnerSubsidies().multiply(new BigDecimal(paiban))); +// }else{ + // 夜班补助 + cwNewPayroll.setNightShiftSubsidies(new BigDecimal(paiban2).multiply(new BigDecimal(5)).add(cwNewEmployeeInformation2.getNightShiftSubsidies().multiply(new BigDecimal(paiban)))); + // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(new BigDecimal(0)); + // 夜餐补助 + cwNewPayroll.setDinnerSubsidies(cwNewEmployeeInformation2.getDinnerSubsidies().multiply(new BigDecimal(paiban))); +// } + // 其他补助= 其他补助+固定补助 + cwNewPayroll.setSubsidyOrBonus(cwNewEmployeeInformation2.getOtherSubsidies().add(cwNewEmployeeInformation2.getFixedAllowance())); + //判断有没有试用期 + if(null!=cwNewEmployeeInformation2.getProbationPeriod()&&0!=cwNewEmployeeInformation2.getProbationPeriod()){ + // 判断工资所属月份和试用期的时间 + if(nian>Integer.valueOf(strings[0])){ + // 如果试用期的年份大于当前工资所属的年份,那一定是在试用期,工资应该乘百分之80 +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().multiply(new BigDecimal("0.8"))); + //时薪的百分之八十 + cwNewPayroll.setHoursSalary(cwNewPayroll.getHoursSalary().multiply(new BigDecimal("0.8"))); + }else if(nian==Integer.valueOf(strings[0])){ + //判断月份 + if(yue>Integer.valueOf(strings[1])){ + // 如果试用期的月份大于当前工资所属月份,那一定是在试用期,工资应该乘百分之80 +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().multiply(new BigDecimal("0.8"))); + //时薪的百分之八十 + cwNewPayroll.setHoursSalary(cwNewPayroll.getHoursSalary().multiply(new BigDecimal("0.8"))); + }else if(yue == Integer.valueOf(strings[1])){ +// //说明试用期为本月结束的 +// // 每天的金额 +// BigDecimal divide = cwNewPayroll.getBasicMonthlySalary().divide(new BigDecimal(26), 2); +// // 计算(时薪=时薪*天数*0.8+时薪*) +// BigDecimal multiply = divide.multiply(new BigDecimal(tian)).multiply(new BigDecimal("0.2")); +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().subtract(multiply)); + + } + } + } + //其他扣款 + cwNewPayroll.setDeductions(cwNewEmployeeInformation2.getDeductions()); + + //查询当前员工上月餐饮消费数据 + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoByNameAndDate(cwNewEmployeeInformation2.getName(),affiliationMonth); + if(null==statisticsInfo){ + cwNewPayroll.setMealFee(new BigDecimal("0")); + }else{ + cwNewPayroll.setMealFee(new BigDecimal(statisticsInfo.getPersonalSumConsumption())); + } + + if(cwNewPayroll.getRealAttendanceNumber()==0){ + cwNewPayroll.setSalary(new BigDecimal(0)); + }else{ + // 应发工资(合算月工资+各项补助-缺勤扣款-补助扣款) + // 各项金额相加(合算月工资+学历补助+合同补助+工龄工资+社保补助+全勤奖+夜班补助+夜餐补助+其他补助-缺勤扣款-补助扣款-其他扣款)-离职应扣款 + BigDecimal d = cwNewPayroll.getHoursSalary().multiply(new BigDecimal(cwNewPayroll.getRealAttendanceNumber())).add(cwNewPayroll.getLevelOfEducationSubsidies()) + .add(cwNewPayroll.getContractSubsidies()).add(cwNewPayroll.getSenioritySalary()) + .add(cwNewPayroll.getSocialSecuritySubsidies()).add(cwNewPayroll.getFullFrequentlySubsidies()) + .add(cwNewPayroll.getSubsidyOrBonus()) + .add(cwNewPayroll.getNightShiftSubsidies()).add(cwNewPayroll.getDinnerSubsidies()) + .subtract(cwNewPayroll.getAbsenteeismSalary()).subtract(cwNewPayroll.getAbsenteeismSubsidies()).subtract(cwNewEmployeeInformation2.getSubsidyDeductMoney()).subtract(cwNewEmployeeInformation2.getDeductions()).subtract(cwNewPayroll.getMealFee()); + cwNewPayroll.setSalary(d); + } + }else if(cwNewEmployeeInformation2.getDailyWage().longValue()!=0){ + //日薪的计算方式 + //获取日薪 + cwNewPayroll.setDailyWage(cwNewEmployeeInformation2.getDailyWage()); + // 合算成月工资(日薪*应出勤天数) +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getDailyWage().multiply(new BigDecimal(Double.valueOf(cwNewPayroll.getShouldAttendanceNumber())/8))); + cwNewPayroll.setBasicMonthlySalary(new BigDecimal(0)); + //判断有没有试用期 + if(null!=cwNewEmployeeInformation2.getProbationPeriod()&&0!=cwNewEmployeeInformation2.getProbationPeriod()){ + // 判断工资所属月份和试用期的时间 + if(nian>Integer.valueOf(strings[0])){ + // 如果试用期的年份大于当前工资所属的年份,那一定是在试用期,工资应该乘百分之80 +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().multiply(new BigDecimal("0.8"))); + //时薪的百分之八十 + cwNewPayroll.setDailyWage(cwNewPayroll.getDailyWage().multiply(new BigDecimal("0.8"))); + }else if(nian==Integer.valueOf(strings[0])){ + //判断月份 + if(yue>Integer.valueOf(strings[1])){ + // 如果试用期的月份大于当前工资所属月份,那一定是在试用期,工资应该乘百分之80 +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().multiply(new BigDecimal("0.8"))); + //时薪的百分之八十 + cwNewPayroll.setDailyWage(cwNewPayroll.getDailyWage().multiply(new BigDecimal("0.8"))); + }else if(yue == Integer.valueOf(strings[1])){ +// //说明试用期为本月结束的 +// // 每天的金额 +// BigDecimal divide = cwNewPayroll.getBasicMonthlySalary().divide(new BigDecimal(26), 2); +// // 计算(日薪*试用期天数*0.8+日薪*(30-试用期天数)/30) +// BigDecimal multiply = divide.multiply(new BigDecimal(tian)).multiply(new BigDecimal("0.2")); +// cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().subtract(multiply)); + cwNewPayroll.setDailyWage(cwNewPayroll.getDailyWage().multiply(new BigDecimal("0.8")).multiply(new BigDecimal(tian)).add(cwNewPayroll.getDailyWage().multiply(new BigDecimal(yuetianshu).subtract(new BigDecimal(tian)))).divide(new BigDecimal(yuetianshu),2)); + } + } + } + //计算是否有全勤奖 时薪和日薪的员工判断是否有全勤奖,直接判断有没有请假记录,如果有请假记录,则没有全勤 + if (qingjia == 0 && cwNewPayroll.getRealAttendanceNumber()>=120) { + // 判断实出勤是否大于等于应出勤(大于等于应出勤,则说明有全勤奖,则直接计算工资) + // 缺勤工资扣款(因考勤不参与工资计算所以不需要扣款) + cwNewPayroll.setAbsenteeismSalary(new BigDecimal("0")); + // 缺勤补助扣款 + cwNewPayroll.setAbsenteeismSubsidies(new BigDecimal("0")); + // 全勤奖 + cwNewPayroll.setFullFrequentlySubsidies(cwNewEmployeeInformation2.getFullFrequentlySubsidies()); + } else { + // 说明没有全勤奖(需要处理补助扣款情况)时薪的没有缺勤扣款 + // 计算缺勤补助扣款(请假天数为1时扣款补助总额的百分之10,请假天数为0.5时,扣款补助总额的百分之5) + // 各项补助总额 + long gongling = 0; + if (cwNewEmployeeInformation2.getSeniority() > 10) { + gongling = 10; + }else{ + gongling = cwNewEmployeeInformation2.getSeniority(); + } + BigDecimal r = cwNewEmployeeInformation2.getLevelOfEducationSubsidies().add(cwNewEmployeeInformation2.getContractSubsidies()).add(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(gongling))).add(cwNewEmployeeInformation2.getSocialSecuritySubsidies()); + // 计算扣除百分比 + //请假时长/(班次时长/2)请半天假扣补助的百分之5,一天假扣百分之10,依次类推 + double s = 0; + if(qingjia>=4){ + s = (Double.valueOf(qingjia) / 8) / 10; + if (s > 1) { + s = 1; + } + } + // 缺勤工资扣款(因为已合成月基本工资,所以这里显示扣款工资,扣款工资为请假时长*时薪) +// cwNewPayroll.setAbsenteeismSalary(cwNewPayroll.getDailyWage().divide(new BigDecimal("8")).multiply(new BigDecimal(qingjia))); + cwNewPayroll.setAbsenteeismSalary(new BigDecimal(0)); + // 缺勤补助扣款 + cwNewPayroll.setAbsenteeismSubsidies(r.multiply(new BigDecimal(s))); + // 全勤奖置为0 + cwNewPayroll.setFullFrequentlySubsidies(new BigDecimal("0")); + } + // 学历补助 + cwNewPayroll.setLevelOfEducationSubsidies(cwNewEmployeeInformation2.getLevelOfEducationSubsidies()); + // 合同补助 + cwNewPayroll.setContractSubsidies(cwNewEmployeeInformation2.getContractSubsidies()); + if(cwNewEmployeeInformation2.getSeniority()>10){ + // 工龄工资 + cwNewPayroll.setSenioritySalary(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(10))); + }else{ + // 工龄工资 + cwNewPayroll.setSenioritySalary(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(cwNewEmployeeInformation2.getSeniority()))); + } + // 社保补助 + cwNewPayroll.setSocialSecuritySubsidies(cwNewEmployeeInformation2.getSocialSecuritySubsidies()); + //判断当前员工是否有加班费 + if(cwNewEmployeeInformation2.getIsOvertimePay().equals("是")){ + //加班工资 + cwNewPayroll.setOvertimeSalary(cwNewPayroll.getDailyWage().divide(new BigDecimal("8")).multiply(new BigDecimal(jiaban))); + }else{ + //加班工资 + cwNewPayroll.setOvertimeSalary(new BigDecimal(0)); + } +// if("三班两倒制".equals(banzhi)){ +// // 夜班补助 +// cwNewPayroll.setNightShiftSubsidies(cwNewEmployeeInformation2.getNightShiftSubsidies().multiply(new BigDecimal(paiban))); +// // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(cwNewEmployeeInformation2.getDinnerSubsidies().multiply(new BigDecimal(paiban))); +// }else{ +// // 夜班补助 +// cwNewPayroll.setNightShiftSubsidies(new BigDecimal(paiban2).multiply(new BigDecimal(5))); +// // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(new BigDecimal(0)); +// } + // 夜班补助 + cwNewPayroll.setNightShiftSubsidies(new BigDecimal(paiban2).multiply(new BigDecimal(5)).add(cwNewEmployeeInformation2.getNightShiftSubsidies().multiply(new BigDecimal(paiban)))); + // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(new BigDecimal(0)); + // 夜餐补助 + cwNewPayroll.setDinnerSubsidies(cwNewEmployeeInformation2.getDinnerSubsidies().multiply(new BigDecimal(paiban))); + // 其他补助 + cwNewPayroll.setSubsidyOrBonus(cwNewEmployeeInformation2.getOtherSubsidies().add(cwNewEmployeeInformation2.getFixedAllowance())); + //其他扣款 + cwNewPayroll.setDeductions(cwNewEmployeeInformation2.getDeductions()); + + //查询当前员工上月餐饮消费数据 + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoByNameAndDate(cwNewEmployeeInformation2.getName(),affiliationMonth); + if(null==statisticsInfo){ + cwNewPayroll.setMealFee(new BigDecimal("0")); + }else{ + cwNewPayroll.setMealFee(new BigDecimal(statisticsInfo.getPersonalSumConsumption())); + } + + if(cwNewPayroll.getRealAttendanceNumber()==0){ + cwNewPayroll.setSalary(new BigDecimal(0)); + }else{ + // 应发工资(合算月工资+各项补助-缺勤扣款-补助扣款) + // 各项金额相加(合算月工资+学历补助+合同补助+工龄工资+社保补助+全勤奖+夜班补助+夜餐补助+其他补助-缺勤扣款-补助扣款-其他扣款)-离职应扣款 + BigDecimal d = (cwNewPayroll.getDailyWage().divide(new BigDecimal(8),2)).multiply(new BigDecimal(cwNewPayroll.getRealAttendanceNumber())).add(cwNewPayroll.getLevelOfEducationSubsidies()) + .add(cwNewPayroll.getContractSubsidies()).add(cwNewPayroll.getSenioritySalary()) + .add(cwNewPayroll.getSocialSecuritySubsidies()).add(cwNewPayroll.getFullFrequentlySubsidies()) + .add(cwNewPayroll.getSubsidyOrBonus()) + .add(cwNewPayroll.getNightShiftSubsidies()).add(cwNewPayroll.getDinnerSubsidies()) + .subtract(cwNewPayroll.getAbsenteeismSalary()).subtract(cwNewPayroll.getAbsenteeismSubsidies()).subtract(cwNewEmployeeInformation2.getSubsidyDeductMoney()).subtract(cwNewEmployeeInformation2.getDeductions()).subtract(cwNewPayroll.getMealFee()); + cwNewPayroll.setSalary(d); + } + }else{ + //月薪的计算方式 + // 获取月薪的基本工资 + cwNewPayroll.setBasicSalary(cwNewEmployeeInformation2.getBasicSalary()); + + //判断是否有扣除的岗位工资天数 + if(gangweikouchu>0){ + cwNewPayroll.setJobsSalary(cwNewEmployeeInformation2.getJobsSalary().divide(new BigDecimal(yuetianshu),2).multiply(new BigDecimal(yuetianshu-gangweikouchu))); + }else{ + // 获取月薪的岗位工资 + cwNewPayroll.setJobsSalary(cwNewEmployeeInformation2.getJobsSalary()); + } + // 合算成月工资(基本工资+岗位工资) + cwNewPayroll.setBasicMonthlySalary(cwNewEmployeeInformation2.getBasicSalary().add(cwNewPayroll.getJobsSalary())); + //判断有没有试用期 + if(null!=cwNewEmployeeInformation2.getProbationPeriod()&&0!=cwNewEmployeeInformation2.getProbationPeriod()){ + // 判断工资所属月份和试用期的时间 + if(nian>Integer.valueOf(strings[0])){ + // 如果试用期的年份大于当前工资所属的年份,那一定是在试用期,工资应该乘百分之80 + cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().multiply(new BigDecimal("0.8"))); + }else if(nian==Integer.valueOf(strings[0])){ + //判断月份 + if(yue>Integer.valueOf(strings[1])){ + // 如果试用期的月份大于当前工资所属月份,那一定是在试用期,工资应该乘百分之80 + cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().multiply(new BigDecimal("0.8"))); + }else if(yue == Integer.valueOf(strings[1])){ + //说明试用期为本月结束的 + // 每天的金额 + BigDecimal divide = cwNewPayroll.getBasicMonthlySalary().divide(new BigDecimal(yuetianshu), 2); + // 计算(一天的金额*试用期结束的天数*百分之20) + BigDecimal multiply = divide.multiply(new BigDecimal(tian)).multiply(new BigDecimal("0.2")); + + cwNewPayroll.setBasicMonthlySalary(cwNewPayroll.getBasicMonthlySalary().subtract(multiply)); + } + } + } + //计算是否有全勤奖 + if (qingjia == 0 && cwNewPayroll.getRealAttendanceNumber()>=120) { + // 判断实出勤是否大于等于应出勤(大于等于应出勤,则说明有全勤奖,则直接计算工资) + // 缺勤工资扣款(因考勤不参与工资计算所以不需要扣款) + cwNewPayroll.setAbsenteeismSalary(new BigDecimal("0")); + // 缺勤补助扣款 + cwNewPayroll.setAbsenteeismSubsidies(new BigDecimal("0")); + // 全勤奖 + cwNewPayroll.setFullFrequentlySubsidies(cwNewEmployeeInformation2.getFullFrequentlySubsidies()); + } else { + // 说明没有全勤奖(需要处理工资扣款及补助扣款情况) + // 计算缺勤工资 + // 缺勤小时数 +// double p = cwNewPayroll.getShouldAttendanceNumber() - cwNewPayroll.getRealAttendanceNumber(); + if(qingjia == workingDaysConfiguration.getWorkingDays()*cwNewEmployeeInformation2.getShiftTheLength()){ + //说明本月没有出勤 + // 缺勤工资扣款(月工资/应出勤天数*缺勤天数) + cwNewPayroll.setAbsenteeismSalary(cwNewPayroll.getBasicMonthlySalary()); + }else{ + // 计算一小时的工资是多少 + BigDecimal divide = cwNewPayroll.getBasicMonthlySalary().divide(new BigDecimal(26), 2).divide(new BigDecimal("8")); +// if(qingjia>(cwNewPayroll.getShouldAttendanceNumber()/2)){ +// // 缺勤工资扣款(月工资-月工资/30*出勤天数) +// cwNewPayroll.setAbsenteeismSalary(cwNewPayroll.getBasicMonthlySalary().subtract(divide.multiply(new BigDecimal(cwNewPayroll.getRealAttendanceNumber())))); +// }else{ + // 缺勤工资扣款(月工资/30*缺勤天数) + cwNewPayroll.setAbsenteeismSalary(divide.multiply(new BigDecimal(qingjia))); +// } + } + // 计算缺勤补助扣款(请假天数为1时扣款补助总额的百分之10,请假天数为0.5时,扣款补助总额的百分之5) + // 各项补助总额 + long gongling = 0; + if (cwNewEmployeeInformation2.getSeniority() > 10) { + gongling = 10; + }else{ + gongling = cwNewEmployeeInformation2.getSeniority(); + } + BigDecimal r = cwNewEmployeeInformation2.getLevelOfEducationSubsidies().add(cwNewEmployeeInformation2.getContractSubsidies()).add(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(gongling))).add(cwNewEmployeeInformation2.getSocialSecuritySubsidies()); + // 计算扣除百分比 + double s = 0; + if(qingjia>=4){ + s = (Double.valueOf(qingjia) / 8) / 10; + if (s > 1) { + s = 1; + } + } + // 缺勤补助扣款 + cwNewPayroll.setAbsenteeismSubsidies(r.multiply(new BigDecimal(s))); + // 全勤奖置为0 + cwNewPayroll.setFullFrequentlySubsidies(new BigDecimal("0")); + } + // 学历补助 + cwNewPayroll.setLevelOfEducationSubsidies(cwNewEmployeeInformation2.getLevelOfEducationSubsidies()); + // 合同补助 + cwNewPayroll.setContractSubsidies(cwNewEmployeeInformation2.getContractSubsidies()); + if(cwNewEmployeeInformation2.getSeniority()>10){ + // 工龄工资 + cwNewPayroll.setSenioritySalary(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(10))); + }else{ + // 工龄工资 + cwNewPayroll.setSenioritySalary(cwNewEmployeeInformation2.getSenioritySubsidies().multiply(new BigDecimal(cwNewEmployeeInformation2.getSeniority()))); + } + // 社保补助 + cwNewPayroll.setSocialSecuritySubsidies(cwNewEmployeeInformation2.getSocialSecuritySubsidies()); + //判断当前员工是否有加班费 + if(cwNewEmployeeInformation2.getIsOvertimePay().equals("是")){ + // 加班工资(有加班工资)月工资的加班工资为(基本工资+岗位工资)/应出勤天数/班次时长 = 一小时的工资*加班时长 = 加班工资 + cwNewPayroll.setOvertimeSalary(cwNewPayroll.getBasicMonthlySalary().divide(new BigDecimal(26),2).divide(new BigDecimal("8")).multiply(new BigDecimal(jiaban))); + }else{ + // 加班工资(有加班工资)月工资的加班工资为(基本工资+岗位工资)/应出勤天数/班次时长 = 一小时的工资*加班时长 = 加班工资 + cwNewPayroll.setOvertimeSalary(new BigDecimal(0)); + } +// if("三班两倒制".equals(banzhi)){ +// // 夜班补助 +// cwNewPayroll.setNightShiftSubsidies(cwNewEmployeeInformation2.getNightShiftSubsidies().multiply(new BigDecimal(paiban))); +// // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(cwNewEmployeeInformation2.getDinnerSubsidies().multiply(new BigDecimal(paiban))); +// }else{ +// // 夜班补助 +// cwNewPayroll.setNightShiftSubsidies(new BigDecimal(paiban2).multiply(new BigDecimal(5))); +// // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(new BigDecimal(0)); +// } + // 夜班补助 + cwNewPayroll.setNightShiftSubsidies(new BigDecimal(paiban2).multiply(new BigDecimal(5)).add(cwNewEmployeeInformation2.getNightShiftSubsidies().multiply(new BigDecimal(paiban)))); + // 夜餐补助 +// cwNewPayroll.setDinnerSubsidies(new BigDecimal(0)); + // 夜餐补助 + cwNewPayroll.setDinnerSubsidies(cwNewEmployeeInformation2.getDinnerSubsidies().multiply(new BigDecimal(paiban))); + // 其他补助 + cwNewPayroll.setSubsidyOrBonus(cwNewEmployeeInformation2.getOtherSubsidies().add(cwNewEmployeeInformation2.getFixedAllowance())); + //其他扣款 + cwNewPayroll.setDeductions(cwNewEmployeeInformation2.getDeductions()); + + //查询当前员工上月餐饮消费数据 + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoByNameAndDate(cwNewEmployeeInformation2.getName(),affiliationMonth); + if(null==statisticsInfo){ + cwNewPayroll.setMealFee(new BigDecimal("0")); + }else{ + cwNewPayroll.setMealFee(new BigDecimal(statisticsInfo.getPersonalSumConsumption())); + } + + if(cwNewPayroll.getRealAttendanceNumber()==0){ + cwNewPayroll.setSalary(new BigDecimal(0)); + }else{ + // 应发工资(合算月工资+各项补助-缺勤扣款-补助扣款) + // 各项金额相加(合算月工资+学历补助+合同补助+工龄工资+社保补助+全勤奖+加班工资+夜班补助+夜餐补助+其他补助-缺勤扣款-补助扣款-其他扣款)-离职应扣款 + BigDecimal d = cwNewPayroll.getBasicMonthlySalary().add(cwNewPayroll.getLevelOfEducationSubsidies()) + .add(cwNewPayroll.getContractSubsidies()).add(cwNewPayroll.getSenioritySalary()) + .add(cwNewPayroll.getSocialSecuritySubsidies()).add(cwNewPayroll.getFullFrequentlySubsidies()) + .add(cwNewPayroll.getSubsidyOrBonus()).add(cwNewPayroll.getOvertimeSalary()) + .add(cwNewPayroll.getNightShiftSubsidies()).add(cwNewPayroll.getDinnerSubsidies()) + .subtract(cwNewPayroll.getAbsenteeismSalary()).subtract(cwNewPayroll.getAbsenteeismSubsidies()).subtract(cwNewEmployeeInformation2.getSubsidyDeductMoney()).subtract(cwNewEmployeeInformation2.getDeductions()).subtract(cwNewPayroll.getMealFee()); + cwNewPayroll.setSalary(d); + } + } + + }else{ + // 虚拟工位(考勤不参与工资计算)直接获取员工的基本工资及岗位工资 + // 基本工资 + cwNewPayroll.setBasicSalary(cwNewEmployeeInformation2.getBasicSalary()); + // 岗位工资 + cwNewPayroll.setJobsSalary(cwNewEmployeeInformation2.getJobsSalary()); + // 月工资(基本工资+岗位工资) + cwNewPayroll.setBasicMonthlySalary(cwNewEmployeeInformation2.getBasicSalary().add(cwNewEmployeeInformation2.getJobsSalary())); + // 应出勤 + cwNewPayroll.setShouldAttendanceNumber((long)(workingDaysConfiguration.getWorkingDays() * cwNewEmployeeInformation2.getShiftTheLength())); + // 实出勤(因考勤不参与工资计算,所以这里实出勤和应出勤设置一致) + cwNewPayroll.setRealAttendanceNumber(Double.valueOf(workingDaysConfiguration.getWorkingDays() * cwNewEmployeeInformation2.getShiftTheLength())); + // 缺勤工资扣款(因考勤不参与工资计算所以不需要扣款) + cwNewPayroll.setAbsenteeismSalary(new BigDecimal("0")); + // 缺勤补助扣款 + cwNewPayroll.setAbsenteeismSubsidies(new BigDecimal("0")); + // 学历补助 + cwNewPayroll.setLevelOfEducationSubsidies(cwNewEmployeeInformation2.getLevelOfEducationSubsidies()); + // 合同补助 + cwNewPayroll.setContractSubsidies(cwNewEmployeeInformation2.getContractSubsidies()); + // 工龄工资(虚拟工位没有补助) + cwNewPayroll.setSenioritySalary(new BigDecimal("0")); + // 社保补助 + cwNewPayroll.setSocialSecuritySubsidies(cwNewEmployeeInformation2.getSocialSecuritySubsidies()); + // 全勤奖 + cwNewPayroll.setFullFrequentlySubsidies(cwNewEmployeeInformation2.getFullFrequentlySubsidies()); + // 加班工资 + cwNewPayroll.setOvertimeSalary(new BigDecimal("0")); + // 夜班补助 + cwNewPayroll.setNightShiftSubsidies(new BigDecimal("0")); + // 夜餐补助 + cwNewPayroll.setDinnerSubsidies(new BigDecimal("0")); + // 其他补助 + cwNewPayroll.setSubsidyOrBonus(cwNewEmployeeInformation2.getOtherSubsidies().add(cwNewEmployeeInformation2.getFixedAllowance())); + //其他扣款 + cwNewPayroll.setDeductions(cwNewEmployeeInformation2.getDeductions()); + + //查询当前员工上月餐饮消费数据 + CyStatisticsInfo statisticsInfo = cyStatisticsInfoService.selectCyStatisticsInfoByNameAndDate(cwNewEmployeeInformation2.getName(),affiliationMonth); + if(null==statisticsInfo){ + cwNewPayroll.setMealFee(new BigDecimal("0")); + }else{ + cwNewPayroll.setMealFee(new BigDecimal(statisticsInfo.getPersonalSumConsumption())); + } + + // 应发工资(合算月工资+各项补助-缺勤扣款-补助扣款) + // 各项金额相加(合算月工资+学历补助+合同补助+工龄工资+社保补助+全勤奖+加班工资+夜班补助+夜餐补助+其他补助-缺勤扣款-补助扣款-其他扣款-餐饮扣款)-离职应扣款 + BigDecimal d = cwNewPayroll.getBasicMonthlySalary().add(cwNewPayroll.getLevelOfEducationSubsidies()) + .add(cwNewPayroll.getContractSubsidies()).add(cwNewPayroll.getSenioritySalary()) + .add(cwNewPayroll.getSocialSecuritySubsidies()).add(cwNewPayroll.getFullFrequentlySubsidies()) + .add(cwNewPayroll.getSubsidyOrBonus()).add(cwNewPayroll.getOvertimeSalary()) + .add(cwNewPayroll.getNightShiftSubsidies()).add(cwNewPayroll.getDinnerSubsidies()) + .subtract(cwNewPayroll.getAbsenteeismSalary()).subtract(cwNewPayroll.getAbsenteeismSubsidies()) + .subtract(cwNewEmployeeInformation2.getSubsidyDeductMoney()).subtract(cwNewEmployeeInformation2.getDeductions()).subtract(cwNewPayroll.getMealFee()); + cwNewPayroll.setSalary(d); + } + // 代缴保险(养老+医疗+失业) + cwNewPayroll.setPayInsurance(cwNewEmployeeInformation2.getEndowmentInsurance().add(cwNewEmployeeInformation2.getMedicalInsurance()).add(cwNewEmployeeInformation2.getUnemploymentInsurance())); + //养老保险 + cwNewPayroll.setEndowmentInsurance(cwNewEmployeeInformation2.getEndowmentInsurance()); + //医疗保险 + cwNewPayroll.setMedicalInsurance(cwNewEmployeeInformation2.getMedicalInsurance()); + //工伤保险 + cwNewPayroll.setEmploymentInjuryInsurance(cwNewEmployeeInformation2.getEmploymentInjuryInsurance()); + //生育保险 + cwNewPayroll.setMaternityInsurance(cwNewEmployeeInformation2.getMaternityInsurance()); + //失业保险 + cwNewPayroll.setUnemploymentInsurance(cwNewEmployeeInformation2.getUnemploymentInsurance()); + // 税前工资(应发工资-代缴保险) + cwNewPayroll.setSalaryBeforeTax(cwNewPayroll.getSalary().subtract(cwNewPayroll.getPayInsurance())); + // 本年累计已发工资(本年累计已发工资+本月税前工资) + cwNewPayroll.setTotalWages(cwNewEmployeeInformation2.getTotalWages().add(cwNewPayroll.getSalaryBeforeTax())); + // 获取当前人员的入职日期 + Date entryDate = cwNewEmployeeInformation2.getEntryDate(); + // 工资所属月份 + String s = affiliationMonth + "-01"; + String format = sdf.format(entryDate); + long monthDiff = getMonthDiff(format, s); + if(Integer.valueOf(strings[1])==12){ + cwNewPayroll.setAnnualExemptionAmount(5000L); + }else{ + if (monthDiff >= Integer.valueOf(strings[1])) { + // 本年累计免征税额 专项扣除+期数*5000+5000(如果大于,则代表入职时间为去年入职的,则需要累加12月份的免征额) + cwNewPayroll.setAnnualExemptionAmount(Long.valueOf(strings[1]) * 5000 + 5000); + } +// else if (monthDiff == Integer.valueOf(strings[1])) { +// // 本年累计免征税额 专项扣除+期数*5000(如果等于,则代表是1月份入职的,则不需要累加) +// cwNewPayroll.setAnnualExemptionAmount(Long.valueOf(strings[1]) * 5000); +// } + else { + // 本年累计免征税额 专项扣除+差额月*5000 + if(monthDiff==0){ + monthDiff = 1; + cwNewPayroll.setAnnualExemptionAmount(monthDiff * 5000); + }else{ + cwNewPayroll.setAnnualExemptionAmount(monthDiff * 5000+5000); + } + } + } + // 专项附加扣除(六项附加扣除额相加) + cwNewPayroll.setSpecialDeduction(cwNewEmployeeInformation2.getChildrenEducation().add(cwNewEmployeeInformation2.getSupportTheOld()).add(cwNewEmployeeInformation2.getHousingLoans()).add(cwNewEmployeeInformation2.getHousingRents()).add(cwNewEmployeeInformation2.getAdultEducation()).add(cwNewEmployeeInformation2.getTreatmentForSeriousDisease())); + // 应纳税所得额(本年累计已发工资-年度免征额-累计专项扣除-本月专项扣除) + if(cwNewPayroll.getTotalWages().subtract(new BigDecimal(cwNewPayroll.getAnnualExemptionAmount())).subtract(cwNewPayroll.getSpecialDeduction()).subtract(cwNewEmployeeInformation2.getSpecialDeduction()).longValue()>0){ + cwNewPayroll.setTaxableIncome(cwNewPayroll.getTotalWages().subtract(new BigDecimal(cwNewPayroll.getAnnualExemptionAmount())).subtract(cwNewPayroll.getSpecialDeduction()).subtract(cwNewEmployeeInformation2.getSpecialDeduction())); + }else{ + cwNewPayroll.setTaxableIncome(new BigDecimal("0")); + } + // 判断应纳税所得额额度(额度不一样税率不一样) + if (cwNewPayroll.getTaxableIncome().intValue() > 0 && cwNewPayroll.getTaxableIncome().intValue() <= 36000) { + // 此阶税率为百分之3,速减数为0 + cwNewPayroll.setTaxRate("0.03"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(0L); + } else if (cwNewPayroll.getTaxableIncome().intValue() > 36000 && cwNewPayroll.getTaxableIncome().intValue() <= 144000) { + // 此阶税率为百分之10,速减数为2520 + cwNewPayroll.setTaxRate("0.1"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(2520L); + } else if (cwNewPayroll.getTaxableIncome().intValue() > 144000 && cwNewPayroll.getTaxableIncome().intValue() <= 300000) { + // 此阶税率为百分之20,速减数为16920 + cwNewPayroll.setTaxRate("0.2"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(16920L); + } else if (cwNewPayroll.getTaxableIncome().intValue() > 300000 && cwNewPayroll.getTaxableIncome().intValue() <= 420000) { + // 此阶税率为百分之25,速减数为31920 + cwNewPayroll.setTaxRate("0.25"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(31920L); + } else if (cwNewPayroll.getTaxableIncome().intValue() > 420000 && cwNewPayroll.getTaxableIncome().intValue() <= 660000) { + // 此阶税率为百分之30,速减数为52920 + cwNewPayroll.setTaxRate("0.3"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(52920L); + } else if (cwNewPayroll.getTaxableIncome().intValue() > 660000 && cwNewPayroll.getTaxableIncome().intValue() <= 960000) { + // 此阶税率为百分之35,速减数为85920 + cwNewPayroll.setTaxRate("0.35"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(85920L); + } else if (cwNewPayroll.getTaxableIncome().intValue() > 960000) { + // 此阶税率为百分之45,速减数为181920 + cwNewPayroll.setTaxRate("0.45"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(181920L); + } else { + // 应纳税所得额小于0(免征额+专项扣除>应发工资时) + // 此阶税率为百分之0,速减数为0 + cwNewPayroll.setTaxRate("0"); + // 速算扣除数(速算扣除数跟税率同步) + cwNewPayroll.setSlowDownTheDeduction(0L); + } + // 本年累计已缴税额 + cwNewPayroll.setAggregatePersonalIncomeTax(cwNewEmployeeInformation2.getAggregatePersonalIncomeTax()); + // 判断税前工资是否大于5000,如果小于,则不在计算个税 + if (cwNewPayroll.getSalaryBeforeTax().intValue() > 5000) { + // 本月应缴税额(本月应纳税所得额*税率-速减数-本年累计已预缴个税) + cwNewPayroll.setTaxPayable( + cwNewPayroll.getTaxableIncome().multiply(new BigDecimal(cwNewPayroll.getTaxRate())).subtract(new BigDecimal(cwNewPayroll.getSlowDownTheDeduction())).subtract(cwNewPayroll.getAggregatePersonalIncomeTax())); + if (cwNewPayroll.getTaxPayable().longValue() < 0) { + cwNewPayroll.setTaxPayable(new BigDecimal(0)); + } + } else { + // 应纳税所得额 + cwNewPayroll.setTaxableIncome(new BigDecimal("0")); + cwNewPayroll.setTaxPayable(new BigDecimal("0")); + } + // 实发工资(税前工资-本月应缴个人所得税) + cwNewPayroll.setNetPayroll(cwNewPayroll.getSalaryBeforeTax().subtract(cwNewPayroll.getTaxPayable())); + // 保存工资信息 + i = cwNewPayrollMapper.insertCwNewPayroll(cwNewPayroll); + // 把本年累计已发工资保存到员工信息表中 + cwNewEmployeeInformation2.setTotalWages(cwNewPayroll.getTotalWages()); + // 把本年累计已缴个税保存到员工信息表中 + cwNewEmployeeInformation2.setAggregatePersonalIncomeTax(cwNewEmployeeInformation2.getAggregatePersonalIncomeTax().add(cwNewPayroll.getTaxPayable())); + // 把本年累计专项扣除保存到员工信息表中 + cwNewEmployeeInformation2.setSpecialDeduction(cwNewEmployeeInformation2.getSpecialDeduction().add(cwNewPayroll.getSpecialDeduction())); + int j = cwNewEmployeeInformationService.updateCwNewEmployeeInformation(cwNewEmployeeInformation2); + } + return i; + } + + /** + * 修改新工资单 + * + * @param cwNewPayroll + * 新工资单 + * @return 结果 + */ + @Override + public int updateCwNewPayroll(CwNewPayroll cwNewPayroll) { + return cwNewPayrollMapper.updateCwNewPayroll(cwNewPayroll); + } + + /** + * 批量删除新工资单 + * + * @param ids + * 需要删除的新工资单ID + * @return 结果 + */ + @Override + public int deleteCwNewPayrollByIds(Long[] ids) { + return cwNewPayrollMapper.deleteCwNewPayrollByIds(ids); + } + + /** + * 删除新工资单信息 + * + * @param id + * 新工资单ID + * @return 结果 + */ + @Override + public int deleteCwNewPayrollById(Long id) { + return cwNewPayrollMapper.deleteCwNewPayrollById(id); + } + + /** + * 得到两日期相差几个月 + * + * @param String + * @return + */ + + public static long getMonthDiff(String startDate, String endDate) throws Exception { + long monthday; + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + Date startDate1 = fmt.parse(startDate); + Calendar starCal = Calendar.getInstance(); + starCal.setTime(startDate1); + int sYear = starCal.get(Calendar.YEAR); + int sMonth = starCal.get(Calendar.MONTH); + Date endDate1 = fmt.parse(endDate); + Calendar endCal = Calendar.getInstance(); + endCal.setTime(endDate1); + int eYear = endCal.get(Calendar.YEAR); + int eMonth = endCal.get(Calendar.MONTH); + monthday = ((eYear - sYear) * 12 + (eMonth - sMonth)); + return monthday; + } + + @Override + public List selectCwNewPayrollListByName(CwNewPayroll cwNewPayroll) { + + return cwNewPayrollMapper.selectCwNewPayrollListByName(cwNewPayroll); + } + + @Override + public List selectCwNewPayrollByAffiliationMonth(String affiliationMonth) { + // TODO Auto-generated method stub + return cwNewPayrollMapper.selectCwNewPayrollByAffiliationMonth(affiliationMonth); + } + + @Override + public List selectCwNewPayrollListByDepartmentName(CwNewPayroll cwNewPayroll) { + // TODO Auto-generated method stub + return cwNewPayrollMapper.selectCwNewPayrollListByDepartmentName(cwNewPayroll); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNonbusinessIncomeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNonbusinessIncomeServiceImpl.java new file mode 100644 index 0000000..7398bc1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwNonbusinessIncomeServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwNonbusinessIncomeMapper; +import com.ruoyi.project.management.domain.CwNonbusinessIncome; +import com.ruoyi.project.management.service.ICwNonbusinessIncomeService; + +/** + * 营业外收入信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-11-30 + */ +@Service +public class CwNonbusinessIncomeServiceImpl implements ICwNonbusinessIncomeService +{ + @Autowired + private CwNonbusinessIncomeMapper cwNonbusinessIncomeMapper; + + /** + * 查询营业外收入信息 + * + * @param id 营业外收入信息ID + * @return 营业外收入信息 + */ + @Override + public CwNonbusinessIncome selectCwNonbusinessIncomeById(Long id) + { + return cwNonbusinessIncomeMapper.selectCwNonbusinessIncomeById(id); + } + + /** + * 查询营业外收入信息列表 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 营业外收入信息 + */ + @Override + public List selectCwNonbusinessIncomeList(CwNonbusinessIncome cwNonbusinessIncome) + { + return cwNonbusinessIncomeMapper.selectCwNonbusinessIncomeList(cwNonbusinessIncome); + } + + /** + * 新增营业外收入信息 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 结果 + */ + @Override + public int insertCwNonbusinessIncome(CwNonbusinessIncome cwNonbusinessIncome) + { + cwNonbusinessIncome.setCreateTime(DateUtils.getNowDate()); + return cwNonbusinessIncomeMapper.insertCwNonbusinessIncome(cwNonbusinessIncome); + //调用金蝶推送 其他应收单 + //return BusinessDataTool.otherPayables(cwNonbusinessIncome); + } + + /** + * 修改营业外收入信息 + * + * @param cwNonbusinessIncome 营业外收入信息 + * @return 结果 + */ + @Override + public int updateCwNonbusinessIncome(CwNonbusinessIncome cwNonbusinessIncome) + { + return cwNonbusinessIncomeMapper.updateCwNonbusinessIncome(cwNonbusinessIncome); + } + + /** + * 批量删除营业外收入信息 + * + * @param ids 需要删除的营业外收入信息ID + * @return 结果 + */ + @Override + public int deleteCwNonbusinessIncomeByIds(Long[] ids) + { + return cwNonbusinessIncomeMapper.deleteCwNonbusinessIncomeByIds(ids); + } + + /** + * 删除营业外收入信息信息 + * + * @param id 营业外收入信息ID + * @return 结果 + */ + @Override + public int deleteCwNonbusinessIncomeById(Long id) + { + return cwNonbusinessIncomeMapper.deleteCwNonbusinessIncomeById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwOtherPaymentInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwOtherPaymentInfoServiceImpl.java new file mode 100644 index 0000000..ef5b7f5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwOtherPaymentInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwOtherPaymentInfoMapper; +import com.ruoyi.project.management.domain.CwOtherPaymentInfo; +import com.ruoyi.project.management.service.ICwOtherPaymentInfoService; + +/** + * 付款单合同关联信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-10 + */ +@Service +public class CwOtherPaymentInfoServiceImpl implements ICwOtherPaymentInfoService +{ + @Autowired + private CwOtherPaymentInfoMapper cwOtherPaymentInfoMapper; + + /** + * 查询付款单合同关联信息 + * + * @param id 付款单合同关联信息ID + * @return 付款单合同关联信息 + */ + @Override + public CwOtherPaymentInfo selectCwOtherPaymentInfoById(Long id) + { + return cwOtherPaymentInfoMapper.selectCwOtherPaymentInfoById(id); + } + + /** + * 查询付款单合同关联信息列表 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 付款单合同关联信息 + */ + @Override + public List selectCwOtherPaymentInfoList(CwOtherPaymentInfo cwOtherPaymentInfo) + { + return cwOtherPaymentInfoMapper.selectCwOtherPaymentInfoList(cwOtherPaymentInfo); + } + + /** + * 新增付款单合同关联信息 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 结果 + */ + @Override + public int insertCwOtherPaymentInfo(CwOtherPaymentInfo cwOtherPaymentInfo) + { + cwOtherPaymentInfo.setCreateTime(DateUtils.getNowDate()); + return cwOtherPaymentInfoMapper.insertCwOtherPaymentInfo(cwOtherPaymentInfo); + } + + /** + * 修改付款单合同关联信息 + * + * @param cwOtherPaymentInfo 付款单合同关联信息 + * @return 结果 + */ + @Override + public int updateCwOtherPaymentInfo(CwOtherPaymentInfo cwOtherPaymentInfo) + { + return cwOtherPaymentInfoMapper.updateCwOtherPaymentInfo(cwOtherPaymentInfo); + } + + /** + * 批量删除付款单合同关联信息 + * + * @param ids 需要删除的付款单合同关联信息ID + * @return 结果 + */ + @Override + public int deleteCwOtherPaymentInfoByIds(Long[] ids) + { + return cwOtherPaymentInfoMapper.deleteCwOtherPaymentInfoByIds(ids); + } + + /** + * 删除付款单合同关联信息信息 + * + * @param id 付款单合同关联信息ID + * @return 结果 + */ + @Override + public int deleteCwOtherPaymentInfoById(Long id) + { + return cwOtherPaymentInfoMapper.deleteCwOtherPaymentInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwOtherPaymentServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwOtherPaymentServiceImpl.java new file mode 100644 index 0000000..093e259 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwOtherPaymentServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwOtherPaymentMapper; +import com.ruoyi.project.management.domain.CwOtherPayment; +import com.ruoyi.project.management.service.ICwOtherPaymentService; + +/** + * 其他付款申请单Service业务层处理 + * + * @author zhukangchao + * @date 2023-11-30 + */ +@Service +public class CwOtherPaymentServiceImpl implements ICwOtherPaymentService +{ + @Autowired + private CwOtherPaymentMapper cwOtherPaymentMapper; + + /** + * 查询其他付款申请单 + * + * @param id 其他付款申请单ID + * @return 其他付款申请单 + */ + @Override + public CwOtherPayment selectCwOtherPaymentById(Long id) + { + return cwOtherPaymentMapper.selectCwOtherPaymentById(id); + } + + /** + * 查询其他付款申请单列表 + * + * @param cwOtherPayment 其他付款申请单 + * @return 其他付款申请单 + */ + @Override + public List selectCwOtherPaymentList(CwOtherPayment cwOtherPayment) + { + return cwOtherPaymentMapper.selectCwOtherPaymentList(cwOtherPayment); + } + + /** + * 新增其他付款申请单 + * + * @param cwOtherPayment 其他付款申请单 + * @return 结果 + */ + @Override + public int insertCwOtherPayment(CwOtherPayment cwOtherPayment) + { + cwOtherPayment.setCreateTime(DateUtils.getNowDate()); + return cwOtherPaymentMapper.insertCwOtherPayment(cwOtherPayment); + } + + /** + * 修改其他付款申请单 + * + * @param cwOtherPayment 其他付款申请单 + * @return 结果 + */ + @Override + public int updateCwOtherPayment(CwOtherPayment cwOtherPayment) + { + return cwOtherPaymentMapper.updateCwOtherPayment(cwOtherPayment); + } + + /** + * 批量删除其他付款申请单 + * + * @param ids 需要删除的其他付款申请单ID + * @return 结果 + */ + @Override + public int deleteCwOtherPaymentByIds(Long[] ids) + { + return cwOtherPaymentMapper.deleteCwOtherPaymentByIds(ids); + } + + /** + * 删除其他付款申请单信息 + * + * @param id 其他付款申请单ID + * @return 结果 + */ + @Override + public int deleteCwOtherPaymentById(Long id) + { + return cwOtherPaymentMapper.deleteCwOtherPaymentById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwPayrollServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwPayrollServiceImpl.java new file mode 100644 index 0000000..416c41c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwPayrollServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwPayrollMapper; +import com.ruoyi.project.management.domain.CwPayroll; +import com.ruoyi.project.management.service.ICwPayrollService; + +/** + * 工资单Service业务层处理 + * + * @author zhukangchao + * @date 2021-10-25 + */ +@Service +public class CwPayrollServiceImpl implements ICwPayrollService +{ + @Autowired + private CwPayrollMapper cwPayrollMapper; + + /** + * 查询工资单 + * + * @param id 工资单ID + * @return 工资单 + */ + @Override + public CwPayroll selectCwPayrollById(Long id) + { + return cwPayrollMapper.selectCwPayrollById(id); + } + + /** + * 查询工资单列表 + * + * @param cwPayroll 工资单 + * @return 工资单 + */ + @Override + public List selectCwPayrollList(CwPayroll cwPayroll) + { + return cwPayrollMapper.selectCwPayrollList(cwPayroll); + } + + /** + * 新增工资单 + * + * @param cwPayroll 工资单 + * @return 结果 + */ + @Override + public int insertCwPayroll(CwPayroll cwPayroll) + { + cwPayroll.setCreateTime(DateUtils.getNowDate()); + return cwPayrollMapper.insertCwPayroll(cwPayroll); + } + + /** + * 修改工资单 + * + * @param cwPayroll 工资单 + * @return 结果 + */ + @Override + public int updateCwPayroll(CwPayroll cwPayroll) + { + return cwPayrollMapper.updateCwPayroll(cwPayroll); + } + + /** + * 批量删除工资单 + * + * @param ids 需要删除的工资单ID + * @return 结果 + */ + @Override + public int deleteCwPayrollByIds(Long[] ids) + { + return cwPayrollMapper.deleteCwPayrollByIds(ids); + } + + /** + * 删除工资单信息 + * + * @param id 工资单ID + * @return 结果 + */ + @Override + public int deleteCwPayrollById(Long id) + { + return cwPayrollMapper.deleteCwPayrollById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwRulesServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwRulesServiceImpl.java new file mode 100644 index 0000000..7aff372 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwRulesServiceImpl.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwRulesMapper; +import com.ruoyi.project.management.domain.CwRules; +import com.ruoyi.project.management.service.ICwRulesService; + +/** + * 排班Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-25 + */ +@Service +public class CwRulesServiceImpl implements ICwRulesService +{ + @Autowired + private CwRulesMapper cwRulesMapper; + + /** + * 查询排班 + * + * @param id 排班ID + * @return 排班 + */ + @Override + public CwRules selectCwRulesById(Long id) + { + return cwRulesMapper.selectCwRulesById(id); + } + + /** + * 查询排班列表 + * + * @param cwRules 排班 + * @return 排班 + */ + @Override + public List selectCwRulesList(CwRules cwRules) + { + return cwRulesMapper.selectCwRulesList(cwRules); + } + + /** + * 新增排班 + * + * @param cwRules 排班 + * @return 结果 + */ + @Override + public int insertCwRules(CwRules cwRules) + { + cwRules.setCreateTime(DateUtils.getNowDate()); + return cwRulesMapper.insertCwRules(cwRules); + } + + /** + * 修改排班 + * + * @param cwRules 排班 + * @return 结果 + */ + @Override + public int updateCwRules(CwRules cwRules) + { + return cwRulesMapper.updateCwRules(cwRules); + } + + /** + * 批量删除排班 + * + * @param ids 需要删除的排班ID + * @return 结果 + */ + @Override + public int deleteCwRulesByIds(Long[] ids) + { + return cwRulesMapper.deleteCwRulesByIds(ids); + } + + /** + * 删除排班信息 + * + * @param id 排班ID + * @return 结果 + */ + @Override + public int deleteCwRulesById(Long id) + { + return cwRulesMapper.deleteCwRulesById(id); + } + + @Override + public int insertCwRuless(List list) { + + return cwRulesMapper.insertCwRuless(list); + } + + @Override + public List selectCwRulesByName(String name) { + // TODO Auto-generated method stub + return cwRulesMapper.selectCwRulesByName(name); + } + + @Override + public List selectCwRulesByNameAndDate(String name, String date) { + // TODO Auto-generated method stub + return cwRulesMapper.selectCwRulesByNameAndDate(name, date); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwSnDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwSnDetailServiceImpl.java new file mode 100644 index 0000000..ec5ac10 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwSnDetailServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwSnDetailMapper; +import com.ruoyi.project.management.domain.CwSnDetail; +import com.ruoyi.project.management.service.ICwSnDetailService; + +/** + * 考勤设备信息Service业务层处理 + * + * @author zhukangchao + * @date 2022-11-01 + */ +@Service +public class CwSnDetailServiceImpl implements ICwSnDetailService +{ + @Autowired + private CwSnDetailMapper cwSnDetailMapper; + + /** + * 查询考勤设备信息 + * + * @param id 考勤设备信息ID + * @return 考勤设备信息 + */ + @Override + public CwSnDetail selectCwSnDetailById(Long id) + { + return cwSnDetailMapper.selectCwSnDetailById(id); + } + + /** + * 查询考勤设备信息列表 + * + * @param cwSnDetail 考勤设备信息 + * @return 考勤设备信息 + */ + @Override + public List selectCwSnDetailList(CwSnDetail cwSnDetail) + { + return cwSnDetailMapper.selectCwSnDetailList(cwSnDetail); + } + + /** + * 新增考勤设备信息 + * + * @param cwSnDetail 考勤设备信息 + * @return 结果 + */ + @Override + public int insertCwSnDetail(CwSnDetail cwSnDetail) + { + cwSnDetail.setCreateTime(DateUtils.getNowDate()); + return cwSnDetailMapper.insertCwSnDetail(cwSnDetail); + } + + /** + * 修改考勤设备信息 + * + * @param cwSnDetail 考勤设备信息 + * @return 结果 + */ + @Override + public int updateCwSnDetail(CwSnDetail cwSnDetail) + { + return cwSnDetailMapper.updateCwSnDetail(cwSnDetail); + } + + /** + * 批量删除考勤设备信息 + * + * @param ids 需要删除的考勤设备信息ID + * @return 结果 + */ + @Override + public int deleteCwSnDetailByIds(Long[] ids) + { + return cwSnDetailMapper.deleteCwSnDetailByIds(ids); + } + + /** + * 删除考勤设备信息信息 + * + * @param id 考勤设备信息ID + * @return 结果 + */ + @Override + public int deleteCwSnDetailById(Long id) + { + return cwSnDetailMapper.deleteCwSnDetailById(id); + } + + @Override + public CwSnDetail selectCwSnDetailBySn(String sn) { + // TODO Auto-generated method stub + return cwSnDetailMapper.selectCwSnDetailBySn(sn); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwTaxRateInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwTaxRateInfoServiceImpl.java new file mode 100644 index 0000000..3fd6d75 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwTaxRateInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwTaxRateInfoMapper; +import com.ruoyi.project.management.domain.CwTaxRateInfo; +import com.ruoyi.project.management.service.ICwTaxRateInfoService; + +/** + * 税率信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-18 + */ +@Service +public class CwTaxRateInfoServiceImpl implements ICwTaxRateInfoService +{ + @Autowired + private CwTaxRateInfoMapper cwTaxRateInfoMapper; + + /** + * 查询税率信息 + * + * @param id 税率信息ID + * @return 税率信息 + */ + @Override + public CwTaxRateInfo selectCwTaxRateInfoById(Long id) + { + return cwTaxRateInfoMapper.selectCwTaxRateInfoById(id); + } + + /** + * 查询税率信息列表 + * + * @param cwTaxRateInfo 税率信息 + * @return 税率信息 + */ + @Override + public List selectCwTaxRateInfoList(CwTaxRateInfo cwTaxRateInfo) + { + return cwTaxRateInfoMapper.selectCwTaxRateInfoList(cwTaxRateInfo); + } + + /** + * 新增税率信息 + * + * @param cwTaxRateInfo 税率信息 + * @return 结果 + */ + @Override + public int insertCwTaxRateInfo(CwTaxRateInfo cwTaxRateInfo) + { + cwTaxRateInfo.setCreateTime(DateUtils.getNowDate()); + return cwTaxRateInfoMapper.insertCwTaxRateInfo(cwTaxRateInfo); + } + + /** + * 修改税率信息 + * + * @param cwTaxRateInfo 税率信息 + * @return 结果 + */ + @Override + public int updateCwTaxRateInfo(CwTaxRateInfo cwTaxRateInfo) + { + return cwTaxRateInfoMapper.updateCwTaxRateInfo(cwTaxRateInfo); + } + + /** + * 批量删除税率信息 + * + * @param ids 需要删除的税率信息ID + * @return 结果 + */ + @Override + public int deleteCwTaxRateInfoByIds(Long[] ids) + { + return cwTaxRateInfoMapper.deleteCwTaxRateInfoByIds(ids); + } + + /** + * 删除税率信息信息 + * + * @param id 税率信息ID + * @return 结果 + */ + @Override + public int deleteCwTaxRateInfoById(Long id) + { + return cwTaxRateInfoMapper.deleteCwTaxRateInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwTypeTimeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwTypeTimeServiceImpl.java new file mode 100644 index 0000000..28a852d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwTypeTimeServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwTypeTimeMapper; +import com.ruoyi.project.management.domain.CwTypeTime; +import com.ruoyi.project.management.service.ICwTypeTimeService; + +/** + * 状态等待时间Service业务层处理 + * + * @author zhukangchao + * @date 2022-10-31 + */ +@Service +public class CwTypeTimeServiceImpl implements ICwTypeTimeService +{ + @Autowired + private CwTypeTimeMapper cwTypeTimeMapper; + + /** + * 查询状态等待时间 + * + * @param id 状态等待时间ID + * @return 状态等待时间 + */ + @Override + public CwTypeTime selectCwTypeTimeById(Long id) + { + return cwTypeTimeMapper.selectCwTypeTimeById(id); + } + + /** + * 查询状态等待时间列表 + * + * @param cwTypeTime 状态等待时间 + * @return 状态等待时间 + */ + @Override + public List selectCwTypeTimeList(CwTypeTime cwTypeTime) + { + return cwTypeTimeMapper.selectCwTypeTimeList(cwTypeTime); + } + + /** + * 新增状态等待时间 + * + * @param cwTypeTime 状态等待时间 + * @return 结果 + */ + @Override + public int insertCwTypeTime(CwTypeTime cwTypeTime) + { + cwTypeTime.setCreateTime(DateUtils.getNowDate()); + return cwTypeTimeMapper.insertCwTypeTime(cwTypeTime); + } + + /** + * 修改状态等待时间 + * + * @param cwTypeTime 状态等待时间 + * @return 结果 + */ + @Override + public int updateCwTypeTime(CwTypeTime cwTypeTime) + { + return cwTypeTimeMapper.updateCwTypeTime(cwTypeTime); + } + + /** + * 批量删除状态等待时间 + * + * @param ids 需要删除的状态等待时间ID + * @return 结果 + */ + @Override + public int deleteCwTypeTimeByIds(Long[] ids) + { + return cwTypeTimeMapper.deleteCwTypeTimeByIds(ids); + } + + /** + * 删除状态等待时间信息 + * + * @param id 状态等待时间ID + * @return 结果 + */ + @Override + public int deleteCwTypeTimeById(Long id) + { + return cwTypeTimeMapper.deleteCwTypeTimeById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWageSummaryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWageSummaryServiceImpl.java new file mode 100644 index 0000000..f708d77 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWageSummaryServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwWageSummaryMapper; +import com.ruoyi.project.management.domain.CwWageSummary; +import com.ruoyi.project.management.service.ICwWageSummaryService; + +/** + * 工资汇总Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-23 + */ +@Service +public class CwWageSummaryServiceImpl implements ICwWageSummaryService +{ + @Autowired + private CwWageSummaryMapper cwWageSummaryMapper; + + /** + * 查询工资汇总 + * + * @param id 工资汇总ID + * @return 工资汇总 + */ + @Override + public CwWageSummary selectCwWageSummaryById(Long id) + { + return cwWageSummaryMapper.selectCwWageSummaryById(id); + } + + /** + * 查询工资汇总列表 + * + * @param cwWageSummary 工资汇总 + * @return 工资汇总 + */ + @Override + public List selectCwWageSummaryList(CwWageSummary cwWageSummary) + { + return cwWageSummaryMapper.selectCwWageSummaryList(cwWageSummary); + } + + /** + * 新增工资汇总 + * + * @param cwWageSummary 工资汇总 + * @return 结果 + */ + @Override + public int insertCwWageSummary(CwWageSummary cwWageSummary) + { + cwWageSummary.setCreateTime(DateUtils.getNowDate()); + return cwWageSummaryMapper.insertCwWageSummary(cwWageSummary); + } + + /** + * 修改工资汇总 + * + * @param cwWageSummary 工资汇总 + * @return 结果 + */ + @Override + public int updateCwWageSummary(CwWageSummary cwWageSummary) + { + return cwWageSummaryMapper.updateCwWageSummary(cwWageSummary); + } + + /** + * 批量删除工资汇总 + * + * @param ids 需要删除的工资汇总ID + * @return 结果 + */ + @Override + public int deleteCwWageSummaryByIds(Long[] ids) + { + return cwWageSummaryMapper.deleteCwWageSummaryByIds(ids); + } + + /** + * 删除工资汇总信息 + * + * @param id 工资汇总ID + * @return 结果 + */ + @Override + public int deleteCwWageSummaryById(Long id) + { + return cwWageSummaryMapper.deleteCwWageSummaryById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWorkOvertimeRecordServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWorkOvertimeRecordServiceImpl.java new file mode 100644 index 0000000..831e023 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWorkOvertimeRecordServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwWorkOvertimeRecordMapper; +import com.ruoyi.project.management.domain.CwWorkOvertimeRecord; +import com.ruoyi.project.management.service.ICwWorkOvertimeRecordService; + +/** + * 加班申请Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-22 + */ +@Service +public class CwWorkOvertimeRecordServiceImpl implements ICwWorkOvertimeRecordService +{ + @Autowired + private CwWorkOvertimeRecordMapper cwWorkOvertimeRecordMapper; + + /** + * 查询加班申请 + * + * @param id 加班申请ID + * @return 加班申请 + */ + @Override + public CwWorkOvertimeRecord selectCwWorkOvertimeRecordById(Long id) + { + return cwWorkOvertimeRecordMapper.selectCwWorkOvertimeRecordById(id); + } + + /** + * 查询加班申请列表 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 加班申请 + */ + @Override + public List selectCwWorkOvertimeRecordList(CwWorkOvertimeRecord cwWorkOvertimeRecord) + { + return cwWorkOvertimeRecordMapper.selectCwWorkOvertimeRecordList(cwWorkOvertimeRecord); + } + + /** + * 新增加班申请 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 结果 + */ + @Override + public int insertCwWorkOvertimeRecord(CwWorkOvertimeRecord cwWorkOvertimeRecord) + { + cwWorkOvertimeRecord.setCreateTime(DateUtils.getNowDate()); + return cwWorkOvertimeRecordMapper.insertCwWorkOvertimeRecord(cwWorkOvertimeRecord); + } + + /** + * 修改加班申请 + * + * @param cwWorkOvertimeRecord 加班申请 + * @return 结果 + */ + @Override + public int updateCwWorkOvertimeRecord(CwWorkOvertimeRecord cwWorkOvertimeRecord) + { + return cwWorkOvertimeRecordMapper.updateCwWorkOvertimeRecord(cwWorkOvertimeRecord); + } + + /** + * 批量删除加班申请 + * + * @param ids 需要删除的加班申请ID + * @return 结果 + */ + @Override + public int deleteCwWorkOvertimeRecordByIds(Long[] ids) + { + return cwWorkOvertimeRecordMapper.deleteCwWorkOvertimeRecordByIds(ids); + } + + /** + * 删除加班申请信息 + * + * @param id 加班申请ID + * @return 结果 + */ + @Override + public int deleteCwWorkOvertimeRecordById(Long id) + { + return cwWorkOvertimeRecordMapper.deleteCwWorkOvertimeRecordById(id); + } + + @Override + public List selectCwWorkOvertimeRecordByNameAndDate(String name, String date) { + // TODO Auto-generated method stub + return cwWorkOvertimeRecordMapper.selectCwWorkOvertimeRecordByNameAndDate(name,date); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWorkingDaysConfigurationServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWorkingDaysConfigurationServiceImpl.java new file mode 100644 index 0000000..8d521bf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CwWorkingDaysConfigurationServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CwWorkingDaysConfigurationMapper; +import com.ruoyi.project.management.domain.CwWorkingDaysConfiguration; +import com.ruoyi.project.management.service.ICwWorkingDaysConfigurationService; + +/** + * 工作日配置Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-21 + */ +@Service +public class CwWorkingDaysConfigurationServiceImpl implements ICwWorkingDaysConfigurationService +{ + @Autowired + private CwWorkingDaysConfigurationMapper cwWorkingDaysConfigurationMapper; + + /** + * 查询工作日配置 + * + * @param id 工作日配置ID + * @return 工作日配置 + */ + @Override + public CwWorkingDaysConfiguration selectCwWorkingDaysConfigurationById(Long id) + { + return cwWorkingDaysConfigurationMapper.selectCwWorkingDaysConfigurationById(id); + } + + /** + * 查询工作日配置列表 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 工作日配置 + */ + @Override + public List selectCwWorkingDaysConfigurationList(CwWorkingDaysConfiguration cwWorkingDaysConfiguration) + { + return cwWorkingDaysConfigurationMapper.selectCwWorkingDaysConfigurationList(cwWorkingDaysConfiguration); + } + + /** + * 新增工作日配置 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 结果 + */ + @Override + public int insertCwWorkingDaysConfiguration(CwWorkingDaysConfiguration cwWorkingDaysConfiguration) + { + cwWorkingDaysConfiguration.setCreateTime(DateUtils.getNowDate()); + return cwWorkingDaysConfigurationMapper.insertCwWorkingDaysConfiguration(cwWorkingDaysConfiguration); + } + + /** + * 修改工作日配置 + * + * @param cwWorkingDaysConfiguration 工作日配置 + * @return 结果 + */ + @Override + public int updateCwWorkingDaysConfiguration(CwWorkingDaysConfiguration cwWorkingDaysConfiguration) + { + return cwWorkingDaysConfigurationMapper.updateCwWorkingDaysConfiguration(cwWorkingDaysConfiguration); + } + + /** + * 批量删除工作日配置 + * + * @param ids 需要删除的工作日配置ID + * @return 结果 + */ + @Override + public int deleteCwWorkingDaysConfigurationByIds(Long[] ids) + { + return cwWorkingDaysConfigurationMapper.deleteCwWorkingDaysConfigurationByIds(ids); + } + + /** + * 删除工作日配置信息 + * + * @param id 工作日配置ID + * @return 结果 + */ + @Override + public int deleteCwWorkingDaysConfigurationById(Long id) + { + return cwWorkingDaysConfigurationMapper.deleteCwWorkingDaysConfigurationById(id); + } + + @Override + public CwWorkingDaysConfiguration selectCwWorkingDaysConfigurationByDate(String affiliationMonth) { + // TODO Auto-generated method stub + return cwWorkingDaysConfigurationMapper.selectCwWorkingDaysConfigurationByDate(affiliationMonth); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CyConsumptionInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CyConsumptionInfoServiceImpl.java new file mode 100644 index 0000000..cc1b2d6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CyConsumptionInfoServiceImpl.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CyConsumptionInfoMapper; +import com.ruoyi.project.management.domain.CyConsumptionInfo; +import com.ruoyi.project.management.service.ICyConsumptionInfoService; + +/** + * 餐饮消费明细Service业务层处理 + * + * @author zhukangchao + * @date 2023-10-05 + */ +@Service +public class CyConsumptionInfoServiceImpl implements ICyConsumptionInfoService +{ + @Autowired + private CyConsumptionInfoMapper cyConsumptionInfoMapper; + + /** + * 查询餐饮消费明细 + * + * @param id 餐饮消费明细ID + * @return 餐饮消费明细 + */ + @Override + public CyConsumptionInfo selectCyConsumptionInfoById(Long id) + { + return cyConsumptionInfoMapper.selectCyConsumptionInfoById(id); + } + + /** + * 查询餐饮消费明细列表 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 餐饮消费明细 + */ + @Override + public List selectCyConsumptionInfoList(CyConsumptionInfo cyConsumptionInfo) + { + return cyConsumptionInfoMapper.selectCyConsumptionInfoList(cyConsumptionInfo); + } + + /** + * 新增餐饮消费明细 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 结果 + */ + @Override + public int insertCyConsumptionInfo(CyConsumptionInfo cyConsumptionInfo) + { + cyConsumptionInfo.setCreateTime(DateUtils.getNowDate()); + return cyConsumptionInfoMapper.insertCyConsumptionInfo(cyConsumptionInfo); + } + + /** + * 修改餐饮消费明细 + * + * @param cyConsumptionInfo 餐饮消费明细 + * @return 结果 + */ + @Override + public int updateCyConsumptionInfo(CyConsumptionInfo cyConsumptionInfo) + { + return cyConsumptionInfoMapper.updateCyConsumptionInfo(cyConsumptionInfo); + } + + /** + * 批量删除餐饮消费明细 + * + * @param ids 需要删除的餐饮消费明细ID + * @return 结果 + */ + @Override + public int deleteCyConsumptionInfoByIds(Long[] ids) + { + return cyConsumptionInfoMapper.deleteCyConsumptionInfoByIds(ids); + } + + /** + * 删除餐饮消费明细信息 + * + * @param id 餐饮消费明细ID + * @return 结果 + */ + @Override + public int deleteCyConsumptionInfoById(Long id) + { + return cyConsumptionInfoMapper.deleteCyConsumptionInfoById(id); + } + + @Override + public List selectCyConsumptionInfoByDate(Date date) { + // TODO Auto-generated method stub + return cyConsumptionInfoMapper.selectCyConsumptionInfoByDate(date); + } + + @Override + public List selectCyConsumptionInfoByYue(Date date,String name) { + // TODO Auto-generated method stub + return cyConsumptionInfoMapper.selectCyConsumptionInfoByYue(date,name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CyFaceInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CyFaceInfoServiceImpl.java new file mode 100644 index 0000000..c1eb089 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CyFaceInfoServiceImpl.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CyFaceInfoMapper; +import com.ruoyi.project.management.domain.CyFaceInfo; +import com.ruoyi.project.management.service.ICyFaceInfoService; + +/** + * 餐饮刷脸详情信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-10-05 + */ +@Service +public class CyFaceInfoServiceImpl implements ICyFaceInfoService +{ + @Autowired + private CyFaceInfoMapper cyFaceInfoMapper; + + /** + * 查询餐饮刷脸详情信息 + * + * @param id 餐饮刷脸详情信息ID + * @return 餐饮刷脸详情信息 + */ + @Override + public CyFaceInfo selectCyFaceInfoById(Long id) + { + return cyFaceInfoMapper.selectCyFaceInfoById(id); + } + + /** + * 查询餐饮刷脸详情信息列表 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 餐饮刷脸详情信息 + */ + @Override + public List selectCyFaceInfoList(CyFaceInfo cyFaceInfo) + { + return cyFaceInfoMapper.selectCyFaceInfoList(cyFaceInfo); + } + + /** + * 新增餐饮刷脸详情信息 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 结果 + */ + @Override + public int insertCyFaceInfo(CyFaceInfo cyFaceInfo) + { + cyFaceInfo.setCreateTime(DateUtils.getNowDate()); + return cyFaceInfoMapper.insertCyFaceInfo(cyFaceInfo); + } + + /** + * 修改餐饮刷脸详情信息 + * + * @param cyFaceInfo 餐饮刷脸详情信息 + * @return 结果 + */ + @Override + public int updateCyFaceInfo(CyFaceInfo cyFaceInfo) + { + return cyFaceInfoMapper.updateCyFaceInfo(cyFaceInfo); + } + + /** + * 批量删除餐饮刷脸详情信息 + * + * @param ids 需要删除的餐饮刷脸详情信息ID + * @return 结果 + */ + @Override + public int deleteCyFaceInfoByIds(Long[] ids) + { + return cyFaceInfoMapper.deleteCyFaceInfoByIds(ids); + } + + /** + * 删除餐饮刷脸详情信息信息 + * + * @param id 餐饮刷脸详情信息ID + * @return 结果 + */ + @Override + public int deleteCyFaceInfoById(Long id) + { + return cyFaceInfoMapper.deleteCyFaceInfoById(id); + } + + @Override + public List selectCyFaceInfoByNameAndTime(String name) { + // TODO Auto-generated method stub + return cyFaceInfoMapper.selectCyFaceInfoByNameAndTime(name); + } + + @Override + public List selectCyFaceInfoByDate(Date format) { + // TODO Auto-generated method stub + return cyFaceInfoMapper.selectCyFaceInfoByDate(format); + } + + @Override + public List selectCyFaceInfoByNameAndDate(String name, Date dateTime) { + // TODO Auto-generated method stub + return cyFaceInfoMapper.selectCyFaceInfoByNameAndDate(name,dateTime); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/CyStatisticsInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/CyStatisticsInfoServiceImpl.java new file mode 100644 index 0000000..6e220d7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/CyStatisticsInfoServiceImpl.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.CyStatisticsInfoMapper; +import com.ruoyi.project.management.domain.CyStatisticsInfo; +import com.ruoyi.project.management.service.ICyStatisticsInfoService; + +/** + * 餐饮消费统计信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-10-05 + */ +@Service +public class CyStatisticsInfoServiceImpl implements ICyStatisticsInfoService +{ + @Autowired + private CyStatisticsInfoMapper cyStatisticsInfoMapper; + + /** + * 查询餐饮消费统计信息 + * + * @param id 餐饮消费统计信息ID + * @return 餐饮消费统计信息 + */ + @Override + public CyStatisticsInfo selectCyStatisticsInfoById(Long id) + { + return cyStatisticsInfoMapper.selectCyStatisticsInfoById(id); + } + + /** + * 查询餐饮消费统计信息列表 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 餐饮消费统计信息 + */ + @Override + public List selectCyStatisticsInfoList(CyStatisticsInfo cyStatisticsInfo) + { + return cyStatisticsInfoMapper.selectCyStatisticsInfoList(cyStatisticsInfo); + } + + /** + * 新增餐饮消费统计信息 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 结果 + */ + @Override + public int insertCyStatisticsInfo(CyStatisticsInfo cyStatisticsInfo) + { + cyStatisticsInfo.setCreateTime(DateUtils.getNowDate()); + return cyStatisticsInfoMapper.insertCyStatisticsInfo(cyStatisticsInfo); + } + + /** + * 修改餐饮消费统计信息 + * + * @param cyStatisticsInfo 餐饮消费统计信息 + * @return 结果 + */ + @Override + public int updateCyStatisticsInfo(CyStatisticsInfo cyStatisticsInfo) + { + return cyStatisticsInfoMapper.updateCyStatisticsInfo(cyStatisticsInfo); + } + + /** + * 批量删除餐饮消费统计信息 + * + * @param ids 需要删除的餐饮消费统计信息ID + * @return 结果 + */ + @Override + public int deleteCyStatisticsInfoByIds(Long[] ids) + { + return cyStatisticsInfoMapper.deleteCyStatisticsInfoByIds(ids); + } + + /** + * 删除餐饮消费统计信息信息 + * + * @param id 餐饮消费统计信息ID + * @return 结果 + */ + @Override + public int deleteCyStatisticsInfoById(Long id) + { + return cyStatisticsInfoMapper.deleteCyStatisticsInfoById(id); + } + + @Override + public CyStatisticsInfo selectCyStatisticsInfoByNameAndDate(String name, String yue) { + + return cyStatisticsInfoMapper.selectCyStatisticsInfoByNameAndDate(name,yue); + } + + /** + * 根据时间和姓名修改信息 + * @param cyStatisticsInfo + * @return + */ + @Override + public int updateCyStatisticsInfoByNameAndDate(List cyStatisticsInfo){ + int i = 0; + for (CyStatisticsInfo statisticsInfo : cyStatisticsInfo) { + //根据姓名和日期查询是否存在 + CyStatisticsInfo csi = cyStatisticsInfoMapper.selectCyStatisticsInfoByNameAndDate(statisticsInfo.getName(),statisticsInfo.getDate()); + if(csi != null){ + i += cyStatisticsInfoMapper.updateCyStatisticsInfoByNameAndDate(statisticsInfo); + }else{ + i += cyStatisticsInfoMapper.insertCyStatisticsInfo(statisticsInfo); + } + } + return i; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoInOutStorageManagementServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoInOutStorageManagementServiceImpl.java new file mode 100644 index 0000000..b18a9e1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoInOutStorageManagementServiceImpl.java @@ -0,0 +1,388 @@ +package com.ruoyi.project.management.service.impl; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.mapper.EvoStagnantStorageMapper; +import com.ruoyi.project.management.mapper.ImMaterialMapper; +import com.ruoyi.project.management.mapper.PwInventoryDetailMapper; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.EvoInOutStorageManagementMapper; +import com.ruoyi.project.management.service.IEvoInOutStorageManagementService; + +/** + * 物品出入库管理Service业务层处理 + * + * @author chenyongjiang + * @date 2023-12-26 + */ +@Service +public class EvoInOutStorageManagementServiceImpl implements IEvoInOutStorageManagementService +{ + @Autowired + private EvoInOutStorageManagementMapper evoInOutStorageManagementMapper; + //库存明细 + @Autowired + private PwInventoryDetailMapper pwInventoryDetailMapper; + //物料 + @Autowired + private ImMaterialMapper imMaterialMapper; + //呆滞库 + @Autowired + private EvoStagnantStorageMapper evoStagnantStorageMapper; + //质检单 + @Autowired + private IPwCompletionNoticeService pwCompletionNoticeService; + //完工通知单 + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + /** + * 查询物品出入库管理 + * + * @param id 物品出入库管理ID + * @return 物品出入库管理 + */ + @Override + public EvoInOutStorageManagement selectEvoInOutStorageManagementById(Long id) + { + return evoInOutStorageManagementMapper.selectEvoInOutStorageManagementById(id); + } + + /** + * 查询物品出入库管理列表 + * + * @param evoInOutStorageManagement 物品出入库管理 + * @return 物品出入库管理 + */ + @Override + public List selectEvoInOutStorageManagementList(EvoInOutStorageManagement evoInOutStorageManagement) + { + return evoInOutStorageManagementMapper.selectEvoInOutStorageManagementList(evoInOutStorageManagement); + } + + /** + * 新增物品出入库管理 + * + * @param evoInOutStorageManagement 物品出入库管理 + * @return 结果 + */ + @Override + public AjaxResult insertEvoInOutStorageManagement(EvoInOutStorageManagement evoInOutStorageManagement) + { + int i = 0; //保存结果 + //判断库,0:物料库 + if("0".equals(evoInOutStorageManagement.getFlag())){ + //判断出库 + if("0".equals(evoInOutStorageManagement.getInOutFlag())){ + //查询库存物品和数量 + PwInventoryDetail inventoryDetails = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(evoInOutStorageManagement.getMaterialName(),evoInOutStorageManagement.getFigureNumber()); + //没有物料 + if(null == inventoryDetails){ + return AjaxResult.error("库存没有此物品!"); + } + //申请数量大于可用 + if(evoInOutStorageManagement.getQuantity() > inventoryDetails.getAvailableNumber()){ + return AjaxResult.error("库存数量不足!"); + } + inventoryDetails.setAvailableNumber(inventoryDetails.getAvailableNumber() - evoInOutStorageManagement.getQuantity()); + inventoryDetails.setLockNumber(inventoryDetails.getLockNumber() + evoInOutStorageManagement.getQuantity()); + i = pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetails); + if(i < 1){ + return AjaxResult.error("锁定物品失败!"); + } + } + }else{ //呆滞库 + //判断出库 + if("0".equals(evoInOutStorageManagement.getInOutFlag())) { + //查询呆滞库库存 + EvoStagnantStorage evoStagnantStorage = evoStagnantStorageMapper.selectEvoStagnantStorageByNameAndFigure(evoInOutStorageManagement.getMaterialName(), evoInOutStorageManagement.getFigureNumber()); + if (null == evoStagnantStorage) { + return AjaxResult.error("库存没有此物品!"); + } + if (evoInOutStorageManagement.getQuantity() > evoStagnantStorage.getAvailableNumber()) { + return AjaxResult.error("库存数量不足!"); + } + evoStagnantStorage.setAvailableNumber(evoStagnantStorage.getAvailableNumber() - evoInOutStorageManagement.getQuantity()); + evoStagnantStorage.setLockNumber(evoStagnantStorage.getLockNumber() + evoInOutStorageManagement.getQuantity()); + i = evoStagnantStorageMapper.updateEvoStagnantStorage(evoStagnantStorage); + if (i < 1) { + return AjaxResult.error("锁定物品失败!"); + } + } + } + if(StringUtils.isEmpty(evoInOutStorageManagement.getStatus())){ + evoInOutStorageManagement.setStatus("1"); + } + i = evoInOutStorageManagementMapper.insertEvoInOutStorageManagement(evoInOutStorageManagement); + if(i < 1){ + return AjaxResult.error("申请记录失败!"); + } + return AjaxResult.success("申请操作成功!"); + } + + /** + * 删除物品出入库管理信息 + * + * @param id 物品出入库管理ID + * @return 结果 + */ + @Override + public AjaxResult deleteEvoInOutStorageManagementById(Long id) + { + //查询删除信息的状态 + EvoInOutStorageManagement evoInOutStorageManagement = evoInOutStorageManagementMapper.selectEvoInOutStorageManagementById(id); + if("2".equals(evoInOutStorageManagement.getStatus()) || "0".equals(evoInOutStorageManagement.getStatus())){ + return AjaxResult.error("审核过后的数据不能删除!!"); + } + int i = evoInOutStorageManagementMapper.deleteEvoInOutStorageManagementById(id); + if(i < 1){ + return AjaxResult.error("删除失败!"); + } + if("0".equals(evoInOutStorageManagement.getFlag())){ + //释放库存物品 + PwInventoryDetail inventoryDetails = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(evoInOutStorageManagement.getMaterialName(),evoInOutStorageManagement.getFigureNumber()); + inventoryDetails.setAvailableNumber(inventoryDetails.getAvailableNumber() + evoInOutStorageManagement.getQuantity()); + inventoryDetails.setLockNumber(inventoryDetails.getLockNumber() - evoInOutStorageManagement.getQuantity()); + i = pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetails); + }else{ + //释放呆滞库库存 + EvoStagnantStorage evoStagnantStorage = evoStagnantStorageMapper.selectEvoStagnantStorageByNameAndFigure(evoInOutStorageManagement.getMaterialName(),evoInOutStorageManagement.getFigureNumber()); + evoStagnantStorage.setAvailableNumber(evoStagnantStorage.getAvailableNumber() + evoInOutStorageManagement.getQuantity()); + evoStagnantStorage.setLockNumber(evoStagnantStorage.getLockNumber() - evoInOutStorageManagement.getQuantity()); + i = evoStagnantStorageMapper.updateEvoStagnantStorage(evoStagnantStorage); + } + if(i < 1){ + return AjaxResult.error("释放物品失败!"); + } + return AjaxResult.success("操作成功!!"); + } + + /** + * 审核 + * @param id + * @param name + * @return + */ + @Override + public AjaxResult audit(Long id,String name){ + //查询审核的数据 + EvoInOutStorageManagement evoInOutStorageManagement = evoInOutStorageManagementMapper.selectEvoInOutStorageManagementById(id); + if("2".equals(evoInOutStorageManagement.getStatus())){ + return AjaxResult.error("不能重复审核!"); + } + evoInOutStorageManagement.setApproveBy(name); + evoInOutStorageManagement.setApproveTime(new Date()); + evoInOutStorageManagement.setStatus("2"); + //1:入库需要推送质检 + if("1".equals(evoInOutStorageManagement.getInOutFlag())){ + int i = pushQualityInspection(evoInOutStorageManagement); + if(i < 1){ + return AjaxResult.error("推送质检失败!"); + } + } + int i = evoInOutStorageManagementMapper.updateEvoInOutStorageManagement(evoInOutStorageManagement); + if(i < 1){ + return AjaxResult.error("审核失败!"); + } + return AjaxResult.success("审核成功!"); + } + + /** + * 推送质检 + * @param id + * @param name + * @return + */ + @Override + public AjaxResult materialReturn(Long id,String name){ + //查询质检的数据 + EvoInOutStorageManagement evoInOutStorageManagement = evoInOutStorageManagementMapper.selectEvoInOutStorageManagementById(id); + if(null != evoInOutStorageManagement){ + int i = pushQualityInspection(evoInOutStorageManagement); + if(i < 1){ + return AjaxResult.error("推送质检失败!!"); + } + } + return AjaxResult.success(); + } + + /** + * 推送质检 + * @param evoInOutStorageManagement + * @return + */ + private int pushQualityInspection(EvoInOutStorageManagement evoInOutStorageManagement){ + int p = 0; //保存返回结果 + //质检信息 + PwCompletionNotice pwCompletionNotice = new PwCompletionNotice(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmsssss"); + //查询质检库中是否有今天的质检单 + PwCompletionNotice pwCompletionNotice1 = pwCompletionNoticeService.selectPwCompletionNoticeByDateAndCode("OBJ",new SimpleDateFormat("yyyy-MM-dd").format(new Date())); + if(null == pwCompletionNotice1){ + String code = "OBJ-" + sdf.format(new Date()) + "-1"; + pwCompletionNotice.setProductionCode(code); + }else{ + //获取当天的下一个序号 + int px = Integer.parseInt(pwCompletionNotice1.getProductionCode().split("-")[2]) + 1; + String code = "OBJ-" + sdf.format(new Date()) + "-" + px; + pwCompletionNotice.setProductionCode(code); + } + pwCompletionNotice.setCreateTime(new Date()); + pwCompletionNotice.setProjectName(evoInOutStorageManagement.getMaterialName()); + pwCompletionNotice.setQualityInspectorAudit(0); + p = pwCompletionNoticeService.insertPwCompletionNotice(pwCompletionNotice); + if(p < 1){ + return p; + } + // 添加完工通知单 + PwCompletionNoticeProduct pwCompletionNoticeProduct = new PwCompletionNoticeProduct(); + pwCompletionNoticeProduct.setCompletionNoticeId(pwCompletionNotice.getId()); + pwCompletionNoticeProduct.setCreateTime(new Date()); + pwCompletionNoticeProduct.setCode(pwCompletionNotice.getProductionCode()); + pwCompletionNoticeProduct.setProductName(evoInOutStorageManagement.getMaterialName()); + pwCompletionNoticeProduct.setFigureNumber(evoInOutStorageManagement.getFigureNumber()); + pwCompletionNoticeProduct.setMaterials(evoInOutStorageManagement.getMaterials()); + pwCompletionNoticeProduct.setReceivableQuantity(evoInOutStorageManagement.getQuantity().doubleValue()); + pwCompletionNoticeProduct.setUserName(evoInOutStorageManagement.getApplicant()); + pwCompletionNoticeProduct.setCheckoutStatus("未检验"); + pwCompletionNoticeProduct.setConcessionQuantity(0.0); + pwCompletionNoticeProduct.setActualQuantity(evoInOutStorageManagement.getQuantity().doubleValue()); + pwCompletionNoticeProduct.setQuantity(0.0); + p = pwCompletionNoticeProductService.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + if(p < 1){ + return p; + } + evoInOutStorageManagement.setProductId(pwCompletionNoticeProduct.getId()); + return p; + } + + /** + * 出入库 + * @param id + * @param name + * @return + */ + @Override + public AjaxResult determine(Long id,String name){ + int i = 0; + //查询审核的数据 + EvoInOutStorageManagement evoInOutStorageManagement = evoInOutStorageManagementMapper.selectEvoInOutStorageManagementById(id); + if("1".equals(evoInOutStorageManagement.getStatus())){ + return AjaxResult.error("未审核不能出入库!"); + } + if("0".equals(evoInOutStorageManagement.getStatus())){ + return AjaxResult.error("不能多次出入库!"); + } + //判断质检单号是否为空,不为空查找质检信息 + if(null != evoInOutStorageManagement.getProductId()){ + PwCompletionNoticeProduct pwCompletionNoticeProduct = pwCompletionNoticeProductService.selectPwCompletionNoticeProductById(evoInOutStorageManagement.getProductId()); + if(null != pwCompletionNoticeProduct){ + if("未检验".equals(pwCompletionNoticeProduct.getCheckoutStatus())){ + return AjaxResult.error("未检验不能入库!"); + } + evoInOutStorageManagement.setQualifiedNumber(pwCompletionNoticeProduct.getActualQuantity().longValue()); + } + } + //0为物料库 对其进行修改 + if("0".equals(evoInOutStorageManagement.getFlag())){ + i = inventoryDetailInoutStorage(evoInOutStorageManagement); + }else{ //呆滞库 + i = inoutStagnantStorage(evoInOutStorageManagement); + } + if(i < 1){ + return AjaxResult.error("修改库存明细失败!"); + } + evoInOutStorageManagement.setOperateBy(name); + evoInOutStorageManagement.setOperateTime(new Date()); + evoInOutStorageManagement.setStatus("0"); + i = evoInOutStorageManagementMapper.updateEvoInOutStorageManagement(evoInOutStorageManagement); + if(i < 1){ + return AjaxResult.error("出入库失败!"); + } + return AjaxResult.success("出/入库成功!"); + } + + /** + * 呆滞库出入库 + * @param evoInOutStorageManagement + * @return + */ + private int inoutStagnantStorage(EvoInOutStorageManagement evoInOutStorageManagement){ + int i = 0; + EvoStagnantStorage evoStagnantStorage = evoStagnantStorageMapper.selectEvoStagnantStorageByNameAndFigure(evoInOutStorageManagement.getMaterialName(),evoInOutStorageManagement.getFigureNumber()); + //出入库修改库存数量 + if("0".equals(evoInOutStorageManagement.getInOutFlag())){ //出库默认了有此物品且足够 + evoStagnantStorage.setQuantity(evoStagnantStorage.getQuantity() - evoInOutStorageManagement.getQuantity()); + evoStagnantStorage.setLockNumber(evoStagnantStorage.getLockNumber() - evoInOutStorageManagement.getQuantity()); + i = evoStagnantStorageMapper.updateEvoStagnantStorage(evoStagnantStorage); + }else{ //入库 + if(null == evoStagnantStorage){ + evoStagnantStorage = new EvoStagnantStorage(); + evoStagnantStorage.setName(evoInOutStorageManagement.getMaterialName()); + evoStagnantStorage.setFigureNumber(evoInOutStorageManagement.getFigureNumber()); + evoStagnantStorage.setLockNumber(0l); + evoStagnantStorage.setMaterials(evoInOutStorageManagement.getMaterials()); + evoStagnantStorage.setUnit(evoInOutStorageManagement.getUnit()); + } + evoStagnantStorage.setQuantity(evoStagnantStorage.getQuantity() + evoInOutStorageManagement.getQualifiedNumber()); + evoStagnantStorage.setAvailableNumber(evoStagnantStorage.getAvailableNumber() + evoInOutStorageManagement.getQualifiedNumber()); + i = evoStagnantStorageMapper.updateEvoStagnantStorage(evoStagnantStorage); + } + return i; + } + + /** + * 库存明细出入库 + * @param evoInOutStorageManagement + * @return + */ + private int inventoryDetailInoutStorage(EvoInOutStorageManagement evoInOutStorageManagement){ + int i = 0; + //修改库存明细 + PwInventoryDetail inventoryDetails = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(evoInOutStorageManagement.getMaterialName(),evoInOutStorageManagement.getFigureNumber()); + //出入库修改库存数量 + if("0".equals(evoInOutStorageManagement.getInOutFlag())){ //出库默认了有此物品且足够 + inventoryDetails.setQuantity(inventoryDetails.getQuantity() - evoInOutStorageManagement.getQuantity()); + inventoryDetails.setLockNumber(inventoryDetails.getLockNumber() - evoInOutStorageManagement.getQuantity()); + i = pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetails); + }else{ //入库 + //判断库存没有此物品 + if(null == inventoryDetails){ + //添加物料信息 + ImMaterial imMaterial = new ImMaterial(); + imMaterial.setMaterialName(evoInOutStorageManagement.getMaterialName()); + imMaterial.setFigureNumber(evoInOutStorageManagement.getFigureNumber()); + imMaterial.setMaterials(evoInOutStorageManagement.getMaterials()); + imMaterial.setUnitOfMeasurementName(evoInOutStorageManagement.getUnit()); + imMaterial.setCreateTime(new Date()); + imMaterial.setCreateBy(evoInOutStorageManagement.getApplicant()); + i = imMaterialMapper.insertImMaterial(imMaterial); + if(i < 1){ + return i; + } + //添加库存明细 + PwInventoryDetail inventory = new PwInventoryDetail(); + inventory.setName(evoInOutStorageManagement.getMaterialName()); + inventory.setFigureNumber(evoInOutStorageManagement.getFigureNumber()); + inventory.setQuantity(evoInOutStorageManagement.getQualifiedNumber()); + inventory.setAvailableNumber(evoInOutStorageManagement.getQualifiedNumber()); + inventory.setUnit(evoInOutStorageManagement.getUnit()); + inventory.setMaterials(evoInOutStorageManagement.getMaterials()); + inventory.setCreateTime(new Date()); + inventory.setCreateBy(evoInOutStorageManagement.getApplicant()); + i = pwInventoryDetailMapper.insertPwInventoryDetail(inventory); + }else{ + inventoryDetails.setQuantity(inventoryDetails.getQuantity() + evoInOutStorageManagement.getQualifiedNumber()); + inventoryDetails.setAvailableNumber(inventoryDetails.getAvailableNumber() + evoInOutStorageManagement.getQualifiedNumber()); + i = pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetails); + } + } + return i; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoInvalidLibraryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoInvalidLibraryServiceImpl.java new file mode 100644 index 0000000..cec8d0a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoInvalidLibraryServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; + +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.EvoInvalidLibraryMapper; +import com.ruoyi.project.management.domain.EvoInvalidLibrary; +import com.ruoyi.project.management.service.IEvoInvalidLibraryService; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author zhukangchao + * @date 2024-01-12 + */ +@Service +public class EvoInvalidLibraryServiceImpl implements IEvoInvalidLibraryService +{ + @Autowired + private EvoInvalidLibraryMapper evoInvalidLibraryMapper; + @Autowired + private IPwCompletionNoticeProductService pwCompletionNoticeProductService; + /** + * 查询 + * + * @param id ID + * @return 【不良品库】 + */ + @Override + public EvoInvalidLibrary selectEvoInvalidLibraryById(Long id) + { + return evoInvalidLibraryMapper.selectEvoInvalidLibraryById(id); + } + + /** + * 查询 不良品库 + * + * @param evoInvalidLibrary 【不良品库】 + * @return + */ + @Override + public List selectEvoInvalidLibraryList(EvoInvalidLibrary evoInvalidLibrary) + { + return evoInvalidLibraryMapper.selectEvoInvalidLibraryList(evoInvalidLibrary); + } + + /** + * 新增 + * + * @param evoInvalidLibrary + * @return 结果不良品库 + */ + @Override + public int insertEvoInvalidLibrary(EvoInvalidLibrary evoInvalidLibrary) + { + return evoInvalidLibraryMapper.insertEvoInvalidLibrary(evoInvalidLibrary); + } + + /** + * 修改 + * + * @param evoInvalidLibrary + * @return 结果 不良品库 + */ + @Override + public int updateEvoInvalidLibrary(EvoInvalidLibrary evoInvalidLibrary) + { + return evoInvalidLibraryMapper.updateEvoInvalidLibrary(evoInvalidLibrary); + } + + /** + * 批量删除 + * + * @param ids 需要删除的 + * @return 结果 + */ + @Override + public int deleteEvoInvalidLibraryByIds(Long[] ids) + { + return evoInvalidLibraryMapper.deleteEvoInvalidLibraryByIds(ids); + } + + /** + * 删除 + * 不良品库 + * @param id + * @return 结果 + */ + @Override + public int deleteEvoInvalidLibraryById(Long id) + { + return evoInvalidLibraryMapper.deleteEvoInvalidLibraryById(id); + } + + @Override + public EvoInvalidLibrary selectEvoInvalidLibraryByFigureNumberAndProductBillCode(String figureNumber, String productBillCode) { + return evoInvalidLibraryMapper.selectEvoInvalidLibraryByFigureNumberAndProductBillCode(figureNumber,productBillCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoOperatorTypeJdServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoOperatorTypeJdServiceImpl.java new file mode 100644 index 0000000..0c6458d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoOperatorTypeJdServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.EvoOperatorTypeJdMapper; +import com.ruoyi.project.management.domain.EvoOperatorTypeJd; +import com.ruoyi.project.management.service.IEvoOperatorTypeJdService; + +/** + * 操作员类型Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-17 + */ +@Service +public class EvoOperatorTypeJdServiceImpl implements IEvoOperatorTypeJdService +{ + @Autowired + private EvoOperatorTypeJdMapper evoOperatorTypeJdMapper; + + /** + * 查询操作员类型 + * + * @param id 操作员类型ID + * @return 操作员类型 + */ + @Override + public EvoOperatorTypeJd selectEvoOperatorTypeJdById(Long id) + { + return evoOperatorTypeJdMapper.selectEvoOperatorTypeJdById(id); + } + + /** + * 查询操作员类型列表 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 操作员类型 + */ + @Override + public List selectEvoOperatorTypeJdList(EvoOperatorTypeJd evoOperatorTypeJd) + { + return evoOperatorTypeJdMapper.selectEvoOperatorTypeJdList(evoOperatorTypeJd); + } + + /** + * 新增操作员类型 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 结果 + */ + @Override + public int insertEvoOperatorTypeJd(EvoOperatorTypeJd evoOperatorTypeJd) + { + return evoOperatorTypeJdMapper.insertEvoOperatorTypeJd(evoOperatorTypeJd); + } + + /** + * 修改操作员类型 + * + * @param evoOperatorTypeJd 操作员类型 + * @return 结果 + */ + @Override + public int updateEvoOperatorTypeJd(EvoOperatorTypeJd evoOperatorTypeJd) + { + return evoOperatorTypeJdMapper.updateEvoOperatorTypeJd(evoOperatorTypeJd); + } + + /** + * 批量删除操作员类型 + * + * @param ids 需要删除的操作员类型ID + * @return 结果 + */ + @Override + public int deleteEvoOperatorTypeJdByIds(Long[] ids) + { + return evoOperatorTypeJdMapper.deleteEvoOperatorTypeJdByIds(ids); + } + + /** + * 删除操作员类型信息 + * + * @param id 操作员类型ID + * @return 结果 + */ + @Override + public int deleteEvoOperatorTypeJdById(Long id) + { + return evoOperatorTypeJdMapper.deleteEvoOperatorTypeJdById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoStagnantStorageServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoStagnantStorageServiceImpl.java new file mode 100644 index 0000000..db4ae5f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/EvoStagnantStorageServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.EvoStagnantStorageMapper; +import com.ruoyi.project.management.domain.EvoStagnantStorage; +import com.ruoyi.project.management.service.IEvoStagnantStorageService; + +/** + * 呆滞库Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-27 + */ +@Service +public class EvoStagnantStorageServiceImpl implements IEvoStagnantStorageService +{ + @Autowired + private EvoStagnantStorageMapper evoStagnantStorageMapper; + + /** + * 查询呆滞库 + * + * @param id 呆滞库ID + * @return 呆滞库 + */ + @Override + public EvoStagnantStorage selectEvoStagnantStorageById(Long id) + { + return evoStagnantStorageMapper.selectEvoStagnantStorageById(id); + } + + /** + * 查询呆滞库列表 + * + * @param evoStagnantStorage 呆滞库 + * @return 呆滞库 + */ + @Override + public List selectEvoStagnantStorageList(EvoStagnantStorage evoStagnantStorage) + { + return evoStagnantStorageMapper.selectEvoStagnantStorageList(evoStagnantStorage); + } + + /** + * 新增呆滞库 + * + * @param evoStagnantStorage 呆滞库 + * @return 结果 + */ + @Override + public int insertEvoStagnantStorage(EvoStagnantStorage evoStagnantStorage) + { + return evoStagnantStorageMapper.insertEvoStagnantStorage(evoStagnantStorage); + } + + /** + * 修改呆滞库 + * + * @param evoStagnantStorage 呆滞库 + * @return 结果 + */ + @Override + public int updateEvoStagnantStorage(EvoStagnantStorage evoStagnantStorage) + { + return evoStagnantStorageMapper.updateEvoStagnantStorage(evoStagnantStorage); + } + + /** + * 批量删除呆滞库 + * + * @param ids 需要删除的呆滞库ID + * @return 结果 + */ + @Override + public int deleteEvoStagnantStorageByIds(Long[] ids) + { + return evoStagnantStorageMapper.deleteEvoStagnantStorageByIds(ids); + } + + /** + * 删除呆滞库信息 + * + * @param id 呆滞库ID + * @return 结果 + */ + @Override + public int deleteEvoStagnantStorageById(Long id) + { + return evoStagnantStorageMapper.deleteEvoStagnantStorageById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImCustomerServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImCustomerServiceImpl.java new file mode 100644 index 0000000..60a5e63 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImCustomerServiceImpl.java @@ -0,0 +1,111 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImCustomerMapper; +import com.ruoyi.project.management.domain.ImCustomer; +import com.ruoyi.project.management.service.IImCustomerService; + +/** + * 客户维护Service业务层处理 + * + * @author chenyj + * @date 2023-10-26 + */ +@Service +public class ImCustomerServiceImpl implements IImCustomerService +{ + @Autowired + private ImCustomerMapper imCustomerMapper; + + /** + * 查询客户维护 + * + * @param id 客户维护ID + * @return 客户维护 + */ + @Override + public ImCustomer selectImCustomerById(Long id) + { + return imCustomerMapper.selectImCustomerById(id); + } + + @Override + public ImCustomer selectImCustomerByCustomerName(String customerName){ + return imCustomerMapper.selectImCustomerByCustomerName(customerName); + } + + /** + * 查询客户维护列表 + * + * @param imCustomer 客户维护 + * @return 客户维护 + */ + @Override + public List selectImCustomerList(ImCustomer imCustomer) + { + return imCustomerMapper.selectImCustomerList(imCustomer); + } + + /** + * 新增客户维护 + * + * @param imCustomer 客户维护 + * @return 结果 + */ + @Override + public int insertImCustomer(ImCustomer imCustomer) + { + imCustomer.setCreateTime(DateUtils.getNowDate()); + return imCustomerMapper.insertImCustomer(imCustomer); + } + + /** + * 修改客户维护 + * + * @param imCustomer 客户维护 + * @return 结果 + */ + @Override + public int updateImCustomer(ImCustomer imCustomer) + { + imCustomer.setUpdateTime(DateUtils.getNowDate()); + return imCustomerMapper.updateImCustomer(imCustomer); + } + + /** + * 批量删除客户维护 + * + * @param ids 需要删除的客户维护ID + * @return 结果 + */ + @Override + public int deleteImCustomerByIds(Long[] ids) + { + return imCustomerMapper.deleteImCustomerByIds(ids); + } + + /** + * 删除客户维护信息 + * + * @param id 客户维护ID + * @return 结果 + */ + @Override + public int deleteImCustomerById(Long id) + { + return imCustomerMapper.deleteImCustomerById(id); + } + + /** + * 获取所有客户 + * @return + */ + @Override + public List queryCustomers(){ + return imCustomerMapper.queryCustomers(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImCustomerTypeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImCustomerTypeServiceImpl.java new file mode 100644 index 0000000..1ff1b66 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImCustomerTypeServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImCustomerTypeMapper; +import com.ruoyi.project.management.domain.ImCustomerType; +import com.ruoyi.project.management.service.IImCustomerTypeService; + +/** + * 客户类型Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-04 + */ +@Service +public class ImCustomerTypeServiceImpl implements IImCustomerTypeService +{ + @Autowired + private ImCustomerTypeMapper imCustomerTypeMapper; + + /** + * 查询客户类型 + * + * @param id 客户类型ID + * @return 客户类型 + */ + @Override + public ImCustomerType selectImCustomerTypeById(Long id) + { + return imCustomerTypeMapper.selectImCustomerTypeById(id); + } + + /** + * 查询客户类型列表 + * + * @param imCustomerType 客户类型 + * @return 客户类型 + */ + @Override + public List selectImCustomerTypeList(ImCustomerType imCustomerType) + { + return imCustomerTypeMapper.selectImCustomerTypeList(imCustomerType); + } + + /** + * 新增客户类型 + * + * @param imCustomerType 客户类型 + * @return 结果 + */ + @Override + public int insertImCustomerType(ImCustomerType imCustomerType) + { + imCustomerType.setCreateTime(DateUtils.getNowDate()); + return imCustomerTypeMapper.insertImCustomerType(imCustomerType); + } + + /** + * 修改客户类型 + * + * @param imCustomerType 客户类型 + * @return 结果 + */ + @Override + public int updateImCustomerType(ImCustomerType imCustomerType) + { + return imCustomerTypeMapper.updateImCustomerType(imCustomerType); + } + + /** + * 批量删除客户类型 + * + * @param ids 需要删除的客户类型ID + * @return 结果 + */ + @Override + public int deleteImCustomerTypeByIds(Long[] ids) + { + return imCustomerTypeMapper.deleteImCustomerTypeByIds(ids); + } + + /** + * 删除客户类型信息 + * + * @param id 客户类型ID + * @return 结果 + */ + @Override + public int deleteImCustomerTypeById(Long id) + { + return imCustomerTypeMapper.deleteImCustomerTypeById(id); + } + + public List queryImCustomerTypeList(){ + return imCustomerTypeMapper.selectImCustomerTypeList(null); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImDeliveryUnitServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImDeliveryUnitServiceImpl.java new file mode 100644 index 0000000..5bad158 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImDeliveryUnitServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImDeliveryUnitMapper; +import com.ruoyi.project.management.domain.ImDeliveryUnit; +import com.ruoyi.project.management.service.IImDeliveryUnitService; + +/** + * 交货单位Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImDeliveryUnitServiceImpl implements IImDeliveryUnitService +{ + @Autowired + private ImDeliveryUnitMapper imDeliveryUnitMapper; + + /** + * 查询交货单位 + * + * @param id 交货单位ID + * @return 交货单位 + */ + @Override + public ImDeliveryUnit selectImDeliveryUnitById(Long id) + { + return imDeliveryUnitMapper.selectImDeliveryUnitById(id); + } + + /** + * 查询交货单位列表 + * + * @param imDeliveryUnit 交货单位 + * @return 交货单位 + */ + @Override + public List selectImDeliveryUnitList(ImDeliveryUnit imDeliveryUnit) + { + return imDeliveryUnitMapper.selectImDeliveryUnitList(imDeliveryUnit); + } + + /** + * 新增交货单位 + * + * @param imDeliveryUnit 交货单位 + * @return 结果 + */ + @Override + public int insertImDeliveryUnit(ImDeliveryUnit imDeliveryUnit) + { + imDeliveryUnit.setCreateTime(DateUtils.getNowDate()); + return imDeliveryUnitMapper.insertImDeliveryUnit(imDeliveryUnit); + } + + /** + * 修改交货单位 + * + * @param imDeliveryUnit 交货单位 + * @return 结果 + */ + @Override + public int updateImDeliveryUnit(ImDeliveryUnit imDeliveryUnit) + { + return imDeliveryUnitMapper.updateImDeliveryUnit(imDeliveryUnit); + } + + /** + * 批量删除交货单位 + * + * @param ids 需要删除的交货单位ID + * @return 结果 + */ + @Override + public int deleteImDeliveryUnitByIds(Long[] ids) + { + return imDeliveryUnitMapper.deleteImDeliveryUnitByIds(ids); + } + + /** + * 删除交货单位信息 + * + * @param id 交货单位ID + * @return 结果 + */ + @Override + public int deleteImDeliveryUnitById(Long id) + { + return imDeliveryUnitMapper.deleteImDeliveryUnitById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImLogisticsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImLogisticsServiceImpl.java new file mode 100644 index 0000000..4e88d76 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImLogisticsServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImLogisticsMapper; +import com.ruoyi.project.management.domain.ImLogistics; +import com.ruoyi.project.management.service.IImLogisticsService; + +/** + * 物流Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImLogisticsServiceImpl implements IImLogisticsService +{ + @Autowired + private ImLogisticsMapper imLogisticsMapper; + + /** + * 查询物流 + * + * @param id 物流ID + * @return 物流 + */ + @Override + public ImLogistics selectImLogisticsById(Long id) + { + return imLogisticsMapper.selectImLogisticsById(id); + } + + /** + * 查询物流列表 + * + * @param imLogistics 物流 + * @return 物流 + */ + @Override + public List selectImLogisticsList(ImLogistics imLogistics) + { + return imLogisticsMapper.selectImLogisticsList(imLogistics); + } + + /** + * 新增物流 + * + * @param imLogistics 物流 + * @return 结果 + */ + @Override + public int insertImLogistics(ImLogistics imLogistics) + { + imLogistics.setCreateTime(DateUtils.getNowDate()); + return imLogisticsMapper.insertImLogistics(imLogistics); + } + + /** + * 修改物流 + * + * @param imLogistics 物流 + * @return 结果 + */ + @Override + public int updateImLogistics(ImLogistics imLogistics) + { + return imLogisticsMapper.updateImLogistics(imLogistics); + } + + /** + * 批量删除物流 + * + * @param ids 需要删除的物流ID + * @return 结果 + */ + @Override + public int deleteImLogisticsByIds(Long[] ids) + { + return imLogisticsMapper.deleteImLogisticsByIds(ids); + } + + /** + * 删除物流信息 + * + * @param id 物流ID + * @return 结果 + */ + @Override + public int deleteImLogisticsById(Long id) + { + return imLogisticsMapper.deleteImLogisticsById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMaterialGroupServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMaterialGroupServiceImpl.java new file mode 100644 index 0000000..fb8dcbb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMaterialGroupServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImMaterialGroupMapper; +import com.ruoyi.project.management.domain.ImMaterialGroup; +import com.ruoyi.project.management.service.IImMaterialGroupService; + +/** + * 物料分组Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-15 + */ +@Service +public class ImMaterialGroupServiceImpl implements IImMaterialGroupService +{ + @Autowired + private ImMaterialGroupMapper imMaterialGroupMapper; + + /** + * 查询物料分组 + * + * @param id 物料分组ID + * @return 物料分组 + */ + @Override + public ImMaterialGroup selectImMaterialGroupById(Long id) + { + return imMaterialGroupMapper.selectImMaterialGroupById(id); + } + + /** + * 查询物料分组列表 + * + * @param imMaterialGroup 物料分组 + * @return 物料分组 + */ + @Override + public List selectImMaterialGroupList(ImMaterialGroup imMaterialGroup) + { + return imMaterialGroupMapper.selectImMaterialGroupList(imMaterialGroup); + } + + /** + * 新增物料分组 + * + * @param imMaterialGroup 物料分组 + * @return 结果 + */ + @Override + public int insertImMaterialGroup(ImMaterialGroup imMaterialGroup) + { + return imMaterialGroupMapper.insertImMaterialGroup(imMaterialGroup); + } + + /** + * 修改物料分组 + * + * @param imMaterialGroup 物料分组 + * @return 结果 + */ + @Override + public int updateImMaterialGroup(ImMaterialGroup imMaterialGroup) + { + return imMaterialGroupMapper.updateImMaterialGroup(imMaterialGroup); + } + + /** + * 批量删除物料分组 + * + * @param ids 需要删除的物料分组ID + * @return 结果 + */ + @Override + public int deleteImMaterialGroupByIds(Long[] ids) + { + return imMaterialGroupMapper.deleteImMaterialGroupByIds(ids); + } + + /** + * 删除物料分组信息 + * + * @param id 物料分组ID + * @return 结果 + */ + @Override + public int deleteImMaterialGroupById(Long id) + { + return imMaterialGroupMapper.deleteImMaterialGroupById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMaterialServiceImpl.java new file mode 100644 index 0000000..f28192b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMaterialServiceImpl.java @@ -0,0 +1,356 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.domain.JDInvertoryVo; +import com.ruoyi.project.management.domain.PwMaterialParams; +import com.ruoyi.project.management.mapper.PwMaterialParamsMapper; +import com.ruoyi.project.management.utils.BaseDataTool; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImMaterialMapper; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.service.IImMaterialService; +import javax.annotation.Resource; + +/** + * 物料(零件)Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImMaterialServiceImpl implements IImMaterialService +{ + @Resource + private ImMaterialMapper imMaterialMapper; + @Resource + private PwMaterialParamsMapper pwMaterialParamsMapper; + + /** + * 查询物料(零件) + * + * @param id 物料(零件)ID + * @return 物料(零件) + */ + @Override + public ImMaterial selectImMaterialById(Long id) + { + return imMaterialMapper.selectImMaterialById(id); + } + + /** + * 查询物料(零件)列表 + * + * @param imMaterial 物料(零件) + * @return 物料(零件) + */ + @Override + public List selectImMaterialList(ImMaterial imMaterial) + { + return imMaterialMapper.selectImMaterialList(imMaterial); + } + + /** + * 新增物料(零件) + * + * @param imMaterial 物料(零件) + * @return 结果 + */ + @Override + public int insertImMaterial(ImMaterial imMaterial){ + imMaterial.setCreateTime(DateUtils.getNowDate()); +// //添加物料的同时,把库存信息中也添加上 +// PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); +// pwInventoryDetail.setName(imMaterial.getMaterialName()); +// pwInventoryDetail.setTypeName(imMaterial.getSpecificationType()); +// pwInventoryDetail.setWarehouseId(imMaterial.getWarehouseId()); +// pwInventoryDetail.setWarehouseName(imMaterial.getWarehouseName()); +// pwInventoryDetail.setUnit(imMaterial.getUnitOfMeasurementName()); +// pwInventoryDetail.setQuantity(0L); +// pwInventoryDetail.setLockNumber(0L); +// pwInventoryDetail.setPreliminaryInventory(0L); +// pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + return imMaterialMapper.insertImMaterial(imMaterial); + } + + /** + * 修改物料(零件) + * + * @param imMaterial 物料(零件) + * @return 结果 + */ + @Override + public int updateImMaterial(ImMaterial imMaterial) + { + return imMaterialMapper.updateImMaterial(imMaterial); + } + + /** + * 批量删除物料(零件) + * + * @param ids 需要删除的物料(零件)ID + * @return 结果 + */ + @Override + public int deleteImMaterialByIds(Long[] ids) + { + return imMaterialMapper.deleteImMaterialByIds(ids); + } + + /** + * 删除物料(零件)信息 + * + * @param id 物料(零件)ID + * @return 结果 + */ + @Override + public int deleteImMaterialById(Long id) + { + return imMaterialMapper.deleteImMaterialById(id); + } + + @Override + public ImMaterial selectImMaterialBySpecificationType(String partGather) { + + return imMaterialMapper.selectImMaterialBySpecificationType(partGather); + } + + /** + * 查询物料表中设置了最低库存和最高库存的数据 + */ + @Override + public List selectByMinimumAndHighest() { + List list = imMaterialMapper.selectByMinimumAndHighest(); + return list; + } + + @Override + public ImMaterial selectImMaterialByMaterialNameAndSpecificationType(String materialName,String figureNumber) { + return imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(materialName,figureNumber); + } + + @Override + public List selectImMaterialListImMaterialByType(ImMaterial imMaterial) { + // TODO Auto-generated method stub + return imMaterialMapper.selectImMaterialListImMaterialByType(imMaterial); + } + + @Override + public List selectImMaterialListImMaterialByYuanCaiLiao(ImMaterial imMaterial) { + // TODO Auto-generated method stub + return imMaterialMapper.selectImMaterialListImMaterialByYuanCaiLiao(imMaterial); + } + + @Override + public List selectImMaterialListImMaterialByJiJian(ImMaterial imMaterial) { + // TODO Auto-generated method stub + return imMaterialMapper.selectImMaterialListImMaterialByJiJian(imMaterial); + } + + @Override + public List selectImMaterialListImMaterialByYHP(ImMaterial imMaterial) { + // TODO Auto-generated method stub + return imMaterialMapper.selectImMaterialListImMaterialByYHP(imMaterial); + } + + @Override + public List selectByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return imMaterialMapper.selectByFigureNumberAndAllGB(); + } + + @Override + public List selectImMaterialListByTypeAndMinimum() { + // TODO Auto-generated method stub + return imMaterialMapper.selectImMaterialListByTypeAndMinimum(); + } + + @Override + public List selectImMaterialListImMaterialByBuJianAndLingJian() { + // TODO Auto-generated method stub + return imMaterialMapper.selectImMaterialListImMaterialByBuJianAndLingJian(); + } + + @Override + public List selectImMaterialListByMinimumAndHighest() { + // TODO Auto-generated method stub + return imMaterialMapper.selectImMaterialListByMinimumAndHighest(); + } + + /** + * 根据图号查询物料信息 + * @param materialName + * @return + */ + @Override + public List getImMaterialByMaterialName(String materialName){ + List material = imMaterialMapper.getImMaterialByMaterialName(materialName); + return material; + } + + /** + * 同步金蝶基础信息 + */ + public void queryJdBaseInformation(){ + queryCategory(); + queryUnits(); + queryWareHouses(); + queryMaterialsType(); + queryJdMaterials(); + } + + /** + * 查询物料属性 + */ + private void queryCategory(){ + pwMaterialParamsMapper.deletePwMaterialParamsByFlag("2"); + try{ + //查询物料 + String result = BaseDataTool.queryMaterialsParams("BD_MATERIALCATEGORY"); + if("[]".equals(result) || StringUtils.isEmpty(result)){ + return; + } + JSONArray arrays = JSONArray.parseArray(result); + PwMaterialParams pwMaterialParams = null; + for (int p=0;p result = BaseDataTool.queryMaterials(""); + //获取ERP物料 + List material_list = imMaterialMapper.selectImMaterialList(null); + for (int p=0;p selectImMaterialTypeList(ImMaterialType imMaterialType) + { + return imMaterialTypeMapper.selectImMaterialTypeList(imMaterialType); + } + + /** + * 新增物料(零件)类型 + * + * @param imMaterialType 物料(零件)类型 + * @return 结果 + */ + @Override + public int insertImMaterialType(ImMaterialType imMaterialType) + { + imMaterialType.setCreateTime(DateUtils.getNowDate()); + return imMaterialTypeMapper.insertImMaterialType(imMaterialType); + } + + /** + * 修改物料(零件)类型 + * + * @param imMaterialType 物料(零件)类型 + * @return 结果 + */ + @Override + public int updateImMaterialType(ImMaterialType imMaterialType) + { + return imMaterialTypeMapper.updateImMaterialType(imMaterialType); + } + + /** + * 批量删除物料(零件)类型 + * + * @param ids 需要删除的物料(零件)类型ID + * @return 结果 + */ + @Override + public int deleteImMaterialTypeByIds(Long[] ids) + { + return imMaterialTypeMapper.deleteImMaterialTypeByIds(ids); + } + + /** + * 删除物料(零件)类型信息 + * + * @param id 物料(零件)类型ID + * @return 结果 + */ + @Override + public int deleteImMaterialTypeById(Long id) + { + return imMaterialTypeMapper.deleteImMaterialTypeById(id); + } + + public ImMaterialType selectImMaterialTypeByName(String materialTypeName){ + return imMaterialTypeMapper.selectImMaterialTypeByName(materialTypeName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMeteringUnitServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMeteringUnitServiceImpl.java new file mode 100644 index 0000000..8dcc606 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImMeteringUnitServiceImpl.java @@ -0,0 +1,88 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImMeteringUnitMapper; +import com.ruoyi.project.management.domain.ImMeteringUnit; +import com.ruoyi.project.management.service.IImMeteringUnitService; + +/** + * 计量单位Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-23 + */ +@Service +public class ImMeteringUnitServiceImpl implements IImMeteringUnitService { + @Autowired + private ImMeteringUnitMapper imMeteringUnitMapper; + + /** + * 查询计量单位 + * + * @param id 计量单位ID + * @return 计量单位 + */ + @Override + public ImMeteringUnit selectImMeteringUnitById(String id) { + return imMeteringUnitMapper.selectImMeteringUnitById(id); + } + + /** + * 查询计量单位列表 + * + * @param imMeteringUnit 计量单位 + * @return 计量单位 + */ + @Override + public List selectImMeteringUnitList(ImMeteringUnit imMeteringUnit) { + return imMeteringUnitMapper.selectImMeteringUnitList(imMeteringUnit); + } + + /** + * 新增计量单位 + * + * @param imMeteringUnit 计量单位 + * @return 结果 + */ + @Override + public int insertImMeteringUnit(ImMeteringUnit imMeteringUnit) { + imMeteringUnit.setCreateTime(DateUtils.getNowDate()); + return imMeteringUnitMapper.insertImMeteringUnit(imMeteringUnit); + } + + /** + * 修改计量单位 + * + * @param imMeteringUnit 计量单位 + * @return 结果 + */ + @Override + public int updateImMeteringUnit(ImMeteringUnit imMeteringUnit) { + return imMeteringUnitMapper.updateImMeteringUnit(imMeteringUnit); + } + + /** + * 批量删除计量单位 + * + * @param ids 需要删除的计量单位ID + * @return 结果 + */ + @Override + public int deleteImMeteringUnitByIds(Long[] ids) { + return imMeteringUnitMapper.deleteImMeteringUnitByIds(ids); + } + + /** + * 删除计量单位信息 + * + * @param id 计量单位ID + * @return 结果 + */ + @Override + public int deleteImMeteringUnitById(Long id) { + return imMeteringUnitMapper.deleteImMeteringUnitById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductReceiptMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductReceiptMaterialServiceImpl.java new file mode 100644 index 0000000..1988ee6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductReceiptMaterialServiceImpl.java @@ -0,0 +1,179 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImProductReceiptMaterialMapper; +import com.ruoyi.project.management.domain.ImProductReceiptMaterial; +import com.ruoyi.project.management.domain.ImProductReceiptMaterialTwo; +import com.ruoyi.project.management.service.IImProductReceiptMaterialService; + +/** + * 物料产品入库单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImProductReceiptMaterialServiceImpl implements IImProductReceiptMaterialService +{ + @Autowired + private ImProductReceiptMaterialMapper imProductReceiptMaterialMapper; + + /** + * 查询物料产品入库单关联 + * + * @param id 物料产品入库单关联ID + * @return 物料产品入库单关联 + */ + @Override + public ImProductReceiptMaterial selectImProductReceiptMaterialById(Long id) + { + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialById(id); + } + + /** + * 查询物料产品入库单关联列表 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 物料产品入库单关联 + */ + @Override + public List selectImProductReceiptMaterialList(ImProductReceiptMaterial imProductReceiptMaterial) + { + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialList(imProductReceiptMaterial); + } + + /** + * 新增物料产品入库单关联 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 结果 + */ + @Override + public int insertImProductReceiptMaterial(ImProductReceiptMaterial imProductReceiptMaterial) + { + imProductReceiptMaterial.setCreateTime(DateUtils.getNowDate()); + return imProductReceiptMaterialMapper.insertImProductReceiptMaterial(imProductReceiptMaterial); + } + + /** + * 修改物料产品入库单关联 + * + * @param imProductReceiptMaterial 物料产品入库单关联 + * @return 结果 + */ + @Override + public int updateImProductReceiptMaterial(ImProductReceiptMaterial imProductReceiptMaterial) + { + return imProductReceiptMaterialMapper.updateImProductReceiptMaterial(imProductReceiptMaterial); + } + + /** + * 批量删除物料产品入库单关联 + * + * @param ids 需要删除的物料产品入库单关联ID + * @return 结果 + */ + @Override + public int deleteImProductReceiptMaterialByIds(Long[] ids) + { + return imProductReceiptMaterialMapper.deleteImProductReceiptMaterialByIds(ids); + } + + /** + * 删除物料产品入库单关联信息 + * + * @param id 物料产品入库单关联ID + * @return 结果 + */ + @Override + public int deleteImProductReceiptMaterialById(Long id) + { + return imProductReceiptMaterialMapper.deleteImProductReceiptMaterialById(id); + } + + /** + * 根据入库单id查询 + * @param productReceiptId + * @return + */ + @Override + public List selectImProductReceiptMaterialByProductReceiptId(Long productReceiptId) { + + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByProductReceiptId(productReceiptId); + } + + @Override + public List selectImProductReceiptMaterialLists(ImProductReceiptMaterial im) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialLists(im); + } + + @Override + public List selectImProductReceiptMaterialByCodeAndNameAndFigureNumber( + String makeDocumentsCode, String name, String figureNumber) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByCodeAndNameAndFigureNumber(makeDocumentsCode,name,figureNumber); + } + + @Override + public int selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime( + String productionCode, String name, String figureNumber) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByCodeAndNameAndFigureNumberByTime(productionCode,name,figureNumber); + } + + @Override + public List selectImProductReceiptMaterialListTwo( + ImProductReceiptMaterial imProductReceiptMaterial) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialListTwo(imProductReceiptMaterial); + } + + @Override + public List selectImProductReceiptMaterialByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByFigureNumberAndAllGB(); + } + + @Override + public List selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber( + Long id, String materialName, String figureNumber) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByProductReceiptIdAndNameAndFigureNumber(id,materialName,figureNumber); + } + + @Override + public List selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(String productionCode, + String name, String figureNumber) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImPRMByCodeAndNameAndFigureNumberAndIsperctor(productionCode,name,figureNumber); + } + + @Override + public List selectImProductReceiptMaterialByCode(String code) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByCode(code); + } + + @Override + public List selectImProductReceiptMaterialByCodeAndFigureNumber(String productionCode, + String figureNumber) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByCodeAndFigureNumber(productionCode,figureNumber); + } + + @Override + public List selectImProductReceiptMaterialByCodeAndSparedFour(String code, Long id) { + // TODO Auto-generated method stub + return imProductReceiptMaterialMapper.selectImProductReceiptMaterialByCodeAndSparedFour(code,id); + } + + @Override + public List queryImProductReceiptMaterialByNameAndFigureNumber(String name,String figureNumber, Date inDate){ + return imProductReceiptMaterialMapper.queryImProductReceiptMaterialByNameAndFigureNumber(name,figureNumber,inDate); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductReceiptServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductReceiptServiceImpl.java new file mode 100644 index 0000000..63485e3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductReceiptServiceImpl.java @@ -0,0 +1,111 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImProductReceiptMapper; +import com.ruoyi.project.management.domain.ImProductReceipt; +import com.ruoyi.project.management.service.IImProductReceiptService; + +/** + * 产品(半成品)入库单Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImProductReceiptServiceImpl implements IImProductReceiptService +{ + @Autowired + private ImProductReceiptMapper imProductReceiptMapper; + + /** + * 查询产品(半成品)入库单 + * + * @param id 产品(半成品)入库单ID + * @return 产品(半成品)入库单 + */ + @Override + public ImProductReceipt selectImProductReceiptById(Long id) + { + return imProductReceiptMapper.selectImProductReceiptById(id); + } + + /** + * 查询产品(半成品)入库单列表 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 产品(半成品)入库单 + */ + @Override + public List selectImProductReceiptList(ImProductReceipt imProductReceipt) + { + return imProductReceiptMapper.selectImProductReceiptList(imProductReceipt); + } + + /** + * 新增产品(半成品)入库单 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 结果 + */ + @Override + public int insertImProductReceipt(ImProductReceipt imProductReceipt) + { + imProductReceipt.setCreateTime(DateUtils.getNowDate()); + return imProductReceiptMapper.insertImProductReceipt(imProductReceipt); + } + + /** + * 修改产品(半成品)入库单 + * + * @param imProductReceipt 产品(半成品)入库单 + * @return 结果 + */ + @Override + public int updateImProductReceipt(ImProductReceipt imProductReceipt) + { + return imProductReceiptMapper.updateImProductReceipt(imProductReceipt); + } + + /** + * 批量删除产品(半成品)入库单 + * + * @param ids 需要删除的产品(半成品)入库单ID + * @return 结果 + */ + @Override + public int deleteImProductReceiptByIds(Long[] ids) + { + return imProductReceiptMapper.deleteImProductReceiptByIds(ids); + } + + /** + * 删除产品(半成品)入库单信息 + * + * @param id 产品(半成品)入库单ID + * @return 结果 + */ + @Override + public int deleteImProductReceiptById(Long id) + { + return imProductReceiptMapper.deleteImProductReceiptById(id); + } + + /** + * 根据合同编号查询入库单信息 + */ + @Override + public ImProductReceipt selectImProductReceiptByContractCode(String contractCode) { + ImProductReceipt imProductReceipt = imProductReceiptMapper.selectImProductReceiptByContractCode(contractCode); + return imProductReceipt; + } + + @Override + public ImProductReceipt selectImProductReceiptByMakeDocumentsCode(String makeDocumentsCode) { + + return imProductReceiptMapper.selectImProductReceiptByMakeDocumentsCode(makeDocumentsCode); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductStockRequistionProductServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductStockRequistionProductServiceImpl.java new file mode 100644 index 0000000..abd46a7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductStockRequistionProductServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImProductStockRequistionProductMapper; +import com.ruoyi.project.management.domain.ImProductStockRequistionProduct; +import com.ruoyi.project.management.service.IImProductStockRequistionProductService; + +/** + * 产品和产品出库单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-23 + */ +@Service +public class ImProductStockRequistionProductServiceImpl implements IImProductStockRequistionProductService +{ + @Autowired + private ImProductStockRequistionProductMapper imProductStockRequistionProductMapper; + + /** + * 查询产品和产品出库单关联 + * + * @param id 产品和产品出库单关联ID + * @return 产品和产品出库单关联 + */ + @Override + public ImProductStockRequistionProduct selectImProductStockRequistionProductById(Long id) + { + return imProductStockRequistionProductMapper.selectImProductStockRequistionProductById(id); + } + + /** + * 查询产品和产品出库单关联列表 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 产品和产品出库单关联 + */ + @Override + public List selectImProductStockRequistionProductList(ImProductStockRequistionProduct imProductStockRequistionProduct) + { + return imProductStockRequistionProductMapper.selectImProductStockRequistionProductList(imProductStockRequistionProduct); + } + + /** + * 新增产品和产品出库单关联 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 结果 + */ + @Override + public int insertImProductStockRequistionProduct(ImProductStockRequistionProduct imProductStockRequistionProduct) + { + imProductStockRequistionProduct.setCreateTime(DateUtils.getNowDate()); + return imProductStockRequistionProductMapper.insertImProductStockRequistionProduct(imProductStockRequistionProduct); + } + + /** + * 修改产品和产品出库单关联 + * + * @param imProductStockRequistionProduct 产品和产品出库单关联 + * @return 结果 + */ + @Override + public int updateImProductStockRequistionProduct(ImProductStockRequistionProduct imProductStockRequistionProduct) + { + return imProductStockRequistionProductMapper.updateImProductStockRequistionProduct(imProductStockRequistionProduct); + } + + /** + * 批量删除产品和产品出库单关联 + * + * @param ids 需要删除的产品和产品出库单关联ID + * @return 结果 + */ + @Override + public int deleteImProductStockRequistionProductByIds(Long[] ids) + { + return imProductStockRequistionProductMapper.deleteImProductStockRequistionProductByIds(ids); + } + + /** + * 删除产品和产品出库单关联信息 + * + * @param id 产品和产品出库单关联ID + * @return 结果 + */ + @Override + public int deleteImProductStockRequistionProductById(Long id) + { + return imProductStockRequistionProductMapper.deleteImProductStockRequistionProductById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductStockRequistionServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductStockRequistionServiceImpl.java new file mode 100644 index 0000000..b624998 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImProductStockRequistionServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImProductStockRequistionMapper; +import com.ruoyi.project.management.domain.ImProductStockRequistion; +import com.ruoyi.project.management.service.IImProductStockRequistionService; + +/** + * 销售出库单Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-23 + */ +@Service +public class ImProductStockRequistionServiceImpl implements IImProductStockRequistionService +{ + @Autowired + private ImProductStockRequistionMapper imProductStockRequistionMapper; + + /** + * 查询销售出库单 + * + * @param id 销售出库单ID + * @return 销售出库单 + */ + @Override + public ImProductStockRequistion selectImProductStockRequistionById(Long id) + { + return imProductStockRequistionMapper.selectImProductStockRequistionById(id); + } + + /** + * 查询销售出库单列表 + * + * @param imProductStockRequistion 销售出库单 + * @return 销售出库单 + */ + @Override + public List selectImProductStockRequistionList(ImProductStockRequistion imProductStockRequistion) + { + return imProductStockRequistionMapper.selectImProductStockRequistionList(imProductStockRequistion); + } + + /** + * 新增销售出库单 + * + * @param imProductStockRequistion 销售出库单 + * @return 结果 + */ + @Override + public int insertImProductStockRequistion(ImProductStockRequistion imProductStockRequistion) + { + imProductStockRequistion.setCreateTime(DateUtils.getNowDate()); + return imProductStockRequistionMapper.insertImProductStockRequistion(imProductStockRequistion); + } + + /** + * 修改销售出库单 + * + * @param imProductStockRequistion 销售出库单 + * @return 结果 + */ + @Override + public int updateImProductStockRequistion(ImProductStockRequistion imProductStockRequistion) + { + return imProductStockRequistionMapper.updateImProductStockRequistion(imProductStockRequistion); + } + + /** + * 批量删除销售出库单 + * + * @param ids 需要删除的销售出库单ID + * @return 结果 + */ + @Override + public int deleteImProductStockRequistionByIds(Long[] ids) + { + return imProductStockRequistionMapper.deleteImProductStockRequistionByIds(ids); + } + + /** + * 删除销售出库单信息 + * + * @param id 销售出库单ID + * @return 结果 + */ + @Override + public int deleteImProductStockRequistionById(Long id) + { + return imProductStockRequistionMapper.deleteImProductStockRequistionById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImPurchaseReceiptMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImPurchaseReceiptMaterialServiceImpl.java new file mode 100644 index 0000000..d562717 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImPurchaseReceiptMaterialServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImPurchaseReceiptMaterialMapper; +import com.ruoyi.project.management.domain.ImPurchaseReceiptMaterial; +import com.ruoyi.project.management.service.IImPurchaseReceiptMaterialService; + +/** + * 物料采购入库单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImPurchaseReceiptMaterialServiceImpl implements IImPurchaseReceiptMaterialService +{ + @Autowired + private ImPurchaseReceiptMaterialMapper imPurchaseReceiptMaterialMapper; + + /** + * 查询物料采购入库单关联 + * + * @param id 物料采购入库单关联ID + * @return 物料采购入库单关联 + */ + @Override + public ImPurchaseReceiptMaterial selectImPurchaseReceiptMaterialById(Long id) + { + return imPurchaseReceiptMaterialMapper.selectImPurchaseReceiptMaterialById(id); + } + + /** + * 查询物料采购入库单关联列表 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 物料采购入库单关联 + */ + @Override + public List selectImPurchaseReceiptMaterialList(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial) + { + return imPurchaseReceiptMaterialMapper.selectImPurchaseReceiptMaterialList(imPurchaseReceiptMaterial); + } + + /** + * 新增物料采购入库单关联 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 结果 + */ + @Override + public int insertImPurchaseReceiptMaterial(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial) + { + imPurchaseReceiptMaterial.setCreateTime(DateUtils.getNowDate()); + return imPurchaseReceiptMaterialMapper.insertImPurchaseReceiptMaterial(imPurchaseReceiptMaterial); + } + + /** + * 修改物料采购入库单关联 + * + * @param imPurchaseReceiptMaterial 物料采购入库单关联 + * @return 结果 + */ + @Override + public int updateImPurchaseReceiptMaterial(ImPurchaseReceiptMaterial imPurchaseReceiptMaterial) + { + return imPurchaseReceiptMaterialMapper.updateImPurchaseReceiptMaterial(imPurchaseReceiptMaterial); + } + + /** + * 批量删除物料采购入库单关联 + * + * @param ids 需要删除的物料采购入库单关联ID + * @return 结果 + */ + @Override + public int deleteImPurchaseReceiptMaterialByIds(Long[] ids) + { + return imPurchaseReceiptMaterialMapper.deleteImPurchaseReceiptMaterialByIds(ids); + } + + /** + * 删除物料采购入库单关联信息 + * + * @param id 物料采购入库单关联ID + * @return 结果 + */ + @Override + public int deleteImPurchaseReceiptMaterialById(Long id) + { + return imPurchaseReceiptMaterialMapper.deleteImPurchaseReceiptMaterialById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImPurchaseReceiptServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImPurchaseReceiptServiceImpl.java new file mode 100644 index 0000000..dfa2694 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImPurchaseReceiptServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImPurchaseReceiptMapper; +import com.ruoyi.project.management.domain.ImPurchaseReceipt; +import com.ruoyi.project.management.service.IImPurchaseReceiptService; + +/** + * 采购入库单Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImPurchaseReceiptServiceImpl implements IImPurchaseReceiptService +{ + @Autowired + private ImPurchaseReceiptMapper imPurchaseReceiptMapper; + + /** + * 查询采购入库单 + * + * @param id 采购入库单ID + * @return 采购入库单 + */ + @Override + public ImPurchaseReceipt selectImPurchaseReceiptById(Long id) + { + return imPurchaseReceiptMapper.selectImPurchaseReceiptById(id); + } + + /** + * 查询采购入库单列表 + * + * @param imPurchaseReceipt 采购入库单 + * @return 采购入库单 + */ + @Override + public List selectImPurchaseReceiptList(ImPurchaseReceipt imPurchaseReceipt) + { + return imPurchaseReceiptMapper.selectImPurchaseReceiptList(imPurchaseReceipt); + } + + /** + * 新增采购入库单 + * + * @param imPurchaseReceipt 采购入库单 + * @return 结果 + */ + @Override + public int insertImPurchaseReceipt(ImPurchaseReceipt imPurchaseReceipt) + { + imPurchaseReceipt.setCreateTime(DateUtils.getNowDate()); + return imPurchaseReceiptMapper.insertImPurchaseReceipt(imPurchaseReceipt); + } + + /** + * 修改采购入库单 + * + * @param imPurchaseReceipt 采购入库单 + * @return 结果 + */ + @Override + public int updateImPurchaseReceipt(ImPurchaseReceipt imPurchaseReceipt) + { + return imPurchaseReceiptMapper.updateImPurchaseReceipt(imPurchaseReceipt); + } + + /** + * 批量删除采购入库单 + * + * @param ids 需要删除的采购入库单ID + * @return 结果 + */ + @Override + public int deleteImPurchaseReceiptByIds(Long[] ids) + { + return imPurchaseReceiptMapper.deleteImPurchaseReceiptByIds(ids); + } + + /** + * 删除采购入库单信息 + * + * @param id 采购入库单ID + * @return 结果 + */ + @Override + public int deleteImPurchaseReceiptById(Long id) + { + return imPurchaseReceiptMapper.deleteImPurchaseReceiptById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImStockRequisitionMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImStockRequisitionMaterialServiceImpl.java new file mode 100644 index 0000000..4d0e078 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImStockRequisitionMaterialServiceImpl.java @@ -0,0 +1,171 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImStockRequisitionMaterialMapper; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterial; +import com.ruoyi.project.management.domain.ImStockRequisitionMaterialTwo; +import com.ruoyi.project.management.service.IImStockRequisitionMaterialService; + +/** + * 物料和物料出库单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-23 + */ +@Service +public class ImStockRequisitionMaterialServiceImpl implements IImStockRequisitionMaterialService +{ + @Autowired + private ImStockRequisitionMaterialMapper imStockRequisitionMaterialMapper; + + /** + * 查询物料和物料出库单关联 + * + * @param id 物料和物料出库单关联ID + * @return 物料和物料出库单关联 + */ + @Override + public ImStockRequisitionMaterial selectImStockRequisitionMaterialById(Long id) + { + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialById(id); + } + + /** + * 查询物料和物料出库单关联列表 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 物料和物料出库单关联 + */ + @Override + public List selectImStockRequisitionMaterialList(ImStockRequisitionMaterial imStockRequisitionMaterial) + { + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialList(imStockRequisitionMaterial); + } + + /** + * 新增物料和物料出库单关联 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 结果 + */ + @Override + public int insertImStockRequisitionMaterial(ImStockRequisitionMaterial imStockRequisitionMaterial) + { + imStockRequisitionMaterial.setCreateTime(DateUtils.getNowDate()); + return imStockRequisitionMaterialMapper.insertImStockRequisitionMaterial(imStockRequisitionMaterial); + } + + /** + * 修改物料和物料出库单关联 + * + * @param imStockRequisitionMaterial 物料和物料出库单关联 + * @return 结果 + */ + @Override + public int updateImStockRequisitionMaterial(ImStockRequisitionMaterial imStockRequisitionMaterial) + { + return imStockRequisitionMaterialMapper.updateImStockRequisitionMaterial(imStockRequisitionMaterial); + } + + /** + * 批量删除物料和物料出库单关联 + * + * @param ids 需要删除的物料和物料出库单关联ID + * @return 结果 + */ + @Override + public int deleteImStockRequisitionMaterialByIds(Long[] ids) + { + return imStockRequisitionMaterialMapper.deleteImStockRequisitionMaterialByIds(ids); + } + + /** + * 删除物料和物料出库单关联信息 + * + * @param id 物料和物料出库单关联ID + * @return 结果 + */ + @Override + public int deleteImStockRequisitionMaterialById(Long id) + { + return imStockRequisitionMaterialMapper.deleteImStockRequisitionMaterialById(id); + } + + @Override + public int insertImStockRequisitionMaterials(List lists) { + + return imStockRequisitionMaterialMapper.insertImStockRequisitionMaterials(lists); + } + + /** + * 根据code查询此物料下所有的物料 + * @param code + * @return + */ + @Override + public List selectImStockRequisitionMaterialByCode(String code) { + + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialByCode(code); + } + + @Override + public List selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber( + String productionCode, String name, String figureNumber) { + + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumber(productionCode,name,figureNumber); + } + + @Override + public int deleteImStockRequisitionMaterialByCode(String code) { + + return imStockRequisitionMaterialMapper.deleteImStockRequisitionMaterialByCode(code); + } + + @Override + public List selectImStockRequisitionMaterialByCodeAndFigureNumber(String productionCode,String figureNumber) { + // TODO Auto-generated method stub + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialByCodeAndFigureNumber(productionCode,figureNumber); + } + + @Override + public List selectImStockRequisitionMaterialListTwo( + ImStockRequisitionMaterial imStockRequisitionMaterial) { + // TODO Auto-generated method stub + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialListTwo(imStockRequisitionMaterial); + } + + @Override + public List selectImStockRequisitionMaterialBySparedThree(String productionCode,Long id) { + // TODO Auto-generated method stub + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialBySparedThree(productionCode,id); + } + + @Override + public List selectImStockRequisitionMaterialByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialByFigureNumberAndAllGB(); + } + + @Override + public List selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId( + String productionCode, String name, String figureNumber, Long id) { + // TODO Auto-generated method stub + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialByCodeAndNameAndFigureNumberAndId(productionCode,name,figureNumber,id); + } + + @Override + public List selectImStockRequisitionMaterialByNameAndFigureNumber(String materialName, + String figureNumber) { + // TODO Auto-generated method stub + return imStockRequisitionMaterialMapper.selectImStockRequisitionMaterialByNameAndFigureNumber(materialName,figureNumber); + } + + @Override + public List queryImStockRequisitionMaterialByNameAndFigureNumber(String name, String figureNumber, Date outdate){ + return imStockRequisitionMaterialMapper.queryImStockRequisitionMaterialByNameAndFigureNumber(name,figureNumber,outdate); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImStockRequisitionServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImStockRequisitionServiceImpl.java new file mode 100644 index 0000000..72ccc69 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImStockRequisitionServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImStockRequisitionMapper; +import com.ruoyi.project.management.domain.ImStockRequisition; +import com.ruoyi.project.management.service.IImStockRequisitionService; + +/** + * 领料单Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-23 + */ +@Service +public class ImStockRequisitionServiceImpl implements IImStockRequisitionService +{ + @Autowired + private ImStockRequisitionMapper imStockRequisitionMapper; + + /** + * 查询领料单 + * + * @param id 领料单ID + * @return 领料单 + */ + @Override + public ImStockRequisition selectImStockRequisitionById(Long id) + { + return imStockRequisitionMapper.selectImStockRequisitionById(id); + } + + /** + * 查询领料单列表 + * + * @param imStockRequisition 领料单 + * @return 领料单 + */ + @Override + public List selectImStockRequisitionList(ImStockRequisition imStockRequisition) + { + return imStockRequisitionMapper.selectImStockRequisitionList(imStockRequisition); + } + + /** + * 新增领料单 + * + * @param imStockRequisition 领料单 + * @return 结果 + */ + @Override + public int insertImStockRequisition(ImStockRequisition imStockRequisition) + { + imStockRequisition.setCreateTime(DateUtils.getNowDate()); + return imStockRequisitionMapper.insertImStockRequisition(imStockRequisition); + } + + /** + * 修改领料单 + * + * @param imStockRequisition 领料单 + * @return 结果 + */ + @Override + public int updateImStockRequisition(ImStockRequisition imStockRequisition) + { + return imStockRequisitionMapper.updateImStockRequisition(imStockRequisition); + } + + /** + * 批量删除领料单 + * + * @param ids 需要删除的领料单ID + * @return 结果 + */ + @Override + public int deleteImStockRequisitionByIds(Long[] ids) + { + return imStockRequisitionMapper.deleteImStockRequisitionByIds(ids); + } + + /** + * 删除领料单信息 + * + * @param id 领料单ID + * @return 结果 + */ + @Override + public int deleteImStockRequisitionById(Long id) + { + return imStockRequisitionMapper.deleteImStockRequisitionById(id); + } + + @Override + public ImStockRequisition selectImStockRequisitionByCode(String code) { + + return imStockRequisitionMapper.selectImStockRequisitionByCode(code); + } + + @Override + public ImStockRequisition selectImStockRequisitionByCodeAndTypeName(String code, String productName) { + // TODO Auto-generated method stub + return imStockRequisitionMapper.selectImStockRequisitionByCodeAndTypeName(code,productName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImSupplierServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImSupplierServiceImpl.java new file mode 100644 index 0000000..931a464 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImSupplierServiceImpl.java @@ -0,0 +1,106 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImSupplierMapper; +import com.ruoyi.project.management.domain.ImSupplier; +import com.ruoyi.project.management.service.IImSupplierService; + +/** + * 供应商Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImSupplierServiceImpl implements IImSupplierService +{ + @Autowired + private ImSupplierMapper imSupplierMapper; + + /** + * 查询供应商 + * + * @param id 供应商ID + * @return 供应商 + */ + @Override + public ImSupplier selectImSupplierById(Long id) + { + return imSupplierMapper.selectImSupplierById(id); + } + + /** + * 查询供应商列表 + * + * @param imSupplier 供应商 + * @return 供应商 + */ + @Override + public List selectImSupplierList(ImSupplier imSupplier) + { + return imSupplierMapper.selectImSupplierList(imSupplier); + } + + /** + * 新增供应商 + * + * @param imSupplier 供应商 + * @return 结果 + */ + @Override + public int insertImSupplier(ImSupplier imSupplier) + { + imSupplier.setCreateTime(DateUtils.getNowDate()); + return imSupplierMapper.insertImSupplier(imSupplier); + } + + /** + * 修改供应商 + * + * @param imSupplier 供应商 + * @return 结果 + */ + @Override + public int updateImSupplier(ImSupplier imSupplier) + { + return imSupplierMapper.updateImSupplier(imSupplier); + } + + /** + * 批量删除供应商 + * + * @param ids 需要删除的供应商ID + * @return 结果 + */ + @Override + public int deleteImSupplierByIds(Long[] ids) + { + return imSupplierMapper.deleteImSupplierByIds(ids); + } + + /** + * 删除供应商信息 + * + * @param id 供应商ID + * @return 结果 + */ + @Override + public int deleteImSupplierById(Long id) + { + return imSupplierMapper.deleteImSupplierById(id); + } + + @Override + public ImSupplier selectImSupplierByName(String sellerName) { + // TODO Auto-generated method stub + return imSupplierMapper.selectImSupplierByName(sellerName); + } + + @Override + public List getImSuppliers(){ + return imSupplierMapper.selectImSupplierList(null); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImSupplierTypeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImSupplierTypeServiceImpl.java new file mode 100644 index 0000000..4d77bf5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImSupplierTypeServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImSupplierTypeMapper; +import com.ruoyi.project.management.domain.ImSupplierType; +import com.ruoyi.project.management.service.IImSupplierTypeService; + +/** + * 供应商类型Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImSupplierTypeServiceImpl implements IImSupplierTypeService +{ + @Autowired + private ImSupplierTypeMapper imSupplierTypeMapper; + + /** + * 查询供应商类型 + * + * @param id 供应商类型ID + * @return 供应商类型 + */ + @Override + public ImSupplierType selectImSupplierTypeById(Long id) + { + return imSupplierTypeMapper.selectImSupplierTypeById(id); + } + + /** + * 查询供应商类型列表 + * + * @param imSupplierType 供应商类型 + * @return 供应商类型 + */ + @Override + public List selectImSupplierTypeList(ImSupplierType imSupplierType) + { + return imSupplierTypeMapper.selectImSupplierTypeList(imSupplierType); + } + + /** + * 新增供应商类型 + * + * @param imSupplierType 供应商类型 + * @return 结果 + */ + @Override + public int insertImSupplierType(ImSupplierType imSupplierType) + { + imSupplierType.setCreateTime(DateUtils.getNowDate()); + return imSupplierTypeMapper.insertImSupplierType(imSupplierType); + } + + /** + * 修改供应商类型 + * + * @param imSupplierType 供应商类型 + * @return 结果 + */ + @Override + public int updateImSupplierType(ImSupplierType imSupplierType) + { + return imSupplierTypeMapper.updateImSupplierType(imSupplierType); + } + + /** + * 批量删除供应商类型 + * + * @param ids 需要删除的供应商类型ID + * @return 结果 + */ + @Override + public int deleteImSupplierTypeByIds(Long[] ids) + { + return imSupplierTypeMapper.deleteImSupplierTypeByIds(ids); + } + + /** + * 删除供应商类型信息 + * + * @param id 供应商类型ID + * @return 结果 + */ + @Override + public int deleteImSupplierTypeById(Long id) + { + return imSupplierTypeMapper.deleteImSupplierTypeById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/ImWarehouseServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImWarehouseServiceImpl.java new file mode 100644 index 0000000..4cb98e5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/ImWarehouseServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.ImWarehouseMapper; +import com.ruoyi.project.management.domain.ImWarehouse; +import com.ruoyi.project.management.service.IImWarehouseService; + +/** + * 仓库Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-22 + */ +@Service +public class ImWarehouseServiceImpl implements IImWarehouseService +{ + @Autowired + private ImWarehouseMapper imWarehouseMapper; + + /** + * 查询仓库 + * + * @param id 仓库ID + * @return 仓库 + */ + @Override + public ImWarehouse selectImWarehouseById(Long id) + { + return imWarehouseMapper.selectImWarehouseById(id); + } + + /** + * 查询仓库列表 + * + * @param imWarehouse 仓库 + * @return 仓库 + */ + @Override + public List selectImWarehouseList(ImWarehouse imWarehouse) + { + return imWarehouseMapper.selectImWarehouseList(imWarehouse); + } + + /** + * 新增仓库 + * + * @param imWarehouse 仓库 + * @return 结果 + */ + @Override + public int insertImWarehouse(ImWarehouse imWarehouse) + { + imWarehouse.setCreateTime(DateUtils.getNowDate()); + return imWarehouseMapper.insertImWarehouse(imWarehouse); + } + + /** + * 修改仓库 + * + * @param imWarehouse 仓库 + * @return 结果 + */ + @Override + public int updateImWarehouse(ImWarehouse imWarehouse) + { + return imWarehouseMapper.updateImWarehouse(imWarehouse); + } + + /** + * 批量删除仓库 + * + * @param ids 需要删除的仓库ID + * @return 结果 + */ + @Override + public int deleteImWarehouseByIds(Long[] ids) + { + return imWarehouseMapper.deleteImWarehouseByIds(ids); + } + + /** + * 删除仓库信息 + * + * @param id 仓库ID + * @return 结果 + */ + @Override + public int deleteImWarehouseById(Long id) + { + return imWarehouseMapper.deleteImWarehouseById(id); + } + @Override + public ImWarehouse selectImWarehouseByName(String name){ + return imWarehouseMapper.selectImWarehouseByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomMateriallsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomMateriallsServiceImpl.java new file mode 100644 index 0000000..17796dc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomMateriallsServiceImpl.java @@ -0,0 +1,81 @@ +package com.ruoyi.project.management.service.impl; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.JDInvertoryVo; +import com.ruoyi.project.management.domain.JdBomRecord; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.mapper.JdBomRecordMapper; +import com.ruoyi.project.management.mapper.PwBomNumberTwoMapper; +import com.ruoyi.project.management.utils.BaseDataTool; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.JdBomMateriallsMapper; +import com.ruoyi.project.management.domain.JdBomMaterialls; +import com.ruoyi.project.management.service.IJdBomMateriallsService; +import javax.annotation.Resource; + +/** + * 金蝶BOM物料信息Service业务层处理 + * + * @author chenyongjiang + * @date 2024-05-17 + */ +@Service +public class JdBomMateriallsServiceImpl implements IJdBomMateriallsService +{ + @Resource + private JdBomMateriallsMapper jdBomMateriallsMapper; + @Resource + private JdBomRecordMapper jdBomRecordMapper; + @Resource + private PwBomNumberTwoMapper bomNumberTwoMapper; + + /** + * 查询金蝶BOM物料信息列表 + * + * @param jdBomMaterialls 金蝶BOM物料信息 + * @return 金蝶BOM物料信息 + */ + @Override + public List selectJdBomMateriallsList(JdBomMaterialls jdBomMaterialls) + { + //查询推送金蝶的生产执行单 + JdBomRecord jdBomRecord = new JdBomRecord(); + jdBomRecord.setStatus(Constants.AUDIT_STATUS_YSH); + jdBomRecord.setProductCode(jdBomMaterialls.getProductCode()); + List list = jdBomRecordMapper.selectJdBomRecordList(jdBomRecord); + List res_list = new ArrayList(); + JdBomMaterialls bomMaterialls = null; + for (JdBomRecord bomRecord : list) { + bomMaterialls = new JdBomMaterialls(); + bomMaterialls.setProductCode(bomRecord.getProductCode()); + bomMaterialls.setFigureNumber(bomRecord.getFigureNumber()); + bomMaterialls.setName(bomRecord.getProductName()); + //获取完工时间 + List lists = bomNumberTwoMapper.selectPwBomNumberTwoListForJd(bomRecord.getProductCode()); + bomMaterialls.setCompletiondate(lists.get(0).getCompletionDate()); + res_list.add(bomMaterialls); + } + return res_list; + } + + /** + * 新增金蝶BOM物料信息 + * + * @param jdBomMaterialls 金蝶BOM物料信息 + * @return 结果 + */ + @Override + public int insertJdBomMaterialls(JdBomMaterialls jdBomMaterialls) + { + jdBomMaterialls.setCreateTime(DateUtils.getNowDate()); + return jdBomMateriallsMapper.insertJdBomMaterialls(jdBomMaterialls); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomNumberServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomNumberServiceImpl.java new file mode 100644 index 0000000..e0a6e3a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomNumberServiceImpl.java @@ -0,0 +1,60 @@ +package com.ruoyi.project.management.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.project.management.domain.JdBomNumber; +import com.ruoyi.project.management.mapper.JdBomNumberMapper; +import com.ruoyi.project.management.service.IJdBomNumberService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 金蝶临时存储Service业务层处理 + * + * @author chenyongjiang + * @date 2024-03-14 + */ +@Service +public class JdBomNumberServiceImpl implements IJdBomNumberService +{ + @Autowired + private JdBomNumberMapper jdBomNumberMapper; + + /** + * 查询金蝶临时存储 + * + * @param code 金蝶临时存储ID + * @return 金蝶临时存储 + */ + @Override + public List selectJdBomNumberByCode(String code) + { + return jdBomNumberMapper.selectJdBomNumberByCode(code); + } + + /** + * 新增金蝶临时存储 + * + * @param list 金蝶临时存储 + * @return 结果 + */ + @Override + public int insertJdBomNumber(List list) + { + for (JdBomNumber bomNumber : list) { + bomNumber.setCreateTime(DateUtils.getNowDate()); + } + return jdBomNumberMapper.insertJdBomNumberBatch(list); + } + /** + * 查询金蝶临时存储序数据 + * + * @param code 执行单号 + * @return 金蝶临时存储 + */ + @Override + public List queryJdBomNumberByCode(String code){ + return jdBomNumberMapper.queryJdBomNumberByCode(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomRecordServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomRecordServiceImpl.java new file mode 100644 index 0000000..50572cf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdBomRecordServiceImpl.java @@ -0,0 +1,598 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.alibaba.fastjson.JSONObject; +import com.google.gson.Gson; +import com.kingdee.bos.webapi.entity.RepoRet; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpJDUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.mapper.*; +import com.ruoyi.project.management.service.IPwBomNumberService; +import com.ruoyi.project.management.utils.BaseDataTool; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.service.IJdBomRecordService; +import javax.annotation.Resource; + +/** + * 金蝶BOM记录Service业务层处理 + * + * @author chenyongjiang + * @date 2024-04-24 + */ +@Service +public class JdBomRecordServiceImpl implements IJdBomRecordService +{ + @Value("${ruoyi.jdInterFaceUrl}") + private String jdInterFaceUrl; + @Value("${ruoyi.jdSessionUrl}") + private String jdSessionUrl; + @Value("${ruoyi.jd_acctId}") + private String acctId; + @Resource + private JdBomRecordMapper jdBomRecordMapper; + @Resource + private JdProcessBomRecordMapper jdProcessBomRecordMapper; + @Resource + private JdProcessBomMapper jdProcessBomMapper; + @Resource + private PwMaterialParamsMapper pwMaterialParamsMapper; + @Resource + private PwBomNumberTwoMapper pwBomNumberTwoMapper; + @Resource + private JdBomMateriallsMapper jdBomMateriallsMapper; + @Autowired + private IPwBomNumberService pwBomNumberService; + + /** + * 查询金蝶BOM记录 + * + * @param id 金蝶BOM记录ID + * @return 金蝶BOM记录 + */ + @Override + public AjaxResult pushJdProcesses(Long id) + { + //判断工艺是否全部审核 + JdBomRecord jdBomRecord = jdBomRecordMapper.selectJdBomRecordById(id); + if(!Constants.AUDIT_STATUS_YSH.equals(jdBomRecord.getStatus())){ + return AjaxResult.error("请把工艺审核完再推送!!!"); + } + try{ + //根据记录ID查询推送的工艺 + List recordList = jdProcessBomRecordMapper.selectJdProcessBomRecordByRecordId(id); + //产生工艺的物料 + List gx_bom_list = null; + //获取金蝶物料信息 把金蝶没有的物料推送到金蝶 一级BOM + List material_list = BaseDataTool.queryMaterials(""); + //物料信息 + ImMaterial imMaterial = null; + //存储金蝶不一致的属性物料 + String warning_str = ""; + //判断有工序 + if(recordList != null && recordList.size() >0){ + List ids = new ArrayList(); + for(JdProcessBomRecord record : recordList){ + ids.add(record.getProcessId()); + } + gx_bom_list = jdProcessBomMapper.selectJdProcessBomList(ids,"已审核"); + //判断物料没有推送过且在金蝶不存在 ,推送金蝶 + for(int r=0;r gy_List = jdProcessBomMapper.queryJdProcessByPatentId(gx_bom_list.get(r).getId()); + //循环把每一个物料推送到金蝶 + for (int i=0;i one_bom_list = pwBomNumberService.selectPwBomNumberByCodeAndTypeName(jdBomRecord.getProductCode(),jdBomRecord.getFigureNumber()); + //判断是否为企标件 + if(one_bom_list.size() == 1){ + //判断是否有工艺 + if(gx_bom_list == null || gx_bom_list.size() == 0){ + return AjaxResult.error("请先填写工艺再推送!!!"); + } + } + //去一级bom的重复物料 + for (int i=0;i reslist =new ArrayList<>(); + //解析一级BOM转化为金蝶BOM + JdInterFace dto = null; + for(PwBomNumber pwBom : one_bom_list){ + //查找主BOM数据 + if(StringUtils.isEmpty(pwBom.getParentLevelFigureNumber())){ + dto = new JdInterFace(); + dto.setFName(pwBom.getProductionCode()); + dto.setFMaterialNumber(pwBom.getFigureNumber()); + dto.setFMaterialName(pwBom.getName()); + dto.setFMaterialGroup("非标"); + //物料属性 + dto.setFErpClsName(pwBom.getPurchaseMark()); + dto.setFGroupNumber(Constants.BOM_GROUP_ID); + dto.setFBaseUnitName(Constants.UNIT_NAME); + dto.setFDepName(Constants.JD_DEPT_NAME_ZP); + dto.setF_SVRI_Assistant(pwBom.getType()); + + //在解析图纸时没有工时,所以都设置为 0 + dto.setF_UCHN_BZGS("0.0"); + if(null == pwBom.getPieceWeight() || pwBom.getPieceWeight() == 0){ + dto.setF_UCHN_DZ("0.0"); + }else{ + dto.setF_UCHN_DZ(pwBom.getPieceWeight().toString()); + } + dto.setF_UCHN_SCDDH(scddh); + dto.setFTreeEntity(PwBomNumberRecursionSonList(dto.getFMaterialNumber(), one_bom_list)); + if(null != dto.getFTreeEntity() && dto.getFTreeEntity().size() > 0){ + reslist.add(dto); + } + PwBomNumberRecursionSonOrNumber(reslist,pwBom.getFigureNumber(),one_bom_list,scddh); + } + } + + //转化工序为金蝶工序 + if(gx_bom_list != null && gx_bom_list.size() > 0){ + for(int r=0;r gy_List = jdProcessBomMapper.queryJdProcessByPatentId(gx_bom_list.get(r).getId()); + //判断是否是整体委外 + if("1".equals(gx_bom_list.get(r).getFlag())){ + String figureNumber = gx_bom_list.get(r).getFigureNumber(); + String shux = gx_bom_list.get(r).getPurchaseMark(); + gx_bom_list.get(r).setFigureNumber(gy_List.get(1).getFigureNumber()); + gx_bom_list.get(r).setPurchaseMark(gy_List.get(1).getPurchaseMark()); + gy_List.get(1).setParentFigureNumber( gx_bom_list.get(r).getFigureNumber()); + gy_List.get(1).setFigureNumber(figureNumber); + gy_List.get(1).setPurchaseMark(shux); + if(gy_List.size() > 2){ + gy_List.get(2).setParentFigureNumber(figureNumber); + } + } + dto = new JdInterFace(); + dto.setFName(gx_bom_list.get(r).getProductCode()); + dto.setFMaterialNumber(gx_bom_list.get(r).getFigureNumber()); + dto.setFMaterialName(gx_bom_list.get(r).getProductName()); + dto.setFMaterialGroup("非标"); + dto.setFErpClsName(gx_bom_list.get(r).getPurchaseMark()); + dto.setFBaseUnitName(Constants.UNIT_NAME); + dto.setFDepName(Constants.JD_DEPT_NAME_JJ); + dto.setF_SVRI_Assistant(gx_bom_list.get(r).getMaterials()); + //工时 + if(gy_List != null && gy_List.size() > 0){ + dto.setF_UCHN_BZGS(gy_List.get(0).getXuTime() + ""); + }else{ + dto.setF_UCHN_BZGS("0.0"); + } + if (StringUtils.isEmpty(gx_bom_list.get(r).getWeight())) { + dto.setF_UCHN_DZ("0.0"); + } else { + dto.setF_UCHN_DZ(gx_bom_list.get(r).getWeight()); + } + dto.setF_UCHN_SCDDH(scddh); + dto.setFGroupNumber(Constants.BOM_GROUP_ID); + dto.setFTreeEntity(recursionSonList(dto.getFMaterialNumber(), gy_List)); + reslist.add(dto); + recursionSonOrNumber(reslist, gx_bom_list.get(r).getFigureNumber(), gy_List, scddh); + } + } + //获取金蝶的sessionId + String jd_param = "{\"acctID\": \""+acctId+"\",\"Username\": \"Administrator\",\"appId\": \"270187_01dPwbFu0NmW2YVp1fSLSc/uziwb4qks\",\"appSecret\": \"2cc5b5308fb044cfaa89bdd73964d59f\", \"lcid\": 2052}"; + String RES = HttpJDUtils.sendPost(jdSessionUrl,jd_param); + JSONObject object = JSONObject.parseObject(RES); + if(!"1".equals(object.getString("LoginResultType"))){ + return AjaxResult.error("单点登录错误!!!"); + } + String sessionId = object.getString("KDSVCSessionId"); + //组装BOM + Gson gson = new Gson(); + String bomJson = "{\"JsonParam\": {\"BOMDatas\": "+ gson.toJson(reslist)+"}}"; + //调用金蝶接口 + String res_str = HttpJDUtils.sendJDPost(jdInterFaceUrl,bomJson,sessionId); + if(res_str.indexOf("InnerExWrapper") != -1){ + return AjaxResult.error("BOM推送金蝶错误!!!"); + } + RepoRet repoRet = gson.fromJson(res_str, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + //修改工艺的推送状态 + if(gx_bom_list != null && gx_bom_list.size() > 0){ + for (JdProcessBom jdProcessBom : gx_bom_list) { + jdProcessBom.setPushStatus(Constants.PUSH_STATUS_YTS); + jdProcessBomMapper.updateJdProcessBom(jdProcessBom); + } + } + //修改记录信息 + jdBomRecord.setJdCode(scddh); + jdBomRecord.setDelFlag("1"); + jdBomRecordMapper.updateJdBomRecord(jdBomRecord); + return AjaxResult.success(); + }else{ + return AjaxResult.error(res_str); + } + }catch (Exception e){ + e.printStackTrace(); + } + return AjaxResult.error(); + } + + /** + * 留档 + * @param record_list //留档工艺 + * @param code 执行单号 + */ + private void insertBomMaterial(List record_list,String code){ + //整体BOM信息留档 + JdBomMaterialls jdBomMaterialls = null; + //根据生产令号查询一级BOM + List bomTwo_list = pwBomNumberTwoMapper.selectPwBomNumberTwoListForJd(code); + //一级BOM留档 + for (PwBomNumberTwo pwBomNumberTwo : bomTwo_list) { + jdBomMaterialls = new JdBomMaterialls(); + jdBomMaterialls.setCompletiondate(pwBomNumberTwo.getCompletionDate()); + jdBomMaterialls.setName(pwBomNumberTwo.getName()); + jdBomMaterialls.setProductCode(pwBomNumberTwo.getProductionCode()); + jdBomMaterialls.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + jdBomMaterialls.setParentFigureNumber(pwBomNumberTwo.getParentLevelFigureNumber()); + jdBomMaterialls.setParentName(pwBomNumberTwo.getParentLevelName()); + jdBomMaterialls.setNumber(pwBomNumberTwo.getSumNumber()); + jdBomMateriallsMapper.insertJdBomMaterialls(jdBomMaterialls); + //工艺留档 + for (JdProcessBom jdProcessBom : record_list) { + if(!jdProcessBom.getFigureNumber().equals(pwBomNumberTwo.getFigureNumber()) && jdProcessBom.getFigureNumber().indexOf(pwBomNumberTwo.getFigureNumber()) != -1){ + jdBomMaterialls = new JdBomMaterialls(); + jdBomMaterialls.setCompletiondate(pwBomNumberTwo.getCompletionDate()); + jdBomMaterialls.setName(jdProcessBom.getProductName()); + jdBomMaterialls.setProductCode(pwBomNumberTwo.getProductionCode()); + jdBomMaterialls.setFigureNumber(jdProcessBom.getFigureNumber()); + jdBomMaterialls.setParentFigureNumber(jdProcessBom.getParentFigureNumber()); + jdBomMaterialls.setParentName(jdProcessBom.getParentProductName()); + jdBomMaterialls.setNumber(pwBomNumberTwo.getSumNumber()); + jdBomMateriallsMapper.insertJdBomMaterialls(jdBomMaterialls); + } + } + } + } + + /** + * 递归查询子项集合 + * @param reslist + * @param number + * @param list + * @param orderNumber + */ + private void recursionSonOrNumber(List reslist,String number,List list,String orderNumber){ + JdInterFace dto = null; + for (JdProcessBom jdProcessBom : list) { + if(number.equals(jdProcessBom.getParentFigureNumber())){ + dto = new JdInterFace(); + dto.setFName(jdProcessBom.getProductCode()); + dto.setFMaterialNumber(jdProcessBom.getFigureNumber()); + dto.setFMaterialName(jdProcessBom.getProductName()); + //dto.setFMaterialGroup(Constants.MATERIAL_GROUP_ID); + dto.setFMaterialGroup("非标"); + dto.setFErpClsName(jdProcessBom.getPurchaseMark()); + dto.setFBaseUnitName(Constants.UNIT_NAME); + dto.setFDepName(Constants.JD_DEPT_NAME_JJ); + dto.setFGroupNumber(Constants.BOM_GROUP_ID); + dto.setF_SVRI_Assistant(jdProcessBom.getMaterials()); + dto.setF_UCHN_BZGS(jdProcessBom.getXuTime()+""); + if(StringUtils.isEmpty(jdProcessBom.getWeight())){ + dto.setF_UCHN_DZ("0.0"); + }else{ + dto.setF_UCHN_DZ(jdProcessBom.getWeight()); + } + dto.setF_UCHN_SCDDH(orderNumber); + dto.setFTreeEntity(recursionSonList(dto.getFMaterialNumber(), list)); + if(null != dto.getFTreeEntity() && dto.getFTreeEntity().size() > 0){ + reslist.add(dto); + recursionSonOrNumber(reslist,jdProcessBom.getFigureNumber(),list,orderNumber); + } + } + } + } + + /** + * 金蝶BOM 的子项集合 + * @param number + * @param list + * @return + */ + private List recursionSonList(String number,List list){ + List res = new ArrayList(); + JdInterFaceDto dto = null; + for (JdProcessBom jdProcessBom : list) { + if(number.equals(jdProcessBom.getParentFigureNumber())){ + dto = new JdInterFaceDto(); + if(StringUtils.isEmpty(jdProcessBom.getMaterials())){ + dto.setF_SVRI_Assistant(""); + }else{ + dto.setF_SVRI_Assistant(jdProcessBom.getMaterials()); + } + dto.setF_SVRI_Assistant(jdProcessBom.getMaterials()); + dto.setFBaseUnitName(Constants.UNIT_NAME); + dto.setFErpClsName(jdProcessBom.getPurchaseMark()); + dto.setFMaterialName(jdProcessBom.getProductName()); + dto.setFMaterialNumber(jdProcessBom.getFigureNumber()); + //dto.setFMaterialGroup(Constants.MATERIAL_GROUP_ID); + dto.setFMaterialGroup("非标"); + //原材料算量 + if(jdProcessBom.getRemarks() != null && Constants.CATEGORY_YCL.equals(jdProcessBom.getRemarks())){ + if(jdProcessBom.getWeight().indexOf("/") != -1){ + dto.setFNUMERATOR("1"); + String[] arr = jdProcessBom.getWeight().split("/"); + dto.setFDENOMINATOR((Integer.valueOf(arr[0])*Integer.valueOf(arr[1]))+""); + }else{ + dto.setFNUMERATOR(jdProcessBom.getWeight()); + dto.setFDENOMINATOR("1"); + } + }else{ + dto.setFNUMERATOR("1"); + dto.setFDENOMINATOR("1"); + } + if(StringUtils.isEmpty(jdProcessBom.getWeight()) || jdProcessBom.getWeight().indexOf("/") != -1){ + dto.setF_UCHN_DZ("0.0"); + }else{ + dto.setF_UCHN_DZ(jdProcessBom.getWeight()); + } + dto.setF_UCHN_BZGS(jdProcessBom.getXuTime()+""); + res.add(dto); + } + } + return res; + } + + /** + * 查询金蝶BOM记录列表 + * + * @param jdBomRecord 金蝶BOM记录 + * @return 金蝶BOM记录 + */ + @Override + public List selectJdBomRecordList(JdBomRecord jdBomRecord) + { + List res_list = jdBomRecordMapper.selectJdBomRecordList(jdBomRecord); + return res_list; + } + @Override + public int updateJdBomRecord(JdBomRecord jdBomRecord){ + return jdBomRecordMapper.updateJdBomRecord(jdBomRecord); + } + + /** + * 新增金蝶BOM记录 + * + * @param jdBomRecord 金蝶BOM记录 + * @return 结果 + */ + @Override + public int insertJdBomRecord(JdBomRecord jdBomRecord) + { + jdBomRecord.setCreateTime(DateUtils.getNowDate()); + return jdBomRecordMapper.insertJdBomRecord(jdBomRecord); + } + + @Override + public List selectJdBomRecordByCode(String productCode){ + return jdBomRecordMapper.selectJdBomRecordByCode(productCode); + } + /** + * 获取金蝶的参数标识 + * @param name + * @return + */ + private String analysisParams(String name){ + if(StringUtils.isEmpty(name)){ + return ""; + } + //获取金蝶物料参数 + List paramList = pwMaterialParamsMapper.selectPwMaterialParamsList(null); + for (PwMaterialParams pwMaterialParams : paramList) { + if(name.equals(pwMaterialParams.getParamName())){ + return pwMaterialParams.getParamValue(); + } + } + return null; + } + + /** + * 打完成标识 + * + * @param id 金蝶BOM记录 + * @return 结果 + */ + @Override + public int updateJdBomRecordById(Long id){ + return jdBomRecordMapper.updateJdBomRecordById(id); + } + + private List PwBomNumberRecursionSonList(String number,List list){ + List rzlist = new ArrayList(); + JdInterFaceDto dto = null; + for(int p=0;p reslist,String number,List list,String orderNumber){ + JdInterFace dto = null; + for(int p=0;p 0){ + reslist.add(dto); + PwBomNumberRecursionSonOrNumber(reslist,list.get(p).getFigureNumber(),list,orderNumber); + } + } + } + } + + private void exchangeAndDelete(PwBomNumber pwBomNumber,List bom_list){ + //判断去掉此物料下的子物料 + for(int i=0;i selectJdCurrencyList(JdCurrency jdCurrency) { + return jdCurrencyMapper.selectJdCurrencyList(jdCurrency); + } + + /** + * 新增币别 + * + * @param jdCurrency 币别 + * @return 结果 + */ + @Override + public int insertJdCurrency(JdCurrency jdCurrency) { + return jdCurrencyMapper.insertJdCurrency(jdCurrency); + } + + /** + * 修改币别 + * + * @param jdCurrency 币别 + * @return 结果 + */ + @Override + public int updateJdCurrency(JdCurrency jdCurrency) { + return jdCurrencyMapper.updateJdCurrency(jdCurrency); + } + + /** + * 批量删除币别 + * + * @param ids 需要删除的币别ID + * @return 结果 + */ + @Override + public int deleteJdCurrencyByIds(Long[] ids) { + return jdCurrencyMapper.deleteJdCurrencyByIds(ids); + } + + /** + * 删除币别信息 + * + * @param id 币别ID + * @return 结果 + */ + @Override + public int deleteJdCurrencyById(Long id) { + return jdCurrencyMapper.deleteJdCurrencyById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/JdExpenseItemsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdExpenseItemsServiceImpl.java new file mode 100644 index 0000000..75dcc5c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdExpenseItemsServiceImpl.java @@ -0,0 +1,89 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; + +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.JdExpenseItemsMapper; +import com.ruoyi.project.management.domain.JdExpenseItems; +import com.ruoyi.project.management.service.IJdExpenseItemsService; + +/** + * 费用项目Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-16 + */ +@Service +public class JdExpenseItemsServiceImpl implements IJdExpenseItemsService { + @Autowired + private JdExpenseItemsMapper jdExpenseItemsMapper; + + /** + * 查询费用项目 + * + * @param id 费用项目ID + * @return 费用项目 + */ + @Override + public JdExpenseItems selectJdExpenseItemsById(Long id) { + return jdExpenseItemsMapper.selectJdExpenseItemsById(id); + } + + /** + * 查询费用项目列表 + * + * @param jdExpenseItems 费用项目 + * @return 费用项目 + */ + @Override + public List selectJdExpenseItemsList(JdExpenseItems jdExpenseItems) { + return jdExpenseItemsMapper.selectJdExpenseItemsList(jdExpenseItems); + } + + /** + * 新增费用项目 + * + * @param jdExpenseItems 费用项目 + * @return 结果 + */ + @Override + public int insertJdExpenseItems(JdExpenseItems jdExpenseItems) { + jdExpenseItems.setCreateTime(DateUtils.getNowDate()); + return jdExpenseItemsMapper.insertJdExpenseItems(jdExpenseItems); + } + + /** + * 修改费用项目 + * + * @param jdExpenseItems 费用项目 + * @return 结果 + */ + @Override + public int updateJdExpenseItems(JdExpenseItems jdExpenseItems) { + return jdExpenseItemsMapper.updateJdExpenseItems(jdExpenseItems); + } + + /** + * 批量删除费用项目 + * + * @param ids 需要删除的费用项目ID + * @return 结果 + */ + @Override + public int deleteJdExpenseItemsByIds(Long[] ids) { + return jdExpenseItemsMapper.deleteJdExpenseItemsByIds(ids); + } + + /** + * 删除费用项目信息 + * + * @param id 费用项目ID + * @return 结果 + */ + @Override + public int deleteJdExpenseItemsById(Long id) { + return jdExpenseItemsMapper.deleteJdExpenseItemsById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/JdProcessBomRecordServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdProcessBomRecordServiceImpl.java new file mode 100644 index 0000000..1143fd6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdProcessBomRecordServiceImpl.java @@ -0,0 +1,19 @@ +package com.ruoyi.project.management.service.impl; + +import com.ruoyi.project.management.domain.JdProcessBomRecord; +import com.ruoyi.project.management.mapper.JdProcessBomRecordMapper; +import com.ruoyi.project.management.service.IJdProcessBomRecordService; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; + +@Service +public class JdProcessBomRecordServiceImpl implements IJdProcessBomRecordService { + + @Resource + private JdProcessBomRecordMapper jdProcessBomRecordMapper; + + @Override + public int insertJdProcessBomAndRecord(JdProcessBomRecord jdProcessBomRecord){ + return jdProcessBomRecordMapper.insertJdProcessBomAndRecord(jdProcessBomRecord); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/JdProcessBomServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdProcessBomServiceImpl.java new file mode 100644 index 0000000..76b9303 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdProcessBomServiceImpl.java @@ -0,0 +1,197 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.JdBomRecord; +import com.ruoyi.project.management.domain.JdProcessBomRecord; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.mapper.JdBomRecordMapper; +import com.ruoyi.project.management.mapper.JdProcessBomRecordMapper; +import com.ruoyi.project.management.mapper.PwBomNumberTwoMapper; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.JdProcessBomMapper; +import com.ruoyi.project.management.domain.JdProcessBom; +import com.ruoyi.project.management.service.IJdProcessBomService; +import javax.annotation.Resource; + +/** + * 金蝶工序BOM记录Service业务层处理 + * + * @author chenyongjiang + * @date 2024-05-07 + */ +@Service +public class JdProcessBomServiceImpl implements IJdProcessBomService +{ + @Resource + private JdProcessBomMapper jdProcessBomMapper; + @Resource + private JdProcessBomRecordMapper jdProcessBomRecordMapper; + @Resource + private JdBomRecordMapper jdBomRecordMapper; + @Resource + private PwBomNumberTwoMapper pwBomNumberTwoMapper; + + + /** + * 查询金蝶工序BOM记录 + * + * @param id 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + @Override + public JdProcessBom selectJdProcessBomById(Long id) + { + return jdProcessBomMapper.selectJdProcessBomById(id); + } + + /** + * 查询金蝶工序BOM记录列表 + * + * @param jdProcessBom 金蝶工序BOM记录 + * @return 金蝶工序BOM记录 + */ + @Override + public List selectJdProcessBomList(JdProcessBom jdProcessBom) + { + //查找关联表,获取相关的ID + List list = jdProcessBomRecordMapper.selectJdProcessBomRecordByRecordId(jdProcessBom.getRecordId()); + List ids = new ArrayList(); + for(JdProcessBomRecord record : list){ + ids.add(record.getProcessId()); + } + if(null == ids || ids.size() == 0){ + return new ArrayList(); + } + List bom_list = jdProcessBomMapper.selectJdProcessBomList(ids,jdProcessBom.getStatus()); + //查询工艺 + for(JdProcessBom JdProcess : bom_list){ + //读取ERP物料 + PwBomNumberTwo pwTwo = pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndFigureNumber(JdProcess.getProductCode(),JdProcess.getFigureNumber()); + //获取ERP工序 + List pwTwo_list = pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndSuperiorId(pwTwo.getProductionCode(),pwTwo.getId()); + List children = jdProcessBomMapper.queryJdProcessByPatentId(JdProcess.getId()); + //金蝶工序中添加ERP工序 + JdProcessBom processBom = null; + for(int i=0;i pr_list = jdProcessBomRecordMapper.selectJdProcessBomRecordByRecordId(jdProcessBomRecord.getRecordId()); + List ids = new ArrayList(); + for(JdProcessBomRecord record : pr_list){ + ids.add(record.getProcessId()); + } + List process_list = jdProcessBomMapper.selectJdProcessBomList(ids,null); + //未审核成为0,有一条审核+1 + int p = 0; + for (JdProcessBom processBom : process_list) { + if(Constants.AUDIT_STATUS_YSH.equals(processBom.getStatus())){ + p += 1; + } + } + //修改记录的审核状态 + JdBomRecord jdBomRecord = new JdBomRecord(); + jdBomRecord.setId(jdProcessBomRecord.getRecordId()); + if(p == process_list.size()){ //全部审核 + jdBomRecord.setStatus(Constants.AUDIT_STATUS_YSH); + }else { + jdBomRecord.setStatus(Constants.AUDIT_STATUS_SHZ); + } + i = jdBomRecordMapper.updateJdBomRecord(jdBomRecord); + if(i < 1){ + return 0; + } + return 1; + } + + /** + * 修改金蝶工序BOM记录 + * + * @param jdProcessBom 金蝶工序BOM记录 + * @return 结果 + */ + @Override + public int updateJdProcessBom(JdProcessBom jdProcessBom) + { + return jdProcessBomMapper.updateJdProcessBom(jdProcessBom); + } + /** + * 查询金蝶工序BOM记录 + * + * @param figureNumber 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + @Override + public JdProcessBom selectJdProcessBomByFigurenumber(String figureNumber){ + return jdProcessBomMapper.selectJdProcessBomByFigurenumber(figureNumber); + } + + /** + * 根据id删除数据 + * @param id + * @return + */ + @Override + public int deleteJdProcessBomById(Long id){ + return jdProcessBomMapper.deleteJdProcessBomById(id); + } + + /** + * 根据生产令号查询所有工艺物料 + * + * @param productCode 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + @Override + public List queryJdProcessByProductCode(String productCode){ + return jdProcessBomMapper.queryJdProcessByProductCode(productCode); + } + + /** + * 根据父级图号模糊查询所有工艺 + * + * @param figureNumber 金蝶工序BOM记录ID + * @return 金蝶工序BOM记录 + */ + @Override + public List queryJdProcessByFigurenumber(String figureNumber){ + return jdProcessBomMapper.queryJdProcessByFigurenumber(figureNumber); + } + @Override + public List queryJdProcessByPatentId(Long parentId){ + return jdProcessBomMapper.queryJdProcessByPatentId(parentId); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/JdReceiptsDataInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdReceiptsDataInfoServiceImpl.java new file mode 100644 index 0000000..d84e767 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/JdReceiptsDataInfoServiceImpl.java @@ -0,0 +1,1367 @@ +package com.ruoyi.project.management.service.impl; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.framework.web.domain.AjaxResult; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.project.management.mapper.CwExpenseReimbursementMapper; +import com.ruoyi.project.management.mapper.CwLogisticsFeesInfoMapper; +import com.ruoyi.project.management.mapper.CwNonbusinessIncomeMapper; +import com.ruoyi.project.management.mapper.CwOtherPaymentMapper; +import com.ruoyi.project.management.mapper.JdReceiptsDataInfoMapper; +import com.ruoyi.project.management.mapper.PwBuyingRequisitionMapper; +import com.ruoyi.project.management.mapper.PwBuyingRequisitionTwoMapper; +import com.ruoyi.project.management.mapper.PwContractMapper; +import com.ruoyi.project.management.mapper.PwCuttingToolPurchaseMapper; +import com.ruoyi.project.management.mapper.PwOutsourceContractMapper; +import com.ruoyi.project.management.mapper.PwPredictPurchaseMapper; +import com.ruoyi.project.management.mapper.PwPurchaseContractMapper; +import com.ruoyi.project.management.domain.CwExpenseReimbursement; +import com.ruoyi.project.management.domain.CwLogisticsFeesInfo; +import com.ruoyi.project.management.domain.CwNonbusinessIncome; +import com.ruoyi.project.management.domain.CwOtherPayment; +import com.ruoyi.project.management.domain.CwOtherPaymentInfo; +import com.ruoyi.project.management.domain.JdReceiptsDataInfo; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.domain.PwBuyingRequisitionTwo; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; +import com.ruoyi.project.management.domain.PwOutsourceContract; +import com.ruoyi.project.management.domain.PwPredictPurchase; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.service.ICwOtherPaymentInfoService; +import com.ruoyi.project.management.service.IJdReceiptsDataInfoService; + +/** + * 财务系统数据信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-11-27 + */ +@Service +public class JdReceiptsDataInfoServiceImpl implements IJdReceiptsDataInfoService +{ + @Autowired + private JdReceiptsDataInfoMapper jdReceiptsDataInfoMapper; + //销售合同信息 + @Autowired + private PwContractMapper pwContractMapper; + //外购件采购合同信息 + @Autowired + private PwPurchaseContractMapper pwPurchaseContractMapper; + //请购单合同信息 + @Autowired + private PwBuyingRequisitionTwoMapper pwBuyingRequisitionTwoMapper; + //预采件采购合同信息 + @Autowired + private PwPredictPurchaseMapper pwPredictPurchaseMapper; + //工量具采购合同信息 + @Autowired + private PwCuttingToolPurchaseMapper pwCuttingToolPurchaseMapper; + //原材料采购合同信息 + @Autowired + private PwBuyingRequisitionMapper pwBuyingRequisitionMapper; + //委外合同信息 + @Autowired + private PwOutsourceContractMapper pwOutsourceContractMapper; + //费用报销信息 + @Autowired + private CwExpenseReimbursementMapper cwExpenseReimbursementMapper; + //物流费用信息 + @Autowired + private CwLogisticsFeesInfoMapper cwLogisticsFeesInfoMapper; + //营业外收入信息 + @Autowired + private CwNonbusinessIncomeMapper cwNonbusinessIncomeMapper; + //其他付款申请单信息 + @Autowired + private CwOtherPaymentMapper cwOtherPaymentMapper; + //付款申请单明细信息 + @Autowired + private ICwOtherPaymentInfoService cwOtherPaymentInfoService; + + /** + * 查询财务系统数据信息 + * + * @param id 财务系统数据信息ID + * @return 财务系统数据信息 + */ + @Override + public JdReceiptsDataInfo selectJdReceiptsDataInfoById(Long id) + { + return jdReceiptsDataInfoMapper.selectJdReceiptsDataInfoById(id); + } + + /** + * 查询财务系统数据信息列表 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 财务系统数据信息 + */ + @Override + public List selectJdReceiptsDataInfoList(JdReceiptsDataInfo jdReceiptsDataInfo) + { + return jdReceiptsDataInfoMapper.selectJdReceiptsDataInfoList(jdReceiptsDataInfo); + } + + /** + * 新增财务系统数据信息 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 结果 + */ + @Override + @Transactional + public int insertJdReceiptsDataInfo(JdReceiptsDataInfo jdReceiptsDataInfo){ + jdReceiptsDataInfo.setCreateTime(DateUtils.getNowDate()); + int i = jdReceiptsDataInfoMapper.insertJdReceiptsDataInfo(jdReceiptsDataInfo); + if(i>0){ + //添加数据后根据单据的类型做后续处理 + if("销售合同".equals(jdReceiptsDataInfo.getType())){ + //查询销售合同信息 + PwContract contract = pwContractMapper.selectByContractCode(jdReceiptsDataInfo.getContractCode()); + if(null==contract){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==contract.getProceedsAmount()){ + contract.setProceedsAmount(new BigDecimal("0.0")); + } + //增加收款金额 + contract.setProceedsAmount(contract.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未收款金额减少(合同金额-已收款金额) + if(null==contract.getMoney()){ + contract.setMoney(0.0); + } + //计算未收款金额 (合同额 - 已收款额 = 未收款额) + if(contract.getMoney() - contract.getProceedsAmount().doubleValue()>0){ + contract.setNotProceedsAmount(new BigDecimal(contract.getMoney()).subtract(contract.getProceedsAmount())); + }else{ + contract.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + contract.setSettlementRatio(contract.getProceedsAmount().divide(new BigDecimal(contract.getMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==contract.getInvoiceAmount()){ + contract.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + contract.setInvoiceAmount(contract.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + if(null==contract.getMoney()){ + contract.setMoney(0.0); + } + //计算未开票金额 + if(contract.getMoney() - contract.getInvoiceAmount().doubleValue()>0){ + contract.setNotProceedsAmount(new BigDecimal(contract.getMoney()).subtract(contract.getInvoiceAmount())); + }else{ + contract.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额减少 + if(null==contract.getProceedsAmount()){ + contract.setProceedsAmount(new BigDecimal("0.0")); + } + //减少收款金额 + contract.setProceedsAmount(contract.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未收款金额增加(合同额-已收款金额) + if(null==contract.getMoney()){ + contract.setMoney(0.0); + } + //计算未收款金额 (合同额 - 已收款额 = 未收款额) + if(contract.getMoney() - contract.getProceedsAmount().doubleValue()>0){ + contract.setNotProceedsAmount(new BigDecimal(contract.getMoney()).subtract(contract.getProceedsAmount())); + }else{ + contract.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + contract.setSettlementRatio(contract.getProceedsAmount().divide(new BigDecimal(contract.getMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==contract.getInvoiceAmount()){ + contract.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + contract.setInvoiceAmount(contract.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + if(null==contract.getMoney()){ + contract.setMoney(0.0); + } + //计算未开票金额 + if(contract.getMoney() - contract.getInvoiceAmount().doubleValue()>0){ + contract.setNotProceedsAmount(new BigDecimal(contract.getMoney()).subtract(contract.getInvoiceAmount())); + }else{ + contract.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + //修改 + pwContractMapper.updatePwContract(contract); + }else{ + return 6004; + } + } + }else if("外购件采购合同".equals(jdReceiptsDataInfo.getType())){ + //查询外购件采购合同信息 + PwPurchaseContract purchaseContract = pwPurchaseContractMapper.selectPwPurchaseContractByCode(jdReceiptsDataInfo.getContractCode()); + if(null==purchaseContract){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==purchaseContract.getProceedsAmount()){ + purchaseContract.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + purchaseContract.setProceedsAmount(purchaseContract.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(purchaseContract.getTotalPrices() - purchaseContract.getProceedsAmount().doubleValue()>0){ + purchaseContract.setNotProceedsAmount(new BigDecimal(purchaseContract.getTotalPrices()).subtract(purchaseContract.getProceedsAmount())); + }else{ + purchaseContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + purchaseContract.setSettlementRatio(purchaseContract.getProceedsAmount().divide(new BigDecimal(purchaseContract.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==purchaseContract.getInvoiceAmount()){ + purchaseContract.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + purchaseContract.setInvoiceAmount(purchaseContract.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(purchaseContract.getTotalPrices() - purchaseContract.getInvoiceAmount().doubleValue()>0){ + purchaseContract.setNotProceedsAmount(new BigDecimal(purchaseContract.getTotalPrices()).subtract(purchaseContract.getInvoiceAmount())); + }else{ + purchaseContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==purchaseContract.getProceedsAmount()){ + purchaseContract.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + purchaseContract.setProceedsAmount(purchaseContract.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(purchaseContract.getTotalPrices() - purchaseContract.getProceedsAmount().doubleValue()>0){ + purchaseContract.setNotProceedsAmount(new BigDecimal(purchaseContract.getTotalPrices()).subtract(purchaseContract.getProceedsAmount())); + }else{ + purchaseContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + purchaseContract.setSettlementRatio(purchaseContract.getProceedsAmount().divide(new BigDecimal(purchaseContract.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==purchaseContract.getInvoiceAmount()){ + purchaseContract.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + purchaseContract.setInvoiceAmount(purchaseContract.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(purchaseContract.getTotalPrices() - purchaseContract.getInvoiceAmount().doubleValue()>0){ + purchaseContract.setNotProceedsAmount(new BigDecimal(purchaseContract.getTotalPrices()).subtract(purchaseContract.getInvoiceAmount())); + }else{ + purchaseContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + pwPurchaseContractMapper.updatePwPurchaseContract(purchaseContract); + } + + }else if("原材料采购合同".equals(jdReceiptsDataInfo.getType())){ + //查询原材料采购合同信息 + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionMapper.selectPwBuyingRequisitionByCode(jdReceiptsDataInfo.getContractCode()); + if(null==buyingRequisition){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==buyingRequisition.getProceedsAmount()){ + buyingRequisition.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + buyingRequisition.setProceedsAmount(buyingRequisition.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(buyingRequisition.getTotalPrices() - buyingRequisition.getProceedsAmount().doubleValue()>0){ + buyingRequisition.setNotProceedsAmount(new BigDecimal(buyingRequisition.getTotalPrices()).subtract(buyingRequisition.getProceedsAmount())); + }else{ + buyingRequisition.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + buyingRequisition.setSettlementRatio(buyingRequisition.getProceedsAmount().divide(new BigDecimal(buyingRequisition.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==buyingRequisition.getInvoiceAmount()){ + buyingRequisition.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + buyingRequisition.setInvoiceAmount(buyingRequisition.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(buyingRequisition.getTotalPrices() - buyingRequisition.getInvoiceAmount().doubleValue()>0){ + buyingRequisition.setNotProceedsAmount(new BigDecimal(buyingRequisition.getTotalPrices()).subtract(buyingRequisition.getInvoiceAmount())); + }else{ + buyingRequisition.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==buyingRequisition.getProceedsAmount()){ + buyingRequisition.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + buyingRequisition.setProceedsAmount(buyingRequisition.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(buyingRequisition.getTotalPrices() - buyingRequisition.getProceedsAmount().doubleValue()>0){ + buyingRequisition.setNotProceedsAmount(new BigDecimal(buyingRequisition.getTotalPrices()).subtract(buyingRequisition.getProceedsAmount())); + }else{ + buyingRequisition.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + buyingRequisition.setSettlementRatio(buyingRequisition.getProceedsAmount().divide(new BigDecimal(buyingRequisition.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==buyingRequisition.getInvoiceAmount()){ + buyingRequisition.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + buyingRequisition.setInvoiceAmount(buyingRequisition.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(buyingRequisition.getTotalPrices() - buyingRequisition.getInvoiceAmount().doubleValue()>0){ + buyingRequisition.setNotProceedsAmount(new BigDecimal(buyingRequisition.getTotalPrices()).subtract(buyingRequisition.getInvoiceAmount())); + }else{ + buyingRequisition.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + + //修改 + pwBuyingRequisitionMapper.updatePwBuyingRequisition(buyingRequisition); + } + }else if("工量具采购合同".equals(jdReceiptsDataInfo.getType())){ + //查询工量具采购合同信息 + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseMapper.selectPwCuttingToolPurchaseByCode(jdReceiptsDataInfo.getContractCode()); + if(null==cuttingToolPurchase){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==cuttingToolPurchase.getProceedsAmount()){ + cuttingToolPurchase.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + cuttingToolPurchase.setProceedsAmount(cuttingToolPurchase.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(cuttingToolPurchase.getTotalPrices() - cuttingToolPurchase.getProceedsAmount().doubleValue()>0){ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal(cuttingToolPurchase.getTotalPrices()).subtract(cuttingToolPurchase.getProceedsAmount())); + }else{ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + cuttingToolPurchase.setSettlementRatio(cuttingToolPurchase.getProceedsAmount().divide(new BigDecimal(cuttingToolPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==cuttingToolPurchase.getInvoiceAmount()){ + cuttingToolPurchase.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + cuttingToolPurchase.setInvoiceAmount(cuttingToolPurchase.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(cuttingToolPurchase.getTotalPrices() - cuttingToolPurchase.getInvoiceAmount().doubleValue()>0){ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal(cuttingToolPurchase.getTotalPrices()).subtract(cuttingToolPurchase.getInvoiceAmount())); + }else{ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==cuttingToolPurchase.getProceedsAmount()){ + cuttingToolPurchase.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + cuttingToolPurchase.setProceedsAmount(cuttingToolPurchase.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(cuttingToolPurchase.getTotalPrices() - cuttingToolPurchase.getProceedsAmount().doubleValue()>0){ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal(cuttingToolPurchase.getTotalPrices()).subtract(cuttingToolPurchase.getProceedsAmount())); + }else{ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + cuttingToolPurchase.setSettlementRatio(cuttingToolPurchase.getProceedsAmount().divide(new BigDecimal(cuttingToolPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==cuttingToolPurchase.getInvoiceAmount()){ + cuttingToolPurchase.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + cuttingToolPurchase.setInvoiceAmount(cuttingToolPurchase.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(cuttingToolPurchase.getTotalPrices() - cuttingToolPurchase.getInvoiceAmount().doubleValue()>0){ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal(cuttingToolPurchase.getTotalPrices()).subtract(cuttingToolPurchase.getInvoiceAmount())); + }else{ + cuttingToolPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + pwCuttingToolPurchaseMapper.updatePwCuttingToolPurchase(cuttingToolPurchase); + } + }else if("预采件采购合同".equals(jdReceiptsDataInfo.getType())){ + //查询预采件采购合同信息 + PwPredictPurchase predictPurchase = pwPredictPurchaseMapper.selectPwPredictPurchaseByCode(jdReceiptsDataInfo.getContractCode()); + if(null==predictPurchase){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==predictPurchase.getProceedsAmount()){ + predictPurchase.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + predictPurchase.setProceedsAmount(predictPurchase.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(predictPurchase.getTotalPrices() - predictPurchase.getProceedsAmount().doubleValue()>0){ + predictPurchase.setNotProceedsAmount(new BigDecimal(predictPurchase.getTotalPrices()).subtract(predictPurchase.getProceedsAmount())); + }else{ + predictPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + predictPurchase.setSettlementRatio(predictPurchase.getProceedsAmount().divide(new BigDecimal(predictPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==predictPurchase.getInvoiceAmount()){ + predictPurchase.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + predictPurchase.setInvoiceAmount(predictPurchase.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(predictPurchase.getTotalPrices() - predictPurchase.getInvoiceAmount().doubleValue()>0){ + predictPurchase.setNotProceedsAmount(new BigDecimal(predictPurchase.getTotalPrices()).subtract(predictPurchase.getInvoiceAmount())); + }else{ + predictPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==predictPurchase.getProceedsAmount()){ + predictPurchase.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + predictPurchase.setProceedsAmount(predictPurchase.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(predictPurchase.getTotalPrices() - predictPurchase.getProceedsAmount().doubleValue()>0){ + predictPurchase.setNotProceedsAmount(new BigDecimal(predictPurchase.getTotalPrices()).subtract(predictPurchase.getProceedsAmount())); + }else{ + predictPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + predictPurchase.setSettlementRatio(predictPurchase.getProceedsAmount().divide(new BigDecimal(predictPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==predictPurchase.getInvoiceAmount()){ + predictPurchase.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + predictPurchase.setInvoiceAmount(predictPurchase.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(predictPurchase.getTotalPrices() - predictPurchase.getInvoiceAmount().doubleValue()>0){ + predictPurchase.setNotProceedsAmount(new BigDecimal(predictPurchase.getTotalPrices()).subtract(predictPurchase.getInvoiceAmount())); + }else{ + predictPurchase.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + pwPredictPurchaseMapper.updatePwPredictPurchase(predictPurchase); + } + }else if("请购单采购合同".equals(jdReceiptsDataInfo.getType())){ + //查询请购单采购合同信息 + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoMapper.selectPwBuyingRequisitionTwoByCode(jdReceiptsDataInfo.getContractCode()); + if(null==buyingRequisitionTwo){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==buyingRequisitionTwo.getProceedsAmount()){ + buyingRequisitionTwo.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + buyingRequisitionTwo.setProceedsAmount(buyingRequisitionTwo.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(buyingRequisitionTwo.getTotalPrices() - buyingRequisitionTwo.getProceedsAmount().doubleValue()>0){ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal(buyingRequisitionTwo.getTotalPrices()).subtract(buyingRequisitionTwo.getProceedsAmount())); + }else{ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + buyingRequisitionTwo.setSettlementRatio(buyingRequisitionTwo.getProceedsAmount().divide(new BigDecimal(buyingRequisitionTwo.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==buyingRequisitionTwo.getInvoiceAmount()){ + buyingRequisitionTwo.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + buyingRequisitionTwo.setInvoiceAmount(buyingRequisitionTwo.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(buyingRequisitionTwo.getTotalPrices() - buyingRequisitionTwo.getInvoiceAmount().doubleValue()>0){ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal(buyingRequisitionTwo.getTotalPrices()).subtract(buyingRequisitionTwo.getInvoiceAmount())); + }else{ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==buyingRequisitionTwo.getProceedsAmount()){ + buyingRequisitionTwo.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + buyingRequisitionTwo.setProceedsAmount(buyingRequisitionTwo.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(buyingRequisitionTwo.getTotalPrices() - buyingRequisitionTwo.getProceedsAmount().doubleValue()>0){ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal(buyingRequisitionTwo.getTotalPrices()).subtract(buyingRequisitionTwo.getProceedsAmount())); + }else{ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + buyingRequisitionTwo.setSettlementRatio(buyingRequisitionTwo.getProceedsAmount().divide(new BigDecimal(buyingRequisitionTwo.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==buyingRequisitionTwo.getInvoiceAmount()){ + buyingRequisitionTwo.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + buyingRequisitionTwo.setInvoiceAmount(buyingRequisitionTwo.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(buyingRequisitionTwo.getTotalPrices() - buyingRequisitionTwo.getInvoiceAmount().doubleValue()>0){ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal(buyingRequisitionTwo.getTotalPrices()).subtract(buyingRequisitionTwo.getInvoiceAmount())); + }else{ + buyingRequisitionTwo.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + pwBuyingRequisitionTwoMapper.updatePwBuyingRequisitionTwo(buyingRequisitionTwo); + } + }else if("委外加工合同".equals(jdReceiptsDataInfo.getType())){ + //查询委外加工合同信息 + PwOutsourceContract outsourceContract = pwOutsourceContractMapper.selectPwOutsourceContractByContractCode(jdReceiptsDataInfo.getContractCode()); + if(null==outsourceContract){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==outsourceContract.getProceedsAmount()){ + outsourceContract.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + outsourceContract.setProceedsAmount(outsourceContract.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(outsourceContract.getTotalPricesSmall() - outsourceContract.getProceedsAmount().doubleValue()>0){ + outsourceContract.setNotProceedsAmount(new BigDecimal(outsourceContract.getTotalPricesSmall()).subtract(outsourceContract.getProceedsAmount())); + }else{ + outsourceContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + outsourceContract.setSettlementRatio(outsourceContract.getProceedsAmount().divide(new BigDecimal(outsourceContract.getTotalPricesSmall()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==outsourceContract.getInvoiceAmount()){ + outsourceContract.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + outsourceContract.setInvoiceAmount(outsourceContract.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(outsourceContract.getTotalPricesSmall() - outsourceContract.getInvoiceAmount().doubleValue()>0){ + outsourceContract.setNotProceedsAmount(new BigDecimal(outsourceContract.getTotalPricesSmall()).subtract(outsourceContract.getInvoiceAmount())); + }else{ + outsourceContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==outsourceContract.getProceedsAmount()){ + outsourceContract.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + outsourceContract.setProceedsAmount(outsourceContract.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(outsourceContract.getTotalPricesSmall() - outsourceContract.getProceedsAmount().doubleValue()>0){ + outsourceContract.setNotProceedsAmount(new BigDecimal(outsourceContract.getTotalPricesSmall()).subtract(outsourceContract.getProceedsAmount())); + }else{ + outsourceContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + outsourceContract.setSettlementRatio(outsourceContract.getProceedsAmount().divide(new BigDecimal(outsourceContract.getTotalPricesSmall()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==outsourceContract.getInvoiceAmount()){ + outsourceContract.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + outsourceContract.setInvoiceAmount(outsourceContract.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(outsourceContract.getTotalPricesSmall() - outsourceContract.getInvoiceAmount().doubleValue()>0){ + outsourceContract.setNotProceedsAmount(new BigDecimal(outsourceContract.getTotalPricesSmall()).subtract(outsourceContract.getInvoiceAmount())); + }else{ + outsourceContract.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + pwOutsourceContractMapper.updatePwOutsourceContract(outsourceContract); + } + + }else if("费用报销".equals(jdReceiptsDataInfo.getType())){ + //查询费用报销信息(暂无此模块,需要新增) + CwExpenseReimbursement expenseReimbursement = cwExpenseReimbursementMapper.selectCwExpenseReimbursementByCode(jdReceiptsDataInfo.getContractCode()); + if(null==expenseReimbursement){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==expenseReimbursement.getProceedsAmount()){ + expenseReimbursement.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + expenseReimbursement.setProceedsAmount(expenseReimbursement.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(expenseReimbursement.getMoney() - expenseReimbursement.getProceedsAmount().doubleValue()>0){ + expenseReimbursement.setNotProceedsAmount(new BigDecimal(expenseReimbursement.getMoney()).subtract(expenseReimbursement.getProceedsAmount())); + }else{ + expenseReimbursement.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + expenseReimbursement.setSettlementRatio(expenseReimbursement.getProceedsAmount().divide(new BigDecimal(expenseReimbursement.getBigMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==expenseReimbursement.getInvoiceAmount()){ + expenseReimbursement.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + expenseReimbursement.setInvoiceAmount(expenseReimbursement.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(expenseReimbursement.getMoney() - expenseReimbursement.getInvoiceAmount().doubleValue()>0){ + expenseReimbursement.setNotProceedsAmount(new BigDecimal(expenseReimbursement.getMoney()).subtract(expenseReimbursement.getInvoiceAmount())); + }else{ + expenseReimbursement.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==expenseReimbursement.getProceedsAmount()){ + expenseReimbursement.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + expenseReimbursement.setProceedsAmount(expenseReimbursement.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(expenseReimbursement.getMoney() - expenseReimbursement.getProceedsAmount().doubleValue()>0){ + expenseReimbursement.setNotProceedsAmount(new BigDecimal(expenseReimbursement.getMoney()).subtract(expenseReimbursement.getProceedsAmount())); + }else{ + expenseReimbursement.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + expenseReimbursement.setSettlementRatio(expenseReimbursement.getProceedsAmount().divide(new BigDecimal(expenseReimbursement.getMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==expenseReimbursement.getInvoiceAmount()){ + expenseReimbursement.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + expenseReimbursement.setInvoiceAmount(expenseReimbursement.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(expenseReimbursement.getMoney() - expenseReimbursement.getInvoiceAmount().doubleValue()>0){ + expenseReimbursement.setNotProceedsAmount(new BigDecimal(expenseReimbursement.getMoney()).subtract(expenseReimbursement.getInvoiceAmount())); + }else{ + expenseReimbursement.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + cwExpenseReimbursementMapper.updateCwExpenseReimbursement(expenseReimbursement); + } + }else if("物流费用".equals(jdReceiptsDataInfo.getType())){ + //查询物流费用信息(暂无此模块,需要新增) + CwLogisticsFeesInfo logisticsFeesInfo = cwLogisticsFeesInfoMapper.selectCwLogisticsFeesInfoByCode(jdReceiptsDataInfo.getContractCode()); + if(null==logisticsFeesInfo){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==logisticsFeesInfo.getProceedsAmount()){ + logisticsFeesInfo.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + logisticsFeesInfo.setProceedsAmount(logisticsFeesInfo.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(logisticsFeesInfo.getMoney() - logisticsFeesInfo.getProceedsAmount().doubleValue()>0){ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal(logisticsFeesInfo.getMoney()).subtract(logisticsFeesInfo.getProceedsAmount())); + }else{ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + logisticsFeesInfo.setSettlementRatio(logisticsFeesInfo.getProceedsAmount().divide(new BigDecimal(logisticsFeesInfo.getBigMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==logisticsFeesInfo.getInvoiceAmount()){ + logisticsFeesInfo.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + logisticsFeesInfo.setInvoiceAmount(logisticsFeesInfo.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(logisticsFeesInfo.getMoney() - logisticsFeesInfo.getInvoiceAmount().doubleValue()>0){ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal(logisticsFeesInfo.getMoney()).subtract(logisticsFeesInfo.getInvoiceAmount())); + }else{ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==logisticsFeesInfo.getProceedsAmount()){ + logisticsFeesInfo.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + logisticsFeesInfo.setProceedsAmount(logisticsFeesInfo.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(logisticsFeesInfo.getMoney() - logisticsFeesInfo.getProceedsAmount().doubleValue()>0){ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal(logisticsFeesInfo.getMoney()).subtract(logisticsFeesInfo.getProceedsAmount())); + }else{ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + logisticsFeesInfo.setSettlementRatio(logisticsFeesInfo.getProceedsAmount().divide(new BigDecimal(logisticsFeesInfo.getMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==logisticsFeesInfo.getInvoiceAmount()){ + logisticsFeesInfo.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + logisticsFeesInfo.setInvoiceAmount(logisticsFeesInfo.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(logisticsFeesInfo.getMoney() - logisticsFeesInfo.getInvoiceAmount().doubleValue()>0){ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal(logisticsFeesInfo.getMoney()).subtract(logisticsFeesInfo.getInvoiceAmount())); + }else{ + logisticsFeesInfo.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + cwLogisticsFeesInfoMapper.updateCwLogisticsFeesInfo(logisticsFeesInfo); + } + }else if("其它收款".equals(jdReceiptsDataInfo.getType())){ + //查询其他收款合同信息(暂无此模块,需要新增) + CwNonbusinessIncome cwNonbusinessIncome = cwNonbusinessIncomeMapper.selectCwNonbusinessIncomeByCode(jdReceiptsDataInfo.getContractCode()); + if(null==cwNonbusinessIncome){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==cwNonbusinessIncome.getProceedsAmount()){ + cwNonbusinessIncome.setProceedsAmount(new BigDecimal("0.0")); + } + //增加收款金额 + cwNonbusinessIncome.setProceedsAmount(cwNonbusinessIncome.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未收款金额减少(合同金额-已收款金额) + if(null==cwNonbusinessIncome.getMoney()){ + cwNonbusinessIncome.setMoney(0.0); + } + //计算未收款金额 (合同额 - 已收款额 = 未收款额) + if(cwNonbusinessIncome.getMoney() - cwNonbusinessIncome.getProceedsAmount().doubleValue()>0){ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal(cwNonbusinessIncome.getMoney()).subtract(cwNonbusinessIncome.getProceedsAmount())); + }else{ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + cwNonbusinessIncome.setSettlementRatio(cwNonbusinessIncome.getProceedsAmount().divide(new BigDecimal(cwNonbusinessIncome.getMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==cwNonbusinessIncome.getInvoiceAmount()){ + cwNonbusinessIncome.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + cwNonbusinessIncome.setInvoiceAmount(cwNonbusinessIncome.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + if(null==cwNonbusinessIncome.getMoney()){ + cwNonbusinessIncome.setMoney(0.0); + } + //计算未开票金额 + if(cwNonbusinessIncome.getMoney() - cwNonbusinessIncome.getInvoiceAmount().doubleValue()>0){ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal(cwNonbusinessIncome.getMoney()).subtract(cwNonbusinessIncome.getInvoiceAmount())); + }else{ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额减少 + if(null==cwNonbusinessIncome.getProceedsAmount()){ + cwNonbusinessIncome.setProceedsAmount(new BigDecimal("0.0")); + } + //减少收款金额 + cwNonbusinessIncome.setProceedsAmount(cwNonbusinessIncome.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未收款金额增加(合同额-已收款金额) + if(null==cwNonbusinessIncome.getMoney()){ + cwNonbusinessIncome.setMoney(0.0); + } + //计算未收款金额 (合同额 - 已收款额 = 未收款额) + if(cwNonbusinessIncome.getMoney() - cwNonbusinessIncome.getProceedsAmount().doubleValue()>0){ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal(cwNonbusinessIncome.getMoney()).subtract(cwNonbusinessIncome.getProceedsAmount())); + }else{ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + cwNonbusinessIncome.setSettlementRatio(cwNonbusinessIncome.getProceedsAmount().divide(new BigDecimal(cwNonbusinessIncome.getMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==cwNonbusinessIncome.getInvoiceAmount()){ + cwNonbusinessIncome.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + cwNonbusinessIncome.setInvoiceAmount(cwNonbusinessIncome.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + if(null==cwNonbusinessIncome.getMoney()){ + cwNonbusinessIncome.setMoney(0.0); + } + //计算未开票金额 + if(cwNonbusinessIncome.getMoney() - cwNonbusinessIncome.getInvoiceAmount().doubleValue()>0){ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal(cwNonbusinessIncome.getMoney()).subtract(cwNonbusinessIncome.getInvoiceAmount())); + }else{ + cwNonbusinessIncome.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + cwNonbusinessIncomeMapper.updateCwNonbusinessIncome(cwNonbusinessIncome); + } + + }else if("其它付款".equals(jdReceiptsDataInfo.getType())){ + //查询其他付款信息(暂无此模块,需要新增) + CwOtherPayment cwOtherPayment = cwOtherPaymentMapper.selectCwOtherPaymentByCode(jdReceiptsDataInfo.getContractCode()); + if(null==cwOtherPayment){ + return 5004; + }else{ + //判断是新增还是删除 + if("新增".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已收款金额增加 + if(null==cwOtherPayment.getProceedsAmount()){ + cwOtherPayment.setProceedsAmount(new BigDecimal("0.0")); + } + //增加付款金额 + cwOtherPayment.setProceedsAmount(cwOtherPayment.getProceedsAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额减少(合同金额-已收款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(cwOtherPayment.getMoney() - cwOtherPayment.getProceedsAmount().doubleValue()>0){ + cwOtherPayment.setNotProceedsAmount(new BigDecimal(cwOtherPayment.getMoney()).subtract(cwOtherPayment.getProceedsAmount())); + }else{ + cwOtherPayment.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + cwOtherPayment.setSettlementRatio(cwOtherPayment.getProceedsAmount().divide(new BigDecimal(cwOtherPayment.getBigMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + //判断当前单据下是否有明细,如果有明细,则把金额反写回去(增加) + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + List list = cwOtherPaymentInfoService.selectCwOtherPaymentInfoList(cwOtherPaymentInfo); + for (CwOtherPaymentInfo cwOtherPaymentInfo2 : list) { + //判断合同类型 + if("外购件采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + //根据单据编号查询合同信息 + PwPurchaseContract purchaseContract = pwPurchaseContractMapper.selectPwPurchaseContractByCode(cwOtherPaymentInfo2.getCode()); + if(null != purchaseContract){ + //未付款金额减少 + purchaseContract.setNotProceedsAmount(purchaseContract.getNotProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额增加 + purchaseContract.setProceedsAmount(purchaseContract.getProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + purchaseContract.setSettlementRatio(purchaseContract.getProceedsAmount().divide(new BigDecimal(purchaseContract.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("原材料采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionMapper.selectPwBuyingRequisitionByCode(cwOtherPaymentInfo2.getCode()); + if(null != buyingRequisition){ + //未付款金额减少 + buyingRequisition.setNotProceedsAmount(buyingRequisition.getNotProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额增加 + buyingRequisition.setProceedsAmount(buyingRequisition.getProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + buyingRequisition.setSettlementRatio(buyingRequisition.getProceedsAmount().divide(new BigDecimal(buyingRequisition.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("工量具采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseMapper.selectPwCuttingToolPurchaseByCode(cwOtherPaymentInfo2.getCode()); + if(null != cuttingToolPurchase){ + //未付款金额减少 + cuttingToolPurchase.setNotProceedsAmount(cuttingToolPurchase.getNotProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额增加 + cuttingToolPurchase.setProceedsAmount(cuttingToolPurchase.getProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + cuttingToolPurchase.setSettlementRatio(cuttingToolPurchase.getProceedsAmount().divide(new BigDecimal(cuttingToolPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("预采件采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwPredictPurchase predictPurchase = pwPredictPurchaseMapper.selectPwPredictPurchaseByCode(cwOtherPaymentInfo2.getCode()); + if(null != predictPurchase){ + //未付款金额减少 + predictPurchase.setNotProceedsAmount(predictPurchase.getNotProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额增加 + predictPurchase.setProceedsAmount(predictPurchase.getProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + predictPurchase.setSettlementRatio(predictPurchase.getProceedsAmount().divide(new BigDecimal(predictPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("请购单采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoMapper.selectPwBuyingRequisitionTwoByCode(cwOtherPaymentInfo2.getCode()); + if(null != buyingRequisitionTwo){ + //未付款金额减少 + buyingRequisitionTwo.setNotProceedsAmount(buyingRequisitionTwo.getNotProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额增加 + buyingRequisitionTwo.setProceedsAmount(buyingRequisitionTwo.getProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + buyingRequisitionTwo.setSettlementRatio(buyingRequisitionTwo.getProceedsAmount().divide(new BigDecimal(buyingRequisitionTwo.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("委外加工合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwOutsourceContract outsourceContract = pwOutsourceContractMapper.selectPwOutsourceContractByContractCode(cwOtherPaymentInfo2.getCode()); + if(null != outsourceContract){ + //未付款金额减少 + outsourceContract.setNotProceedsAmount(outsourceContract.getNotProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额增加 + outsourceContract.setProceedsAmount(outsourceContract.getProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + outsourceContract.setSettlementRatio(outsourceContract.getProceedsAmount().divide(new BigDecimal(outsourceContract.getTotalPricesSmall()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else{ + //无法处理的业务类型 + return 7004; + } + } + + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==cwOtherPayment.getInvoiceAmount()){ + cwOtherPayment.setInvoiceAmount(new BigDecimal("0.0")); + } + //增加发票金额 + cwOtherPayment.setInvoiceAmount(cwOtherPayment.getInvoiceAmount().add(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(cwOtherPayment.getMoney() - cwOtherPayment.getInvoiceAmount().doubleValue()>0){ + cwOtherPayment.setNotProceedsAmount(new BigDecimal(cwOtherPayment.getMoney()).subtract(cwOtherPayment.getInvoiceAmount())); + }else{ + cwOtherPayment.setNotProceedsAmount(new BigDecimal("0.0")); + } + + }else{ + //无法处理的业务类型 + return 7004; + } + }else if("删除".equals(jdReceiptsDataInfo.getSign())){ + //判断是款,还是票 + if("1".equals(jdReceiptsDataInfo.getBusinessSign())){ + //1为款 + //合同已付款金额减少 + if(null==cwOtherPayment.getProceedsAmount()){ + cwOtherPayment.setProceedsAmount(new BigDecimal("0.0")); + } + //减少付款金额 + cwOtherPayment.setProceedsAmount(cwOtherPayment.getProceedsAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //合同未付款金额增加(合同额-已付款金额) + //计算未付款金额 (合同额 - 已付款额 = 未付款额) + if(cwOtherPayment.getMoney() - cwOtherPayment.getProceedsAmount().doubleValue()>0){ + cwOtherPayment.setNotProceedsAmount(new BigDecimal(cwOtherPayment.getMoney()).subtract(cwOtherPayment.getProceedsAmount())); + }else{ + cwOtherPayment.setNotProceedsAmount(new BigDecimal("0.0")); + } + //计算结算比例 + cwOtherPayment.setSettlementRatio(cwOtherPayment.getProceedsAmount().divide(new BigDecimal(cwOtherPayment.getMoney()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + + //判断当前单据下是否有明细,如果有明细,则把金额反写回去(减少) TODO + CwOtherPaymentInfo cwOtherPaymentInfo = new CwOtherPaymentInfo(); + cwOtherPaymentInfo.setOtherPaymentCode(cwOtherPayment.getCode()); + List list = cwOtherPaymentInfoService.selectCwOtherPaymentInfoList(cwOtherPaymentInfo); + for (CwOtherPaymentInfo cwOtherPaymentInfo2 : list) { + //判断合同类型 + if("外购件采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + //根据单据编号查询合同信息 + PwPurchaseContract purchaseContract = pwPurchaseContractMapper.selectPwPurchaseContractByCode(cwOtherPaymentInfo2.getCode()); + if(null != purchaseContract){ + //未付款金额增加 + purchaseContract.setNotProceedsAmount(purchaseContract.getNotProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额减少 + purchaseContract.setProceedsAmount(purchaseContract.getProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + purchaseContract.setSettlementRatio(purchaseContract.getProceedsAmount().divide(new BigDecimal(purchaseContract.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("原材料采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwBuyingRequisition buyingRequisition = pwBuyingRequisitionMapper.selectPwBuyingRequisitionByCode(cwOtherPaymentInfo2.getCode()); + if(null != buyingRequisition){ + //未付款金额增加 + buyingRequisition.setNotProceedsAmount(buyingRequisition.getNotProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额减少 + buyingRequisition.setProceedsAmount(buyingRequisition.getProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + buyingRequisition.setSettlementRatio(buyingRequisition.getProceedsAmount().divide(new BigDecimal(buyingRequisition.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("工量具采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwCuttingToolPurchase cuttingToolPurchase = pwCuttingToolPurchaseMapper.selectPwCuttingToolPurchaseByCode(cwOtherPaymentInfo2.getCode()); + if(null != cuttingToolPurchase){ + //未付款金额增加 + cuttingToolPurchase.setNotProceedsAmount(cuttingToolPurchase.getNotProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额减少 + cuttingToolPurchase.setProceedsAmount(cuttingToolPurchase.getProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + cuttingToolPurchase.setSettlementRatio(cuttingToolPurchase.getProceedsAmount().divide(new BigDecimal(cuttingToolPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("预采件采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwPredictPurchase predictPurchase = pwPredictPurchaseMapper.selectPwPredictPurchaseByCode(cwOtherPaymentInfo2.getCode()); + if(null != predictPurchase){ + //未付款金额增加 + predictPurchase.setNotProceedsAmount(predictPurchase.getNotProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额减少 + predictPurchase.setProceedsAmount(predictPurchase.getProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + predictPurchase.setSettlementRatio(predictPurchase.getProceedsAmount().divide(new BigDecimal(predictPurchase.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("请购单采购合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwBuyingRequisitionTwo buyingRequisitionTwo = pwBuyingRequisitionTwoMapper.selectPwBuyingRequisitionTwoByCode(cwOtherPaymentInfo2.getCode()); + if(null != buyingRequisitionTwo){ + //未付款金额增加 + buyingRequisitionTwo.setNotProceedsAmount(buyingRequisitionTwo.getNotProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额减少 + buyingRequisitionTwo.setProceedsAmount(buyingRequisitionTwo.getProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + buyingRequisitionTwo.setSettlementRatio(buyingRequisitionTwo.getProceedsAmount().divide(new BigDecimal(buyingRequisitionTwo.getTotalPrices()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else if("委外加工合同".equals(cwOtherPaymentInfo2.getSparedOne())){ + PwOutsourceContract outsourceContract = pwOutsourceContractMapper.selectPwOutsourceContractByContractCode(cwOtherPaymentInfo2.getCode()); + if(null != outsourceContract){ + //未付款金额增加 + outsourceContract.setNotProceedsAmount(outsourceContract.getNotProceedsAmount().add(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //已付款金额减少 + outsourceContract.setProceedsAmount(outsourceContract.getProceedsAmount().subtract(new BigDecimal(cwOtherPaymentInfo2.getPaymentAmount()))); + //计算结算比例 已付款金额/合同金额*100 + outsourceContract.setSettlementRatio(outsourceContract.getProceedsAmount().divide(new BigDecimal(outsourceContract.getTotalPricesSmall()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100"))); + }else{ + return 5004; + } + }else{ + //无法处理的业务类型 + return 7004; + } + } + }else if("2".equals(jdReceiptsDataInfo.getBusinessSign())){ + //2为票 + //合同发票金额增加 + if(null==cwOtherPayment.getInvoiceAmount()){ + cwOtherPayment.setInvoiceAmount(new BigDecimal("0.0")); + } + //减少发票金额 + cwOtherPayment.setInvoiceAmount(cwOtherPayment.getInvoiceAmount().subtract(new BigDecimal(jdReceiptsDataInfo.getMoney()))); + //未开票金额减少 + //计算未开票金额 + if(cwOtherPayment.getMoney() - cwOtherPayment.getInvoiceAmount().doubleValue()>0){ + cwOtherPayment.setNotProceedsAmount(new BigDecimal(cwOtherPayment.getMoney()).subtract(cwOtherPayment.getInvoiceAmount())); + }else{ + cwOtherPayment.setNotProceedsAmount(new BigDecimal("0.0")); + } + }else{ + //无法处理的业务类型 + return 7004; + } + }else{ + return 6004; + } + //修改 + cwOtherPaymentMapper.updateCwOtherPayment(cwOtherPayment); + } + }else{ + //不作处理 + return 4004; + } + } + return i; + } + + /** + * 修改财务系统数据信息 + * + * @param jdReceiptsDataInfo 财务系统数据信息 + * @return 结果 + */ + @Override + public int updateJdReceiptsDataInfo(JdReceiptsDataInfo jdReceiptsDataInfo) + { + return jdReceiptsDataInfoMapper.updateJdReceiptsDataInfo(jdReceiptsDataInfo); + } + + /** + * 批量删除财务系统数据信息 + * + * @param ids 需要删除的财务系统数据信息ID + * @return 结果 + */ + @Override + public int deleteJdReceiptsDataInfoByIds(Long[] ids) + { + return jdReceiptsDataInfoMapper.deleteJdReceiptsDataInfoByIds(ids); + } + + /** + * 删除财务系统数据信息信息 + * + * @param id 财务系统数据信息ID + * @return 结果 + */ + @Override + public int deleteJdReceiptsDataInfoById(Long id) + { + return jdReceiptsDataInfoMapper.deleteJdReceiptsDataInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/MaterialSecureServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/MaterialSecureServiceImpl.java new file mode 100644 index 0000000..44d7120 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/MaterialSecureServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.MaterialSecureMapper; +import com.ruoyi.project.management.domain.MaterialSecure; +import com.ruoyi.project.management.service.IMaterialSecureService; + +/** + * 安全库存设置Service业务层处理 + * + * @author chenyongjiang + * @date 2024-02-19 + */ +@Service +public class MaterialSecureServiceImpl implements IMaterialSecureService +{ + @Autowired + private MaterialSecureMapper materialSecureMapper; + + /** + * 查询安全库存设置 + * + * @param id 安全库存设置ID + * @return 安全库存设置 + */ + @Override + public MaterialSecure selectMaterialSecureById(Long id) + { + return materialSecureMapper.selectMaterialSecureById(id); + } + + /** + * 查询安全库存设置列表 + * + * @param materialSecure 安全库存设置 + * @return 安全库存设置 + */ + @Override + public List selectMaterialSecureList(MaterialSecure materialSecure) + { + return materialSecureMapper.selectMaterialSecureList(materialSecure); + } + + /** + * 新增安全库存设置 + * + * @param materialSecure 安全库存设置 + * @return 结果 + */ + @Override + public int insertMaterialSecure(MaterialSecure materialSecure) + { + materialSecure.setCreateTime(DateUtils.getNowDate()); + return materialSecureMapper.insertMaterialSecure(materialSecure); + } + + /** + * 修改安全库存设置 + * + * @param materialSecure 安全库存设置 + * @return 结果 + */ + @Override + public int updateMaterialSecure(MaterialSecure materialSecure) + { + materialSecure.setUpdateTime(DateUtils.getNowDate()); + return materialSecureMapper.updateMaterialSecure(materialSecure); + } + + /** + * 批量删除安全库存设置 + * + * @param ids 需要删除的安全库存设置ID + * @return 结果 + */ + @Override + public int deleteMaterialSecureByIds(Long[] ids) + { + return materialSecureMapper.deleteMaterialSecureByIds(ids); + } + + /** + * 删除安全库存设置信息 + * + * @param id 安全库存设置ID + * @return 结果 + */ + @Override + public int deleteMaterialSecureById(Long id) + { + return materialSecureMapper.deleteMaterialSecureById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcCurtainMachineServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcCurtainMachineServiceImpl.java new file mode 100644 index 0000000..d82442d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcCurtainMachineServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcCurtainMachineMapper; +import com.ruoyi.project.management.domain.PcCurtainMachine; +import com.ruoyi.project.management.service.IPcCurtainMachineService; + +/** + * 大幕机型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcCurtainMachineServiceImpl implements IPcCurtainMachineService +{ + @Autowired + private PcCurtainMachineMapper pcCurtainMachineMapper; + + /** + * 查询大幕机型号 + * + * @param id 大幕机型号ID + * @return 大幕机型号 + */ + @Override + public PcCurtainMachine selectPcCurtainMachineById(Long id) + { + return pcCurtainMachineMapper.selectPcCurtainMachineById(id); + } + + /** + * 查询大幕机型号列表 + * + * @param pcCurtainMachine 大幕机型号 + * @return 大幕机型号 + */ + @Override + public List selectPcCurtainMachineList(PcCurtainMachine pcCurtainMachine) + { + return pcCurtainMachineMapper.selectPcCurtainMachineList(pcCurtainMachine); + } + + /** + * 新增大幕机型号 + * + * @param pcCurtainMachine 大幕机型号 + * @return 结果 + */ + @Override + public int insertPcCurtainMachine(PcCurtainMachine pcCurtainMachine) + { + pcCurtainMachine.setCreateTime(DateUtils.getNowDate()); + return pcCurtainMachineMapper.insertPcCurtainMachine(pcCurtainMachine); + } + + /** + * 修改大幕机型号 + * + * @param pcCurtainMachine 大幕机型号 + * @return 结果 + */ + @Override + public int updatePcCurtainMachine(PcCurtainMachine pcCurtainMachine) + { + return pcCurtainMachineMapper.updatePcCurtainMachine(pcCurtainMachine); + } + + /** + * 批量删除大幕机型号 + * + * @param ids 需要删除的大幕机型号ID + * @return 结果 + */ + @Override + public int deletePcCurtainMachineByIds(Long[] ids) + { + return pcCurtainMachineMapper.deletePcCurtainMachineByIds(ids); + } + + /** + * 删除大幕机型号信息 + * + * @param id 大幕机型号ID + * @return 结果 + */ + @Override + public int deletePcCurtainMachineById(Long id) + { + return pcCurtainMachineMapper.deletePcCurtainMachineById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcCurtainMachine selectPcCurtainMachineByTypeName(String typeName) { + PcCurtainMachine pcCurtainMachine = pcCurtainMachineMapper.selectPcCurtainMachineByTypeName(typeName); + return pcCurtainMachine; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcDetentServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcDetentServiceImpl.java new file mode 100644 index 0000000..79d6991 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcDetentServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcDetentMapper; +import com.ruoyi.project.management.domain.PcDetent; +import com.ruoyi.project.management.service.IPcDetentService; + +/** + * 制动器型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcDetentServiceImpl implements IPcDetentService +{ + @Autowired + private PcDetentMapper pcDetentMapper; + + /** + * 查询制动器型号 + * + * @param id 制动器型号ID + * @return 制动器型号 + */ + @Override + public PcDetent selectPcDetentById(Long id) + { + return pcDetentMapper.selectPcDetentById(id); + } + + /** + * 查询制动器型号列表 + * + * @param pcDetent 制动器型号 + * @return 制动器型号 + */ + @Override + public List selectPcDetentList(PcDetent pcDetent) + { + return pcDetentMapper.selectPcDetentList(pcDetent); + } + + /** + * 新增制动器型号 + * + * @param pcDetent 制动器型号 + * @return 结果 + */ + @Override + public int insertPcDetent(PcDetent pcDetent) + { + pcDetent.setCreateTime(DateUtils.getNowDate()); + return pcDetentMapper.insertPcDetent(pcDetent); + } + + /** + * 修改制动器型号 + * + * @param pcDetent 制动器型号 + * @return 结果 + */ + @Override + public int updatePcDetent(PcDetent pcDetent) + { + return pcDetentMapper.updatePcDetent(pcDetent); + } + + /** + * 批量删除制动器型号 + * + * @param ids 需要删除的制动器型号ID + * @return 结果 + */ + @Override + public int deletePcDetentByIds(Long[] ids) + { + return pcDetentMapper.deletePcDetentByIds(ids); + } + + /** + * 删除制动器型号信息 + * + * @param id 制动器型号ID + * @return 结果 + */ + @Override + public int deletePcDetentById(Long id) + { + return pcDetentMapper.deletePcDetentById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcDetent selectPcDetentByTypeName(String typeName) { + PcDetent pcDetent = pcDetentMapper.selectPcDetentByTypeName(typeName); + return pcDetent; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcElectricalMachineryAcServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcElectricalMachineryAcServiceImpl.java new file mode 100644 index 0000000..5a94358 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcElectricalMachineryAcServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcElectricalMachineryAcMapper; +import com.ruoyi.project.management.domain.PcElectricalMachineryAc; +import com.ruoyi.project.management.service.IPcElectricalMachineryAcService; + +/** + * 电机AC型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcElectricalMachineryAcServiceImpl implements IPcElectricalMachineryAcService +{ + @Autowired + private PcElectricalMachineryAcMapper pcElectricalMachineryAcMapper; + + /** + * 查询电机AC型号 + * + * @param id 电机AC型号ID + * @return 电机AC型号 + */ + @Override + public PcElectricalMachineryAc selectPcElectricalMachineryAcById(Long id) + { + return pcElectricalMachineryAcMapper.selectPcElectricalMachineryAcById(id); + } + + /** + * 查询电机AC型号列表 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 电机AC型号 + */ + @Override + public List selectPcElectricalMachineryAcList(PcElectricalMachineryAc pcElectricalMachineryAc) + { + return pcElectricalMachineryAcMapper.selectPcElectricalMachineryAcList(pcElectricalMachineryAc); + } + + /** + * 新增电机AC型号 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 结果 + */ + @Override + public int insertPcElectricalMachineryAc(PcElectricalMachineryAc pcElectricalMachineryAc) + { + pcElectricalMachineryAc.setCreateTime(DateUtils.getNowDate()); + return pcElectricalMachineryAcMapper.insertPcElectricalMachineryAc(pcElectricalMachineryAc); + } + + /** + * 修改电机AC型号 + * + * @param pcElectricalMachineryAc 电机AC型号 + * @return 结果 + */ + @Override + public int updatePcElectricalMachineryAc(PcElectricalMachineryAc pcElectricalMachineryAc) + { + return pcElectricalMachineryAcMapper.updatePcElectricalMachineryAc(pcElectricalMachineryAc); + } + + /** + * 批量删除电机AC型号 + * + * @param ids 需要删除的电机AC型号ID + * @return 结果 + */ + @Override + public int deletePcElectricalMachineryAcByIds(Long[] ids) + { + return pcElectricalMachineryAcMapper.deletePcElectricalMachineryAcByIds(ids); + } + + /** + * 删除电机AC型号信息 + * + * @param id 电机AC型号ID + * @return 结果 + */ + @Override + public int deletePcElectricalMachineryAcById(Long id) + { + return pcElectricalMachineryAcMapper.deletePcElectricalMachineryAcById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcElectricalMachineryAc selectPcElectricalMachineryAcByTypeName(String typeName) { + PcElectricalMachineryAc pcElectricalMachineryAc = pcElectricalMachineryAcMapper.selectPcElectricalMachineryAcByTypeName(typeName); + return pcElectricalMachineryAc; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcFTypeReducerServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcFTypeReducerServiceImpl.java new file mode 100644 index 0000000..76c6591 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcFTypeReducerServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcFTypeReducerMapper; +import com.ruoyi.project.management.domain.PcFTypeReducer; +import com.ruoyi.project.management.service.IPcFTypeReducerService; + +/** + * F型减速机型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcFTypeReducerServiceImpl implements IPcFTypeReducerService +{ + @Autowired + private PcFTypeReducerMapper pcFTypeReducerMapper; + + /** + * 查询F型减速机型号 + * + * @param id F型减速机型号ID + * @return F型减速机型号 + */ + @Override + public PcFTypeReducer selectPcFTypeReducerById(Long id) + { + return pcFTypeReducerMapper.selectPcFTypeReducerById(id); + } + + /** + * 查询F型减速机型号列表 + * + * @param pcFTypeReducer F型减速机型号 + * @return F型减速机型号 + */ + @Override + public List selectPcFTypeReducerList(PcFTypeReducer pcFTypeReducer) + { + return pcFTypeReducerMapper.selectPcFTypeReducerList(pcFTypeReducer); + } + + /** + * 新增F型减速机型号 + * + * @param pcFTypeReducer F型减速机型号 + * @return 结果 + */ + @Override + public int insertPcFTypeReducer(PcFTypeReducer pcFTypeReducer) + { + pcFTypeReducer.setCreateTime(DateUtils.getNowDate()); + return pcFTypeReducerMapper.insertPcFTypeReducer(pcFTypeReducer); + } + + /** + * 修改F型减速机型号 + * + * @param pcFTypeReducer F型减速机型号 + * @return 结果 + */ + @Override + public int updatePcFTypeReducer(PcFTypeReducer pcFTypeReducer) + { + return pcFTypeReducerMapper.updatePcFTypeReducer(pcFTypeReducer); + } + + /** + * 批量删除F型减速机型号 + * + * @param ids 需要删除的F型减速机型号ID + * @return 结果 + */ + @Override + public int deletePcFTypeReducerByIds(Long[] ids) + { + return pcFTypeReducerMapper.deletePcFTypeReducerByIds(ids); + } + + /** + * 删除F型减速机型号信息 + * + * @param id F型减速机型号ID + * @return 结果 + */ + @Override + public int deletePcFTypeReducerById(Long id) + { + return pcFTypeReducerMapper.deletePcFTypeReducerById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcFTypeReducer selectPcFTypeReducerByTypeName(String typeName) { + PcFTypeReducer pcFTypeReducer = pcFTypeReducerMapper.selectPcFTypeReducerByTypeName(typeName); + return pcFTypeReducer; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcFireCurtainDampingDriveServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcFireCurtainDampingDriveServiceImpl.java new file mode 100644 index 0000000..9667434 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcFireCurtainDampingDriveServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcFireCurtainDampingDriveMapper; +import com.ruoyi.project.management.domain.PcFireCurtainDampingDrive; +import com.ruoyi.project.management.service.IPcFireCurtainDampingDriveService; + +/** + * 防火隔离幕阻尼驱动型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcFireCurtainDampingDriveServiceImpl implements IPcFireCurtainDampingDriveService +{ + @Autowired + private PcFireCurtainDampingDriveMapper pcFireCurtainDampingDriveMapper; + + /** + * 查询防火隔离幕阻尼驱动型号 + * + * @param id 防火隔离幕阻尼驱动型号ID + * @return 防火隔离幕阻尼驱动型号 + */ + @Override + public PcFireCurtainDampingDrive selectPcFireCurtainDampingDriveById(Long id) + { + return pcFireCurtainDampingDriveMapper.selectPcFireCurtainDampingDriveById(id); + } + + /** + * 查询防火隔离幕阻尼驱动型号列表 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 防火隔离幕阻尼驱动型号 + */ + @Override + public List selectPcFireCurtainDampingDriveList(PcFireCurtainDampingDrive pcFireCurtainDampingDrive) + { + return pcFireCurtainDampingDriveMapper.selectPcFireCurtainDampingDriveList(pcFireCurtainDampingDrive); + } + + /** + * 新增防火隔离幕阻尼驱动型号 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 结果 + */ + @Override + public int insertPcFireCurtainDampingDrive(PcFireCurtainDampingDrive pcFireCurtainDampingDrive) + { + pcFireCurtainDampingDrive.setCreateTime(DateUtils.getNowDate()); + return pcFireCurtainDampingDriveMapper.insertPcFireCurtainDampingDrive(pcFireCurtainDampingDrive); + } + + /** + * 修改防火隔离幕阻尼驱动型号 + * + * @param pcFireCurtainDampingDrive 防火隔离幕阻尼驱动型号 + * @return 结果 + */ + @Override + public int updatePcFireCurtainDampingDrive(PcFireCurtainDampingDrive pcFireCurtainDampingDrive) + { + return pcFireCurtainDampingDriveMapper.updatePcFireCurtainDampingDrive(pcFireCurtainDampingDrive); + } + + /** + * 批量删除防火隔离幕阻尼驱动型号 + * + * @param ids 需要删除的防火隔离幕阻尼驱动型号ID + * @return 结果 + */ + @Override + public int deletePcFireCurtainDampingDriveByIds(Long[] ids) + { + return pcFireCurtainDampingDriveMapper.deletePcFireCurtainDampingDriveByIds(ids); + } + + /** + * 删除防火隔离幕阻尼驱动型号信息 + * + * @param id 防火隔离幕阻尼驱动型号ID + * @return 结果 + */ + @Override + public int deletePcFireCurtainDampingDriveById(Long id) + { + return pcFireCurtainDampingDriveMapper.deletePcFireCurtainDampingDriveById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcFireCurtainDampingDrive selectPcFireCurtainDampingDriveByTypeName(String typeName) { + PcFireCurtainDampingDrive pcFireCurtainDampingDrive = pcFireCurtainDampingDriveMapper.selectPcFireCurtainDampingDriveByTypeName(typeName); + return pcFireCurtainDampingDrive; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcHooksCouplingServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcHooksCouplingServiceImpl.java new file mode 100644 index 0000000..707983a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcHooksCouplingServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcHooksCouplingMapper; +import com.ruoyi.project.management.domain.PcHooksCoupling; +import com.ruoyi.project.management.service.IPcHooksCouplingService; + +/** + * 万向连轴器型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcHooksCouplingServiceImpl implements IPcHooksCouplingService +{ + @Autowired + private PcHooksCouplingMapper pcHooksCouplingMapper; + + /** + * 查询万向连轴器型号 + * + * @param id 万向连轴器型号ID + * @return 万向连轴器型号 + */ + @Override + public PcHooksCoupling selectPcHooksCouplingById(Long id) + { + return pcHooksCouplingMapper.selectPcHooksCouplingById(id); + } + + /** + * 查询万向连轴器型号列表 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 万向连轴器型号 + */ + @Override + public List selectPcHooksCouplingList(PcHooksCoupling pcHooksCoupling) + { + return pcHooksCouplingMapper.selectPcHooksCouplingList(pcHooksCoupling); + } + + /** + * 新增万向连轴器型号 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 结果 + */ + @Override + public int insertPcHooksCoupling(PcHooksCoupling pcHooksCoupling) + { + pcHooksCoupling.setCreateTime(DateUtils.getNowDate()); + return pcHooksCouplingMapper.insertPcHooksCoupling(pcHooksCoupling); + } + + /** + * 修改万向连轴器型号 + * + * @param pcHooksCoupling 万向连轴器型号 + * @return 结果 + */ + @Override + public int updatePcHooksCoupling(PcHooksCoupling pcHooksCoupling) + { + return pcHooksCouplingMapper.updatePcHooksCoupling(pcHooksCoupling); + } + + /** + * 批量删除万向连轴器型号 + * + * @param ids 需要删除的万向连轴器型号ID + * @return 结果 + */ + @Override + public int deletePcHooksCouplingByIds(Long[] ids) + { + return pcHooksCouplingMapper.deletePcHooksCouplingByIds(ids); + } + + /** + * 删除万向连轴器型号信息 + * + * @param id 万向连轴器型号ID + * @return 结果 + */ + @Override + public int deletePcHooksCouplingById(Long id) + { + return pcHooksCouplingMapper.deletePcHooksCouplingById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcHooksCoupling selectPcHooksCouplingByTypeName(String typeName) { + PcHooksCoupling pcHooksCoupling = pcHooksCouplingMapper.selectPcHooksCouplingByTypeName(typeName); + return pcHooksCoupling; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcRigidChainServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcRigidChainServiceImpl.java new file mode 100644 index 0000000..debd364 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcRigidChainServiceImpl.java @@ -0,0 +1,131 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcRigidChainMapper; +import com.ruoyi.project.management.domain.PcRigidChain; +import com.ruoyi.project.management.service.IPcRigidChainService; + +/** + * 销齿链型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcRigidChainServiceImpl implements IPcRigidChainService +{ + @Autowired + private PcRigidChainMapper pcRigidChainMapper; + + /** + * 查询销齿链型号 + * + * @param id 销齿链型号ID + * @return 销齿链型号 + */ + @Override + public PcRigidChain selectPcRigidChainById(Long id) + { + return pcRigidChainMapper.selectPcRigidChainById(id); + } + + /** + * 查询销齿链型号列表 + * + * @param pcRigidChain 销齿链型号 + * @return 销齿链型号 + */ + @Override + public List selectPcRigidChainList(PcRigidChain pcRigidChain) + { + return pcRigidChainMapper.selectPcRigidChainList(pcRigidChain); + } + + /** + * 新增销齿链型号 + * + * @param pcRigidChain 销齿链型号 + * @return 结果 + */ + @Override + public int insertPcRigidChain(PcRigidChain pcRigidChain) + { + pcRigidChain.setCreateTime(DateUtils.getNowDate()); + return pcRigidChainMapper.insertPcRigidChain(pcRigidChain); + } + + /** + * 修改销齿链型号 + * + * @param pcRigidChain 销齿链型号 + * @return 结果 + */ + @Override + public int updatePcRigidChain(PcRigidChain pcRigidChain) + { + return pcRigidChainMapper.updatePcRigidChain(pcRigidChain); + } + + /** + * 批量删除销齿链型号 + * + * @param ids 需要删除的销齿链型号ID + * @return 结果 + */ + @Override + public int deletePcRigidChainByIds(Long[] ids) + { + return pcRigidChainMapper.deletePcRigidChainByIds(ids); + } + + /** + * 删除销齿链型号信息 + * + * @param id 销齿链型号ID + * @return 结果 + */ + @Override + public int deletePcRigidChainById(Long id) + { + return pcRigidChainMapper.deletePcRigidChainById(id); + } + + /** + * 查询销齿链型号,按型号名称分类 + * @return + */ + @Override + public List selectPcRigidChainByTypeList() { + List list = pcRigidChainMapper.selectPcRigidChainByTypeList(); + return list; + } + + /** + * 根据型号全称查询型号信息 + * @param typeName + */ + @Override + public PcRigidChain selectPcRigidChainByTypeName(String typeName) { + PcRigidChain pcRigidChain = pcRigidChainMapper.selectPcRigidChainByTypeName(typeName); + return pcRigidChain; + } + + /** + * 根据型号查询行程(去重) + */ + @Override + public List selectPcRigidChainByJourneyList(String type) { + List list = pcRigidChainMapper.selectPcRigidChainByJourneyList(type); + return list; + } + + @Override + public List selectPcRigidChainByType(String type) { + List list = pcRigidChainMapper.selectPcRigidChainByType(type); + return list; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcStrokeMeasurementServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcStrokeMeasurementServiceImpl.java new file mode 100644 index 0000000..dd61afe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcStrokeMeasurementServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcStrokeMeasurementMapper; +import com.ruoyi.project.management.domain.PcStrokeMeasurement; +import com.ruoyi.project.management.service.IPcStrokeMeasurementService; + +/** + * 行程检测型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcStrokeMeasurementServiceImpl implements IPcStrokeMeasurementService +{ + @Autowired + private PcStrokeMeasurementMapper pcStrokeMeasurementMapper; + + /** + * 查询行程检测型号 + * + * @param id 行程检测型号ID + * @return 行程检测型号 + */ + @Override + public PcStrokeMeasurement selectPcStrokeMeasurementById(Long id) + { + return pcStrokeMeasurementMapper.selectPcStrokeMeasurementById(id); + } + + /** + * 查询行程检测型号列表 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 行程检测型号 + */ + @Override + public List selectPcStrokeMeasurementList(PcStrokeMeasurement pcStrokeMeasurement) + { + return pcStrokeMeasurementMapper.selectPcStrokeMeasurementList(pcStrokeMeasurement); + } + + /** + * 新增行程检测型号 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 结果 + */ + @Override + public int insertPcStrokeMeasurement(PcStrokeMeasurement pcStrokeMeasurement) + { + pcStrokeMeasurement.setCreateTime(DateUtils.getNowDate()); + return pcStrokeMeasurementMapper.insertPcStrokeMeasurement(pcStrokeMeasurement); + } + + /** + * 修改行程检测型号 + * + * @param pcStrokeMeasurement 行程检测型号 + * @return 结果 + */ + @Override + public int updatePcStrokeMeasurement(PcStrokeMeasurement pcStrokeMeasurement) + { + return pcStrokeMeasurementMapper.updatePcStrokeMeasurement(pcStrokeMeasurement); + } + + /** + * 批量删除行程检测型号 + * + * @param ids 需要删除的行程检测型号ID + * @return 结果 + */ + @Override + public int deletePcStrokeMeasurementByIds(Long[] ids) + { + return pcStrokeMeasurementMapper.deletePcStrokeMeasurementByIds(ids); + } + + /** + * 删除行程检测型号信息 + * + * @param id 行程检测型号ID + * @return 结果 + */ + @Override + public int deletePcStrokeMeasurementById(Long id) + { + return pcStrokeMeasurementMapper.deletePcStrokeMeasurementById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcStrokeMeasurement selectPcStrokeMeasurementByTypeName(String typeName) { + PcStrokeMeasurement pcStrokeMeasurement = pcStrokeMeasurementMapper.selectPcStrokeMeasurementByTypeName(typeName); + return pcStrokeMeasurement; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcToothedCouplingServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcToothedCouplingServiceImpl.java new file mode 100644 index 0000000..ec51150 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcToothedCouplingServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcToothedCouplingMapper; +import com.ruoyi.project.management.domain.PcToothedCoupling; +import com.ruoyi.project.management.service.IPcToothedCouplingService; + +/** + * 齿形连轴器型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcToothedCouplingServiceImpl implements IPcToothedCouplingService +{ + @Autowired + private PcToothedCouplingMapper pcToothedCouplingMapper; + + /** + * 查询齿形连轴器型号 + * + * @param id 齿形连轴器型号ID + * @return 齿形连轴器型号 + */ + @Override + public PcToothedCoupling selectPcToothedCouplingById(Long id) + { + return pcToothedCouplingMapper.selectPcToothedCouplingById(id); + } + + /** + * 查询齿形连轴器型号列表 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 齿形连轴器型号 + */ + @Override + public List selectPcToothedCouplingList(PcToothedCoupling pcToothedCoupling) + { + return pcToothedCouplingMapper.selectPcToothedCouplingList(pcToothedCoupling); + } + + /** + * 新增齿形连轴器型号 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 结果 + */ + @Override + public int insertPcToothedCoupling(PcToothedCoupling pcToothedCoupling) + { + pcToothedCoupling.setCreateTime(DateUtils.getNowDate()); + return pcToothedCouplingMapper.insertPcToothedCoupling(pcToothedCoupling); + } + + /** + * 修改齿形连轴器型号 + * + * @param pcToothedCoupling 齿形连轴器型号 + * @return 结果 + */ + @Override + public int updatePcToothedCoupling(PcToothedCoupling pcToothedCoupling) + { + return pcToothedCouplingMapper.updatePcToothedCoupling(pcToothedCoupling); + } + + /** + * 批量删除齿形连轴器型号 + * + * @param ids 需要删除的齿形连轴器型号ID + * @return 结果 + */ + @Override + public int deletePcToothedCouplingByIds(Long[] ids) + { + return pcToothedCouplingMapper.deletePcToothedCouplingByIds(ids); + } + + /** + * 删除齿形连轴器型号信息 + * + * @param id 齿形连轴器型号ID + * @return 结果 + */ + @Override + public int deletePcToothedCouplingById(Long id) + { + return pcToothedCouplingMapper.deletePcToothedCouplingById(id); + } + + /** + * 根据产品型号查询 + */ + @Override + public PcToothedCoupling selectPcToothedCouplingByTypeName(String typeName) { + PcToothedCoupling pcToothedCoupling = pcToothedCouplingMapper.selectPcToothedCouplingByTypeName(typeName); + return pcToothedCoupling; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcTravelSwitchServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcTravelSwitchServiceImpl.java new file mode 100644 index 0000000..fab167a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcTravelSwitchServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcTravelSwitchMapper; +import com.ruoyi.project.management.domain.PcTravelSwitch; +import com.ruoyi.project.management.service.IPcTravelSwitchService; + +/** + * 行程开关型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcTravelSwitchServiceImpl implements IPcTravelSwitchService +{ + @Autowired + private PcTravelSwitchMapper pcTravelSwitchMapper; + + /** + * 查询行程开关型号 + * + * @param id 行程开关型号ID + * @return 行程开关型号 + */ + @Override + public PcTravelSwitch selectPcTravelSwitchById(Long id) + { + return pcTravelSwitchMapper.selectPcTravelSwitchById(id); + } + + /** + * 查询行程开关型号列表 + * + * @param pcTravelSwitch 行程开关型号 + * @return 行程开关型号 + */ + @Override + public List selectPcTravelSwitchList(PcTravelSwitch pcTravelSwitch) + { + return pcTravelSwitchMapper.selectPcTravelSwitchList(pcTravelSwitch); + } + + /** + * 新增行程开关型号 + * + * @param pcTravelSwitch 行程开关型号 + * @return 结果 + */ + @Override + public int insertPcTravelSwitch(PcTravelSwitch pcTravelSwitch) + { + pcTravelSwitch.setCreateTime(DateUtils.getNowDate()); + return pcTravelSwitchMapper.insertPcTravelSwitch(pcTravelSwitch); + } + + /** + * 修改行程开关型号 + * + * @param pcTravelSwitch 行程开关型号 + * @return 结果 + */ + @Override + public int updatePcTravelSwitch(PcTravelSwitch pcTravelSwitch) + { + return pcTravelSwitchMapper.updatePcTravelSwitch(pcTravelSwitch); + } + + /** + * 批量删除行程开关型号 + * + * @param ids 需要删除的行程开关型号ID + * @return 结果 + */ + @Override + public int deletePcTravelSwitchByIds(Long[] ids) + { + return pcTravelSwitchMapper.deletePcTravelSwitchByIds(ids); + } + + /** + * 删除行程开关型号信息 + * + * @param id 行程开关型号ID + * @return 结果 + */ + @Override + public int deletePcTravelSwitchById(Long id) + { + return pcTravelSwitchMapper.deletePcTravelSwitchById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcTravelSwitch selectPcTravelSwitchByTypeName(String typeName) { + PcTravelSwitch pcTravelSwitch = pcTravelSwitchMapper.selectPcTravelSwitchByTypeName(typeName); + return pcTravelSwitch; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcTwoStageReductionGearServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcTwoStageReductionGearServiceImpl.java new file mode 100644 index 0000000..bff17ca --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcTwoStageReductionGearServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcTwoStageReductionGearMapper; +import com.ruoyi.project.management.domain.PcTwoStageReductionGear; +import com.ruoyi.project.management.service.IPcTwoStageReductionGearService; + +/** + * 二级减速器型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcTwoStageReductionGearServiceImpl implements IPcTwoStageReductionGearService +{ + @Autowired + private PcTwoStageReductionGearMapper pcTwoStageReductionGearMapper; + + /** + * 查询二级减速器型号 + * + * @param id 二级减速器型号ID + * @return 二级减速器型号 + */ + @Override + public PcTwoStageReductionGear selectPcTwoStageReductionGearById(Long id) + { + return pcTwoStageReductionGearMapper.selectPcTwoStageReductionGearById(id); + } + + /** + * 查询二级减速器型号列表 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 二级减速器型号 + */ + @Override + public List selectPcTwoStageReductionGearList(PcTwoStageReductionGear pcTwoStageReductionGear) + { + return pcTwoStageReductionGearMapper.selectPcTwoStageReductionGearList(pcTwoStageReductionGear); + } + + /** + * 新增二级减速器型号 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 结果 + */ + @Override + public int insertPcTwoStageReductionGear(PcTwoStageReductionGear pcTwoStageReductionGear) + { + pcTwoStageReductionGear.setCreateTime(DateUtils.getNowDate()); + return pcTwoStageReductionGearMapper.insertPcTwoStageReductionGear(pcTwoStageReductionGear); + } + + /** + * 修改二级减速器型号 + * + * @param pcTwoStageReductionGear 二级减速器型号 + * @return 结果 + */ + @Override + public int updatePcTwoStageReductionGear(PcTwoStageReductionGear pcTwoStageReductionGear) + { + return pcTwoStageReductionGearMapper.updatePcTwoStageReductionGear(pcTwoStageReductionGear); + } + + /** + * 批量删除二级减速器型号 + * + * @param ids 需要删除的二级减速器型号ID + * @return 结果 + */ + @Override + public int deletePcTwoStageReductionGearByIds(Long[] ids) + { + return pcTwoStageReductionGearMapper.deletePcTwoStageReductionGearByIds(ids); + } + + /** + * 删除二级减速器型号信息 + * + * @param id 二级减速器型号ID + * @return 结果 + */ + @Override + public int deletePcTwoStageReductionGearById(Long id) + { + return pcTwoStageReductionGearMapper.deletePcTwoStageReductionGearById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcTwoStageReductionGear selectPcTwoStageReductionGearByTypeName(String typeName) { + PcTwoStageReductionGear pcTwoStageReductionGear = pcTwoStageReductionGearMapper.selectPcTwoStageReductionGearByTypeName(typeName); + return pcTwoStageReductionGear; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PcWindlassServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcWindlassServiceImpl.java new file mode 100644 index 0000000..f023509 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PcWindlassServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PcWindlassMapper; +import com.ruoyi.project.management.domain.PcWindlass; +import com.ruoyi.project.management.service.IPcWindlassService; + +/** + * 卷扬机型号Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PcWindlassServiceImpl implements IPcWindlassService +{ + @Autowired + private PcWindlassMapper pcWindlassMapper; + + /** + * 查询卷扬机型号 + * + * @param id 卷扬机型号ID + * @return 卷扬机型号 + */ + @Override + public PcWindlass selectPcWindlassById(Long id) + { + return pcWindlassMapper.selectPcWindlassById(id); + } + + /** + * 查询卷扬机型号列表 + * + * @param pcWindlass 卷扬机型号 + * @return 卷扬机型号 + */ + @Override + public List selectPcWindlassList(PcWindlass pcWindlass) + { + return pcWindlassMapper.selectPcWindlassList(pcWindlass); + } + + /** + * 新增卷扬机型号 + * + * @param pcWindlass 卷扬机型号 + * @return 结果 + */ + @Override + public int insertPcWindlass(PcWindlass pcWindlass) + { + pcWindlass.setCreateTime(DateUtils.getNowDate()); + return pcWindlassMapper.insertPcWindlass(pcWindlass); + } + + /** + * 修改卷扬机型号 + * + * @param pcWindlass 卷扬机型号 + * @return 结果 + */ + @Override + public int updatePcWindlass(PcWindlass pcWindlass) + { + return pcWindlassMapper.updatePcWindlass(pcWindlass); + } + + /** + * 批量删除卷扬机型号 + * + * @param ids 需要删除的卷扬机型号ID + * @return 结果 + */ + @Override + public int deletePcWindlassByIds(Long[] ids) + { + return pcWindlassMapper.deletePcWindlassByIds(ids); + } + + /** + * 删除卷扬机型号信息 + * + * @param id 卷扬机型号ID + * @return 结果 + */ + @Override + public int deletePcWindlassById(Long id) + { + return pcWindlassMapper.deletePcWindlassById(id); + } + + /** + * 根据产品型号全称查询 + */ + @Override + public PcWindlass selectPcWindlassByTypeName(String typeName) { + PcWindlass pcWindlass = pcWindlassMapper.selectPcWindlassByTypeName(typeName); + return pcWindlass; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PlannedOrderServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PlannedOrderServiceImpl.java new file mode 100644 index 0000000..0494534 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PlannedOrderServiceImpl.java @@ -0,0 +1,200 @@ +package com.ruoyi.project.management.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpJDUtils; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.mapper.JdErrorMessageMapper; +import com.ruoyi.project.management.service.PlannedOrderService; +import com.ruoyi.project.management.utils.BaseDataTool; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class PlannedOrderServiceImpl implements PlannedOrderService { + + @Value("${ruoyi.jdInterFaceToufUrl}") + private String jdInterFaceUrl; + @Value("${ruoyi.jdSessionUrl}") + private String jdSessionUrl; + @Value("${ruoyi.jd_acctId}") + private String acctId; + @Resource + private JdErrorMessageMapper jdErrormessageMapper; + + @Override + public void queryPlannedOrders(){ + //查询计划订单数据 + String resultJson = ""; + try{ + resultJson = BaseDataTool.queryPlannedOrders(); + }catch (Exception e){ + e.printStackTrace(); + return; + } + if(StringUtils.isEmpty(resultJson) || Constants.JD_RESULT.equals(resultJson)){ + System.out.println("---------------------------------查询金蝶计划订单未投放接口返回结果为空!!-------------------------------------------- "); + return; + } + //解析金蝶返回的数据保存到集合中 + JSONArray arrays = JSONArray.parseArray(resultJson); + List res_list = new ArrayList(); + PlannedOrder plannedOrder = null; + //查询物料 + List material_list = null; + try{ + material_list = BaseDataTool.queryMaterialsForInstantLibrary(""); + }catch (Exception e){ + e.printStackTrace(); + return; + } + for(int i=0;i parent_list = new ArrayList(); + //循环找出订单中的子产品 + PlannedOrderParent plannedOrderParent = null; + List son_list = null; + PlannedOrderSon plannedOrderSon = null; + for (int i=0;i(); + plannedOrderSon = new PlannedOrderSon(); + plannedOrderSon.setSonCode(res_list.get(i).getSonCode()); + plannedOrderSon.setSonNum(new BigDecimal(res_list.get(i).getSonNum())); + plannedOrderSon.setSonName(res_list.get(i).getSonName()); + son_list.add(plannedOrderSon); + for (int j = i + 1; j < res_list.size(); j++) { + //判断是否是同一订单 + if(res_list.get(i).getOrderNumber().equals(res_list.get(j).getOrderNumber()) && res_list.get(i).getParentCode().equals(res_list.get(j).getParentCode())){ + plannedOrderSon = new PlannedOrderSon(); + plannedOrderSon.setSonCode(res_list.get(j).getSonCode()); + plannedOrderSon.setSonNum(new BigDecimal(res_list.get(j).getSonNum())); + plannedOrderSon.setSonName(res_list.get(j).getSonName()); + son_list.add(plannedOrderSon); + res_list.remove(j); + j--; + } + } + plannedOrderParent.setSonList(son_list); + parent_list.add(plannedOrderParent); + } + //循环订单查询子产品是否满足 + for (PlannedOrderParent parent_order : parent_list) { + //判断父级下边的子订单是否满足,满足投放 + //标识子集的满足个数 + int sonNumber = 0; + for (PlannedOrderSon son_order : parent_order.getSonList()) { + for(JDInvertoryVo material : material_list){ + if(material.getFnumber().equals(son_order.getSonCode())){ + //判断即时库存物料是否大于需求数量 + if(new BigDecimal(material.getBaseQty()).compareTo(son_order.getSonNum()) == 1){ + sonNumber += 1; + } + } + } + } + if(parent_order.getSonList().size() == sonNumber){ + advertising(parent_order); + } + } + } + + /** + * 投放数据 + * @param plannedOrder + */ + private void advertising(PlannedOrderParent plannedOrder){ + JdErrorMessage jdErrormessage = null; + try{ + switch (plannedOrder.getOrderStatus()){ + case Constants.ORDER_STATUS_A: + //提交 + String res_submit = BaseDataTool.submitJDInformation(Constants.JD_FORMID_PLANNEDORDER,plannedOrder.getBillNumber()); + if(StringUtils.isNotEmpty(res_submit)){ + //错误记录错误日志 + jdErrormessage = new JdErrorMessage(); + jdErrormessage.setMessageId(plannedOrder.getOrderNumber()); + jdErrormessage.setStatus(Constants.JD_MESSAGE_ERROR_FLAG); + jdErrormessage.setMessageContent(res_submit); + jdErrormessage.setMessageOpt(Constants.JD_MESSAGE_SUBMIT); + jdErrormessage.setMessageType(Constants.JD_MESSAGE_TYPE); + jdErrormessage.setCreateTime(new Date()); + jdErrormessageMapper.insertJdErrorMessage(jdErrormessage); + return; + } + case Constants.ORDER_STATUS_B: + //审核 + String res_audit = BaseDataTool.auditJDInformation(Constants.JD_FORMID_PLANNEDORDER,plannedOrder.getBillNumber()); + if(StringUtils.isNotEmpty(res_audit)){ + //错误记录错误日志 + jdErrormessage = new JdErrorMessage(); + jdErrormessage.setMessageId(plannedOrder.getOrderNumber()); + jdErrormessage.setStatus(Constants.JD_MESSAGE_ERROR_FLAG); + jdErrormessage.setMessageContent(res_audit); + jdErrormessage.setMessageOpt(Constants.JD_MESSAGE_AUDIT); + jdErrormessage.setMessageType(Constants.JD_MESSAGE_TYPE); + jdErrormessage.setCreateTime(new Date()); + jdErrormessageMapper.insertJdErrorMessage(jdErrormessage); + return; + } + case Constants.ORDER_STATUS_C: + break; + } + }catch (Exception e){ + e.printStackTrace(); + } + //获取金蝶的sessionId + String jd_param = "{\"acctID\": \""+acctId+"\",\"Username\": \"Administrator\",\"appId\": \"270187_01dPwbFu0NmW2YVp1fSLSc/uziwb4qks\",\"appSecret\": \"2cc5b5308fb044cfaa89bdd73964d59f\", \"lcid\": 2052}"; + String RES = HttpJDUtils.sendPost(jdSessionUrl,jd_param); + JSONObject object_s = JSONObject.parseObject(RES); + String sessionId = object_s.getString("KDSVCSessionId"); + //组装投放的参数 + String param = "{\"JsonParam\":{\"PkId\":\""+plannedOrder.getOrderNumber()+"\"}}"; + //调用投放接口 + String reslut = HttpJDUtils.sendJDPost(jdInterFaceUrl,param,sessionId); + JSONObject object = JSONObject.parseObject(reslut); + if(Constants.ADVERTISSING_SECCESS.equals(object.getString("Status"))){ + System.out.println("----------------------------------投放成功!!----------------------------------------------"); + }else{ + System.out.println("********************************************投放失败!!**************************************************"); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwAlterationDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwAlterationDetailServiceImpl.java new file mode 100644 index 0000000..598b467 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwAlterationDetailServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwAlterationDetailMapper; +import com.ruoyi.project.management.domain.PwAlterationDetail; +import com.ruoyi.project.management.service.IPwAlterationDetailService; + +/** + * 变更单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-04-14 + */ +@Service +public class PwAlterationDetailServiceImpl implements IPwAlterationDetailService +{ + @Autowired + private PwAlterationDetailMapper pwAlterationDetailMapper; + + /** + * 查询变更单详情 + * + * @param id 变更单详情ID + * @return 变更单详情 + */ + @Override + public PwAlterationDetail selectPwAlterationDetailById(Long id) + { + return pwAlterationDetailMapper.selectPwAlterationDetailById(id); + } + + /** + * 查询变更单详情列表 + * + * @param pwAlterationDetail 变更单详情 + * @return 变更单详情 + */ + @Override + public List selectPwAlterationDetailList(PwAlterationDetail pwAlterationDetail) + { + return pwAlterationDetailMapper.selectPwAlterationDetailList(pwAlterationDetail); + } + + /** + * 新增变更单详情 + * + * @param pwAlterationDetail 变更单详情 + * @return 结果 + */ + @Override + public int insertPwAlterationDetail(PwAlterationDetail pwAlterationDetail) + { + pwAlterationDetail.setCreateTime(DateUtils.getNowDate()); + return pwAlterationDetailMapper.insertPwAlterationDetail(pwAlterationDetail); + } + + /** + * 修改变更单详情 + * + * @param pwAlterationDetail 变更单详情 + * @return 结果 + */ + @Override + public int updatePwAlterationDetail(PwAlterationDetail pwAlterationDetail) + { + return pwAlterationDetailMapper.updatePwAlterationDetail(pwAlterationDetail); + } + + /** + * 批量删除变更单详情 + * + * @param ids 需要删除的变更单详情ID + * @return 结果 + */ + @Override + public int deletePwAlterationDetailByIds(Long[] ids) + { + return pwAlterationDetailMapper.deletePwAlterationDetailByIds(ids); + } + + /** + * 删除变更单详情信息 + * + * @param id 变更单详情ID + * @return 结果 + */ + @Override + public int deletePwAlterationDetailById(Long id) + { + return pwAlterationDetailMapper.deletePwAlterationDetailById(id); + } + + @Override + public List selectPwAlterationDetailByAlterationId(Long id) { + // TODO Auto-generated method stub + return pwAlterationDetailMapper.selectPwAlterationDetailByAlterationId(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwAlterationServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwAlterationServiceImpl.java new file mode 100644 index 0000000..03c4700 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwAlterationServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwAlterationMapper; +import com.ruoyi.project.management.domain.PwAlteration; +import com.ruoyi.project.management.service.IPwAlterationService; + +/** + * 变更单Service业务层处理 + * + * @author zhukangchao + * @date 2022-04-14 + */ +@Service +public class PwAlterationServiceImpl implements IPwAlterationService +{ + @Autowired + private PwAlterationMapper pwAlterationMapper; + + /** + * 查询变更单 + * + * @param id 变更单ID + * @return 变更单 + */ + @Override + public PwAlteration selectPwAlterationById(Long id) + { + return pwAlterationMapper.selectPwAlterationById(id); + } + + /** + * 查询变更单列表 + * + * @param pwAlteration 变更单 + * @return 变更单 + */ + @Override + public List selectPwAlterationList(PwAlteration pwAlteration) + { + return pwAlterationMapper.selectPwAlterationList(pwAlteration); + } + + /** + * 新增变更单 + * + * @param pwAlteration 变更单 + * @return 结果 + */ + @Override + public int insertPwAlteration(PwAlteration pwAlteration) + { + pwAlteration.setCreateTime(DateUtils.getNowDate()); + return pwAlterationMapper.insertPwAlteration(pwAlteration); + } + + /** + * 修改变更单 + * + * @param pwAlteration 变更单 + * @return 结果 + */ + @Override + public int updatePwAlteration(PwAlteration pwAlteration) + { + return pwAlterationMapper.updatePwAlteration(pwAlteration); + } + + /** + * 批量删除变更单 + * + * @param ids 需要删除的变更单ID + * @return 结果 + */ + @Override + public int deletePwAlterationByIds(Long[] ids) + { + return pwAlterationMapper.deletePwAlterationByIds(ids); + } + + /** + * 删除变更单信息 + * + * @param id 变更单ID + * @return 结果 + */ + @Override + public int deletePwAlterationById(Long id) + { + return pwAlterationMapper.deletePwAlterationById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBacklogServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBacklogServiceImpl.java new file mode 100644 index 0000000..a47bcd0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBacklogServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBacklogMapper; +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.service.IPwBacklogService; + +/** + * 待办事项Service业务层处理 + * + * @author zhukangchao + * @date 2023-02-05 + */ +@Service +public class PwBacklogServiceImpl implements IPwBacklogService +{ + @Autowired + private PwBacklogMapper pwBacklogMapper; + + /** + * 查询待办事项 + * + * @param id 待办事项ID + * @return 待办事项 + */ + @Override + public PwBacklog selectPwBacklogById(Long id) + { + return pwBacklogMapper.selectPwBacklogById(id); + } + + /** + * 查询待办事项列表 + * + * @param pwBacklog 待办事项 + * @return 待办事项 + */ + @Override + public List selectPwBacklogList(PwBacklog pwBacklog) + { + return pwBacklogMapper.selectPwBacklogList(pwBacklog); + } + + /** + * 新增待办事项 + * + * @param pwBacklog 待办事项 + * @return 结果 + */ + @Override + public int insertPwBacklog(PwBacklog pwBacklog){ + pwBacklog.setCreateTime(DateUtils.getNowDate()); + return pwBacklogMapper.insertPwBacklog(pwBacklog); + } + + /** + * 修改待办事项 + * + * @param pwBacklog 待办事项 + * @return 结果 + */ + @Override + public int updatePwBacklog(PwBacklog pwBacklog) + { + return pwBacklogMapper.updatePwBacklog(pwBacklog); + } + + /** + * 批量删除待办事项 + * + * @param ids 需要删除的待办事项ID + * @return 结果 + */ + @Override + public int deletePwBacklogByIds(Long[] ids) + { + return pwBacklogMapper.deletePwBacklogByIds(ids); + } + + /** + * 删除待办事项信息 + * + * @param id 待办事项ID + * @return 结果 + */ + @Override + public int deletePwBacklogById(Long id) + { + return pwBacklogMapper.deletePwBacklogById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberServiceImpl.java new file mode 100644 index 0000000..40d74e9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberServiceImpl.java @@ -0,0 +1,179 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.ArrayList; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.mapper.*; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.service.IPwBomNumberService; +import javax.annotation.Resource; + +/** + * 数量计算Service业务层处理 + * + * @author zhukangchao + * @date 2021-03-22 + */ +@Service +public class PwBomNumberServiceImpl implements IPwBomNumberService +{ + @Resource + private PwBomNumberMapper pwBomNumberMapper; + /** + * 查询数量计算 + * + * @param id 数量计算ID + * @return 数量计算 + */ + @Override + public PwBomNumber selectPwBomNumberById(Long id) + { + return pwBomNumberMapper.selectPwBomNumberById(id); + } + + /** + * 查询数量计算列表 + * + * @param pwBomNumber 数量计算 + * @return 数量计算 + */ + @Override + public List selectPwBomNumberList(PwBomNumber pwBomNumber) + { + return pwBomNumberMapper.selectPwBomNumberList(pwBomNumber); + } + + /** + * 新增数量计算 + * + * @param pwBomNumber 数量计算 + * @return 结果 + */ + @Override + public int insertPwBomNumber(PwBomNumber pwBomNumber) + { + pwBomNumber.setCreateTime(DateUtils.getNowDate()); + return pwBomNumberMapper.insertPwBomNumber(pwBomNumber); + } + + /** + * 修改数量计算 + * + * @param pwBomNumber 数量计算 + * @return 结果 + */ + @Override + public int updatePwBomNumber(PwBomNumber pwBomNumber) + { + return pwBomNumberMapper.updatePwBomNumber(pwBomNumber); + } + + @Override + public List selectPwBomNumberByParentLevelFigureNumber(String parentLevelFigureNumber,String typeName,String code) { + + return pwBomNumberMapper.selectPwBomNumberByParentLevelFigureNumber(parentLevelFigureNumber,parentLevelFigureNumber+"/2-1",parentLevelFigureNumber+"/2-2",typeName,code); + } + + @Override + public List selectPwBomNumberByCode(String code) { + + return pwBomNumberMapper.selectPwBomNumberByCode(code); + } + + @Override + public List queryPwBomNumberByCode(String code) { + + return pwBomNumberMapper.queryPwBomNumberByCode(code); + } + + @Override + public int insertPwBoms(List list) { + + return pwBomNumberMapper.insertPwBoms(list); + } + + @Override + public int deletePwBomNumberByCode(String code) { + + return pwBomNumberMapper.deletePwBomNumberByCode(code); + } + + @Override + public List selectPwBomNumberByCodeAndTypeName(String code, String typeName) { + // TODO Auto-generated method stub + return pwBomNumberMapper.selectPwBomNumberByCodeAndTypeName(code,typeName); + } + + @Override + public List selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(String productionCode, + String name, String figureNumber, String sparedOne) { + // TODO Auto-generated method stub + return pwBomNumberMapper.selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(productionCode,name,figureNumber,sparedOne); + } + + @Override + public List selectPwBomNumberByCodeAndNameAndFigureNumber(String productionCode, String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberMapper.selectPwBomNumberByCodeAndNameAndFigureNumber(productionCode,name,figureNumber); + } + + @Override + public List queryPwBomNumberZTByCode(String code){ + return pwBomNumberMapper.queryPwBomNumberZTByCode(code); + } + + @Override + public List selectPwBomNumberByParentFigureNumber(String parentLevelFigureNumber,String code){ + return pwBomNumberMapper.selectPwBomNumberByParentFigureNumber(parentLevelFigureNumber,code); + } + /** + * 根据生产单号,父级图号,序号查询 + * @param parentLevelFigureNumber 父级图号 + * @param code 生产单号 + * @param num 序号 + * @return + */ + @Override + public List queryPwBomNumberByParentFigureNumberAndNum(String parentLevelFigureNumber,String code,String num){ + return pwBomNumberMapper.queryPwBomNumberByParentFigureNumberAndNum(parentLevelFigureNumber,code,num); + } + /** + * 根据生产令号和图号修改属性 + * @param purchaseMark 属性 + * @param productCode 生产令号 + * @param figureNumber 图号 + * @return + */ + @Override + public int updatePwBomNumberByCodeAndFigureNumber(String purchaseMark,String productCode,String figureNumber){ + return pwBomNumberMapper.updatePwBomNumberByCodeAndFigureNumber(purchaseMark,productCode,figureNumber); + } + + /** + * 根据生产令号查询BOM + * @param code + * @return + */ + @Override + public List queryBomList(String code){ + List list = pwBomNumberMapper.queryPwBomNumberByCode(code); + List res_list = new ArrayList(); + ProdictBillBom prodictBillBom = null; + for (PwBomNumber pwBomNumber : list) { + prodictBillBom = new ProdictBillBom(); + prodictBillBom.setCode(pwBomNumber.getProductionCode()); + prodictBillBom.setName(pwBomNumber.getName()); + prodictBillBom.setFigureNumber(pwBomNumber.getFigureNumber()); + prodictBillBom.setNum(pwBomNumber.getNum()); + prodictBillBom.setOneNumber(pwBomNumber.getOneNumber().intValue()); + prodictBillBom.setSpecification(pwBomNumber.getType()); + prodictBillBom.setRemarks(pwBomNumber.getRemarks()); + prodictBillBom.setTypeName(pwBomNumber.getSparedTwo()); + res_list.add(prodictBillBom); + } + return res_list; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoFuServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoFuServiceImpl.java new file mode 100644 index 0000000..b79058e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoFuServiceImpl.java @@ -0,0 +1,129 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBomNumberTwoFuMapper; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoFu; +import com.ruoyi.project.management.service.IPwBomNumberTwoFuService; + +/** + * 副BomService业务层处理 + * + * @author zhukangchao + * @date 2023-04-17 + */ +@Service +public class PwBomNumberTwoFuServiceImpl implements IPwBomNumberTwoFuService +{ + @Autowired + private PwBomNumberTwoFuMapper pwBomNumberTwoFuMapper; + + /** + * 查询副Bom + * + * @param id 副BomID + * @return 副Bom + */ + @Override + public PwBomNumberTwoFu selectPwBomNumberTwoFuById(Long id) + { + return pwBomNumberTwoFuMapper.selectPwBomNumberTwoFuById(id); + } + + /** + * 查询副Bom列表 + * + * @param pwBomNumberTwoFu 副Bom + * @return 副Bom + */ + @Override + public List selectPwBomNumberTwoFuList(PwBomNumberTwoFu pwBomNumberTwoFu) + { + return pwBomNumberTwoFuMapper.selectPwBomNumberTwoFuList(pwBomNumberTwoFu); + } + + /** + * 新增副Bom + * + * @param pwBomNumberTwoFu 副Bom + * @return 结果 + */ + @Override + public int insertPwBomNumberTwoFu(PwBomNumberTwoFu pwBomNumberTwoFu) + { + pwBomNumberTwoFu.setCreateTime(DateUtils.getNowDate()); + return pwBomNumberTwoFuMapper.insertPwBomNumberTwoFu(pwBomNumberTwoFu); + } + + /** + * 修改副Bom + * + * @param pwBomNumberTwoFu 副Bom + * @return 结果 + */ + @Override + public int updatePwBomNumberTwoFu(PwBomNumberTwoFu pwBomNumberTwoFu) + { + return pwBomNumberTwoFuMapper.updatePwBomNumberTwoFu(pwBomNumberTwoFu); + } + + /** + * 批量删除副Bom + * + * @param ids 需要删除的副BomID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoFuByIds(Long[] ids) + { + return pwBomNumberTwoFuMapper.deletePwBomNumberTwoFuByIds(ids); + } + + /** + * 删除副Bom信息 + * + * @param id 副BomID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoFuById(Long id) + { + return pwBomNumberTwoFuMapper.deletePwBomNumberTwoFuById(id); + } + + @Override + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndParentLevelNameAndParentLevelFigureNumber( + String productionCode, String parentLevelName, String parentLevelFigureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoFuMapper.selectPwBomNumberTwoFuByCodeAndParentLevelNameAndParentLevelFigureNumber(productionCode,parentLevelName,parentLevelFigureNumber); + } + + @Override + public List selectPwBomNumberTwoFuByCodeAndSuperiorId(String productionCode, Long id) { + // TODO Auto-generated method stub + return pwBomNumberTwoFuMapper.selectPwBomNumberTwoFuByCodeAndSuperiorId(productionCode,id); + } + + @Override + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndFigureNumber(String productionCode, String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoFuMapper.selectPwBomNumberTwoFuByCodeAndFigureNumber(productionCode,figureNumber); + } + + @Override + public PwBomNumberTwoFu selectPwBomNumberTwoFuByCodeAndNameAndFigureNumber(String productionCode, String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoFuMapper.selectPwBomNumberTwoFuByCodeAndNameAndFigureNumber(productionCode,name,figureNumber); + } + + @Override + public List selectPwBomByCodeAndParentNameAndParentFigureNumbers(String productionCode, String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoFuMapper.selectPwBomByCodeAndParentNameAndParentFigureNumbers(productionCode,name,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoGongxuServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoGongxuServiceImpl.java new file mode 100644 index 0000000..fec9416 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoGongxuServiceImpl.java @@ -0,0 +1,102 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBomNumberTwoGongxuMapper; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoGongxu; +import com.ruoyi.project.management.service.IPwBomNumberTwoGongxuService; + +/** + * BOM工序引用Service业务层处理 + * + * @author zhukangchao + * @date 2023-09-24 + */ +@Service +public class PwBomNumberTwoGongxuServiceImpl implements IPwBomNumberTwoGongxuService +{ + @Autowired + private PwBomNumberTwoGongxuMapper pwBomNumberTwoGongxuMapper; + + /** + * 查询BOM工序引用 + * + * @param id BOM工序引用ID + * @return BOM工序引用 + */ + @Override + public PwBomNumberTwoGongxu selectPwBomNumberTwoGongxuById(Long id) + { + return pwBomNumberTwoGongxuMapper.selectPwBomNumberTwoGongxuById(id); + } + + /** + * 查询BOM工序引用列表 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return BOM工序引用 + */ + @Override + public List selectPwBomNumberTwoGongxuList(PwBomNumberTwoGongxu pwBomNumberTwoGongxu) + { + return pwBomNumberTwoGongxuMapper.selectPwBomNumberTwoGongxuList(pwBomNumberTwoGongxu); + } + + /** + * 新增BOM工序引用 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return 结果 + */ + @Override + public int insertPwBomNumberTwoGongxu(PwBomNumberTwoGongxu pwBomNumberTwoGongxu) + { + pwBomNumberTwoGongxu.setCreateTime(DateUtils.getNowDate()); + return pwBomNumberTwoGongxuMapper.insertPwBomNumberTwoGongxu(pwBomNumberTwoGongxu); + } + + /** + * 修改BOM工序引用 + * + * @param pwBomNumberTwoGongxu BOM工序引用 + * @return 结果 + */ + @Override + public int updatePwBomNumberTwoGongxu(PwBomNumberTwoGongxu pwBomNumberTwoGongxu) + { + return pwBomNumberTwoGongxuMapper.updatePwBomNumberTwoGongxu(pwBomNumberTwoGongxu); + } + + /** + * 批量删除BOM工序引用 + * + * @param ids 需要删除的BOM工序引用ID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoGongxuByIds(Long[] ids) + { + return pwBomNumberTwoGongxuMapper.deletePwBomNumberTwoGongxuByIds(ids); + } + + /** + * 删除BOM工序引用信息 + * + * @param id BOM工序引用ID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoGongxuById(Long id) + { + return pwBomNumberTwoGongxuMapper.deletePwBomNumberTwoGongxuById(id); + } + + @Override + public int insertPwBomNumberTwoGongxus(List list) { + // TODO Auto-generated method stub + return pwBomNumberTwoGongxuMapper.insertPwBomNumberTwoGongxus(list); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoLingliaoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoLingliaoServiceImpl.java new file mode 100644 index 0000000..2fba8fa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoLingliaoServiceImpl.java @@ -0,0 +1,141 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBomNumberTwoLingliaoMapper; +import com.ruoyi.project.management.domain.PwBomNumberTwoLingliao; +import com.ruoyi.project.management.service.IPwBomNumberTwoLingliaoService; + +/** + * 领料专用bomService业务层处理 + * + * @author zhukangchao + * @date 2022-02-23 + */ +@Service +public class PwBomNumberTwoLingliaoServiceImpl implements IPwBomNumberTwoLingliaoService +{ + @Autowired + private PwBomNumberTwoLingliaoMapper pwBomNumberTwoLingliaoMapper; + + /** + * 查询领料专用bom + * + * @param id 领料专用bomID + * @return 领料专用bom + */ + @Override + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingliaoById(Long id) + { + return pwBomNumberTwoLingliaoMapper.selectPwBomNumberTwoLingliaoById(id); + } + + /** + * 查询领料专用bom列表 + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 领料专用bom + */ + @Override + public List selectPwBomNumberTwoLingliaoList(PwBomNumberTwoLingliao pwBomNumberTwoLingliao) + { + return pwBomNumberTwoLingliaoMapper.selectPwBomNumberTwoLingliaoList(pwBomNumberTwoLingliao); + } + + /** + * 新增领料专用bom + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 结果 + */ + @Override + public int insertPwBomNumberTwoLingliao(PwBomNumberTwoLingliao pwBomNumberTwoLingliao) + { + pwBomNumberTwoLingliao.setCreateTime(DateUtils.getNowDate()); + return pwBomNumberTwoLingliaoMapper.insertPwBomNumberTwoLingliao(pwBomNumberTwoLingliao); + } + + /** + * 修改领料专用bom + * + * @param pwBomNumberTwoLingliao 领料专用bom + * @return 结果 + */ + @Override + public int updatePwBomNumberTwoLingliao(PwBomNumberTwoLingliao pwBomNumberTwoLingliao) + { + return pwBomNumberTwoLingliaoMapper.updatePwBomNumberTwoLingliao(pwBomNumberTwoLingliao); + } + + /** + * 批量删除领料专用bom + * + * @param ids 需要删除的领料专用bomID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoLingliaoByIds(Long[] ids) + { + return pwBomNumberTwoLingliaoMapper.deletePwBomNumberTwoLingliaoByIds(ids); + } + + /** + * 删除领料专用bom信息 + * + * @param id 领料专用bomID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoLingliaoById(Long id) + { + return pwBomNumberTwoLingliaoMapper.deletePwBomNumberTwoLingliaoById(id); + } + + @Override + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(String productionCode, String type, String name, String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoLingliaoMapper.selectPwBomNumberTwoLingliaoByCodeAndTypeNameAndFigureNumber(productionCode,type,name,figureNumber); + } + + @Override + public List selectPwBomNumberTwoLingliaoByCodeAndProductType(String code, + String productType) { + // TODO Auto-generated method stub + return pwBomNumberTwoLingliaoMapper.selectPwBomNumberTwoLingliaoByCodeAndProductType(code,productType); + } + + @Override + public int deletePwBomNumberTwoLingliaoByCode(String code) { + // TODO Auto-generated method stub + return pwBomNumberTwoLingliaoMapper.deletePwBomNumberTwoLingliaoByCode(code); + } + + @Override + public List selectPwBomNumberTwoLingliaoByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return pwBomNumberTwoLingliaoMapper.selectPwBomNumberTwoLingliaoByFigureNumberAndAllGB(); + } + + @Override + public List selectPwBomNumberTwoLingliaoByCodeAndFigureNumber(String productionCode, String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoLingliaoMapper.selectPwBomNumberTwoLingliaoByCodeAndFigureNumber(productionCode,name,figureNumber); + } + + @Override + public List selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(String productionCode, + String name, String figureNumber,String type) { + // TODO Auto-generated method stub + return pwBomNumberTwoLingliaoMapper.selectBomLingliaoByCodeAndLevelNameAndLevelFigureNumberAndType(productionCode,name,figureNumber,type); + } + + @Override + public PwBomNumberTwoLingliao selectPwBomNumberTwoLingLiaoByCodeAndNameAndFigureNumber(String productionCode, + String name, String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoLingliaoMapper.selectPwBomNumberTwoLingLiaoByCodeAndNameAndFigureNumber(productionCode,name,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoServiceImpl.java new file mode 100644 index 0000000..04318b6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomNumberTwoServiceImpl.java @@ -0,0 +1,397 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.mapper.PwBomNumberMapper; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBomNumberTwoMapper; +import com.ruoyi.project.management.domain.PwBomNumberTwo; +import com.ruoyi.project.management.domain.PwBomNumberTwoVo; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import javax.annotation.Resource; + +/** + * 数量保存Service业务层处理 + * + * @author zhukangchao + * @date 2021-03-30 + */ +@Service +public class PwBomNumberTwoServiceImpl implements IPwBomNumberTwoService +{ + @Resource + private PwBomNumberTwoMapper pwBomNumberTwoMapper; + @Resource + private PwBomNumberMapper pwBomNumberMapper; + /** + * 查询数量保存 + * + * @param id 数量保存ID + * @return 数量保存 + */ + @Override + public PwBomNumberTwo selectPwBomNumberTwoById(Long id) + { + PwBomNumberTwo pwBomNumberTwo = pwBomNumberTwoMapper.selectPwBomNumberTwoById(id); + /*if("组焊件".equals(pwBomNumberTwo.getType())){ + List children_list = pwBomNumberTwoMapper.selectPwBomByCodeAndParentNameAndParentFigureNumbers(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + pwBomNumberTwo.setChildren(children_list); + }*/ + return pwBomNumberTwo; + } + + /** + * 查询数量保存列表 + * + * @param pwBomNumberTwo 数量保存 + * @return 数量保存 + */ + @Override + public List selectPwBomNumberTwoList(PwBomNumberTwo pwBomNumberTwo) + { + return pwBomNumberTwoMapper.selectPwBomNumberTwoList(pwBomNumberTwo); + } + + /** + * 查询数量保存列表(去掉本批数量为0的数据) + * + * @param pwBomNumberTwo 数量保存 + * @return 数量保存 + */ + @Override + public List selectPwBomNumberTwoLists(PwBomNumberTwo pwBomNumberTwo) + { + return pwBomNumberTwoMapper.selectPwBomNumberTwoLists(pwBomNumberTwo); + } + + /** + * 新增数量保存 + * + * @param pwBomNumberTwo 数量保存 + * @return 结果 + */ + @Override + public int insertPwBomNumberTwo(PwBomNumberTwo pwBomNumberTwo) + { + pwBomNumberTwo.setCreateTime(DateUtils.getNowDate()); + return pwBomNumberTwoMapper.insertPwBomNumberTwo(pwBomNumberTwo); + } + + /** + * 修改数量保存 + * + * @param pwBomNumberTwo 数量保存 + * @return 结果 + */ + @Override + public int updatePwBomNumberTwo(PwBomNumberTwo pwBomNumberTwo) + { + return pwBomNumberTwoMapper.updatePwBomNumberTwo(pwBomNumberTwo); + } + + /** + * 批量删除数量保存 + * + * @param ids 需要删除的数量保存ID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoByIds(Long[] ids) + { + return pwBomNumberTwoMapper.deletePwBomNumberTwoByIds(ids); + } + + /** + * 删除数量保存信息 + * + * @param id 数量保存ID + * @return 结果 + */ + @Override + public int deletePwBomNumberTwoById(Long id) + { + return pwBomNumberTwoMapper.deletePwBomNumberTwoById(id); + } + + @Override + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(String productionCode,String name,String figureNumber) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(productionCode,name,figureNumber); + } + + @Override + public List selectPwBomNumberTwoByCode(String code) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCode(code); + } + + @Override + public int deletePwBomNumberTwoByCode(String code) { + + return pwBomNumberTwoMapper.deletePwBomNumberTwoByCode(code); + } + + @Override + public List selectPwBomNumberTwoByCodeAndProductType(String code, String productType) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndProductType(code,productType); + } + + /** + * 根据生产令号查询当前令号下所有的物料信息 + */ + @Override + public List selectPwBomNumberTwoByProductionCode(String code) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByProductionCode(code); + } + + @Override + public List selectPwBomNumberTwoByNameAndFigureNumberNoRepetition(String name, + String figureNumber) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByNameAndFigureNumberNoRepetition(name,figureNumber); + } + + @Override + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndNameAndFigureNumber(String makeDocumentsCode, + String materialName, String specification) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndNameAndFigureNumber(makeDocumentsCode,materialName,specification); + } + + @Override + public List selectPwBomNumberTwoByCodeAndIsSpacing(String code) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndIsSpacing(code); + } + + @Override + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumber(String productionCode, + String parentLevelName, String parentLevelFigureNumber) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumber(productionCode,parentLevelName,parentLevelFigureNumber); + } + + @Override + public List selectPwBomNumberTwoByCodeAndSuperiorId(String productionCode, Long id) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndSuperiorId(productionCode,id); + } + + @Override + public List selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumbers(String code,String parentLevelName, String figureNumber) { + + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndParentLevelNameAndParentLevelFigureNumbers(code,parentLevelName,figureNumber); + } + + @Override + public PwBomNumberTwo selectPwBomNumberTwoByCodeAndFigureNumber(String productionCode, String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndFigureNumber(productionCode,figureNumber); + } + + @Override + public List selectPwBomNumberTwoByCodeAndSuperiorIdAndDepartmentName(String productionCode, + Long id) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndSuperiorIdAndDepartmentName(productionCode,id); + } + + @Override + public List selectPwBomNumberTwoListToBom(PwBomNumberTwo two) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoListToBom(two); + } + + @Override + public List selectPwBomNumberTwoByProductionCodeALL(String code) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByProductionCodeALL(code); + } + + @Override + public List selectPwBomNumberTwoListHomeMade(PwBomNumberTwo pwBomNumberTwo) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoListHomeMade(pwBomNumberTwo); + } + + @Override + public List selectPwBomNumberTwoListStandard(PwBomNumberTwo pwBomNumberTwo) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoListStandard(pwBomNumberTwo); + } + + @Override + public List selectPwBomNumberTwoListOutsourcing(PwBomNumberTwo pwBomNumberTwo) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoListOutsourcing(pwBomNumberTwo); + } + + @Override + public List selectPwBomNumberTwoListFirstParty(PwBomNumberTwo pwBomNumberTwo) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoListFirstParty(pwBomNumberTwo); + } + + @Override + public List selectPwBomNumberTwoByCodeByG(String code) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeByG(code); + } + + @Override + public List selectPwBomNumberTwoByCodeAndSuperiorIdNotIsNull(String productionCode) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndSuperiorIdNotIsNull(productionCode); + } + + @Override + public List selectPwBomNumberTwoListToBomVo(PwBomNumberTwoVo two) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoListToBomVo(two); + } + + @Override + public List selectPwBomNumberTwoVoByCodeAndSuperiorId(String productionCode, Long id) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoVoByCodeAndSuperiorId(productionCode,id); + } + + @Override + public List selectPwBomNumberTwoByCodeAndMuXiang(String code) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndMuXiang(code); + } + + @Override + public List selectPwBomNumberTwoByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByFigureNumberAndAllGB(); + } + + @Override + public List selectPwBomNumberTwoByDeptNameAndWeiWanCheng(PwBomNumberTwo pwBomNumberTwo) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByDeptNameAndWeiWanCheng(pwBomNumberTwo); + } + + @Override + public List selectPwBomByCodeAndParentNameAndParentFigureNumbers(String productionCode, String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomByCodeAndParentNameAndParentFigureNumbers(productionCode,name,figureNumber); + } + + @Override + public List selectPwBomNumberTwoByCodeAndKanBan(String code) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndKanBan(code); + } + + @Override + public List selectPwBomNumberTwoByCodeAndAll(String code) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndAll(code); + } + + @Override + public List selectPwBomNumberTwoByNameAndFigureNumber(String name, String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByNameAndFigureNumber(name,figureNumber); + } + + @Override + public List selectPwBomNumberTwoByMaterialId(Long id) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByMaterialId(id); + } + + /** + * 根据令号和原材料名称和原材料图号查询添加了原材料的数据 + */ + @Override + public List selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(String code, String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(code,name,figureNumber); + } + + @Override + public List selectBomTwoByCodeAndSparedOne(String code, String productType) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectBomTwoByCodeAndSparedOne(code,productType); + } + + @Override + public List selectPwBomNumberTwoByCodeAndMaterialIdIsNotNull(String productionCode) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectPwBomNumberTwoByCodeAndMaterialIdIsNotNull(productionCode); + } + + @Override + public List selectbycodeAndSparedFive(String productionCode, int i) { + // TODO Auto-generated method stub + return pwBomNumberTwoMapper.selectbycodeAndSparedFive(productionCode,i); + } + + /** + * 批量新增数量保存 + * + * @param bomList 数量保存 + * @return 结果 + */ + @Override + public int insertBatchPwBomNumberTwo(List bomList){ + return pwBomNumberTwoMapper.insertBatchPwBomNumberTwo(bomList); + } + + @Override + public AjaxResult importData(List list){ + int i =0; + for (PwBomNumberTwo pwBomNumberTwo : list) { + //根据ID判断是否新增 + if(pwBomNumberTwo.getId() != null){ + pwBomNumberTwoMapper.updatePwBomNumberTwo(pwBomNumberTwo); + }else{ + pwBomNumberTwoMapper.insertPwBomNumberTwo(pwBomNumberTwo); + } + } + return AjaxResult.success(); + } + @Override + public List selectPwBomNumberTwoListForJd(String productCode){ + return pwBomNumberTwoMapper.selectPwBomNumberTwoListForJd(productCode); + } + /** + * 根据图号和生产令号,查询本图号及其工艺 + * @param productionCode + * @param figureNumber + * @return + */ + @Override + public List queryPwBomNumberTwoProcessByCodeAndFigureNumber(String productionCode, String figureNumber){ + return pwBomNumberTwoMapper.queryPwBomNumberTwoProcessByCodeAndFigureNumber(productionCode,figureNumber); + } + + @Override + public List queryPwBomNumberTwoProcessByCodeAndNum(String productionCode, String num){ + return pwBomNumberTwoMapper.queryPwBomNumberTwoProcessByCodeAndNum(productionCode,num); + } + @Override + public List queryProcessByCodeAndFigureNumber(Long id){ + return pwBomNumberTwoMapper.queryProcessByCodeAndFigureNumber(id); + } + /** + * 根据父级ID查询工序 + * @return + */ + @Override + public List queryProcessByParentId(Long parentId){ + return pwBomNumberTwoMapper.queryProcessByParentId(parentId); + } + + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomServiceImpl.java new file mode 100644 index 0000000..68c0d5b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBomServiceImpl.java @@ -0,0 +1,124 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBomMapper; +import com.ruoyi.project.management.domain.PwBom; +import com.ruoyi.project.management.service.IPwBomService; + +/** + * bomService业务层处理 + * + * @author zhukangchao + * @date 2020-08-11 + */ +@Service +public class PwBomServiceImpl implements IPwBomService +{ + @Autowired + private PwBomMapper pwBomMapper; + + /** + * 查询bom + * + * @param id bomID + * @return bom + */ + @Override + public PwBom selectPwBomById(Long id) + { + return pwBomMapper.selectPwBomById(id); + } + + /** + * 查询bom列表 + * + * @param pwBom bom + * @return bom + */ + @Override + public List selectPwBomList(PwBom pwBom) + { + return pwBomMapper.selectPwBomList(pwBom); + } + + /** + * 新增bom + * + * @param pwBom bom + * @return 结果 + */ + @Override + public int insertPwBom(PwBom pwBom) + { + pwBom.setCreateTime(DateUtils.getNowDate()); + return pwBomMapper.insertPwBom(pwBom); + } + + /** + * 修改bom + * + * @param pwBom bom + * @return 结果 + */ + @Override + public int updatePwBom(PwBom pwBom) + { + return pwBomMapper.updatePwBom(pwBom); + } + + /** + * 批量删除bom + * + * @param ids 需要删除的bomID + * @return 结果 + */ + @Override + public int deletePwBomByIds(Long[] ids) + { + return pwBomMapper.deletePwBomByIds(ids); + } + + /** + * 删除bom信息 + * + * @param id bomID + * @return 结果 + */ + @Override + public int deletePwBomById(Long id) + { + return pwBomMapper.deletePwBomById(id); + } + + @Override + public int insertPwBoms(List list) { + int insertPwBoms = pwBomMapper.insertPwBoms(list); + return insertPwBoms; + } + + @Override + public List selectPwBomByFigureNumberAndProductType(String partGather,String productType) { + return pwBomMapper.selectPwBomByFigureNumberAndProductType(partGather,productType); + } + + @Override + public PwBom selectPwBomByFigureNumber(String partGather) { + PwBom pwBom = pwBomMapper.selectPwBomByFigureNumber(partGather); + return pwBom; + } + + @Override + public List selectPwBomByProductType(String productType) { + List list = pwBomMapper.selectPwBomByProductType(productType); + return list; + } + + @Override + public List selectPwBomByCode(String code,String productType) { + + return pwBomMapper.selectPwBomByCode(code,productType); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionJjServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionJjServiceImpl.java new file mode 100644 index 0000000..6b00b32 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionJjServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBuyingRequisitionJjMapper; +import com.ruoyi.project.management.domain.PwBuyingRequisitionJj; +import com.ruoyi.project.management.service.IPwBuyingRequisitionJjService; + +/** + * 基建请购申请单Service业务层处理 + * + * @author zhukangchao + * @date 2022-06-28 + */ +@Service +public class PwBuyingRequisitionJjServiceImpl implements IPwBuyingRequisitionJjService +{ + @Autowired + private PwBuyingRequisitionJjMapper pwBuyingRequisitionJjMapper; + + /** + * 查询基建请购申请单 + * + * @param id 基建请购申请单ID + * @return 基建请购申请单 + */ + @Override + public PwBuyingRequisitionJj selectPwBuyingRequisitionJjById(Long id) + { + return pwBuyingRequisitionJjMapper.selectPwBuyingRequisitionJjById(id); + } + + /** + * 查询基建请购申请单列表 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 基建请购申请单 + */ + @Override + public List selectPwBuyingRequisitionJjList(PwBuyingRequisitionJj pwBuyingRequisitionJj) + { + return pwBuyingRequisitionJjMapper.selectPwBuyingRequisitionJjList(pwBuyingRequisitionJj); + } + + /** + * 新增基建请购申请单 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 结果 + */ + @Override + public int insertPwBuyingRequisitionJj(PwBuyingRequisitionJj pwBuyingRequisitionJj) + { + pwBuyingRequisitionJj.setCreateTime(DateUtils.getNowDate()); + return pwBuyingRequisitionJjMapper.insertPwBuyingRequisitionJj(pwBuyingRequisitionJj); + } + + /** + * 修改基建请购申请单 + * + * @param pwBuyingRequisitionJj 基建请购申请单 + * @return 结果 + */ + @Override + public int updatePwBuyingRequisitionJj(PwBuyingRequisitionJj pwBuyingRequisitionJj) + { + return pwBuyingRequisitionJjMapper.updatePwBuyingRequisitionJj(pwBuyingRequisitionJj); + } + + /** + * 批量删除基建请购申请单 + * + * @param ids 需要删除的基建请购申请单ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionJjByIds(Long[] ids) + { + return pwBuyingRequisitionJjMapper.deletePwBuyingRequisitionJjByIds(ids); + } + + /** + * 删除基建请购申请单信息 + * + * @param id 基建请购申请单ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionJjById(Long id) + { + return pwBuyingRequisitionJjMapper.deletePwBuyingRequisitionJjById(id); + } + + @Override + public PwBuyingRequisitionJj selectPwBuyingRequisitionJjByCode(String code) { + // TODO Auto-generated method stub + return pwBuyingRequisitionJjMapper.selectPwBuyingRequisitionJjByCode(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialJjServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialJjServiceImpl.java new file mode 100644 index 0000000..f6388db --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialJjServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBuyingRequisitionMaterialJjMapper; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialJj; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialJjService; + +/** + * 基建请购单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-06-28 + */ +@Service +public class PwBuyingRequisitionMaterialJjServiceImpl implements IPwBuyingRequisitionMaterialJjService +{ + @Autowired + private PwBuyingRequisitionMaterialJjMapper pwBuyingRequisitionMaterialJjMapper; + + /** + * 查询基建请购单详情 + * + * @param id 基建请购单详情ID + * @return 基建请购单详情 + */ + @Override + public PwBuyingRequisitionMaterialJj selectPwBuyingRequisitionMaterialJjById(Long id) + { + return pwBuyingRequisitionMaterialJjMapper.selectPwBuyingRequisitionMaterialJjById(id); + } + + /** + * 查询基建请购单详情列表 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 基建请购单详情 + */ + @Override + public List selectPwBuyingRequisitionMaterialJjList(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj) + { + return pwBuyingRequisitionMaterialJjMapper.selectPwBuyingRequisitionMaterialJjList(pwBuyingRequisitionMaterialJj); + } + + /** + * 新增基建请购单详情 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 结果 + */ + @Override + public int insertPwBuyingRequisitionMaterialJj(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj) + { + pwBuyingRequisitionMaterialJj.setCreateTime(DateUtils.getNowDate()); + return pwBuyingRequisitionMaterialJjMapper.insertPwBuyingRequisitionMaterialJj(pwBuyingRequisitionMaterialJj); + } + + /** + * 修改基建请购单详情 + * + * @param pwBuyingRequisitionMaterialJj 基建请购单详情 + * @return 结果 + */ + @Override + public int updatePwBuyingRequisitionMaterialJj(PwBuyingRequisitionMaterialJj pwBuyingRequisitionMaterialJj) + { + return pwBuyingRequisitionMaterialJjMapper.updatePwBuyingRequisitionMaterialJj(pwBuyingRequisitionMaterialJj); + } + + /** + * 批量删除基建请购单详情 + * + * @param ids 需要删除的基建请购单详情ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionMaterialJjByIds(Long[] ids) + { + return pwBuyingRequisitionMaterialJjMapper.deletePwBuyingRequisitionMaterialJjByIds(ids); + } + + /** + * 删除基建请购单详情信息 + * + * @param id 基建请购单详情ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionMaterialJjById(Long id) + { + return pwBuyingRequisitionMaterialJjMapper.deletePwBuyingRequisitionMaterialJjById(id); + } + + @Override + public List selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(Long id) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMaterialJjMapper.selectPwBuyingRequisitionMaterialJjByBuyingRequisitionJjId(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialServiceImpl.java new file mode 100644 index 0000000..f62d540 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialServiceImpl.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBuyingRequisitionMaterialMapper; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterial; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialService; + +/** + * 请购单物料详情Service业务层处理 + * + * @author zhukangchao + * @date 2021-10-18 + */ +@Service +public class PwBuyingRequisitionMaterialServiceImpl implements IPwBuyingRequisitionMaterialService +{ + @Autowired + private PwBuyingRequisitionMaterialMapper pwBuyingRequisitionMaterialMapper; + + /** + * 查询请购单物料详情 + * + * @param id 请购单物料详情ID + * @return 请购单物料详情 + */ + @Override + public PwBuyingRequisitionMaterial selectPwBuyingRequisitionMaterialById(Long id) + { + return pwBuyingRequisitionMaterialMapper.selectPwBuyingRequisitionMaterialById(id); + } + + /** + * 查询请购单物料详情列表 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 请购单物料详情 + */ + @Override + public List selectPwBuyingRequisitionMaterialList(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial) + { + return pwBuyingRequisitionMaterialMapper.selectPwBuyingRequisitionMaterialList(pwBuyingRequisitionMaterial); + } + + /** + * 新增请购单物料详情 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 结果 + */ + @Override + public int insertPwBuyingRequisitionMaterial(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial) + { + pwBuyingRequisitionMaterial.setCreateTime(DateUtils.getNowDate()); + return pwBuyingRequisitionMaterialMapper.insertPwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + } + + /** + * 修改请购单物料详情 + * + * @param pwBuyingRequisitionMaterial 请购单物料详情 + * @return 结果 + */ + @Override + public int updatePwBuyingRequisitionMaterial(PwBuyingRequisitionMaterial pwBuyingRequisitionMaterial) + { + return pwBuyingRequisitionMaterialMapper.updatePwBuyingRequisitionMaterial(pwBuyingRequisitionMaterial); + } + + /** + * 批量删除请购单物料详情 + * + * @param ids 需要删除的请购单物料详情ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionMaterialByIds(Long[] ids) + { + return pwBuyingRequisitionMaterialMapper.deletePwBuyingRequisitionMaterialByIds(ids); + } + + /** + * 删除请购单物料详情信息 + * + * @param id 请购单物料详情ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionMaterialById(Long id) + { + return pwBuyingRequisitionMaterialMapper.deletePwBuyingRequisitionMaterialById(id); + } + + @Override + public List selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(Long buyingRequisitionId) { + + return pwBuyingRequisitionMaterialMapper.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionId(buyingRequisitionId); + } + + @Override + public PwBuyingRequisitionMaterial selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(Long id, String materialName, + String specification) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMaterialMapper.selectPwBuyingRequisitionMaterialByPwBuyingRequisitionIdAndName(id,materialName,specification); + } + + @Override + public List selectPwBuyingRequisitionMaterialByNameAndSpecification(String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMaterialMapper.selectPwBuyingRequisitionMaterialByNameAndSpecification(name,figureNumber); + } + + @Override + public List selectPwBuyingRequisitionMaterialByName(String materialsName) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMaterialMapper.selectPwBuyingRequisitionMaterialByName(materialsName); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialTwoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialTwoServiceImpl.java new file mode 100644 index 0000000..8df1911 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionMaterialTwoServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBuyingRequisitionMaterialTwoMapper; +import com.ruoyi.project.management.domain.PwBuyingRequisitionMaterialTwo; +import com.ruoyi.project.management.service.IPwBuyingRequisitionMaterialTwoService; + +/** + * 易耗品请购单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-07-05 + */ +@Service +public class PwBuyingRequisitionMaterialTwoServiceImpl implements IPwBuyingRequisitionMaterialTwoService +{ + @Autowired + private PwBuyingRequisitionMaterialTwoMapper pwBuyingRequisitionMaterialTwoMapper; + + /** + * 查询易耗品请购单详情 + * + * @param id 易耗品请购单详情ID + * @return 易耗品请购单详情 + */ + @Override + public PwBuyingRequisitionMaterialTwo selectPwBuyingRequisitionMaterialTwoById(Long id) + { + return pwBuyingRequisitionMaterialTwoMapper.selectPwBuyingRequisitionMaterialTwoById(id); + } + + /** + * 查询易耗品请购单详情列表 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 易耗品请购单详情 + */ + @Override + public List selectPwBuyingRequisitionMaterialTwoList(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo) + { + return pwBuyingRequisitionMaterialTwoMapper.selectPwBuyingRequisitionMaterialTwoList(pwBuyingRequisitionMaterialTwo); + } + + /** + * 新增易耗品请购单详情 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 结果 + */ + @Override + public int insertPwBuyingRequisitionMaterialTwo(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo) + { + pwBuyingRequisitionMaterialTwo.setCreateTime(DateUtils.getNowDate()); + return pwBuyingRequisitionMaterialTwoMapper.insertPwBuyingRequisitionMaterialTwo(pwBuyingRequisitionMaterialTwo); + } + + /** + * 修改易耗品请购单详情 + * + * @param pwBuyingRequisitionMaterialTwo 易耗品请购单详情 + * @return 结果 + */ + @Override + public int updatePwBuyingRequisitionMaterialTwo(PwBuyingRequisitionMaterialTwo pwBuyingRequisitionMaterialTwo) + { + return pwBuyingRequisitionMaterialTwoMapper.updatePwBuyingRequisitionMaterialTwo(pwBuyingRequisitionMaterialTwo); + } + + /** + * 批量删除易耗品请购单详情 + * + * @param ids 需要删除的易耗品请购单详情ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionMaterialTwoByIds(Long[] ids) + { + return pwBuyingRequisitionMaterialTwoMapper.deletePwBuyingRequisitionMaterialTwoByIds(ids); + } + + /** + * 删除易耗品请购单详情信息 + * + * @param id 易耗品请购单详情ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionMaterialTwoById(Long id) + { + return pwBuyingRequisitionMaterialTwoMapper.deletePwBuyingRequisitionMaterialTwoById(id); + } + + @Override + public List selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId( + Long buyingRequisitionId) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMaterialTwoMapper.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionId(buyingRequisitionId); + } + + @Override + public PwBuyingRequisitionMaterialTwo selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionIdAndName(Long id, + String materialName, String specification) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMaterialTwoMapper.selectPwBuyingRequisitionMaterialTwoByPwBuyingRequisitionIdAndName(id,materialName,specification); + } + + @Override + public List selectPwBuyingRequisitionMaterialTwoByName(String materialName) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMaterialTwoMapper.selectPwBuyingRequisitionMaterialTwoByName(materialName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionServiceImpl.java new file mode 100644 index 0000000..23eed6b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionServiceImpl.java @@ -0,0 +1,121 @@ +package com.ruoyi.project.management.service.impl; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.domain.AjaxResult; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.project.management.mapper.PwBuyingRequisitionMapper; +import com.ruoyi.project.management.domain.PwBuyingRequisition; +import com.ruoyi.project.management.service.IPwBuyingRequisitionService; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 采购申请单Service业务层处理 + * + * @author zhukangchao + * @date 2020-08-31 + */ +@Service +public class PwBuyingRequisitionServiceImpl implements IPwBuyingRequisitionService +{ + @Autowired + private PwBuyingRequisitionMapper pwBuyingRequisitionMapper; + // 用户标识信息 + @Autowired + private TokenService tokenService; + + /** + * 查询采购申请单 + * + * @param id 采购申请单ID + * @return 采购申请单 + */ + @Override + public PwBuyingRequisition selectPwBuyingRequisitionById(Long id) + { + return pwBuyingRequisitionMapper.selectPwBuyingRequisitionById(id); + } + + /** + * 查询采购申请单列表 + * + * @param pwBuyingRequisition 采购申请单 + * @return 采购申请单 + */ + @Override + public List selectPwBuyingRequisitionList(PwBuyingRequisition pwBuyingRequisition) + { + return pwBuyingRequisitionMapper.selectPwBuyingRequisitionList(pwBuyingRequisition); + } + + /** + * 新增采购申请单 + * + * @param pwBuyingRequisition 采购申请单 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertPwBuyingRequisition(PwBuyingRequisition pwBuyingRequisition){ + pwBuyingRequisition.setCreateTime(DateUtils.getNowDate()); + + return pwBuyingRequisitionMapper.insertPwBuyingRequisition(pwBuyingRequisition); + } + + /** + * 修改采购申请单 + * + * @param pwBuyingRequisition 采购申请单 + * @return 结果 + */ + @Override + public int updatePwBuyingRequisition(PwBuyingRequisition pwBuyingRequisition) + { + return pwBuyingRequisitionMapper.updatePwBuyingRequisition(pwBuyingRequisition); + } + + /** + * 批量删除采购申请单 + * + * @param ids 需要删除的采购申请单ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionByIds(Long[] ids) + { + return pwBuyingRequisitionMapper.deletePwBuyingRequisitionByIds(ids); + } + + /** + * 删除采购申请单信息 + * + * @param id 采购申请单ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionById(Long id) + { + return pwBuyingRequisitionMapper.deletePwBuyingRequisitionById(id); + } + + @Override + public PwBuyingRequisition selectPwBuyingRequisitionByCode(String makeDocumentsCode) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMapper.selectPwBuyingRequisitionByCode(makeDocumentsCode); + } + + @Override + public List selectPwBuyingRequisitionByPurpose(String code) { + // TODO Auto-generated method stub + return pwBuyingRequisitionMapper.selectPwBuyingRequisitionByPurpose(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionTwoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionTwoServiceImpl.java new file mode 100644 index 0000000..aca1485 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwBuyingRequisitionTwoServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwBuyingRequisitionTwoMapper; +import com.ruoyi.project.management.domain.PwBuyingRequisitionTwo; +import com.ruoyi.project.management.service.IPwBuyingRequisitionTwoService; + +/** + * 易耗品请购单Service业务层处理 + * + * @author zhukangchao + * @date 2022-07-05 + */ +@Service +public class PwBuyingRequisitionTwoServiceImpl implements IPwBuyingRequisitionTwoService +{ + @Autowired + private PwBuyingRequisitionTwoMapper pwBuyingRequisitionTwoMapper; + + /** + * 查询易耗品请购单 + * + * @param id 易耗品请购单ID + * @return 易耗品请购单 + */ + @Override + public PwBuyingRequisitionTwo selectPwBuyingRequisitionTwoById(Long id) + { + return pwBuyingRequisitionTwoMapper.selectPwBuyingRequisitionTwoById(id); + } + + /** + * 查询易耗品请购单列表 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 易耗品请购单 + */ + @Override + public List selectPwBuyingRequisitionTwoList(PwBuyingRequisitionTwo pwBuyingRequisitionTwo) + { + return pwBuyingRequisitionTwoMapper.selectPwBuyingRequisitionTwoList(pwBuyingRequisitionTwo); + } + + /** + * 新增易耗品请购单 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 结果 + */ + @Override + public int insertPwBuyingRequisitionTwo(PwBuyingRequisitionTwo pwBuyingRequisitionTwo) + { + pwBuyingRequisitionTwo.setCreateTime(DateUtils.getNowDate()); + return pwBuyingRequisitionTwoMapper.insertPwBuyingRequisitionTwo(pwBuyingRequisitionTwo); + } + + /** + * 修改易耗品请购单 + * + * @param pwBuyingRequisitionTwo 易耗品请购单 + * @return 结果 + */ + @Override + public int updatePwBuyingRequisitionTwo(PwBuyingRequisitionTwo pwBuyingRequisitionTwo) + { + return pwBuyingRequisitionTwoMapper.updatePwBuyingRequisitionTwo(pwBuyingRequisitionTwo); + } + + /** + * 批量删除易耗品请购单 + * + * @param ids 需要删除的易耗品请购单ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionTwoByIds(Long[] ids) + { + return pwBuyingRequisitionTwoMapper.deletePwBuyingRequisitionTwoByIds(ids); + } + + /** + * 删除易耗品请购单信息 + * + * @param id 易耗品请购单ID + * @return 结果 + */ + @Override + public int deletePwBuyingRequisitionTwoById(Long id) + { + return pwBuyingRequisitionTwoMapper.deletePwBuyingRequisitionTwoById(id); + } + + @Override + public PwBuyingRequisitionTwo selectPwBuyingRequisitionTwoByCode(String makeDocumentsCode) { + // TODO Auto-generated method stub + return pwBuyingRequisitionTwoMapper.selectPwBuyingRequisitionTwoByCode(makeDocumentsCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCompletionNoticeProductServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCompletionNoticeProductServiceImpl.java new file mode 100644 index 0000000..254694c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCompletionNoticeProductServiceImpl.java @@ -0,0 +1,126 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCompletionNoticeProductMapper; +import com.ruoyi.project.management.domain.PwCompletionNoticeProduct; +import com.ruoyi.project.management.service.IPwCompletionNoticeProductService; + +/** + * 产品完工通知单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-20 + */ +@Service +public class PwCompletionNoticeProductServiceImpl implements IPwCompletionNoticeProductService +{ + @Autowired + private PwCompletionNoticeProductMapper pwCompletionNoticeProductMapper; + + /** + * 查询产品完工通知单关联 + * + * @param id 产品完工通知单关联ID + * @return 产品完工通知单关联 + */ + @Override + public PwCompletionNoticeProduct selectPwCompletionNoticeProductById(Long id) + { + return pwCompletionNoticeProductMapper.selectPwCompletionNoticeProductById(id); + } + + /** + * 查询产品完工通知单关联列表 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 产品完工通知单关联 + */ + @Override + public List selectPwCompletionNoticeProductList(PwCompletionNoticeProduct pwCompletionNoticeProduct) + { + return pwCompletionNoticeProductMapper.selectPwCompletionNoticeProductList(pwCompletionNoticeProduct); + } + + /** + * 新增产品完工通知单关联 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 结果 + */ + @Override + public int insertPwCompletionNoticeProduct(PwCompletionNoticeProduct pwCompletionNoticeProduct) + { + pwCompletionNoticeProduct.setCreateTime(DateUtils.getNowDate()); + return pwCompletionNoticeProductMapper.insertPwCompletionNoticeProduct(pwCompletionNoticeProduct); + } + + /** + * 修改产品完工通知单关联 + * + * @param pwCompletionNoticeProduct 产品完工通知单关联 + * @return 结果 + */ + @Override + public int updatePwCompletionNoticeProduct(PwCompletionNoticeProduct pwCompletionNoticeProduct) + { + return pwCompletionNoticeProductMapper.updatePwCompletionNoticeProduct(pwCompletionNoticeProduct); + } + + /** + * 批量删除产品完工通知单关联 + * + * @param ids 需要删除的产品完工通知单关联ID + * @return 结果 + */ + @Override + public int deletePwCompletionNoticeProductByIds(Long[] ids) + { + return pwCompletionNoticeProductMapper.deletePwCompletionNoticeProductByIds(ids); + } + + /** + * 删除产品完工通知单关联信息 + * + * @param id 产品完工通知单关联ID + * @return 结果 + */ + @Override + public int deletePwCompletionNoticeProductById(Long id) + { + return pwCompletionNoticeProductMapper.deletePwCompletionNoticeProductById(id); + } + + @Override + public List selectPwCompletionNoticeProductByCode(String productionCode) { + + return pwCompletionNoticeProductMapper.selectPwCompletionNoticeProductByCode(productionCode); + } + + @Override + public List selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber( + String makeDocumentsCode, String name, String figureNumber) { + // TODO Auto-generated method stub + return pwCompletionNoticeProductMapper.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumber(makeDocumentsCode,name,figureNumber); + } + + @Override + public int selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(String productionCode, String name,String figureNumber) { + + return pwCompletionNoticeProductMapper.selectPwCompletionNoticeProductByCodeAndNameAndFigureNumberByTime(productionCode,name,figureNumber); + } + + @Override + public List selectPwCompletionNoticeProductByCnpId(Long id) { + // TODO Auto-generated method stub + return pwCompletionNoticeProductMapper.selectPwCompletionNoticeProductByCnpId(id); + } + + @Override + public List selectPwCompletionNoticeProductByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return pwCompletionNoticeProductMapper.selectPwCompletionNoticeProductByFigureNumberAndAllGB(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCompletionNoticeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCompletionNoticeServiceImpl.java new file mode 100644 index 0000000..7816eb6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCompletionNoticeServiceImpl.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCompletionNoticeMapper; +import com.ruoyi.project.management.domain.PwCompletionNotice; +import com.ruoyi.project.management.service.IPwCompletionNoticeService; + +/** + * 完工通知单Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-20 + */ +@Service +public class PwCompletionNoticeServiceImpl implements IPwCompletionNoticeService +{ + @Autowired + private PwCompletionNoticeMapper pwCompletionNoticeMapper; + + /** + * 查询完工通知单 + * + * @param id 完工通知单ID + * @return 完工通知单 + */ + @Override + public PwCompletionNotice selectPwCompletionNoticeById(Long id) + { + return pwCompletionNoticeMapper.selectPwCompletionNoticeById(id); + } + + /** + * 查询完工通知单列表 + * + * @param pwCompletionNotice 完工通知单 + * @return 完工通知单 + */ + @Override + public List selectPwCompletionNoticeList(PwCompletionNotice pwCompletionNotice) + { + return pwCompletionNoticeMapper.selectPwCompletionNoticeList(pwCompletionNotice); + } + + /** + * 新增完工通知单 + * + * @param pwCompletionNotice 完工通知单 + * @return 结果 + */ + @Override + public int insertPwCompletionNotice(PwCompletionNotice pwCompletionNotice) + { + pwCompletionNotice.setCreateTime(DateUtils.getNowDate()); + return pwCompletionNoticeMapper.insertPwCompletionNotice(pwCompletionNotice); + } + + /** + * 修改完工通知单 + * + * @param pwCompletionNotice 完工通知单 + * @return 结果 + */ + @Override + public int updatePwCompletionNotice(PwCompletionNotice pwCompletionNotice) + { + return pwCompletionNoticeMapper.updatePwCompletionNotice(pwCompletionNotice); + } + + /** + * 批量删除完工通知单 + * + * @param ids 需要删除的完工通知单ID + * @return 结果 + */ + @Override + public int deletePwCompletionNoticeByIds(Long[] ids) + { + return pwCompletionNoticeMapper.deletePwCompletionNoticeByIds(ids); + } + + /** + * 删除完工通知单信息 + * + * @param id 完工通知单ID + * @return 结果 + */ + @Override + public int deletePwCompletionNoticeById(Long id) + { + return pwCompletionNoticeMapper.deletePwCompletionNoticeById(id); + } + + @Override + public PwCompletionNotice selectPwCompletionNoticeByCode(String productionCode) { + + return pwCompletionNoticeMapper.selectPwCompletionNoticeByCode(productionCode); + } + + /** + * 根据执行单号和时间查询最大数据 + * @param productionCode + * @param date + * @return + */ + @Override + public PwCompletionNotice selectPwCompletionNoticeByDateAndCode(String productionCode,String date){ + return pwCompletionNoticeMapper.selectPwCompletionNoticeByDateAndCode(productionCode,date); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwContractInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwContractInfoServiceImpl.java new file mode 100644 index 0000000..8a36179 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwContractInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwContractInfoMapper; +import com.ruoyi.project.management.domain.PwContractInfo; +import com.ruoyi.project.management.service.IPwContractInfoService; + +/** + * 合同信息明细Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-06 + */ +@Service +public class PwContractInfoServiceImpl implements IPwContractInfoService +{ + @Autowired + private PwContractInfoMapper pwContractInfoMapper; + + /** + * 查询合同信息明细 + * + * @param id 合同信息明细ID + * @return 合同信息明细 + */ + @Override + public PwContractInfo selectPwContractInfoById(Long id) + { + return pwContractInfoMapper.selectPwContractInfoById(id); + } + + /** + * 查询合同信息明细列表 + * + * @param pwContractInfo 合同信息明细 + * @return 合同信息明细 + */ + @Override + public List selectPwContractInfoList(PwContractInfo pwContractInfo) + { + return pwContractInfoMapper.selectPwContractInfoList(pwContractInfo); + } + + /** + * 新增合同信息明细 + * + * @param pwContractInfo 合同信息明细 + * @return 结果 + */ + @Override + public int insertPwContractInfo(PwContractInfo pwContractInfo) + { + pwContractInfo.setCreateTime(DateUtils.getNowDate()); + return pwContractInfoMapper.insertPwContractInfo(pwContractInfo); + } + + /** + * 修改合同信息明细 + * + * @param pwContractInfo 合同信息明细 + * @return 结果 + */ + @Override + public int updatePwContractInfo(PwContractInfo pwContractInfo) + { + return pwContractInfoMapper.updatePwContractInfo(pwContractInfo); + } + + /** + * 批量删除合同信息明细 + * + * @param ids 需要删除的合同信息明细ID + * @return 结果 + */ + @Override + public int deletePwContractInfoByIds(Long[] ids) + { + return pwContractInfoMapper.deletePwContractInfoByIds(ids); + } + + /** + * 删除合同信息明细信息 + * + * @param id 合同信息明细ID + * @return 结果 + */ + @Override + public int deletePwContractInfoById(Long id) + { + return pwContractInfoMapper.deletePwContractInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwContractServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwContractServiceImpl.java new file mode 100644 index 0000000..0ff548c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwContractServiceImpl.java @@ -0,0 +1,111 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwContractMapper; +import com.ruoyi.project.management.domain.PwContract; +import com.ruoyi.project.management.service.IPwContractService; + +/** + * 合同Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PwContractServiceImpl implements IPwContractService +{ + @Autowired + private PwContractMapper pwContractMapper; + + /** + * 查询合同 + * + * @param id 合同ID + * @return 合同 + */ + @Override + public PwContract selectPwContractById(Long id) + { + return pwContractMapper.selectPwContractById(id); + } + + /** + * 查询合同列表 + * + * @param pwContract 合同 + * @return 合同 + */ + @Override + public List selectPwContractList(PwContract pwContract) + { + return pwContractMapper.selectPwContractList(pwContract); + } + + /** + * 新增合同 + * + * @param pwContract 合同 + * @return 结果 + */ + @Override + public int insertPwContract(PwContract pwContract) + { + pwContract.setCreateTime(DateUtils.getNowDate()); + return pwContractMapper.insertPwContract(pwContract); + } + + /** + * 修改合同 + * + * @param pwContract 合同 + * @return 结果 + */ + @Override + public int updatePwContract(PwContract pwContract) + { + return pwContractMapper.updatePwContract(pwContract); + } + + /** + * 批量删除合同 + * + * @param ids 需要删除的合同ID + * @return 结果 + */ + @Override + public int deletePwContractByIds(Long[] ids) + { + return pwContractMapper.deletePwContractByIds(ids); + } + + /** + * 删除合同信息 + * + * @param id 合同ID + * @return 结果 + */ + @Override + public int deletePwContractById(Long id) + { + return pwContractMapper.deletePwContractById(id); + } + + /** + * 根据合同编号查询合同信息 + */ + @Override + public PwContract selectByContractCode(String code) { + PwContract contract = pwContractMapper.selectByContractCode(code); + return contract; + } + + @Override + public List selectPwContractDate(Date date) { + // TODO Auto-generated method stub + return pwContractMapper.selectPwContractDate(date); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolApplyDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolApplyDetailServiceImpl.java new file mode 100644 index 0000000..acdb3f8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolApplyDetailServiceImpl.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolApplyDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolApplyDetail; +import com.ruoyi.project.management.service.IPwCuttingToolApplyDetailService; + +/** + * 刀具领用申请单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-09 + */ +@Service +public class PwCuttingToolApplyDetailServiceImpl implements IPwCuttingToolApplyDetailService +{ + @Autowired + private PwCuttingToolApplyDetailMapper pwCuttingToolApplyDetailMapper; + + /** + * 查询刀具领用申请单详情 + * + * @param id 刀具领用申请单详情ID + * @return 刀具领用申请单详情 + */ + @Override + public PwCuttingToolApplyDetail selectPwCuttingToolApplyDetailById(Long id) + { + return pwCuttingToolApplyDetailMapper.selectPwCuttingToolApplyDetailById(id); + } + + /** + * 查询刀具领用申请单详情列表 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 刀具领用申请单详情 + */ + @Override + public List selectPwCuttingToolApplyDetailList(PwCuttingToolApplyDetail pwCuttingToolApplyDetail) + { + return pwCuttingToolApplyDetailMapper.selectPwCuttingToolApplyDetailList(pwCuttingToolApplyDetail); + } + + /** + * 新增刀具领用申请单详情 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 结果 + */ + @Override + public int insertPwCuttingToolApplyDetail(PwCuttingToolApplyDetail pwCuttingToolApplyDetail) + { + pwCuttingToolApplyDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolApplyDetailMapper.insertPwCuttingToolApplyDetail(pwCuttingToolApplyDetail); + } + + /** + * 修改刀具领用申请单详情 + * + * @param pwCuttingToolApplyDetail 刀具领用申请单详情 + * @return 结果 + */ + @Override + public int updatePwCuttingToolApplyDetail(PwCuttingToolApplyDetail pwCuttingToolApplyDetail) + { + return pwCuttingToolApplyDetailMapper.updatePwCuttingToolApplyDetail(pwCuttingToolApplyDetail); + } + + /** + * 批量删除刀具领用申请单详情 + * + * @param ids 需要删除的刀具领用申请单详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolApplyDetailByIds(Long[] ids) + { + return pwCuttingToolApplyDetailMapper.deletePwCuttingToolApplyDetailByIds(ids); + } + + /** + * 删除刀具领用申请单详情信息 + * + * @param id 刀具领用申请单详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolApplyDetailById(Long id) + { + return pwCuttingToolApplyDetailMapper.deletePwCuttingToolApplyDetailById(id); + } + + @Override + public List selectPwCuttingToolApplyDetailByApplyDetailId(Long id) { + // TODO Auto-generated method stub + return pwCuttingToolApplyDetailMapper.selectPwCuttingToolApplyDetailByApplyDetailId(id); + } + + @Override + public PwCuttingToolApplyDetail selectPwCuttingToolApplyDetailByApplyDetailIdAndNameAndType(Long id, String name,String type) { + // TODO Auto-generated method stub + return pwCuttingToolApplyDetailMapper.selectPwCuttingToolApplyDetailByApplyDetailIdAndNameAndType(id,name,type); + } + + @Override + public List selectPwCuttingToolApplyDetailByName(String name) { + // TODO Auto-generated method stub + return pwCuttingToolApplyDetailMapper.selectPwCuttingToolApplyDetailByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolApplyServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolApplyServiceImpl.java new file mode 100644 index 0000000..08b7628 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolApplyServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolApplyMapper; +import com.ruoyi.project.management.domain.PwCuttingToolApply; +import com.ruoyi.project.management.service.IPwCuttingToolApplyService; + +/** + * 刀具领用申请单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-09 + */ +@Service +public class PwCuttingToolApplyServiceImpl implements IPwCuttingToolApplyService +{ + @Autowired + private PwCuttingToolApplyMapper pwCuttingToolApplyMapper; + + /** + * 查询刀具领用申请单 + * + * @param id 刀具领用申请单ID + * @return 刀具领用申请单 + */ + @Override + public PwCuttingToolApply selectPwCuttingToolApplyById(Long id) + { + return pwCuttingToolApplyMapper.selectPwCuttingToolApplyById(id); + } + + /** + * 查询刀具领用申请单列表 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 刀具领用申请单 + */ + @Override + public List selectPwCuttingToolApplyList(PwCuttingToolApply pwCuttingToolApply) + { + return pwCuttingToolApplyMapper.selectPwCuttingToolApplyList(pwCuttingToolApply); + } + + /** + * 新增刀具领用申请单 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 结果 + */ + @Override + public int insertPwCuttingToolApply(PwCuttingToolApply pwCuttingToolApply) + { + return pwCuttingToolApplyMapper.insertPwCuttingToolApply(pwCuttingToolApply); + } + + /** + * 修改刀具领用申请单 + * + * @param pwCuttingToolApply 刀具领用申请单 + * @return 结果 + */ + @Override + public int updatePwCuttingToolApply(PwCuttingToolApply pwCuttingToolApply) + { + return pwCuttingToolApplyMapper.updatePwCuttingToolApply(pwCuttingToolApply); + } + + /** + * 批量删除刀具领用申请单 + * + * @param ids 需要删除的刀具领用申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolApplyByIds(Long[] ids) + { + return pwCuttingToolApplyMapper.deletePwCuttingToolApplyByIds(ids); + } + + /** + * 删除刀具领用申请单信息 + * + * @param id 刀具领用申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolApplyById(Long id) + { + return pwCuttingToolApplyMapper.deletePwCuttingToolApplyById(id); + } + + @Override + public PwCuttingToolApply selectPwCuttingToolApplyByCode(String code) { + // TODO Auto-generated method stub + return pwCuttingToolApplyMapper.selectPwCuttingToolApplyByCode(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolDeliveryDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolDeliveryDetailServiceImpl.java new file mode 100644 index 0000000..ed631a2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolDeliveryDetailServiceImpl.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolDeliveryDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolDeliveryDetail; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryDetailService; + +/** + * 刀具出库单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-09 + */ +@Service +public class PwCuttingToolDeliveryDetailServiceImpl implements IPwCuttingToolDeliveryDetailService +{ + @Autowired + private PwCuttingToolDeliveryDetailMapper pwCuttingToolDeliveryDetailMapper; + + /** + * 查询刀具出库单详情 + * + * @param id 刀具出库单详情ID + * @return 刀具出库单详情 + */ + @Override + public PwCuttingToolDeliveryDetail selectPwCuttingToolDeliveryDetailById(Long id) + { + return pwCuttingToolDeliveryDetailMapper.selectPwCuttingToolDeliveryDetailById(id); + } + + /** + * 查询刀具出库单详情列表 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 刀具出库单详情 + */ + @Override + public List selectPwCuttingToolDeliveryDetailList(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail) + { + return pwCuttingToolDeliveryDetailMapper.selectPwCuttingToolDeliveryDetailList(pwCuttingToolDeliveryDetail); + } + + /** + * 新增刀具出库单详情 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 结果 + */ + @Override + public int insertPwCuttingToolDeliveryDetail(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail) + { + pwCuttingToolDeliveryDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolDeliveryDetailMapper.insertPwCuttingToolDeliveryDetail(pwCuttingToolDeliveryDetail); + } + + /** + * 修改刀具出库单详情 + * + * @param pwCuttingToolDeliveryDetail 刀具出库单详情 + * @return 结果 + */ + @Override + public int updatePwCuttingToolDeliveryDetail(PwCuttingToolDeliveryDetail pwCuttingToolDeliveryDetail) + { + return pwCuttingToolDeliveryDetailMapper.updatePwCuttingToolDeliveryDetail(pwCuttingToolDeliveryDetail); + } + + /** + * 批量删除刀具出库单详情 + * + * @param ids 需要删除的刀具出库单详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolDeliveryDetailByIds(Long[] ids) + { + return pwCuttingToolDeliveryDetailMapper.deletePwCuttingToolDeliveryDetailByIds(ids); + } + + /** + * 删除刀具出库单详情信息 + * + * @param id 刀具出库单详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolDeliveryDetailById(Long id) + { + return pwCuttingToolDeliveryDetailMapper.deletePwCuttingToolDeliveryDetailById(id); + } + + @Override + public List selectPwCuttingToolDeliveryDetailByDeliveryId(Long deliveryId) { + // TODO Auto-generated method stub + return pwCuttingToolDeliveryDetailMapper.selectPwCuttingToolDeliveryDetailByDeliveryId(deliveryId); + } + + @Override + public PwCuttingToolDeliveryDetail selectPwCuttingToolDeliveryDetailByDeliveryIdAndNameAndBrandAndType(Long id,String name, String brand, String type) { + + return pwCuttingToolDeliveryDetailMapper.selectPwCuttingToolDeliveryDetailByDeliveryIdAndNameAndBrandAndType(id,name,brand,type); + } + + @Override + public List selectPwCuttingToolDeliveryDetailByName(String name) { + // TODO Auto-generated method stub + return pwCuttingToolDeliveryDetailMapper.selectPwCuttingToolDeliveryDetailByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolDeliveryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolDeliveryServiceImpl.java new file mode 100644 index 0000000..50c0083 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolDeliveryServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolDeliveryMapper; +import com.ruoyi.project.management.domain.PwCuttingToolDelivery; +import com.ruoyi.project.management.service.IPwCuttingToolDeliveryService; + +/** + * 刀具出库单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-09 + */ +@Service +public class PwCuttingToolDeliveryServiceImpl implements IPwCuttingToolDeliveryService +{ + @Autowired + private PwCuttingToolDeliveryMapper pwCuttingToolDeliveryMapper; + + /** + * 查询刀具出库单 + * + * @param id 刀具出库单ID + * @return 刀具出库单 + */ + @Override + public PwCuttingToolDelivery selectPwCuttingToolDeliveryById(Long id) + { + return pwCuttingToolDeliveryMapper.selectPwCuttingToolDeliveryById(id); + } + + /** + * 查询刀具出库单列表 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 刀具出库单 + */ + @Override + public List selectPwCuttingToolDeliveryList(PwCuttingToolDelivery pwCuttingToolDelivery) + { + return pwCuttingToolDeliveryMapper.selectPwCuttingToolDeliveryList(pwCuttingToolDelivery); + } + + /** + * 新增刀具出库单 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 结果 + */ + @Override + public int insertPwCuttingToolDelivery(PwCuttingToolDelivery pwCuttingToolDelivery) + { + pwCuttingToolDelivery.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolDeliveryMapper.insertPwCuttingToolDelivery(pwCuttingToolDelivery); + } + + /** + * 修改刀具出库单 + * + * @param pwCuttingToolDelivery 刀具出库单 + * @return 结果 + */ + @Override + public int updatePwCuttingToolDelivery(PwCuttingToolDelivery pwCuttingToolDelivery) + { + return pwCuttingToolDeliveryMapper.updatePwCuttingToolDelivery(pwCuttingToolDelivery); + } + + /** + * 批量删除刀具出库单 + * + * @param ids 需要删除的刀具出库单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolDeliveryByIds(Long[] ids) + { + return pwCuttingToolDeliveryMapper.deletePwCuttingToolDeliveryByIds(ids); + } + + /** + * 删除刀具出库单信息 + * + * @param id 刀具出库单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolDeliveryById(Long id) + { + return pwCuttingToolDeliveryMapper.deletePwCuttingToolDeliveryById(id); + } + + @Override + public PwCuttingToolDelivery selectPwCuttingToolDeliveryByCode(String code) { + // TODO Auto-generated method stub + return pwCuttingToolDeliveryMapper.selectPwCuttingToolDeliveryByCode(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolGodownEntryDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolGodownEntryDetailServiceImpl.java new file mode 100644 index 0000000..334b6a0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolGodownEntryDetailServiceImpl.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolGodownEntryDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntryDetail; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryDetailService; + +/** + * 刀具入库详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-09 + */ +@Service +public class PwCuttingToolGodownEntryDetailServiceImpl implements IPwCuttingToolGodownEntryDetailService +{ + @Autowired + private PwCuttingToolGodownEntryDetailMapper pwCuttingToolGodownEntryDetailMapper; + + /** + * 查询刀具入库详情 + * + * @param id 刀具入库详情ID + * @return 刀具入库详情 + */ + @Override + public PwCuttingToolGodownEntryDetail selectPwCuttingToolGodownEntryDetailById(Long id) + { + return pwCuttingToolGodownEntryDetailMapper.selectPwCuttingToolGodownEntryDetailById(id); + } + + /** + * 查询刀具入库详情列表 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 刀具入库详情 + */ + @Override + public List selectPwCuttingToolGodownEntryDetailList(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail) + { + return pwCuttingToolGodownEntryDetailMapper.selectPwCuttingToolGodownEntryDetailList(pwCuttingToolGodownEntryDetail); + } + + /** + * 新增刀具入库详情 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 结果 + */ + @Override + public int insertPwCuttingToolGodownEntryDetail(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail) + { + pwCuttingToolGodownEntryDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolGodownEntryDetailMapper.insertPwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail); + } + + /** + * 修改刀具入库详情 + * + * @param pwCuttingToolGodownEntryDetail 刀具入库详情 + * @return 结果 + */ + @Override + public int updatePwCuttingToolGodownEntryDetail(PwCuttingToolGodownEntryDetail pwCuttingToolGodownEntryDetail) + { + return pwCuttingToolGodownEntryDetailMapper.updatePwCuttingToolGodownEntryDetail(pwCuttingToolGodownEntryDetail); + } + + /** + * 批量删除刀具入库详情 + * + * @param ids 需要删除的刀具入库详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolGodownEntryDetailByIds(Long[] ids) + { + return pwCuttingToolGodownEntryDetailMapper.deletePwCuttingToolGodownEntryDetailByIds(ids); + } + + /** + * 删除刀具入库详情信息 + * + * @param id 刀具入库详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolGodownEntryDetailById(Long id) + { + return pwCuttingToolGodownEntryDetailMapper.deletePwCuttingToolGodownEntryDetailById(id); + } + + @Override + public List selectPwCuttingToolGodownEntryDetailByGosownEntryId( + Long gosownEntryId) { + // TODO Auto-generated method stub + return pwCuttingToolGodownEntryDetailMapper.selectPwCuttingToolGodownEntryDetailByGosownEntryId(gosownEntryId); + } + + @Override + public List selectPwCuttingToolGodownEntryDetailByName(String name) { + // TODO Auto-generated method stub + return pwCuttingToolGodownEntryDetailMapper.selectPwCuttingToolGodownEntryDetailByName(name); + } + + @Override + public List selectPwCuttingToolGodownEntryDetailByIdAndNameAndBrandAndType(Long id,String name, String brand, String type) { + // TODO Auto-generated method stub + return pwCuttingToolGodownEntryDetailMapper.selectPwCuttingToolGodownEntryDetailByIdAndNameAndBrandAndType(id,name,brand,type); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolGodownEntryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolGodownEntryServiceImpl.java new file mode 100644 index 0000000..df36a4c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolGodownEntryServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolGodownEntryMapper; +import com.ruoyi.project.management.domain.PwCuttingToolGodownEntry; +import com.ruoyi.project.management.service.IPwCuttingToolGodownEntryService; + +/** + * 刀具入库单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-09 + */ +@Service +public class PwCuttingToolGodownEntryServiceImpl implements IPwCuttingToolGodownEntryService +{ + @Autowired + private PwCuttingToolGodownEntryMapper pwCuttingToolGodownEntryMapper; + + /** + * 查询刀具入库单 + * + * @param id 刀具入库单ID + * @return 刀具入库单 + */ + @Override + public PwCuttingToolGodownEntry selectPwCuttingToolGodownEntryById(Long id) + { + return pwCuttingToolGodownEntryMapper.selectPwCuttingToolGodownEntryById(id); + } + + /** + * 查询刀具入库单列表 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 刀具入库单 + */ + @Override + public List selectPwCuttingToolGodownEntryList(PwCuttingToolGodownEntry pwCuttingToolGodownEntry) + { + return pwCuttingToolGodownEntryMapper.selectPwCuttingToolGodownEntryList(pwCuttingToolGodownEntry); + } + + /** + * 新增刀具入库单 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 结果 + */ + @Override + public int insertPwCuttingToolGodownEntry(PwCuttingToolGodownEntry pwCuttingToolGodownEntry) + { + return pwCuttingToolGodownEntryMapper.insertPwCuttingToolGodownEntry(pwCuttingToolGodownEntry); + } + + /** + * 修改刀具入库单 + * + * @param pwCuttingToolGodownEntry 刀具入库单 + * @return 结果 + */ + @Override + public int updatePwCuttingToolGodownEntry(PwCuttingToolGodownEntry pwCuttingToolGodownEntry) + { + return pwCuttingToolGodownEntryMapper.updatePwCuttingToolGodownEntry(pwCuttingToolGodownEntry); + } + + /** + * 批量删除刀具入库单 + * + * @param ids 需要删除的刀具入库单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolGodownEntryByIds(Long[] ids) + { + return pwCuttingToolGodownEntryMapper.deletePwCuttingToolGodownEntryByIds(ids); + } + + /** + * 删除刀具入库单信息 + * + * @param id 刀具入库单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolGodownEntryById(Long id) + { + return pwCuttingToolGodownEntryMapper.deletePwCuttingToolGodownEntryById(id); + } + + @Override + public PwCuttingToolGodownEntry selectPwCuttingToolGodownEntryByContractCode(String code) { + // TODO Auto-generated method stub + return pwCuttingToolGodownEntryMapper.selectPwCuttingToolGodownEntryByContractCode(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolInventoryDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolInventoryDetailServiceImpl.java new file mode 100644 index 0000000..2f14606 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolInventoryDetailServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolInventoryDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolInventoryDetail; +import com.ruoyi.project.management.service.IPwCuttingToolInventoryDetailService; + +/** + * 刀具库存Service业务层处理 + * + * @author zhukangchao + * @date 2022-01-27 + */ +@Service +public class PwCuttingToolInventoryDetailServiceImpl implements IPwCuttingToolInventoryDetailService +{ + @Autowired + private PwCuttingToolInventoryDetailMapper pwCuttingToolInventoryDetailMapper; + + /** + * 查询刀具库存 + * + * @param id 刀具库存ID + * @return 刀具库存 + */ + @Override + public PwCuttingToolInventoryDetail selectPwCuttingToolInventoryDetailById(Long id) + { + return pwCuttingToolInventoryDetailMapper.selectPwCuttingToolInventoryDetailById(id); + } + + /** + * 查询刀具库存列表 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 刀具库存 + */ + @Override + public List selectPwCuttingToolInventoryDetailList(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail) + { + return pwCuttingToolInventoryDetailMapper.selectPwCuttingToolInventoryDetailList(pwCuttingToolInventoryDetail); + } + + /** + * 新增刀具库存 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 结果 + */ + @Override + public int insertPwCuttingToolInventoryDetail(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail) + { + pwCuttingToolInventoryDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolInventoryDetailMapper.insertPwCuttingToolInventoryDetail(pwCuttingToolInventoryDetail); + } + + /** + * 修改刀具库存 + * + * @param pwCuttingToolInventoryDetail 刀具库存 + * @return 结果 + */ + @Override + public int updatePwCuttingToolInventoryDetail(PwCuttingToolInventoryDetail pwCuttingToolInventoryDetail) + { + return pwCuttingToolInventoryDetailMapper.updatePwCuttingToolInventoryDetail(pwCuttingToolInventoryDetail); + } + + /** + * 批量删除刀具库存 + * + * @param ids 需要删除的刀具库存ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolInventoryDetailByIds(Long[] ids) + { + return pwCuttingToolInventoryDetailMapper.deletePwCuttingToolInventoryDetailByIds(ids); + } + + /** + * 删除刀具库存信息 + * + * @param id 刀具库存ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolInventoryDetailById(Long id) + { + return pwCuttingToolInventoryDetailMapper.deletePwCuttingToolInventoryDetailById(id); + } + + @Override + public PwCuttingToolInventoryDetail selectPwCuttingToolInventoryDetailByNameAndBrandAndType(String name,String brand, String type) { + + return pwCuttingToolInventoryDetailMapper.selectPwCuttingToolInventoryDetailByNameAndBrandAndType(name,brand,type); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolMaintainDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolMaintainDetailServiceImpl.java new file mode 100644 index 0000000..7b7faf0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolMaintainDetailServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolMaintainDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolMaintainDetail; +import com.ruoyi.project.management.service.IPwCuttingToolMaintainDetailService; + +/** + * 刀具维修申请单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-21 + */ +@Service +public class PwCuttingToolMaintainDetailServiceImpl implements IPwCuttingToolMaintainDetailService +{ + @Autowired + private PwCuttingToolMaintainDetailMapper pwCuttingToolMaintainDetailMapper; + + /** + * 查询刀具维修申请单详情 + * + * @param id 刀具维修申请单详情ID + * @return 刀具维修申请单详情 + */ + @Override + public PwCuttingToolMaintainDetail selectPwCuttingToolMaintainDetailById(Long id) + { + return pwCuttingToolMaintainDetailMapper.selectPwCuttingToolMaintainDetailById(id); + } + + /** + * 查询刀具维修申请单详情列表 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 刀具维修申请单详情 + */ + @Override + public List selectPwCuttingToolMaintainDetailList(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail) + { + return pwCuttingToolMaintainDetailMapper.selectPwCuttingToolMaintainDetailList(pwCuttingToolMaintainDetail); + } + + /** + * 新增刀具维修申请单详情 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 结果 + */ + @Override + public int insertPwCuttingToolMaintainDetail(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail) + { + pwCuttingToolMaintainDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolMaintainDetailMapper.insertPwCuttingToolMaintainDetail(pwCuttingToolMaintainDetail); + } + + /** + * 修改刀具维修申请单详情 + * + * @param pwCuttingToolMaintainDetail 刀具维修申请单详情 + * @return 结果 + */ + @Override + public int updatePwCuttingToolMaintainDetail(PwCuttingToolMaintainDetail pwCuttingToolMaintainDetail) + { + return pwCuttingToolMaintainDetailMapper.updatePwCuttingToolMaintainDetail(pwCuttingToolMaintainDetail); + } + + /** + * 批量删除刀具维修申请单详情 + * + * @param ids 需要删除的刀具维修申请单详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolMaintainDetailByIds(Long[] ids) + { + return pwCuttingToolMaintainDetailMapper.deletePwCuttingToolMaintainDetailByIds(ids); + } + + /** + * 删除刀具维修申请单详情信息 + * + * @param id 刀具维修申请单详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolMaintainDetailById(Long id) + { + return pwCuttingToolMaintainDetailMapper.deletePwCuttingToolMaintainDetailById(id); + } + + @Override + public List selectPwCuttingToolMaintainDetailByMaintainId(Long id) { + // TODO Auto-generated method stub + return pwCuttingToolMaintainDetailMapper.selectPwCuttingToolMaintainDetailByMaintainId(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolMaintainServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolMaintainServiceImpl.java new file mode 100644 index 0000000..7daaece --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolMaintainServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolMaintainMapper; +import com.ruoyi.project.management.domain.PwCuttingToolMaintain; +import com.ruoyi.project.management.service.IPwCuttingToolMaintainService; + +/** + * 刀具维修申请单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-21 + */ +@Service +public class PwCuttingToolMaintainServiceImpl implements IPwCuttingToolMaintainService +{ + @Autowired + private PwCuttingToolMaintainMapper pwCuttingToolMaintainMapper; + + /** + * 查询刀具维修申请单 + * + * @param id 刀具维修申请单ID + * @return 刀具维修申请单 + */ + @Override + public PwCuttingToolMaintain selectPwCuttingToolMaintainById(Long id) + { + return pwCuttingToolMaintainMapper.selectPwCuttingToolMaintainById(id); + } + + /** + * 查询刀具维修申请单列表 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 刀具维修申请单 + */ + @Override + public List selectPwCuttingToolMaintainList(PwCuttingToolMaintain pwCuttingToolMaintain) + { + return pwCuttingToolMaintainMapper.selectPwCuttingToolMaintainList(pwCuttingToolMaintain); + } + + /** + * 新增刀具维修申请单 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 结果 + */ + @Override + public int insertPwCuttingToolMaintain(PwCuttingToolMaintain pwCuttingToolMaintain) + { + pwCuttingToolMaintain.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolMaintainMapper.insertPwCuttingToolMaintain(pwCuttingToolMaintain); + } + + /** + * 修改刀具维修申请单 + * + * @param pwCuttingToolMaintain 刀具维修申请单 + * @return 结果 + */ + @Override + public int updatePwCuttingToolMaintain(PwCuttingToolMaintain pwCuttingToolMaintain) + { + return pwCuttingToolMaintainMapper.updatePwCuttingToolMaintain(pwCuttingToolMaintain); + } + + /** + * 批量删除刀具维修申请单 + * + * @param ids 需要删除的刀具维修申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolMaintainByIds(Long[] ids) + { + return pwCuttingToolMaintainMapper.deletePwCuttingToolMaintainByIds(ids); + } + + /** + * 删除刀具维修申请单信息 + * + * @param id 刀具维修申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolMaintainById(Long id) + { + return pwCuttingToolMaintainMapper.deletePwCuttingToolMaintainById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolPurchaseDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolPurchaseDetailServiceImpl.java new file mode 100644 index 0000000..d3bf9ff --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolPurchaseDetailServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolPurchaseDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolPurchaseDetail; +import com.ruoyi.project.management.service.IPwCuttingToolPurchaseDetailService; + +/** + * 刀具采购详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-09 + */ +@Service +public class PwCuttingToolPurchaseDetailServiceImpl implements IPwCuttingToolPurchaseDetailService +{ + @Autowired + private PwCuttingToolPurchaseDetailMapper pwCuttingToolPurchaseDetailMapper; + + /** + * 查询刀具采购详情 + * + * @param id 刀具采购详情ID + * @return 刀具采购详情 + */ + @Override + public PwCuttingToolPurchaseDetail selectPwCuttingToolPurchaseDetailById(Long id) + { + return pwCuttingToolPurchaseDetailMapper.selectPwCuttingToolPurchaseDetailById(id); + } + + /** + * 查询刀具采购详情列表 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 刀具采购详情 + */ + @Override + public List selectPwCuttingToolPurchaseDetailList(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail) + { + return pwCuttingToolPurchaseDetailMapper.selectPwCuttingToolPurchaseDetailList(pwCuttingToolPurchaseDetail); + } + + /** + * 新增刀具采购详情 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 结果 + */ + @Override + public int insertPwCuttingToolPurchaseDetail(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail) + { + pwCuttingToolPurchaseDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolPurchaseDetailMapper.insertPwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); + } + + /** + * 修改刀具采购详情 + * + * @param pwCuttingToolPurchaseDetail 刀具采购详情 + * @return 结果 + */ + @Override + public int updatePwCuttingToolPurchaseDetail(PwCuttingToolPurchaseDetail pwCuttingToolPurchaseDetail) + { + return pwCuttingToolPurchaseDetailMapper.updatePwCuttingToolPurchaseDetail(pwCuttingToolPurchaseDetail); + } + + /** + * 批量删除刀具采购详情 + * + * @param ids 需要删除的刀具采购详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolPurchaseDetailByIds(Long[] ids) + { + return pwCuttingToolPurchaseDetailMapper.deletePwCuttingToolPurchaseDetailByIds(ids); + } + + /** + * 删除刀具采购详情信息 + * + * @param id 刀具采购详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolPurchaseDetailById(Long id) + { + return pwCuttingToolPurchaseDetailMapper.deletePwCuttingToolPurchaseDetailById(id); + } + + @Override + public List selectPwCuttingToolPurchaseDetailByPurchaseId(Long id) { + // TODO Auto-generated method stub + return pwCuttingToolPurchaseDetailMapper.selectPwCuttingToolPurchaseDetailByPurchaseId(id); + } + + @Override + public List selectPwCuttingToolPurchaseDetailByName(String name) { + // TODO Auto-generated method stub + return pwCuttingToolPurchaseDetailMapper.selectPwCuttingToolPurchaseDetailByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolPurchaseServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolPurchaseServiceImpl.java new file mode 100644 index 0000000..c3fc897 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolPurchaseServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolPurchaseMapper; +import com.ruoyi.project.management.domain.PwCuttingToolPurchase; +import com.ruoyi.project.management.service.IPwCuttingToolPurchaseService; + +/** + * 刀具采购申请单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-10 + */ +@Service +public class PwCuttingToolPurchaseServiceImpl implements IPwCuttingToolPurchaseService +{ + @Autowired + private PwCuttingToolPurchaseMapper pwCuttingToolPurchaseMapper; + + /** + * 查询刀具采购申请单 + * + * @param id 刀具采购申请单ID + * @return 刀具采购申请单 + */ + @Override + public PwCuttingToolPurchase selectPwCuttingToolPurchaseById(Long id) + { + return pwCuttingToolPurchaseMapper.selectPwCuttingToolPurchaseById(id); + } + + /** + * 查询刀具采购申请单列表 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 刀具采购申请单 + */ + @Override + public List selectPwCuttingToolPurchaseList(PwCuttingToolPurchase pwCuttingToolPurchase) + { + return pwCuttingToolPurchaseMapper.selectPwCuttingToolPurchaseList(pwCuttingToolPurchase); + } + + /** + * 新增刀具采购申请单 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 结果 + */ + @Override + public int insertPwCuttingToolPurchase(PwCuttingToolPurchase pwCuttingToolPurchase) + { + pwCuttingToolPurchase.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolPurchaseMapper.insertPwCuttingToolPurchase(pwCuttingToolPurchase); + } + + /** + * 修改刀具采购申请单 + * + * @param pwCuttingToolPurchase 刀具采购申请单 + * @return 结果 + */ + @Override + public int updatePwCuttingToolPurchase(PwCuttingToolPurchase pwCuttingToolPurchase) + { + return pwCuttingToolPurchaseMapper.updatePwCuttingToolPurchase(pwCuttingToolPurchase); + } + + /** + * 批量删除刀具采购申请单 + * + * @param ids 需要删除的刀具采购申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolPurchaseByIds(Long[] ids) + { + return pwCuttingToolPurchaseMapper.deletePwCuttingToolPurchaseByIds(ids); + } + + /** + * 删除刀具采购申请单信息 + * + * @param id 刀具采购申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolPurchaseById(Long id) + { + return pwCuttingToolPurchaseMapper.deletePwCuttingToolPurchaseById(id); + } + @Override + public int updatePwCuttingToolPurchaseByCode(PwCuttingToolPurchase pwCuttingToolPurchase){ + return pwCuttingToolPurchaseMapper.updatePwCuttingToolPurchaseByCode(pwCuttingToolPurchase); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapDetailServiceImpl.java new file mode 100644 index 0000000..209c685 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapDetailServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolScrapDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolScrapDetail; +import com.ruoyi.project.management.service.IPwCuttingToolScrapDetailService; + +/** + * 刀具报废详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-19 + */ +@Service +public class PwCuttingToolScrapDetailServiceImpl implements IPwCuttingToolScrapDetailService +{ + @Autowired + private PwCuttingToolScrapDetailMapper pwCuttingToolScrapDetailMapper; + + /** + * 查询刀具报废详情 + * + * @param id 刀具报废详情ID + * @return 刀具报废详情 + */ + @Override + public PwCuttingToolScrapDetail selectPwCuttingToolScrapDetailById(Long id) + { + return pwCuttingToolScrapDetailMapper.selectPwCuttingToolScrapDetailById(id); + } + + /** + * 查询刀具报废详情列表 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 刀具报废详情 + */ + @Override + public List selectPwCuttingToolScrapDetailList(PwCuttingToolScrapDetail pwCuttingToolScrapDetail) + { + return pwCuttingToolScrapDetailMapper.selectPwCuttingToolScrapDetailList(pwCuttingToolScrapDetail); + } + + /** + * 新增刀具报废详情 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 结果 + */ + @Override + public int insertPwCuttingToolScrapDetail(PwCuttingToolScrapDetail pwCuttingToolScrapDetail) + { + pwCuttingToolScrapDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolScrapDetailMapper.insertPwCuttingToolScrapDetail(pwCuttingToolScrapDetail); + } + + /** + * 修改刀具报废详情 + * + * @param pwCuttingToolScrapDetail 刀具报废详情 + * @return 结果 + */ + @Override + public int updatePwCuttingToolScrapDetail(PwCuttingToolScrapDetail pwCuttingToolScrapDetail) + { + return pwCuttingToolScrapDetailMapper.updatePwCuttingToolScrapDetail(pwCuttingToolScrapDetail); + } + + /** + * 批量删除刀具报废详情 + * + * @param ids 需要删除的刀具报废详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapDetailByIds(Long[] ids) + { + return pwCuttingToolScrapDetailMapper.deletePwCuttingToolScrapDetailByIds(ids); + } + + /** + * 删除刀具报废详情信息 + * + * @param id 刀具报废详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapDetailById(Long id) + { + return pwCuttingToolScrapDetailMapper.deletePwCuttingToolScrapDetailById(id); + } + + @Override + public List selectPwCuttingToolScrapDetailByScrapId(Long id) { + // TODO Auto-generated method stub + return pwCuttingToolScrapDetailMapper.selectPwCuttingToolScrapDetailByScrapId(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapGodownEntryDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapGodownEntryDetailServiceImpl.java new file mode 100644 index 0000000..fec822a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapGodownEntryDetailServiceImpl.java @@ -0,0 +1,102 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolScrapGodownEntryDetailMapper; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntryDetail; +import com.ruoyi.project.management.service.IPwCuttingToolScrapGodownEntryDetailService; + +/** + * 刀具报废入库详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-19 + */ +@Service +public class PwCuttingToolScrapGodownEntryDetailServiceImpl implements IPwCuttingToolScrapGodownEntryDetailService +{ + @Autowired + private PwCuttingToolScrapGodownEntryDetailMapper pwCuttingToolScrapGodownEntryDetailMapper; + + /** + * 查询刀具报废入库详情 + * + * @param id 刀具报废入库详情ID + * @return 刀具报废入库详情 + */ + @Override + public PwCuttingToolScrapGodownEntryDetail selectPwCuttingToolScrapGodownEntryDetailById(Long id) + { + return pwCuttingToolScrapGodownEntryDetailMapper.selectPwCuttingToolScrapGodownEntryDetailById(id); + } + + /** + * 查询刀具报废入库详情列表 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 刀具报废入库详情 + */ + @Override + public List selectPwCuttingToolScrapGodownEntryDetailList(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail) + { + return pwCuttingToolScrapGodownEntryDetailMapper.selectPwCuttingToolScrapGodownEntryDetailList(pwCuttingToolScrapGodownEntryDetail); + } + + /** + * 新增刀具报废入库详情 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 结果 + */ + @Override + public int insertPwCuttingToolScrapGodownEntryDetail(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail) + { + pwCuttingToolScrapGodownEntryDetail.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolScrapGodownEntryDetailMapper.insertPwCuttingToolScrapGodownEntryDetail(pwCuttingToolScrapGodownEntryDetail); + } + + /** + * 修改刀具报废入库详情 + * + * @param pwCuttingToolScrapGodownEntryDetail 刀具报废入库详情 + * @return 结果 + */ + @Override + public int updatePwCuttingToolScrapGodownEntryDetail(PwCuttingToolScrapGodownEntryDetail pwCuttingToolScrapGodownEntryDetail) + { + return pwCuttingToolScrapGodownEntryDetailMapper.updatePwCuttingToolScrapGodownEntryDetail(pwCuttingToolScrapGodownEntryDetail); + } + + /** + * 批量删除刀具报废入库详情 + * + * @param ids 需要删除的刀具报废入库详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapGodownEntryDetailByIds(Long[] ids) + { + return pwCuttingToolScrapGodownEntryDetailMapper.deletePwCuttingToolScrapGodownEntryDetailByIds(ids); + } + + /** + * 删除刀具报废入库详情信息 + * + * @param id 刀具报废入库详情ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapGodownEntryDetailById(Long id) + { + return pwCuttingToolScrapGodownEntryDetailMapper.deletePwCuttingToolScrapGodownEntryDetailById(id); + } + + @Override + public List selectPwCuttingToolGodownEntryDetailByGosownEntryId( + Long gosownEntryId) { + // TODO Auto-generated method stub + return pwCuttingToolScrapGodownEntryDetailMapper.selectPwCuttingToolGodownEntryDetailByGosownEntryId(gosownEntryId); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapGodownEntryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapGodownEntryServiceImpl.java new file mode 100644 index 0000000..ac8e801 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapGodownEntryServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolScrapGodownEntryMapper; +import com.ruoyi.project.management.domain.PwCuttingToolScrapGodownEntry; +import com.ruoyi.project.management.service.IPwCuttingToolScrapGodownEntryService; + +/** + * 刀具报废入库单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-19 + */ +@Service +public class PwCuttingToolScrapGodownEntryServiceImpl implements IPwCuttingToolScrapGodownEntryService +{ + @Autowired + private PwCuttingToolScrapGodownEntryMapper pwCuttingToolScrapGodownEntryMapper; + + /** + * 查询刀具报废入库单 + * + * @param id 刀具报废入库单ID + * @return 刀具报废入库单 + */ + @Override + public PwCuttingToolScrapGodownEntry selectPwCuttingToolScrapGodownEntryById(Long id) + { + return pwCuttingToolScrapGodownEntryMapper.selectPwCuttingToolScrapGodownEntryById(id); + } + + /** + * 查询刀具报废入库单列表 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 刀具报废入库单 + */ + @Override + public List selectPwCuttingToolScrapGodownEntryList(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry) + { + return pwCuttingToolScrapGodownEntryMapper.selectPwCuttingToolScrapGodownEntryList(pwCuttingToolScrapGodownEntry); + } + + /** + * 新增刀具报废入库单 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 结果 + */ + @Override + public int insertPwCuttingToolScrapGodownEntry(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry) + { + return pwCuttingToolScrapGodownEntryMapper.insertPwCuttingToolScrapGodownEntry(pwCuttingToolScrapGodownEntry); + } + + /** + * 修改刀具报废入库单 + * + * @param pwCuttingToolScrapGodownEntry 刀具报废入库单 + * @return 结果 + */ + @Override + public int updatePwCuttingToolScrapGodownEntry(PwCuttingToolScrapGodownEntry pwCuttingToolScrapGodownEntry) + { + return pwCuttingToolScrapGodownEntryMapper.updatePwCuttingToolScrapGodownEntry(pwCuttingToolScrapGodownEntry); + } + + /** + * 批量删除刀具报废入库单 + * + * @param ids 需要删除的刀具报废入库单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapGodownEntryByIds(Long[] ids) + { + return pwCuttingToolScrapGodownEntryMapper.deletePwCuttingToolScrapGodownEntryByIds(ids); + } + + /** + * 删除刀具报废入库单信息 + * + * @param id 刀具报废入库单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapGodownEntryById(Long id) + { + return pwCuttingToolScrapGodownEntryMapper.deletePwCuttingToolScrapGodownEntryById(id); + } + + @Override + public PwCuttingToolScrapGodownEntry selectPwCuttingToolScrapGodownEntryByCode(String code) { + // TODO Auto-generated method stub + return pwCuttingToolScrapGodownEntryMapper.selectPwCuttingToolScrapGodownEntryByCode(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapServiceImpl.java new file mode 100644 index 0000000..8916267 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolScrapServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolScrapMapper; +import com.ruoyi.project.management.domain.PwCuttingToolScrap; +import com.ruoyi.project.management.service.IPwCuttingToolScrapService; + +/** + * 刀具报废申请单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-19 + */ +@Service +public class PwCuttingToolScrapServiceImpl implements IPwCuttingToolScrapService +{ + @Autowired + private PwCuttingToolScrapMapper pwCuttingToolScrapMapper; + + /** + * 查询刀具报废申请单 + * + * @param id 刀具报废申请单ID + * @return 刀具报废申请单 + */ + @Override + public PwCuttingToolScrap selectPwCuttingToolScrapById(Long id) + { + return pwCuttingToolScrapMapper.selectPwCuttingToolScrapById(id); + } + + /** + * 查询刀具报废申请单列表 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 刀具报废申请单 + */ + @Override + public List selectPwCuttingToolScrapList(PwCuttingToolScrap pwCuttingToolScrap) + { + return pwCuttingToolScrapMapper.selectPwCuttingToolScrapList(pwCuttingToolScrap); + } + + /** + * 新增刀具报废申请单 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 结果 + */ + @Override + public int insertPwCuttingToolScrap(PwCuttingToolScrap pwCuttingToolScrap) + { + pwCuttingToolScrap.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolScrapMapper.insertPwCuttingToolScrap(pwCuttingToolScrap); + } + + /** + * 修改刀具报废申请单 + * + * @param pwCuttingToolScrap 刀具报废申请单 + * @return 结果 + */ + @Override + public int updatePwCuttingToolScrap(PwCuttingToolScrap pwCuttingToolScrap) + { + return pwCuttingToolScrapMapper.updatePwCuttingToolScrap(pwCuttingToolScrap); + } + + /** + * 批量删除刀具报废申请单 + * + * @param ids 需要删除的刀具报废申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapByIds(Long[] ids) + { + return pwCuttingToolScrapMapper.deletePwCuttingToolScrapByIds(ids); + } + + /** + * 删除刀具报废申请单信息 + * + * @param id 刀具报废申请单ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolScrapById(Long id) + { + return pwCuttingToolScrapMapper.deletePwCuttingToolScrapById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolServiceImpl.java new file mode 100644 index 0000000..266446c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwCuttingToolServiceImpl.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwCuttingToolMapper; +import com.ruoyi.project.management.domain.PwCuttingTool; +import com.ruoyi.project.management.service.IPwCuttingToolService; + +/** + * 刀具Service业务层处理 + * + * @author zhukangchao + * @date 2022-01-27 + */ +@Service +public class PwCuttingToolServiceImpl implements IPwCuttingToolService +{ + @Autowired + private PwCuttingToolMapper pwCuttingToolMapper; + + /** + * 查询刀具 + * + * @param id 刀具ID + * @return 刀具 + */ + @Override + public PwCuttingTool selectPwCuttingToolById(Long id) + { + return pwCuttingToolMapper.selectPwCuttingToolById(id); + } + + /** + * 查询刀具列表 + * + * @param pwCuttingTool 刀具 + * @return 刀具 + */ + @Override + public List selectPwCuttingToolList(PwCuttingTool pwCuttingTool) + { + return pwCuttingToolMapper.selectPwCuttingToolList(pwCuttingTool); + } + + /** + * 新增刀具 + * + * @param pwCuttingTool 刀具 + * @return 结果 + */ + @Override + public int insertPwCuttingTool(PwCuttingTool pwCuttingTool) + { + pwCuttingTool.setCreateTime(DateUtils.getNowDate()); + return pwCuttingToolMapper.insertPwCuttingTool(pwCuttingTool); + } + + /** + * 修改刀具 + * + * @param pwCuttingTool 刀具 + * @return 结果 + */ + @Override + public int updatePwCuttingTool(PwCuttingTool pwCuttingTool) + { + return pwCuttingToolMapper.updatePwCuttingTool(pwCuttingTool); + } + + /** + * 批量删除刀具 + * + * @param ids 需要删除的刀具ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolByIds(Long[] ids) + { + return pwCuttingToolMapper.deletePwCuttingToolByIds(ids); + } + + /** + * 删除刀具信息 + * + * @param id 刀具ID + * @return 结果 + */ + @Override + public int deletePwCuttingToolById(Long id) + { + return pwCuttingToolMapper.deletePwCuttingToolById(id); + } + + @Override + public PwCuttingTool selectPwCuttingToolByName(String name, String brand, String type, String supplier) { + + return pwCuttingToolMapper.selectPwCuttingToolByName(name,brand,type,supplier); + } + + @Override + public List selectPwCuttingToolByPeriodNotIsNull() { + // TODO Auto-generated method stub + return pwCuttingToolMapper.selectPwCuttingToolByPeriodNotIsNull(); + } + + @Override + public List selectPwCuttingToolByNameAndType(String name) { + // TODO Auto-generated method stub + return pwCuttingToolMapper.selectPwCuttingToolByNameAndType(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwDanceNotStandardServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwDanceNotStandardServiceImpl.java new file mode 100644 index 0000000..2550538 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwDanceNotStandardServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwDanceNotStandardMapper; +import com.ruoyi.project.management.domain.PwDanceNotStandard; +import com.ruoyi.project.management.service.IPwDanceNotStandardService; + +/** + * 舞非型号Service业务层处理 + * + * @author zhukangchao + * @date 2021-08-02 + */ +@Service +public class PwDanceNotStandardServiceImpl implements IPwDanceNotStandardService +{ + @Autowired + private PwDanceNotStandardMapper pwDanceNotStandardMapper; + + /** + * 查询舞非型号 + * + * @param id 舞非型号ID + * @return 舞非型号 + */ + @Override + public PwDanceNotStandard selectPwDanceNotStandardById(Long id) + { + return pwDanceNotStandardMapper.selectPwDanceNotStandardById(id); + } + + /** + * 查询舞非型号列表 + * + * @param pwDanceNotStandard 舞非型号 + * @return 舞非型号 + */ + @Override + public List selectPwDanceNotStandardList(PwDanceNotStandard pwDanceNotStandard) + { + return pwDanceNotStandardMapper.selectPwDanceNotStandardList(pwDanceNotStandard); + } + + /** + * 新增舞非型号 + * + * @param pwDanceNotStandard 舞非型号 + * @return 结果 + */ + @Override + public int insertPwDanceNotStandard(PwDanceNotStandard pwDanceNotStandard) + { + pwDanceNotStandard.setCreateTime(DateUtils.getNowDate()); + return pwDanceNotStandardMapper.insertPwDanceNotStandard(pwDanceNotStandard); + } + + /** + * 修改舞非型号 + * + * @param pwDanceNotStandard 舞非型号 + * @return 结果 + */ + @Override + public int updatePwDanceNotStandard(PwDanceNotStandard pwDanceNotStandard) + { + return pwDanceNotStandardMapper.updatePwDanceNotStandard(pwDanceNotStandard); + } + + /** + * 批量删除舞非型号 + * + * @param ids 需要删除的舞非型号ID + * @return 结果 + */ + @Override + public int deletePwDanceNotStandardByIds(Long[] ids) + { + return pwDanceNotStandardMapper.deletePwDanceNotStandardByIds(ids); + } + + /** + * 删除舞非型号信息 + * + * @param id 舞非型号ID + * @return 结果 + */ + @Override + public int deletePwDanceNotStandardById(Long id) + { + return pwDanceNotStandardMapper.deletePwDanceNotStandardById(id); + } + + @Override + public PwDanceNotStandard selectPwDanceNotStandardByType(String type) { + + return pwDanceNotStandardMapper.selectPwDanceNotStandardByType(type); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwDefectiveMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwDefectiveMaterialServiceImpl.java new file mode 100644 index 0000000..811eea6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwDefectiveMaterialServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwDefectiveMaterialMapper; +import com.ruoyi.project.management.domain.PwDefectiveMaterial; +import com.ruoyi.project.management.service.IPwDefectiveMaterialService; + +/** + * 残料Service业务层处理 + * + * @author zhukangchao + * @date 2022-12-14 + */ +@Service +public class PwDefectiveMaterialServiceImpl implements IPwDefectiveMaterialService +{ + @Autowired + private PwDefectiveMaterialMapper pwDefectiveMaterialMapper; + + /** + * 查询残料 + * + * @param id 残料ID + * @return 残料 + */ + @Override + public PwDefectiveMaterial selectPwDefectiveMaterialById(Long id) + { + return pwDefectiveMaterialMapper.selectPwDefectiveMaterialById(id); + } + + /** + * 查询残料列表 + * + * @param pwDefectiveMaterial 残料 + * @return 残料 + */ + @Override + public List selectPwDefectiveMaterialList(PwDefectiveMaterial pwDefectiveMaterial) + { + return pwDefectiveMaterialMapper.selectPwDefectiveMaterialList(pwDefectiveMaterial); + } + + /** + * 新增残料 + * + * @param pwDefectiveMaterial 残料 + * @return 结果 + */ + @Override + public int insertPwDefectiveMaterial(PwDefectiveMaterial pwDefectiveMaterial) + { + pwDefectiveMaterial.setCreateTime(DateUtils.getNowDate()); + return pwDefectiveMaterialMapper.insertPwDefectiveMaterial(pwDefectiveMaterial); + } + + /** + * 修改残料 + * + * @param pwDefectiveMaterial 残料 + * @return 结果 + */ + @Override + public int updatePwDefectiveMaterial(PwDefectiveMaterial pwDefectiveMaterial) + { + return pwDefectiveMaterialMapper.updatePwDefectiveMaterial(pwDefectiveMaterial); + } + + /** + * 批量删除残料 + * + * @param ids 需要删除的残料ID + * @return 结果 + */ + @Override + public int deletePwDefectiveMaterialByIds(Long[] ids) + { + return pwDefectiveMaterialMapper.deletePwDefectiveMaterialByIds(ids); + } + + /** + * 删除残料信息 + * + * @param id 残料ID + * @return 结果 + */ + @Override + public int deletePwDefectiveMaterialById(Long id) + { + return pwDefectiveMaterialMapper.deletePwDefectiveMaterialById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwEquipmentInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwEquipmentInfoServiceImpl.java new file mode 100644 index 0000000..f979ae9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwEquipmentInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwEquipmentInfoMapper; +import com.ruoyi.project.management.domain.PwEquipmentInfo; +import com.ruoyi.project.management.service.IPwEquipmentInfoService; + +/** + * 生产设备信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-08-01 + */ +@Service +public class PwEquipmentInfoServiceImpl implements IPwEquipmentInfoService +{ + @Autowired + private PwEquipmentInfoMapper pwEquipmentInfoMapper; + + /** + * 查询生产设备信息 + * + * @param id 生产设备信息ID + * @return 生产设备信息 + */ + @Override + public PwEquipmentInfo selectPwEquipmentInfoById(Long id) + { + return pwEquipmentInfoMapper.selectPwEquipmentInfoById(id); + } + + /** + * 查询生产设备信息列表 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 生产设备信息 + */ + @Override + public List selectPwEquipmentInfoList(PwEquipmentInfo pwEquipmentInfo) + { + return pwEquipmentInfoMapper.selectPwEquipmentInfoList(pwEquipmentInfo); + } + + /** + * 新增生产设备信息 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 结果 + */ + @Override + public int insertPwEquipmentInfo(PwEquipmentInfo pwEquipmentInfo) + { + pwEquipmentInfo.setCreateTime(DateUtils.getNowDate()); + return pwEquipmentInfoMapper.insertPwEquipmentInfo(pwEquipmentInfo); + } + + /** + * 修改生产设备信息 + * + * @param pwEquipmentInfo 生产设备信息 + * @return 结果 + */ + @Override + public int updatePwEquipmentInfo(PwEquipmentInfo pwEquipmentInfo) + { + return pwEquipmentInfoMapper.updatePwEquipmentInfo(pwEquipmentInfo); + } + + /** + * 批量删除生产设备信息 + * + * @param ids 需要删除的生产设备信息ID + * @return 结果 + */ + @Override + public int deletePwEquipmentInfoByIds(Long[] ids) + { + return pwEquipmentInfoMapper.deletePwEquipmentInfoByIds(ids); + } + + /** + * 删除生产设备信息信息 + * + * @param id 生产设备信息ID + * @return 结果 + */ + @Override + public int deletePwEquipmentInfoById(Long id) + { + return pwEquipmentInfoMapper.deletePwEquipmentInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersDetailServiceImpl.java new file mode 100644 index 0000000..979961b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersDetailServiceImpl.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwFuturesOrdersDetailMapper; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetail; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailService; + +/** + * 预采购单明细Service业务层处理 + * + * @author zhukangchao + * @date 2022-06-22 + */ +@Service +public class PwFuturesOrdersDetailServiceImpl implements IPwFuturesOrdersDetailService +{ + @Autowired + private PwFuturesOrdersDetailMapper pwFuturesOrdersDetailMapper; + + /** + * 查询预采购单明细 + * + * @param id 预采购单明细ID + * @return 预采购单明细 + */ + @Override + public PwFuturesOrdersDetail selectPwFuturesOrdersDetailById(Long id) + { + return pwFuturesOrdersDetailMapper.selectPwFuturesOrdersDetailById(id); + } + + /** + * 查询预采购单明细列表 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 预采购单明细 + */ + @Override + public List selectPwFuturesOrdersDetailList(PwFuturesOrdersDetail pwFuturesOrdersDetail) + { + return pwFuturesOrdersDetailMapper.selectPwFuturesOrdersDetailList(pwFuturesOrdersDetail); + } + + /** + * 新增预采购单明细 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 结果 + */ + @Override + public int insertPwFuturesOrdersDetail(PwFuturesOrdersDetail pwFuturesOrdersDetail) + { + pwFuturesOrdersDetail.setCreateTime(DateUtils.getNowDate()); + return pwFuturesOrdersDetailMapper.insertPwFuturesOrdersDetail(pwFuturesOrdersDetail); + } + + /** + * 修改预采购单明细 + * + * @param pwFuturesOrdersDetail 预采购单明细 + * @return 结果 + */ + @Override + public int updatePwFuturesOrdersDetail(PwFuturesOrdersDetail pwFuturesOrdersDetail) + { + return pwFuturesOrdersDetailMapper.updatePwFuturesOrdersDetail(pwFuturesOrdersDetail); + } + + /** + * 批量删除预采购单明细 + * + * @param ids 需要删除的预采购单明细ID + * @return 结果 + */ + @Override + public int deletePwFuturesOrdersDetailByIds(Long[] ids) + { + return pwFuturesOrdersDetailMapper.deletePwFuturesOrdersDetailByIds(ids); + } + + /** + * 删除预采购单明细信息 + * + * @param id 预采购单明细ID + * @return 结果 + */ + @Override + public int deletePwFuturesOrdersDetailById(Long id) + { + return pwFuturesOrdersDetailMapper.deletePwFuturesOrdersDetailById(id); + } + + @Override + public List selectPwFuturesOrdersDetailByCode(String makeDocumentsCode) { + // TODO Auto-generated method stub + return pwFuturesOrdersDetailMapper.selectPwFuturesOrdersDetailByCode(makeDocumentsCode); + } + + @Override + public PwFuturesOrdersDetail selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(String productionCode, + String materialsName, String materialsSpecification) { + // TODO Auto-generated method stub + return pwFuturesOrdersDetailMapper.selectPwFuturesOrdersDetailByCodeAndNameAndFigureNumber(productionCode,materialsName,materialsSpecification); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersDetailTwoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersDetailTwoServiceImpl.java new file mode 100644 index 0000000..951c8b3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersDetailTwoServiceImpl.java @@ -0,0 +1,120 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwFuturesOrdersDetailTwoMapper; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetailTwo; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailTwoService; + +/** + * 预采购单明细详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-06-27 + */ +@Service +public class PwFuturesOrdersDetailTwoServiceImpl implements IPwFuturesOrdersDetailTwoService +{ + @Autowired + private PwFuturesOrdersDetailTwoMapper pwFuturesOrdersDetailTwoMapper; + + /** + * 查询预采购单明细详情 + * + * @param id 预采购单明细详情ID + * @return 预采购单明细详情 + */ + @Override + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoById(Long id) + { + return pwFuturesOrdersDetailTwoMapper.selectPwFuturesOrdersDetailTwoById(id); + } + + /** + * 查询预采购单明细详情列表 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 预采购单明细详情 + */ + @Override + public List selectPwFuturesOrdersDetailTwoList(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo) + { + return pwFuturesOrdersDetailTwoMapper.selectPwFuturesOrdersDetailTwoList(pwFuturesOrdersDetailTwo); + } + + /** + * 新增预采购单明细详情 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 结果 + */ + @Override + public int insertPwFuturesOrdersDetailTwo(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo) + { + pwFuturesOrdersDetailTwo.setCreateTime(DateUtils.getNowDate()); + return pwFuturesOrdersDetailTwoMapper.insertPwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo); + } + + /** + * 修改预采购单明细详情 + * + * @param pwFuturesOrdersDetailTwo 预采购单明细详情 + * @return 结果 + */ + @Override + public int updatePwFuturesOrdersDetailTwo(PwFuturesOrdersDetailTwo pwFuturesOrdersDetailTwo) + { + return pwFuturesOrdersDetailTwoMapper.updatePwFuturesOrdersDetailTwo(pwFuturesOrdersDetailTwo); + } + + /** + * 批量删除预采购单明细详情 + * + * @param ids 需要删除的预采购单明细详情ID + * @return 结果 + */ + @Override + public int deletePwFuturesOrdersDetailTwoByIds(Long[] ids) + { + return pwFuturesOrdersDetailTwoMapper.deletePwFuturesOrdersDetailTwoByIds(ids); + } + + /** + * 删除预采购单明细详情信息 + * + * @param id 预采购单明细详情ID + * @return 结果 + */ + @Override + public int deletePwFuturesOrdersDetailTwoById(Long id) + { + return pwFuturesOrdersDetailTwoMapper.deletePwFuturesOrdersDetailTwoById(id); + } + + @Override + public List selectPwFuturesOrdersDetailTwoByCode(String code) { + // TODO Auto-generated method stub + return pwFuturesOrdersDetailTwoMapper.selectPwFuturesOrdersDetailTwoByCode(code); + } + + @Override + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoByMatenaisId(Long id) { + // TODO Auto-generated method stub + return pwFuturesOrdersDetailTwoMapper.selectPwFuturesOrdersDetailTwoByMatenaisId(id); + } + + @Override + public PwFuturesOrdersDetailTwo selectPwFuturesOrdersDetailTwoByMatenaisIdAndNameAndFigureNumber(Long id, + String materialsName, String materialsSpecification) { + // TODO Auto-generated method stub + return pwFuturesOrdersDetailTwoMapper.selectPwFuturesOrdersDetailTwoByMatenaisIdAndNameAndFigureNumber(id,materialsName,materialsSpecification); + } + + @Override + public int deletePwFuturesOrdersDetailTwoByOrdersDetailId(Long id) { + // TODO Auto-generated method stub + return pwFuturesOrdersDetailTwoMapper.deletePwFuturesOrdersDetailTwoByOrdersDetailId(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersServiceImpl.java new file mode 100644 index 0000000..6adf7d1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwFuturesOrdersServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwFuturesOrdersMapper; +import com.ruoyi.project.management.domain.PwFuturesOrders; +import com.ruoyi.project.management.service.IPwFuturesOrdersService; + +/** + * 预采购单Service业务层处理 + * + * @author zhukangchao + * @date 2022-06-22 + */ +@Service +public class PwFuturesOrdersServiceImpl implements IPwFuturesOrdersService +{ + @Autowired + private PwFuturesOrdersMapper pwFuturesOrdersMapper; + + /** + * 查询预采购单 + * + * @param id 预采购单ID + * @return 预采购单 + */ + @Override + public PwFuturesOrders selectPwFuturesOrdersById(Long id) + { + return pwFuturesOrdersMapper.selectPwFuturesOrdersById(id); + } + + /** + * 查询预采购单列表 + * + * @param pwFuturesOrders 预采购单 + * @return 预采购单 + */ + @Override + public List selectPwFuturesOrdersList(PwFuturesOrders pwFuturesOrders) + { + return pwFuturesOrdersMapper.selectPwFuturesOrdersList(pwFuturesOrders); + } + + /** + * 新增预采购单 + * + * @param pwFuturesOrders 预采购单 + * @return 结果 + */ + @Override + public int insertPwFuturesOrders(PwFuturesOrders pwFuturesOrders) + { + pwFuturesOrders.setCreateTime(DateUtils.getNowDate()); + return pwFuturesOrdersMapper.insertPwFuturesOrders(pwFuturesOrders); + } + + /** + * 修改预采购单 + * + * @param pwFuturesOrders 预采购单 + * @return 结果 + */ + @Override + public int updatePwFuturesOrders(PwFuturesOrders pwFuturesOrders) + { + return pwFuturesOrdersMapper.updatePwFuturesOrders(pwFuturesOrders); + } + + /** + * 批量删除预采购单 + * + * @param ids 需要删除的预采购单ID + * @return 结果 + */ + @Override + public int deletePwFuturesOrdersByIds(Long[] ids) + { + return pwFuturesOrdersMapper.deletePwFuturesOrdersByIds(ids); + } + + /** + * 删除预采购单信息 + * + * @param id 预采购单ID + * @return 结果 + */ + @Override + public int deletePwFuturesOrdersById(Long id) + { + return pwFuturesOrdersMapper.deletePwFuturesOrdersById(id); + } + + @Override + public PwFuturesOrders selectPwFuturesOrdersByCode(String makeDocumentsCode) { + // TODO Auto-generated method stub + return pwFuturesOrdersMapper.selectPwFuturesOrdersByCode(makeDocumentsCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwGxProcessServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwGxProcessServiceImpl.java new file mode 100644 index 0000000..2e51cd1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwGxProcessServiceImpl.java @@ -0,0 +1,307 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.GxProcessVo; +import com.ruoyi.project.management.domain.PwGxProcess; +import com.ruoyi.project.management.domain.PwProcessOrDept; +import com.ruoyi.project.management.mapper.PwGxProcessMapper; +import com.ruoyi.project.management.mapper.PwProcessOrDeptMapper; +import com.ruoyi.project.management.service.IPwGxProcessService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; + +/** + * 物料工序信息Service业务层处理 + * + * @author chenyongjiang + * @date 2024-08-06 + */ +@Service +public class PwGxProcessServiceImpl implements IPwGxProcessService +{ + @Resource + private PwGxProcessMapper pwGxlProcessMapper; + @Resource + private PwProcessOrDeptMapper pwProcessOrDeptMapper; + + /** + * 查询物料工序信息 + * + * @param id 物料工序信息ID + * @return 物料工序信息 + */ + @Override + public PwGxProcess selectPwMaterialProcessById(Long id) + { + return pwGxlProcessMapper.selectPwGxProcessById(id); + } + + /** + * 查询物料工序信息列表 + * + * @param pwGxProcess 物料工序信息 + * @return 物料工序信息 + */ + @Override + public List selectPwMaterialProcessList(PwGxProcess pwGxProcess) + { + List res_list = pwGxlProcessMapper.selectPwGxProcessList(pwGxProcess); + for (PwGxProcess pwProcess : res_list) { + List chird_list = pwGxlProcessMapper.selectPwGxProcessByParengId(pwProcess.getId()); + pwProcess.setChildren(chird_list); + } + return res_list; + } + + /** + * 新增物料工序信息 + * + * @param pwGxProcess 物料工序信息 + * @return 结果 + */ + @Override + @Transactional + public AjaxResult insertPwMaterialProcess(PwGxProcess pwGxProcess) + { + //获取工艺 + String process_str = pwGxProcess.getTableData(); + if(StringUtils.isEmpty(process_str)){ + return AjaxResult.error("请添加工序!!"); + } + //解析工序 + JSONArray process_arrays = JSONArray.parseArray(process_str); + String figureNumber = ""; + String gxName = ""; + String type = ""; + Long id = 0l; + int ii = 0; + PwGxProcess process = null; + for(int i=0;i list = pwGxlProcessMapper.selectPwGxProcessByParengId(id); + for (PwGxProcess pwGxProcess : list) { + pwGxlProcessMapper.deletePwGxProcessById(pwGxProcess.getId()); + } + return pwGxlProcessMapper.deletePwGxProcessById(id); + } + + /** + * 根据物料号查询系统 + * @param figureNumber + * @return + */ + @Override + public PwGxProcess queryPwGxProcesssByFigureNumber(String figureNumber){ + return pwGxlProcessMapper.queryPwGxProcesssByFigureNumber(figureNumber); + } + + /** + * 根据父ID查询 + * @param parentId + * @return + */ + @Override + public List selectPwGxProcessByParengId(Long parentId){ + return pwGxlProcessMapper.selectPwGxProcessByParengId(parentId); + } + + /** + * 导入工艺路线 + * @param list + * @param operName + * @return + */ + @Override + @Transactional + public String importGxProcesses(List list, String operName){ + if(StringUtils.isNull(list) || list.size() == 0){ + return "导入数据为空!!"; + } + PwGxProcess pwGxProcess = null; + List dept_list = pwProcessOrDeptMapper.selectPwProcessOrDeptList(null); + for (GxProcessVo gxProcessVo : list) { + //判断物料是否存在 + PwGxProcess gxProcess = pwGxlProcessMapper.queryPwGxProcesssByFigureNumber(gxProcessVo.getFigureNumber()); + if(StringUtils.isNotNull(gxProcess)){ + gxProcess.setDelFlag(Constants.DELETE_FLAG_1); + pwGxlProcessMapper.updatePwGxProcess(gxProcess); + } + //添加物料 + String figure = gxProcessVo.getFigureNumber(); + String name = gxProcessVo.getName(); + String type = gxProcessVo.getType(); + pwGxProcess = new PwGxProcess(); + pwGxProcess.setFigureNumber(gxProcessVo.getFigureNumber()); + pwGxProcess.setName(gxProcessVo.getName()); + pwGxProcess.setMaterials(gxProcessVo.getType()); + pwGxProcess.setDelFlag("0"); + pwGxlProcessMapper.insertPwGxProcess(pwGxProcess); + Long id = pwGxProcess.getId(); + //添加原材料 + if(StringUtils.isNotEmpty(gxProcessVo.getMaterialCode())){ + pwGxProcess = new PwGxProcess(); + pwGxProcess.setParentId(id); + pwGxProcess.setFigureNumber(gxProcessVo.getMaterialCode()); + pwGxProcess.setName(gxProcessVo.getMaterialName()); + if(StringUtils.isNotEmpty(gxProcessVo.getNumber1())){ + pwGxProcess.setWorkblank(gxProcessVo.getNumber1()); + } + if(StringUtils.isNotEmpty(gxProcessVo.getNumber2())){ + pwGxProcess.setWorkblank(gxProcessVo.getNumber2()); + } + pwGxProcess.setDelFlag("0"); + pwGxlProcessMapper.insertPwGxProcess(pwGxProcess); + } + //添加工序 + String[] processes = gxProcessVo.getProcessName().split(","); + String[] time = null; + if(StringUtils.isNotEmpty(gxProcessVo.getProcessTime())){ + time = gxProcessVo.getProcessTime().split(","); + } + for(int i=0;i dept_list,String name){ + for (PwProcessOrDept pwProcessOrDept : dept_list) { + if(pwProcessOrDept.getProcessName().equals(name)){ + return pwProcessOrDept.getDeptName(); + } + } + return null; + } + + /** + * 新增物料工序信息 + * + * @param pwGxProcess 物料工序信息 + * @return 结果 + */ + public int insertPwGxProcess(PwGxProcess pwGxProcess){ + return pwGxlProcessMapper.insertPwGxProcess(pwGxProcess); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwHeightPermittedInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwHeightPermittedInfoServiceImpl.java new file mode 100644 index 0000000..81b8982 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwHeightPermittedInfoServiceImpl.java @@ -0,0 +1,102 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwHeightPermittedInfoMapper; +import com.ruoyi.project.management.domain.PwHeightPermittedInfo; +import com.ruoyi.project.management.service.IPwHeightPermittedInfoService; + +/** + * 安全库存限制信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-03-29 + */ +@Service +public class PwHeightPermittedInfoServiceImpl implements IPwHeightPermittedInfoService +{ + @Autowired + private PwHeightPermittedInfoMapper pwHeightPermittedInfoMapper; + + /** + * 查询安全库存限制信息 + * + * @param id 安全库存限制信息ID + * @return 安全库存限制信息 + */ + @Override + public PwHeightPermittedInfo selectPwHeightPermittedInfoById(Long id) + { + return pwHeightPermittedInfoMapper.selectPwHeightPermittedInfoById(id); + } + + /** + * 查询安全库存限制信息列表 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 安全库存限制信息 + */ + @Override + public List selectPwHeightPermittedInfoList(PwHeightPermittedInfo pwHeightPermittedInfo) + { + return pwHeightPermittedInfoMapper.selectPwHeightPermittedInfoList(pwHeightPermittedInfo); + } + + /** + * 新增安全库存限制信息 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 结果 + */ + @Override + public int insertPwHeightPermittedInfo(PwHeightPermittedInfo pwHeightPermittedInfo) + { + pwHeightPermittedInfo.setCreateTime(DateUtils.getNowDate()); + return pwHeightPermittedInfoMapper.insertPwHeightPermittedInfo(pwHeightPermittedInfo); + } + + /** + * 修改安全库存限制信息 + * + * @param pwHeightPermittedInfo 安全库存限制信息 + * @return 结果 + */ + @Override + public int updatePwHeightPermittedInfo(PwHeightPermittedInfo pwHeightPermittedInfo) + { + return pwHeightPermittedInfoMapper.updatePwHeightPermittedInfo(pwHeightPermittedInfo); + } + + /** + * 批量删除安全库存限制信息 + * + * @param ids 需要删除的安全库存限制信息ID + * @return 结果 + */ + @Override + public int deletePwHeightPermittedInfoByIds(Long[] ids) + { + return pwHeightPermittedInfoMapper.deletePwHeightPermittedInfoByIds(ids); + } + + /** + * 删除安全库存限制信息信息 + * + * @param id 安全库存限制信息ID + * @return 结果 + */ + @Override + public int deletePwHeightPermittedInfoById(Long id) + { + return pwHeightPermittedInfoMapper.deletePwHeightPermittedInfoById(id); + } + + @Override + public PwHeightPermittedInfo selectPwHeightPermittedInfoByNameAndFigureNumber(String materialName, + String figureNumber) { + // TODO Auto-generated method stub + return pwHeightPermittedInfoMapper.selectPwHeightPermittedInfoByNameAndFigureNumber(materialName,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInspectionCardDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInspectionCardDetailServiceImpl.java new file mode 100644 index 0000000..fc4b2c9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInspectionCardDetailServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwInspectionCardDetailMapper; +import com.ruoyi.project.management.domain.PwInspectionCardDetail; +import com.ruoyi.project.management.service.IPwInspectionCardDetailService; + +/** + * 检验单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-07-20 + */ +@Service +public class PwInspectionCardDetailServiceImpl implements IPwInspectionCardDetailService +{ + @Autowired + private PwInspectionCardDetailMapper pwInspectionCardDetailMapper; + + /** + * 查询检验单详情 + * + * @param id 检验单详情ID + * @return 检验单详情 + */ + @Override + public PwInspectionCardDetail selectPwInspectionCardDetailById(Long id) + { + return pwInspectionCardDetailMapper.selectPwInspectionCardDetailById(id); + } + + /** + * 查询检验单详情列表 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 检验单详情 + */ + @Override + public List selectPwInspectionCardDetailList(PwInspectionCardDetail pwInspectionCardDetail) + { + return pwInspectionCardDetailMapper.selectPwInspectionCardDetailList(pwInspectionCardDetail); + } + + /** + * 新增检验单详情 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 结果 + */ + @Override + public int insertPwInspectionCardDetail(PwInspectionCardDetail pwInspectionCardDetail) + { + pwInspectionCardDetail.setCreateTime(DateUtils.getNowDate()); + return pwInspectionCardDetailMapper.insertPwInspectionCardDetail(pwInspectionCardDetail); + } + + /** + * 修改检验单详情 + * + * @param pwInspectionCardDetail 检验单详情 + * @return 结果 + */ + @Override + public int updatePwInspectionCardDetail(PwInspectionCardDetail pwInspectionCardDetail) + { + return pwInspectionCardDetailMapper.updatePwInspectionCardDetail(pwInspectionCardDetail); + } + + /** + * 批量删除检验单详情 + * + * @param ids 需要删除的检验单详情ID + * @return 结果 + */ + @Override + public int deletePwInspectionCardDetailByIds(Long[] ids) + { + return pwInspectionCardDetailMapper.deletePwInspectionCardDetailByIds(ids); + } + + /** + * 删除检验单详情信息 + * + * @param id 检验单详情ID + * @return 结果 + */ + @Override + public int deletePwInspectionCardDetailById(Long id) + { + return pwInspectionCardDetailMapper.deletePwInspectionCardDetailById(id); + } + + @Override + public PwInspectionCardDetail selectPwInspectionCardDetailByNameAndType(String name, String type) { + // TODO Auto-generated method stub + return pwInspectionCardDetailMapper.selectPwInspectionCardDetailByNameAndType(name,type); + } + + @Override + public List selectPwInspectionCardDetailByCardId(Long id) { + // TODO Auto-generated method stub + return pwInspectionCardDetailMapper.selectPwInspectionCardDetailByCardId(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInspectionCardServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInspectionCardServiceImpl.java new file mode 100644 index 0000000..21d1c41 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInspectionCardServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwInspectionCardMapper; +import com.ruoyi.project.management.domain.PwInspectionCard; +import com.ruoyi.project.management.service.IPwInspectionCardService; + +/** + * 检验单Service业务层处理 + * + * @author zhukangchao + * @date 2022-07-20 + */ +@Service +public class PwInspectionCardServiceImpl implements IPwInspectionCardService +{ + @Autowired + private PwInspectionCardMapper pwInspectionCardMapper; + + /** + * 查询检验单 + * + * @param id 检验单ID + * @return 检验单 + */ + @Override + public PwInspectionCard selectPwInspectionCardById(Long id) + { + return pwInspectionCardMapper.selectPwInspectionCardById(id); + } + + /** + * 查询检验单列表 + * + * @param pwInspectionCard 检验单 + * @return 检验单 + */ + @Override + public List selectPwInspectionCardList(PwInspectionCard pwInspectionCard) + { + return pwInspectionCardMapper.selectPwInspectionCardList(pwInspectionCard); + } + + /** + * 新增检验单 + * + * @param pwInspectionCard 检验单 + * @return 结果 + */ + @Override + public int insertPwInspectionCard(PwInspectionCard pwInspectionCard) + { + pwInspectionCard.setCreateTime(DateUtils.getNowDate()); + return pwInspectionCardMapper.insertPwInspectionCard(pwInspectionCard); + } + + /** + * 修改检验单 + * + * @param pwInspectionCard 检验单 + * @return 结果 + */ + @Override + public int updatePwInspectionCard(PwInspectionCard pwInspectionCard) + { + return pwInspectionCardMapper.updatePwInspectionCard(pwInspectionCard); + } + + /** + * 批量删除检验单 + * + * @param ids 需要删除的检验单ID + * @return 结果 + */ + @Override + public int deletePwInspectionCardByIds(Long[] ids) + { + return pwInspectionCardMapper.deletePwInspectionCardByIds(ids); + } + + /** + * 删除检验单信息 + * + * @param id 检验单ID + * @return 结果 + */ + @Override + public int deletePwInspectionCardById(Long id) + { + return pwInspectionCardMapper.deletePwInspectionCardById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInventoryComparisonServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInventoryComparisonServiceImpl.java new file mode 100644 index 0000000..0578578 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInventoryComparisonServiceImpl.java @@ -0,0 +1,48 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwInventoryComparisonMapper; +import com.ruoyi.project.management.domain.PwInventoryComparison; +import com.ruoyi.project.management.service.IPwInventoryComparisonService; + +/** + * 盘库对比Service业务层处理 + * + * @author zhukangchao + * @date 2023-11-06 + */ +@Service +public class PwInventoryComparisonServiceImpl implements IPwInventoryComparisonService +{ + @Autowired + private PwInventoryComparisonMapper pwInventoryComparisonMapper; + + /** + * 查询盘库对比列表 + * + * @param pwInventoryComparison 盘库对比 + * @return 盘库对比 + */ + @Override + public List selectPwInventoryComparisonList(PwInventoryComparison pwInventoryComparison) + { + return pwInventoryComparisonMapper.selectPwInventoryComparisonList(pwInventoryComparison); + } + + /** + * 新增盘库对比 + * + * @param pwInventoryComparison 盘库对比 + * @return 结果 + */ + @Override + public int insertPwInventoryComparison(PwInventoryComparison pwInventoryComparison) + { + pwInventoryComparison.setCreateTime(DateUtils.getNowDate()); + return pwInventoryComparisonMapper.insertPwInventoryComparison(pwInventoryComparison); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInventoryDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInventoryDetailServiceImpl.java new file mode 100644 index 0000000..f5ca59b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInventoryDetailServiceImpl.java @@ -0,0 +1,157 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwInventoryDetailMapper; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.service.IPwInventoryDetailService; + +/** + * 库存明细Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-18 + */ +@Service +public class PwInventoryDetailServiceImpl implements IPwInventoryDetailService +{ + @Autowired + private PwInventoryDetailMapper pwInventoryDetailMapper; + + /** + * 查询库存明细 + * + * @param id 库存明细ID + * @return 库存明细 + */ + @Override + public PwInventoryDetail selectPwInventoryDetailById(Long id) + { + return pwInventoryDetailMapper.selectPwInventoryDetailById(id); + } + + /** + * 查询库存明细列表 + * + * @param pwInventoryDetail 库存明细 + * @return 库存明细 + */ + @Override + public List selectPwInventoryDetailList(PwInventoryDetail pwInventoryDetail) + { + return pwInventoryDetailMapper.selectPwInventoryDetailList(pwInventoryDetail); + } + + /** + * 新增库存明细 + * + * @param pwInventoryDetail 库存明细 + * @return 结果 + */ + @Override + public int insertPwInventoryDetail(PwInventoryDetail pwInventoryDetail) + { + pwInventoryDetail.setCreateTime(DateUtils.getNowDate()); + return pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + + /** + * 修改库存明细 + * + * @param pwInventoryDetail 库存明细 + * @return 结果 + */ + @Override + public int updatePwInventoryDetail(PwInventoryDetail pwInventoryDetail) + { + return pwInventoryDetailMapper.updatePwInventoryDetail(pwInventoryDetail); + } + + /** + * 批量删除库存明细 + * + * @param ids 需要删除的库存明细ID + * @return 结果 + */ + @Override + public int deletePwInventoryDetailByIds(Long[] ids) + { + return pwInventoryDetailMapper.deletePwInventoryDetailByIds(ids); + } + + /** + * 删除库存明细信息 + * + * @param id 库存明细ID + * @return 结果 + */ + @Override + public int deletePwInventoryDetailById(Long id) + { + return pwInventoryDetailMapper.deletePwInventoryDetailById(id); + } + + /** + * 根据物品名称和型号查询物品 + * @param materialName + * @param specification + * @return + */ + @Override + public PwInventoryDetail selectPwInventoryDetailByNameAndTypeName(String materialName, String specification) { + PwInventoryDetail pwInventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(materialName,specification); + return pwInventoryDetail; + } + + /** + * 根据物品名称和图号查询物品 + * @param materialName + * @param specification + * @return + */ + @Override + public PwInventoryDetail selectPwInventoryDetailByNameAndFigureNumber(String materialName, String figureNumber) { + PwInventoryDetail pwInventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(materialName,figureNumber); + return pwInventoryDetail; + } + + /** + * 根据图号查询库存 + * @param replace + * @return + */ + @Override + public PwInventoryDetail selectPwInventoryDetailByFigureNumber(String replace) { + PwInventoryDetail pwInventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByFigureNumber(replace); + return pwInventoryDetail; + } + + /** + * 查询所有设置了最低和最高库存的信息 + */ + @Override + public List selectPwInventoryDetailByMinHig() { + + return pwInventoryDetailMapper.selectPwInventoryDetailByMinHig(); + } + + @Override + public List selectPwInventoryDetailByYuanCaiLiao() { + // TODO Auto-generated method stub + return pwInventoryDetailMapper.selectPwInventoryDetailByYuanCaiLiao(); + } + + @Override + public List selectPwInventoryDetailByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return pwInventoryDetailMapper.selectPwInventoryDetailByFigureNumberAndAllGB(); + } + + @Override + public List selectPwInventoryDetailByWareHouserName() { + // TODO Auto-generated method stub + return pwInventoryDetailMapper.selectPwInventoryDetailByWareHouserName(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInvoiceInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInvoiceInfoServiceImpl.java new file mode 100644 index 0000000..9e933a3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwInvoiceInfoServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwInvoiceInfoMapper; +import com.ruoyi.project.management.domain.PwInvoiceInfo; +import com.ruoyi.project.management.service.IPwInvoiceInfoService; + +/** + * 发票信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-04-09 + */ +@Service +public class PwInvoiceInfoServiceImpl implements IPwInvoiceInfoService +{ + @Autowired + private PwInvoiceInfoMapper pwInvoiceInfoMapper; + + /** + * 查询发票信息 + * + * @param id 发票信息ID + * @return 发票信息 + */ + @Override + public PwInvoiceInfo selectPwInvoiceInfoById(Long id) + { + return pwInvoiceInfoMapper.selectPwInvoiceInfoById(id); + } + + /** + * 查询发票信息列表 + * + * @param pwInvoiceInfo 发票信息 + * @return 发票信息 + */ + @Override + public List selectPwInvoiceInfoList(PwInvoiceInfo pwInvoiceInfo) + { + return pwInvoiceInfoMapper.selectPwInvoiceInfoList(pwInvoiceInfo); + } + + /** + * 新增发票信息 + * + * @param pwInvoiceInfo 发票信息 + * @return 结果 + */ + @Override + public int insertPwInvoiceInfo(PwInvoiceInfo pwInvoiceInfo) + { + pwInvoiceInfo.setCreateTime(DateUtils.getNowDate()); + return pwInvoiceInfoMapper.insertPwInvoiceInfo(pwInvoiceInfo); + } + + /** + * 修改发票信息 + * + * @param pwInvoiceInfo 发票信息 + * @return 结果 + */ + @Override + public int updatePwInvoiceInfo(PwInvoiceInfo pwInvoiceInfo) + { + return pwInvoiceInfoMapper.updatePwInvoiceInfo(pwInvoiceInfo); + } + + /** + * 批量删除发票信息 + * + * @param ids 需要删除的发票信息ID + * @return 结果 + */ + @Override + public int deletePwInvoiceInfoByIds(Long[] ids) + { + return pwInvoiceInfoMapper.deletePwInvoiceInfoByIds(ids); + } + + /** + * 删除发票信息信息 + * + * @param id 发票信息ID + * @return 结果 + */ + @Override + public int deletePwInvoiceInfoById(Long id) + { + return pwInvoiceInfoMapper.deletePwInvoiceInfoById(id); + } + + @Override + public PwInvoiceInfo selectPwInvoiceInfoByCodeAndName(String code, String supplierName) { + // TODO Auto-generated method stub + return pwInvoiceInfoMapper.selectPwInvoiceInfoByCodeAndName(code,supplierName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceDetailsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceDetailsServiceImpl.java new file mode 100644 index 0000000..5eeaee2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceDetailsServiceImpl.java @@ -0,0 +1,116 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; + +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwLetterOfAdviceDetailsMapper; +import com.ruoyi.project.management.domain.PwLetterOfAdviceDetails; +import com.ruoyi.project.management.service.IPwLetterOfAdviceDetailsService; + +/** + * 产品发货通知单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-01 + */ +@Service +public class PwLetterOfAdviceDetailsServiceImpl implements IPwLetterOfAdviceDetailsService +{ + @Autowired + private PwLetterOfAdviceDetailsMapper pwLetterOfAdviceDetailsMapper; + + /** + * 查询产品发货通知单详情 + * + * @param id 产品发货通知单详情ID + * @return 产品发货通知单详情 + */ + @Override + public PwLetterOfAdviceDetails selectPwLetterOfAdviceDetailsById(Long id) + { + return pwLetterOfAdviceDetailsMapper.selectPwLetterOfAdviceDetailsById(id); + } + + /** + * 查询产品发货通知单详情列表 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 产品发货通知单详情 + */ + @Override + public List selectPwLetterOfAdviceDetailsList(PwLetterOfAdviceDetails pwLetterOfAdviceDetails) + { + return pwLetterOfAdviceDetailsMapper.selectPwLetterOfAdviceDetailsList(pwLetterOfAdviceDetails); + } + + /** + * 新增产品发货通知单详情 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 结果 + */ + @Override + public int insertPwLetterOfAdviceDetails(PwLetterOfAdviceDetails pwLetterOfAdviceDetails) + { + pwLetterOfAdviceDetails.setCreateTime(DateUtils.getNowDate()); + return pwLetterOfAdviceDetailsMapper.insertPwLetterOfAdviceDetails(pwLetterOfAdviceDetails); + } + + /** + * 修改产品发货通知单详情 + * + * @param pwLetterOfAdviceDetails 产品发货通知单详情 + * @return 结果 + */ + @Override + public int updatePwLetterOfAdviceDetails(PwLetterOfAdviceDetails pwLetterOfAdviceDetails) + { + return pwLetterOfAdviceDetailsMapper.updatePwLetterOfAdviceDetails(pwLetterOfAdviceDetails); + } + + /** + * 批量删除产品发货通知单详情 + * + * @param ids 需要删除的产品发货通知单详情ID + * @return 结果 + */ + @Override + public int deletePwLetterOfAdviceDetailsByIds(Long[] ids) + { + return pwLetterOfAdviceDetailsMapper.deletePwLetterOfAdviceDetailsByIds(ids); + } + + /** + * 删除产品发货通知单详情信息 + * + * @param id 产品发货通知单详情ID + * @return 结果 + */ + @Override + public int deletePwLetterOfAdviceDetailsById(Long id) + { + return pwLetterOfAdviceDetailsMapper.deletePwLetterOfAdviceDetailsById(id); + } + + @Override + public List selectPwLetterOfAdviceDetailsByCodeAndTypeName(String productionBillCode, + String productType) { + // TODO Auto-generated method stub + return pwLetterOfAdviceDetailsMapper.selectPwLetterOfAdviceDetailsByCodeAndTypeName(productionBillCode,productType); + } + + @Override + public List selectPwLetterOfAdviceDetailsByLetterOfAdviceId(Long long1) { + // TODO Auto-generated method stub + return pwLetterOfAdviceDetailsMapper.selectPwLetterOfAdviceDetailsByLetterOfAdviceId(long1); + } + + @Override + public PwLetterOfAdviceDetails selectPwLetterOfAdviceDetailsByLetterOfAdviceIdAndTypeName(Long id,String figureNumber) { + // TODO Auto-generated method stub + return pwLetterOfAdviceDetailsMapper.selectPwLetterOfAdviceDetailsByLetterOfAdviceIdAndTypeName(id,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceProductServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceProductServiceImpl.java new file mode 100644 index 0000000..2cb2f3c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceProductServiceImpl.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwLetterOfAdviceProductMapper; +import com.ruoyi.project.management.domain.PwLetterOfAdviceProduct; +import com.ruoyi.project.management.service.IPwLetterOfAdviceProductService; + +/** + * 产品发货通知单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-21 + */ +@Service +public class PwLetterOfAdviceProductServiceImpl implements IPwLetterOfAdviceProductService +{ + @Autowired + private PwLetterOfAdviceProductMapper pwLetterOfAdviceProductMapper; + + /** + * 查询产品发货通知单关联 + * + * @param id 产品发货通知单关联ID + * @return 产品发货通知单关联 + */ + @Override + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductById(Long id) + { + return pwLetterOfAdviceProductMapper.selectPwLetterOfAdviceProductById(id); + } + + /** + * 查询产品发货通知单关联列表 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 产品发货通知单关联 + */ + @Override + public List selectPwLetterOfAdviceProductList(PwLetterOfAdviceProduct pwLetterOfAdviceProduct) + { + return pwLetterOfAdviceProductMapper.selectPwLetterOfAdviceProductList(pwLetterOfAdviceProduct); + } + + /** + * 新增产品发货通知单关联 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 结果 + */ + @Override + public int insertPwLetterOfAdviceProduct(PwLetterOfAdviceProduct pwLetterOfAdviceProduct) + { + pwLetterOfAdviceProduct.setCreateTime(DateUtils.getNowDate()); + return pwLetterOfAdviceProductMapper.insertPwLetterOfAdviceProduct(pwLetterOfAdviceProduct); + } + + /** + * 修改产品发货通知单关联 + * + * @param pwLetterOfAdviceProduct 产品发货通知单关联 + * @return 结果 + */ + @Override + public int updatePwLetterOfAdviceProduct(PwLetterOfAdviceProduct pwLetterOfAdviceProduct) + { + return pwLetterOfAdviceProductMapper.updatePwLetterOfAdviceProduct(pwLetterOfAdviceProduct); + } + + /** + * 批量删除产品发货通知单关联 + * + * @param ids 需要删除的产品发货通知单关联ID + * @return 结果 + */ + @Override + public int deletePwLetterOfAdviceProductByIds(Long[] ids) + { + return pwLetterOfAdviceProductMapper.deletePwLetterOfAdviceProductByIds(ids); + } + + /** + * 删除产品发货通知单关联信息 + * + * @param id 产品发货通知单关联ID + * @return 结果 + */ + @Override + public int deletePwLetterOfAdviceProductById(Long id) + { + return pwLetterOfAdviceProductMapper.deletePwLetterOfAdviceProductById(id); + } + + @Override + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductByCodeAndFigureNumber(String productionCode, + String figureNumber) { + // TODO Auto-generated method stub + return pwLetterOfAdviceProductMapper.selectPwLetterOfAdviceProductByCodeAndFigureNumber(productionCode,figureNumber); + } + + @Override + public List selectPwLetterOfAdviceProductByLetterOfAdviceById(Long long1) { + // TODO Auto-generated method stub + return pwLetterOfAdviceProductMapper.selectPwLetterOfAdviceProductByLetterOfAdviceById(long1); + } + + @Override + public List selectPwLetterOfAdviceProductListIsNull( + PwLetterOfAdviceProduct pwLetterOfAdviceProduct) { + // TODO Auto-generated method stub + return pwLetterOfAdviceProductMapper.selectPwLetterOfAdviceProductListIsNull(pwLetterOfAdviceProduct); + } + + @Override + public PwLetterOfAdviceProduct selectPwLetterOfAdviceProductByLetterOfAdviceByIdAndFigureNumber(Long id, + String figureNumber) { + // TODO Auto-generated method stub + return pwLetterOfAdviceProductMapper.selectPwLetterOfAdviceProductByLetterOfAdviceByIdAndFigureNumber(id,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceServiceImpl.java new file mode 100644 index 0000000..894484d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwLetterOfAdviceServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwLetterOfAdviceMapper; +import com.ruoyi.project.management.domain.PwLetterOfAdvice; +import com.ruoyi.project.management.service.IPwLetterOfAdviceService; + +/** + * 发运通知单Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-20 + */ +@Service +public class PwLetterOfAdviceServiceImpl implements IPwLetterOfAdviceService +{ + @Autowired + private PwLetterOfAdviceMapper pwLetterOfAdviceMapper; + + /** + * 查询发运通知单 + * + * @param id 发运通知单ID + * @return 发运通知单 + */ + @Override + public PwLetterOfAdvice selectPwLetterOfAdviceById(Long id) + { + return pwLetterOfAdviceMapper.selectPwLetterOfAdviceById(id); + } + + /** + * 查询发运通知单列表 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 发运通知单 + */ + @Override + public List selectPwLetterOfAdviceList(PwLetterOfAdvice pwLetterOfAdvice) + { + return pwLetterOfAdviceMapper.selectPwLetterOfAdviceList(pwLetterOfAdvice); + } + + /** + * 新增发运通知单 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 结果 + */ + @Override + public int insertPwLetterOfAdvice(PwLetterOfAdvice pwLetterOfAdvice) + { + pwLetterOfAdvice.setCreateTime(DateUtils.getNowDate()); + return pwLetterOfAdviceMapper.insertPwLetterOfAdvice(pwLetterOfAdvice); + } + + /** + * 修改发运通知单 + * + * @param pwLetterOfAdvice 发运通知单 + * @return 结果 + */ + @Override + public int updatePwLetterOfAdvice(PwLetterOfAdvice pwLetterOfAdvice) + { + return pwLetterOfAdviceMapper.updatePwLetterOfAdvice(pwLetterOfAdvice); + } + + /** + * 批量删除发运通知单 + * + * @param ids 需要删除的发运通知单ID + * @return 结果 + */ + @Override + public int deletePwLetterOfAdviceByIds(Long[] ids) + { + return pwLetterOfAdviceMapper.deletePwLetterOfAdviceByIds(ids); + } + + /** + * 删除发运通知单信息 + * + * @param id 发运通知单ID + * @return 结果 + */ + @Override + public int deletePwLetterOfAdviceById(Long id) + { + return pwLetterOfAdviceMapper.deletePwLetterOfAdviceById(id); + } + + @Override + public PwLetterOfAdvice selectPwLetterOfAdviceByCode(String code) { + + return pwLetterOfAdviceMapper.selectPwLetterOfAdviceByCode(code); + } + + @Override + public List selectPwLetterOfAdviceByCodeAndStatus(String code) { + // TODO Auto-generated method stub + return pwLetterOfAdviceMapper.selectPwLetterOfAdviceByCodeAndStatus(code); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMakeDocumentsDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMakeDocumentsDetailServiceImpl.java new file mode 100644 index 0000000..67a5024 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMakeDocumentsDetailServiceImpl.java @@ -0,0 +1,211 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwMakeDocumentsDetailMapper; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwMakeDocumentsDetailService; + +/** + * 库存制作单明细Service业务层处理 + * + * @author zhukangchao + * @date 2020-11-11 + */ +@Service +public class PwMakeDocumentsDetailServiceImpl implements IPwMakeDocumentsDetailService +{ + @Autowired + private PwMakeDocumentsDetailMapper pwMakeDocumentsDetailMapper; + //库存明细信息 + @Autowired + private IPwInventoryDetailService pwInventoryDetailMapper; + + /** + * 查询库存制作单明细 + * + * @param id 库存制作单明细ID + * @return 库存制作单明细 + */ + @Override + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailById(Long id) + { + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailById(id); + } + + /** + * 查询库存制作单明细列表 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 库存制作单明细 + */ + @Override + public List selectPwMakeDocumentsDetailList(PwMakeDocumentsDetail pwMakeDocumentsDetail) + { + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailList(pwMakeDocumentsDetail); + } + + /** + * 新增库存制作单明细 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 结果 + */ + @Override + public int insertPwMakeDocumentsDetail(PwMakeDocumentsDetail pwMakeDocumentsDetail){ + pwMakeDocumentsDetail.setCreateTime(DateUtils.getNowDate()); + return pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + + /** + * 修改库存制作单明细 + * + * @param pwMakeDocumentsDetail 库存制作单明细 + * @return 结果 + */ + @Override + public int updatePwMakeDocumentsDetail(PwMakeDocumentsDetail pwMakeDocumentsDetail) + { + return pwMakeDocumentsDetailMapper.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + } + + /** + * 批量删除库存制作单明细 + * + * @param ids 需要删除的库存制作单明细ID + * @return 结果 + */ + @Override + public int deletePwMakeDocumentsDetailByIds(Long[] ids) + { + return pwMakeDocumentsDetailMapper.deletePwMakeDocumentsDetailByIds(ids); + } + + /** + * 删除库存制作单明细信息 + * + * @param id 库存制作单明细ID + * @return 结果 + */ + @Override + public int deletePwMakeDocumentsDetailById(Long id) + { + return pwMakeDocumentsDetailMapper.deletePwMakeDocumentsDetailById(id); + } + + @Override + public List selectPwMakeDocumentsDetailByNameAndFigureNumber(String materialName, String specificationType) { + + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByNameAndFigureNumber(materialName,specificationType); + } + + @Override + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(String makeDocumentsCode,String materialName, String specification) { + + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeAndNameAndFigureNumber(makeDocumentsCode,materialName,specification); + } + + /** + * 根据名称和图号查询,按照code去重,查询未入库和入库中的数据 + */ + @Override + public List selectPwMakeDocumentsDetailByNameAndFigureNumberNoRepetition(String name, + String figureNumber) { + + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByNameAndFigureNumberNoRepetition(name,figureNumber); + } + + @Override + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumber( + String makeDocumentsCode, String parentLevelName, String parentLevelFigureNumber) { + + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumber(makeDocumentsCode,parentLevelName,parentLevelFigureNumber); + } + + @Override + public List selectPwMakeDocumentsDetailByCodeAndSuperiorId(String makeDocumentsCode, + Long id) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeAndSuperiorId(makeDocumentsCode,id); + } + + @Override + public PwMakeDocumentsDetail selectPwMakeDocumentsDetailByCodeAndFigureNumber(String makeDocumentsCode, + String figureNumber) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeAndFigureNumber(makeDocumentsCode,figureNumber); + } + + @Override + public List selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumbers(String code, + String parentLevelName, String parentLevelFigureNumber) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeAndParentLevelNameAndParentLevelFigureNumbers(code,parentLevelName,parentLevelFigureNumber); + } + + @Override + public List selectPwMakeDocumentsDetailLists(PwMakeDocumentsDetail pwMakeDocumentsDetail) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailLists(pwMakeDocumentsDetail); + } + + @Override + public List selectPwMakeDocumentsDetailByCode(String makeDocumentsCode) { + + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCode(makeDocumentsCode); + } + + @Override + public List selectPwMakeDocumentsDetailByCodeAndDeleteXu(String code) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeAndDeleteXu(code); + } + + @Override + public List selectPwMakeDocumentsDetailByNameAndFigureNumberList(String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByNameAndFigureNumberList(name,figureNumber); + } + + @Override + public List selectPwMakeDocumentsDetailByMaterialId(Long id) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByMaterialId(id); + } + + @Override + public List selectPwMakeDocumentsDetailByAll() { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByAll(); + } + + @Override + public List selectPwMakeDocumentsDetailByCodeMoHu(String makeDocumentCode) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeMoHu(makeDocumentCode); + } + + @Override + public List selectPwMakeDocumentsDetailListAll(PwMakeDocumentsDetail pwMakeDocumentsDetail) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailListAll(pwMakeDocumentsDetail); + } + + @Override + public List selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(String code, + String name, String figureNumber) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwBomByCodeAndMaterialsNameAndmaterialsSpecification(code,name,figureNumber); + } + + @Override + public List selectPwMakeDocumentsDetailByCodeAndMaterialIdIsNotNull(String makeDocumentsCode) { + // TODO Auto-generated method stub + return pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByCodeAndMaterialIdIsNotNull(makeDocumentsCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMakeDocumentsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMakeDocumentsServiceImpl.java new file mode 100644 index 0000000..91d729a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMakeDocumentsServiceImpl.java @@ -0,0 +1,856 @@ +package com.ruoyi.project.management.service.impl; + +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.framework.security.service.TokenService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.ruoyi.project.management.mapper.ImMaterialMapper; +import com.ruoyi.project.management.mapper.PwInventoryDetailMapper; +import com.ruoyi.project.management.mapper.PwMakeDocumentsDetailMapper; +import com.ruoyi.project.management.mapper.PwMakeDocumentsMapper; +import com.ruoyi.project.management.mapper.PwPurchaseContractMaterialMapper; +import com.ruoyi.project.management.domain.ImMaterial; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwMakeDocuments; +import com.ruoyi.project.management.domain.PwMakeDocumentsDetail; +import com.ruoyi.project.management.domain.PwMaterialProcess; +import com.ruoyi.project.management.domain.PwModulePart; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.service.IPwMakeDocumentsService; +import com.ruoyi.project.management.service.IPwMaterialProcessService; +import com.ruoyi.project.management.service.IPwModulePartService; + +/** + * 库存制作单Service业务层处理 + * + * @author zhukangchao + * @date 2020-11-11 + */ +@Service +public class PwMakeDocumentsServiceImpl implements IPwMakeDocumentsService +{ + @Autowired + private PwMakeDocumentsMapper pwMakeDocumentsMapper; + @Autowired + private PwMakeDocumentsDetailMapper pwMakeDocumentsDetailMapper; + //用户标识信息 + @Autowired + private TokenService tokenService; + @Autowired + private ImMaterialMapper imMaterialMapper; + //库存信息 + @Autowired + private PwInventoryDetailMapper pwInventoryDetailMapper; + //采购明细信息 + @Autowired + private PwPurchaseContractMaterialMapper pwPurchaseContractMaterialMapper; + //物料工序信息 + @Autowired + private IPwMaterialProcessService pwMaterialProcessService; + //零部件关联信息 + @Autowired + private IPwModulePartService pwModulePartService; + + + /** + * 查询库存制作单 + * + * @param id 库存制作单ID + * @return 库存制作单 + */ + @Override + public PwMakeDocuments selectPwMakeDocumentsById(Long id) + { + return pwMakeDocumentsMapper.selectPwMakeDocumentsById(id); + } + + /** + * 查询库存制作单列表 + * + * @param pwMakeDocuments 库存制作单 + * @return 库存制作单 + */ + @Override + public List selectPwMakeDocumentsList(PwMakeDocuments pwMakeDocuments) + { + return pwMakeDocumentsMapper.selectPwMakeDocumentsList(pwMakeDocuments); + } + + /** + * 新增库存制作单 + * + * @param pwMakeDocuments 库存制作单 + * @return 结果 + */ + @Override + public int insertPwMakeDocuments(PwMakeDocuments pwMakeDocuments){ + + //新增企标单 + //下单日期 +// pwMakeDocuments.setDate(new Date()); +// //获取当前登录用户信息,查询当前登录用户的vip等级 +// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); +// SysUser user = loginUser.getUser(); +// //制单人 +// pwMakeDocuments.setPrepared(user.getNickName()); +// //是否审批 +// pwMakeDocuments.setPass(0); +// pwMakeDocuments.setCreateTime(DateUtils.getNowDate()); +// int i = pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + int i = 0; + + //编号 + String str = ""; + //型号 + String str2 = ""; + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + //年份 + String substring2 = ss.substring(2); + + //查询所有设置了安全库存的物料,根据安全库存数量对比库存数量 + ImMaterial imMaterial = new ImMaterial(); + imMaterial.setMinimum(1L); + List list = imMaterialMapper.selectImMaterialList(imMaterial); + for (ImMaterial imMaterial2 : list) { + //判断是否为易耗品,易耗品不做处理 + if(null==imMaterial2.getMaterialTypeName()||!imMaterial2.getMaterialTypeName().equals("易耗品")){ + //根据物料名称和图号查询库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(imMaterial2.getMaterialName(), imMaterial2.getFigureNumber()); + //判断是否是标准件 + if((null!=imMaterial2.getFigureNumber()&&(" ".equals(imMaterial2.getFigureNumber().substring(0,2)) || "009".equals(imMaterial2.getFigureNumber().substring(0,3))|| "017".equals(imMaterial2.getFigureNumber().substring(0,3))))||imMaterial2.getFigureNumber().contains("GB/T")||(null!=imMaterial2.getRemark()&&imMaterial2.getRemark().contains("外购件"))){ + //添加到采购合同详情信息中 + //判断库存数量+在途数量-锁定数量是否大于安全库存的最低数量,如果大于则不添加到采购单明细中,如小于则添加采购单明细 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<=inventoryDetail.getMinimum()){ + //创建采购明细 + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code + pcm.setCode(pwMakeDocuments.getCode()); + //物料名称 + pcm.setMaterialName(imMaterial2.getMaterialName()); + //图号 + pcm.setFigureNumber(imMaterial2.getFigureNumber()); + //材料 + pcm.setMaterials(imMaterial2.getMaterials()); + //含税单价 + pcm.setUnivalence(imMaterial2.getUnitPrice().doubleValue()); + //数量 + pcm.setAmount(inventoryDetail.getHighest()); +// 判断物料是什么物料,如果是原材料且单位为毫米,则总价等于单价(一千克的单价)*(转换成米数*M + //判断如果单位不为毫米和平方毫米的计算总价 + if(null!=imMaterial2.getUnitOfMeasurementName()&&!imMaterial2.getUnitOfMeasurementName().equals("毫米")&&!imMaterial2.getUnitOfMeasurementName().equals("平方毫米")){ + //总价 + pcm.setTotalPrices(imMaterial2.getUnitPrice().doubleValue()*pcm.getAmount()); + } + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pcm); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(pcm.getAmount()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + } + }else{ + //如果库存数量+在途数量-预订数量<=最低安全库存数量,则添加一条企标单信息 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<=imMaterial2.getMinimum()){ + + //遍历其图号 + String figureNumber = imMaterial2.getFigureNumber(); + //判断图号中是否包函点 + + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + str2 = figureNumber.substring(0, figureNumber.indexOf(".")); + } + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsMapper.selectList(); + String code = documents.getCode(); + String substring = code.substring(code.length()-7,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + str = String.format("%04d", valueOf); + //code + pwMakeDocuments.setCode("QB-XCL"+str2+"-"+str+"-"+substring2); + + //单据名称 + pwMakeDocuments.setName(str2+"预制清单"); + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(str2)){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(str2); + } + i = pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + + //添加企标单详情信息 + PwMakeDocumentsDetail pmdd = new PwMakeDocumentsDetail(); + //令号 + pmdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pmdd.setName(imMaterial2.getMaterialName()); + //图号 + pmdd.setFigureNumber(imMaterial2.getFigureNumber()); + //材料 + pmdd.setMaterialType(imMaterial2.getMaterials()); + //数量 + pmdd.setQuantity(imMaterial2.getHighest()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pmdd); + + //添加在途数量 + inventoryDetail.setPreliminaryInventory(pmdd.getQuantity()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + + //判断此物料是否在零部件关联表中配置,如果配置了,则把部件的子零件全部加入到库存制作单中 + List lists = pwModulePartService.selectPwModulePartByMaterialId(imMaterial2.getId()); + for (PwModulePart pwModulePart : lists) { + //根据零件id查询零件信息 + ImMaterial material = imMaterialMapper.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd2 = new PwMakeDocumentsDetail(); + //令号 + pdd2.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd2.setName(pwModulePart.getName()); + //图号 + pdd2.setFigureNumber(pwModulePart.getSpecification()); + //材料 + pdd2.setMaterialType(material.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd2.setQuantity(pmdd.getQuantity()*pwModulePart.getNumber()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd2); + + PwInventoryDetail inventoryDetail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(material.getMaterialName(), material.getFigureNumber()); + inventoryDetail2.setPreliminaryInventory(pdd2.getQuantity()); + //更新库存信息 + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); + } + + //自动添加工序 + List list2 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pmdd.getName(),pmdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess : list2) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pmdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pmdd.getFigureNumber()+"-"+pwMaterialProcess.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail2.setName(pmdd.getName()+"-"+pwMaterialProcess.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pmdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pmdd.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pmdd.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pmdd.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pmdd.getFigureNumber()); + //派工部门 + pwMakeDocumentsDetail2.setDepartmentName(pwMaterialProcess.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail2.setGodownEntry(pwMaterialProcess.getStorage()); + //材料名称 + pwMakeDocumentsDetail2.setMaterialsName(pwMaterialProcess.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail2.setMaterialsSpecification(pwMaterialProcess.getMaterialsSpecification()); + if(null!=pwMaterialProcess.getLen()){ + //下料长度 + pwMakeDocumentsDetail2.setLen(pwMaterialProcess.getLen().longValue()); + } + if(null!=pwMaterialProcess.getWid()){ + //下料宽度 + pwMakeDocumentsDetail2.setWid(pwMaterialProcess.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess.getSerialNumber()==1){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess.getWorkblank()&&pwMaterialProcess.getWorkblank()!=0){ + if(pwMakeDocumentsDetail2.getQuantity()%pwMaterialProcess.getWorkblank()!=0){ + pwMakeDocumentsDetail2.setWorkblank((pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail2.setFinished(pwMakeDocumentsDetail2.getQuantity()); + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess.getLen()&&pwMaterialProcess.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess.getWid()&&pwMaterialProcess.getWid()!=0){ + pwMakeDocumentsDetail2.setMeasure((pwMaterialProcess.getLen()*pwMaterialProcess.getWid())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen()+"*"+pwMaterialProcess.getWid()); + }else{ + pwMakeDocumentsDetail2.setMeasure(pwMaterialProcess.getLen()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen()+""); + } + } + } + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == material){ + //添加物料信息 + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialMapper.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == detail){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + + //查询原材料是否有安全库存 + ImMaterial material2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getMaterialsName(), pwMakeDocumentsDetail2.getMaterialsSpecification()); + if(null!=material2){ + //查询库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getMaterialsName(), pwMakeDocumentsDetail2.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 + if(material2.getMinimum()!=0&&material2.getHighest()!=0){ + //锁定库存数量 + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail2.getWorkblank()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); + //计算安全库存是否触发 + if(inventoryDetail2.getQuantity()-inventoryDetail2.getLockNumber()<=material2.getMinimum()){ + //生成企标单 + //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + //令号 + pdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd.setName(material2.getMaterialName()); + //图号 + pdd.setFigureNumber(material2.getFigureNumber()); + //材料 + pdd.setMaterialType(material2.getMaterials()); + //数量(最高库存数量-(库存数量+在途数量-本批数量)) + pdd.setQuantity(material2.getHighest()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd); + + //自动添加工序 + List list3 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pdd.getName(),pdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess2 : list3) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail3 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail3.setMakeDocumentsCode(pdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail3.setFigureNumber(pdd.getFigureNumber()+"-"+pwMaterialProcess2.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail3.setName(pdd.getName()+"-"+pwMaterialProcess2.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail3.setMaterialType(pdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail3.setQuantity(pdd.getQuantity()); + //上级id + pwMakeDocumentsDetail3.setSuperiorId(pdd.getId()); + //上级名称 + pwMakeDocumentsDetail3.setParentLevelName(pdd.getName()); + //上级图号 + pwMakeDocumentsDetail3.setParentLevelFigureNumber(pdd.getFigureNumber()); + //派工部门 + pwMakeDocumentsDetail3.setDepartmentName(pwMaterialProcess2.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail3.setGodownEntry(pwMaterialProcess2.getStorage()); + //材料名称 + pwMakeDocumentsDetail3.setMaterialsName(pwMaterialProcess2.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail3.setMaterialsSpecification(pwMaterialProcess2.getMaterialsSpecification()); + if(null!=pwMaterialProcess2.getLen()){ + //下料长度 + pwMakeDocumentsDetail3.setLen(pwMaterialProcess2.getLen().longValue()); + } + if(null!=pwMaterialProcess2.getWid()){ + //下料宽度 + pwMakeDocumentsDetail3.setWid(pwMaterialProcess2.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess2.getSerialNumber()==1){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess2.getWorkblank()&&pwMaterialProcess2.getWorkblank()!=0){ + if(pwMakeDocumentsDetail3.getQuantity()%pwMaterialProcess2.getWorkblank()!=0){ + pwMakeDocumentsDetail3.setWorkblank((pwMakeDocumentsDetail3.getQuantity()/pwMaterialProcess2.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail3.setWorkblank(pwMakeDocumentsDetail3.getQuantity()/pwMaterialProcess2.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail3.setWorkblank(pwMakeDocumentsDetail3.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail3.setFinished(pwMakeDocumentsDetail3.getQuantity()); + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess2.getLen()&&pwMaterialProcess2.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess2.getWid()&&pwMaterialProcess2.getWid()!=0){ + pwMakeDocumentsDetail3.setMeasure((pwMaterialProcess2.getLen()*pwMaterialProcess2.getWid())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail3.setSpecification(pwMaterialProcess2.getLen()+"*"+pwMaterialProcess2.getWid()); + }else{ + pwMakeDocumentsDetail3.setMeasure(pwMaterialProcess2.getLen()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail3.setSpecification(pwMaterialProcess2.getLen()+""); + } + } + } + + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail3); + + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material3 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail3.getName(), pwMakeDocumentsDetail3.getFigureNumber()); + if(null == material3){ + //添加物料信息 + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail3.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail3.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialMapper.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail3.getName(), pwMakeDocumentsDetail3.getFigureNumber()); + if(null == detail2){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail3.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail3.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + } + //添加在途数量 + inventoryDetail2.setPreliminaryInventory(pdd.getQuantity()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); + } + } + } + } + } + } + } + } + } + + return i; + } +// for (ImMaterial imMaterial2 : list) { +// if(null==imMaterial2.getMaterialTypeName()||!imMaterial2.getMaterialTypeName().equals("易耗品")){ +// //判断是否是标准件 +// if((null!=imMaterial2.getFigureNumber()&&imMaterial2.getFigureNumber().contains(" "))||(null!=imMaterial2.getRemark()&&imMaterial2.getRemark().contains("外购件"))){ +// }else{ +// //如果库存数量+在途数量-预订数量<=最低安全库存数量,则添加一条企标单信息 +// if(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber()<=imMaterial2.getMinimum()){ +// //自动添加工序 +// //查询当前令号下所有的物料(不包含标准件和数量为0的数据,遍历此集合查询物料工序表,如果查询到则添加到bomtwo中) +// List list5 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pmdd.getName(),pmdd.getFigureNumber()); +// for (PwMaterialProcess pwMaterialProcess : list5) { +// +// +// //原材料查库计算库存数量 +// //把物料信息保存到物料表中 +// ImMaterial material2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getMaterialsName(), pwMakeDocumentsDetail2.getMaterialsSpecification()); +// if(null!=material2){ +// //先根据名称和图号查询库存信息表中有没有此数据 +// PwInventoryDetail inventoryDetail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getMaterialsName(), pwMakeDocumentsDetail2.getMaterialsSpecification()); +// if(null!=inventoryDetail2){ +// //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 +// if(material2.getMinimum()!=0&&material2.getHighest()!=0){ +// //如果有安全库存数量,则直接锁定数量,然后标记库存数量为本批制作数量,然后计算是否触发最低安全库存,如果触发,则添加一条新的企标单详情,生成一个新的企标单 +// pwMakeDocumentsDetail2.setUsableQuantity(pwMakeDocumentsDetail2.getWorkblank()); +// //锁定库存数量 +// inventoryDetail2.setLockNumber(inventoryDetail.getLockNumber()+pwMakeDocumentsDetail2.getWorkblank()); +// //计算安全库存是否触发 +// if(inventoryDetail2.getQuantity()+inventoryDetail2.getPreliminaryInventory()-inventoryDetail2.getLockNumber()<=material2.getMinimum()){ +// //生成企标单 +// //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 +// PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); +// //令号 +// pdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); +// //名称 +// pdd.setName(material2.getMaterialName()); +// //图号 +// pdd.setFigureNumber(material2.getFigureNumber()); +// //材料 +// pdd.setMaterialType(material2.getMaterials()); +// //数量(最高库存数量-(库存数量+在途数量-本批数量)) +// pdd.setQuantity(material2.getHighest()-(inventoryDetail2.getQuantity()+inventoryDetail2.getPreliminaryInventory())+pwMakeDocumentsDetail2.getWorkblank()); +// pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd); +// +// //自动添加工序 +// //查询当前令号下所有的物料(不包含标准件和数量为0的数据,遍历此集合查询物料工序表,如果查询到则添加到bomtwo中) +// List list6 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pdd.getName(),pdd.getFigureNumber()); +// for (PwMaterialProcess pwMaterialProcess2 : list6) { +// //创建新对象 +// PwMakeDocumentsDetail pwMakeDocumentsDetail3 = new PwMakeDocumentsDetail(); +// //令号 +// pwMakeDocumentsDetail3.setMakeDocumentsCode(pdd.getMakeDocumentsCode()); +// //图号 +// pwMakeDocumentsDetail3.setFigureNumber(pdd.getFigureNumber()+"-"+pwMaterialProcess2.getSerialNumber()); +// //物料名称 +// pwMakeDocumentsDetail3.setName(pdd.getName()+"-"+pwMaterialProcess2.getProcess()+"(M)"); +// //材料 +// pwMakeDocumentsDetail3.setMaterialType(pdd.getMaterialType()); +// //本批数量 +// pwMakeDocumentsDetail3.setQuantity(pdd.getQuantity()); +// //上级id +// pwMakeDocumentsDetail3.setSuperiorId(pdd.getId()); +// //上级名称 +// pwMakeDocumentsDetail3.setParentLevelName(pdd.getName()); +// //上级图号 +// pwMakeDocumentsDetail3.setParentLevelFigureNumber(pdd.getFigureNumber()); +// //派工部门 +// pwMakeDocumentsDetail3.setDepartmentName(pwMaterialProcess2.getDispatchingDept()); +// pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail3); +// //更新在途数量 +// inventoryDetail2.setPreliminaryInventory(inventoryDetail2.getPreliminaryInventory()+pdd.getQuantity()); +// } +// //更新可用数量 +// if(inventoryDetail2.getQuantity()>=inventoryDetail2.getLockNumber()){ +// inventoryDetail2.setAvailableNumber(inventoryDetail2.getQuantity()-inventoryDetail2.getLockNumber()); +// }else{ +// inventoryDetail2.setAvailableNumber(0L); +// } +// pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); +// } +// } +// } +// //自动生成企标单 +//// addMakeDocuments(); +// +// //把物料信息保存到物料表中 +// ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); +// if(null!=material){ +// //先根据名称和图号查询库存信息表中有没有此数据 +// PwInventoryDetail inventoryDetail3 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); +// if(null!=inventoryDetail3){ +// //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 +// if(material.getMinimum()!=0&&material.getHighest()!=0){ +// //判断库存数量+在途数量-锁定数量,是否小于等于最低安全库存数量 +// if(inventoryDetail3.getQuantity()+inventoryDetail3.getPreliminaryInventory()-inventoryDetail3.getLockNumber()<=material.getMinimum()){ +// pwMakeDocumentsDetail2.setQuantity(material.getHighest()-(inventoryDetail3.getQuantity()+inventoryDetail3.getPreliminaryInventory()-inventoryDetail2.getLockNumber())); +// }else{ +// pwMakeDocumentsDetail2.setQuantity(0L); +// } +// } +// //预存数量 +// inventoryDetail3.setPreliminaryInventory(inventoryDetail3.getPreliminaryInventory()+pwMakeDocumentsDetail2.getQuantity()); +// pwMakeDocumentsDetail2.setUsableQuantity(inventoryDetail3.getQuantity()); +// pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail3); +// }else{ +// //把物料信息保存到库存表中 +// PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); +// //物料名称 +// pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); +// //物料图号 +// pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); +// //预存数量 +// pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); +// pwInventoryDetail.setDelFlag(0); +// pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); +// } +// }else{ +// //添加物料信息 +// ImMaterial imMaterial3 = new ImMaterial(); +// //物料名称 +// imMaterial3.setMaterialName(pwMakeDocumentsDetail2.getName()); +// //物料图号 +// imMaterial3.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); +// imMaterialMapper.insertImMaterial(imMaterial3); +// //把物料信息保存到库存表中 +// PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); +// //物料名称 +// pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); +// //物料图号 +// pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); +// //预存数量 +// pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); +// //锁定数量 +//// pwInventoryDetail.setLockNumber(pwMakeDocumentsDetail2.getQuantity()); +// pwInventoryDetail.setLockNumber(0L); +// //删除标记 +// pwInventoryDetail.setDelFlag(0); +// pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); +// } +// pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); +// } +// +// //更新在途数量 +// inventoryDetail.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()+pmdd.getQuantity()); +// pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); +// } +// } +// } +// } +// return i; +// } + + /** + * 修改库存制作单 + * + * @param pwMakeDocuments 库存制作单 + * @return 结果 + */ + @Override + public int updatePwMakeDocuments(PwMakeDocuments pwMakeDocuments) + { + return pwMakeDocumentsMapper.updatePwMakeDocuments(pwMakeDocuments); + } + + /** + * 批量删除库存制作单 + * + * @param ids 需要删除的库存制作单ID + * @return 结果 + */ + @Override + public int deletePwMakeDocumentsByIds(Long[] ids) + { + return pwMakeDocumentsMapper.deletePwMakeDocumentsByIds(ids); + } + + /** + * 删除库存制作单信息 + * + * @param id 库存制作单ID + * @return 结果 + */ + @Override + public int deletePwMakeDocumentsById(Long id) + { + return pwMakeDocumentsMapper.deletePwMakeDocumentsById(id); + } + + @Override + public PwMakeDocuments selectPwMakeDocumentsByCode(String code) { + + return pwMakeDocumentsMapper.selectPwMakeDocumentsByCode(code); + } + + /** + * 自动出企标单 + * + */ + private void addMakeDocuments() { + //查询预制单详情表没有预制单号的数据 + List list3 = pwMakeDocumentsDetailMapper.selectByMakeDocumentsCodeIsNull(); + //创建存储图纸类型的集合 + List li = new ArrayList(); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list3) { + //判断集合是否存在当前图号的标识 + int p = 0; + //遍历其图号 + String figureNumber = pwMakeDocumentsDetail.getFigureNumber(); + //判断图号中是否包函点 + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + String str1=figureNumber.substring(0, figureNumber.indexOf(".")); + for (String string : li) { + if(string.contains(str1)){ + p = 1; + } + } + if(p==0){ + //p = 0时说明集合中没有此型号 + li.add(str1); + } + } + } + //查看map的长度,长度为几,则创建几个预制单 + for (int j = 0; j < li.size(); j++) { + //创建预制单,然后把单据的code添加到相关的物料上 + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsMapper.selectList(); + //获取最后一条记录的code的,分解其code + String code = documents.getCode(); + String substring = code.substring(code.length()-6,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + String str = String.format("%03d", valueOf); + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + String substring2 = ss.substring(2); + //code + pwMakeDocuments.setCode("QB-XCL-"+str+"-"+substring2); + //单据名称 + pwMakeDocuments.setName(li.get(j)+"预制清单"); + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(li.get(j))){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(li.get(j)); + } + pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + //把code添加到预制单明细表包函当前图纸型号的物料上 + //查询预制单明细表(物料图号包函当前图号且code为null的数据) + List list4 = pwMakeDocumentsDetailMapper.selectPwMakeDocumentsDetailByFigureNumberAndCode(li.get(j)); + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list4) { + pwMakeDocumentsDetail.setMakeDocumentsCode(pwMakeDocuments.getCode()); + pwMakeDocumentsDetailMapper.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + //自动添加工序 + //查询当前令号下所有的物料(不包含标准件和数量为0的数据,遍历此集合查询物料工序表,如果查询到则添加到bomtwo中) + List list5 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pwMakeDocumentsDetail.getName(),pwMakeDocumentsDetail.getFigureNumber()); + if(list5.size()>0){ + for (int js = 0; js < list5.size(); js++) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()+"-"+(js+1)); + //物料名称 + pwMakeDocumentsDetail2.setName(pwMakeDocumentsDetail.getName()+"-"+list5.get(js).getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pwMakeDocumentsDetail.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pwMakeDocumentsDetail.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pwMakeDocumentsDetail.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //派工部门 + if(null!=list5.get(js).getDispatchingDept()&&!"".equals(list5.get(js).getDispatchingDept())){ + pwMakeDocumentsDetail2.setDepartmentName(list5.get(js).getDispatchingDept()); + } + //把物料信息保存到物料表中 + ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null!=material){ + //先根据名称和图号查询库存信息表中有没有此数据 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null!=inventoryDetail){ + //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 + if(material.getMinimum()!=0&&material.getHighest()!=0){ + //判断库存数量+在途数量-锁定数量,是否小于等于最低安全库存数量 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()<=material.getMinimum()){ + pwMakeDocumentsDetail2.setQuantity(material.getHighest()); + }else{ + pwMakeDocumentsDetail2.setQuantity(0L); + } + } + //预存数量 + inventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); + pwMakeDocumentsDetail2.setUsableQuantity(inventoryDetail.getQuantity()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + }else{ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //预存数量 + pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + }else{ + //添加物料信息 + ImMaterial imMaterial = new ImMaterial(); + //物料名称 + imMaterial.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + + imMaterialMapper.insertImMaterial(imMaterial); + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //预存数量 + pwInventoryDetail.setPreliminaryInventory(pwMakeDocumentsDetail2.getQuantity()); + //锁定数量 +// pwInventoryDetail.setLockNumber(pwMakeDocumentsDetail2.getQuantity()); + pwInventoryDetail.setLockNumber(0L); + //删除标记 + pwInventoryDetail.setDelFlag(0); + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + } + } + } + } + } + + @Override + public PwMakeDocuments selectList() { + // TODO Auto-generated method stub + return pwMakeDocumentsMapper.selectList(); + } + + @Override + public int newInsertPwMakeDocuments(PwMakeDocuments pwMakeDocuments) { + // TODO Auto-generated method stub + return pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialBorrowInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialBorrowInfoServiceImpl.java new file mode 100644 index 0000000..3a1e1eb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialBorrowInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwMaterialBorrowInfoMapper; +import com.ruoyi.project.management.domain.PwMaterialBorrowInfo; +import com.ruoyi.project.management.service.IPwMaterialBorrowInfoService; + +/** + * 借用信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-11-24 + */ +@Service +public class PwMaterialBorrowInfoServiceImpl implements IPwMaterialBorrowInfoService +{ + @Autowired + private PwMaterialBorrowInfoMapper pwMaterialBorrowInfoMapper; + + /** + * 查询借用信息 + * + * @param id 借用信息ID + * @return 借用信息 + */ + @Override + public PwMaterialBorrowInfo selectPwMaterialBorrowInfoById(Long id) + { + return pwMaterialBorrowInfoMapper.selectPwMaterialBorrowInfoById(id); + } + + /** + * 查询借用信息列表 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 借用信息 + */ + @Override + public List selectPwMaterialBorrowInfoList(PwMaterialBorrowInfo pwMaterialBorrowInfo) + { + return pwMaterialBorrowInfoMapper.selectPwMaterialBorrowInfoList(pwMaterialBorrowInfo); + } + + /** + * 新增借用信息 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 结果 + */ + @Override + public int insertPwMaterialBorrowInfo(PwMaterialBorrowInfo pwMaterialBorrowInfo) + { + pwMaterialBorrowInfo.setCreateTime(DateUtils.getNowDate()); + return pwMaterialBorrowInfoMapper.insertPwMaterialBorrowInfo(pwMaterialBorrowInfo); + } + + /** + * 修改借用信息 + * + * @param pwMaterialBorrowInfo 借用信息 + * @return 结果 + */ + @Override + public int updatePwMaterialBorrowInfo(PwMaterialBorrowInfo pwMaterialBorrowInfo) + { + return pwMaterialBorrowInfoMapper.updatePwMaterialBorrowInfo(pwMaterialBorrowInfo); + } + + /** + * 批量删除借用信息 + * + * @param ids 需要删除的借用信息ID + * @return 结果 + */ + @Override + public int deletePwMaterialBorrowInfoByIds(Long[] ids) + { + return pwMaterialBorrowInfoMapper.deletePwMaterialBorrowInfoByIds(ids); + } + + /** + * 删除借用信息信息 + * + * @param id 借用信息ID + * @return 结果 + */ + @Override + public int deletePwMaterialBorrowInfoById(Long id) + { + return pwMaterialBorrowInfoMapper.deletePwMaterialBorrowInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialMaterialsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialMaterialsServiceImpl.java new file mode 100644 index 0000000..a973e76 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialMaterialsServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwMaterialMaterialsMapper; +import com.ruoyi.project.management.domain.PwMaterialMaterials; +import com.ruoyi.project.management.service.IPwMaterialMaterialsService; + +/** + * 物料原材料Service业务层处理 + * + * @author zhukangchao + * @date 2022-12-14 + */ +@Service +public class PwMaterialMaterialsServiceImpl implements IPwMaterialMaterialsService +{ + @Autowired + private PwMaterialMaterialsMapper pwMaterialMaterialsMapper; + + /** + * 查询物料原材料 + * + * @param id 物料原材料ID + * @return 物料原材料 + */ + @Override + public PwMaterialMaterials selectPwMaterialMaterialsById(Long id) + { + return pwMaterialMaterialsMapper.selectPwMaterialMaterialsById(id); + } + + /** + * 查询物料原材料列表 + * + * @param pwMaterialMaterials 物料原材料 + * @return 物料原材料 + */ + @Override + public List selectPwMaterialMaterialsList(PwMaterialMaterials pwMaterialMaterials) + { + return pwMaterialMaterialsMapper.selectPwMaterialMaterialsList(pwMaterialMaterials); + } + + /** + * 新增物料原材料 + * + * @param pwMaterialMaterials 物料原材料 + * @return 结果 + */ + @Override + public int insertPwMaterialMaterials(PwMaterialMaterials pwMaterialMaterials) + { + pwMaterialMaterials.setCreateTime(DateUtils.getNowDate()); + return pwMaterialMaterialsMapper.insertPwMaterialMaterials(pwMaterialMaterials); + } + + /** + * 修改物料原材料 + * + * @param pwMaterialMaterials 物料原材料 + * @return 结果 + */ + @Override + public int updatePwMaterialMaterials(PwMaterialMaterials pwMaterialMaterials) + { + return pwMaterialMaterialsMapper.updatePwMaterialMaterials(pwMaterialMaterials); + } + + /** + * 批量删除物料原材料 + * + * @param ids 需要删除的物料原材料ID + * @return 结果 + */ + @Override + public int deletePwMaterialMaterialsByIds(Long[] ids) + { + return pwMaterialMaterialsMapper.deletePwMaterialMaterialsByIds(ids); + } + + /** + * 删除物料原材料信息 + * + * @param id 物料原材料ID + * @return 结果 + */ + @Override + public int deletePwMaterialMaterialsById(Long id) + { + return pwMaterialMaterialsMapper.deletePwMaterialMaterialsById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialParamsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialParamsServiceImpl.java new file mode 100644 index 0000000..0872cad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialParamsServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwMaterialParamsMapper; +import com.ruoyi.project.management.domain.PwMaterialParams; +import com.ruoyi.project.management.service.IPwMaterialParamsService; + +/** + * 物料参数Service业务层处理 + * + * @author chenyongjiang + * @date 2024-04-16 + */ +@Service +public class PwMaterialParamsServiceImpl implements IPwMaterialParamsService +{ + @Autowired + private PwMaterialParamsMapper pwMaterialParamsMapper; + + /** + * 查询物料参数 + * + * @param id 物料参数ID + * @return 物料参数 + */ + @Override + public PwMaterialParams selectPwMaterialParamsById(Long id) + { + return pwMaterialParamsMapper.selectPwMaterialParamsById(id); + } + + /** + * 查询物料参数列表 + * + * @param pwMaterialParams 物料参数 + * @return 物料参数 + */ + @Override + public List selectPwMaterialParamsList(PwMaterialParams pwMaterialParams) + { + return pwMaterialParamsMapper.selectPwMaterialParamsList(pwMaterialParams); + } + + /** + * 新增物料参数 + * + * @param pwMaterialParams 物料参数 + * @return 结果 + */ + @Override + public int insertPwMaterialParams(PwMaterialParams pwMaterialParams) + { + return pwMaterialParamsMapper.insertPwMaterialParams(pwMaterialParams); + } + + /** + * 修改物料参数 + * + * @param pwMaterialParams 物料参数 + * @return 结果 + */ + @Override + public int updatePwMaterialParams(PwMaterialParams pwMaterialParams) + { + return pwMaterialParamsMapper.updatePwMaterialParams(pwMaterialParams); + } + + /** + * 批量删除物料参数 + * + * @param ids 需要删除的物料参数ID + * @return 结果 + */ + @Override + public int deletePwMaterialParamsByIds(Long[] ids) + { + return pwMaterialParamsMapper.deletePwMaterialParamsByIds(ids); + } + + /** + * 删除物料参数信息 + * + * @param id 物料参数ID + * @return 结果 + */ + @Override + public int deletePwMaterialParamsById(Long id) + { + return pwMaterialParamsMapper.deletePwMaterialParamsById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialPriceServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialPriceServiceImpl.java new file mode 100644 index 0000000..96365e2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialPriceServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwMaterialPriceMapper; +import com.ruoyi.project.management.domain.PwMaterialPrice; +import com.ruoyi.project.management.service.IPwMaterialPriceService; + +/** + * 物料价格校验Service业务层处理 + * + * @author zhukangchao + * @date 2023-06-23 + */ +@Service +public class PwMaterialPriceServiceImpl implements IPwMaterialPriceService +{ + @Autowired + private PwMaterialPriceMapper pwMaterialPriceMapper; + + /** + * 查询物料价格校验 + * + * @param id 物料价格校验ID + * @return 物料价格校验 + */ + @Override + public PwMaterialPrice selectPwMaterialPriceById(Long id) + { + return pwMaterialPriceMapper.selectPwMaterialPriceById(id); + } + + /** + * 查询物料价格校验列表 + * + * @param pwMaterialPrice 物料价格校验 + * @return 物料价格校验 + */ + @Override + public List selectPwMaterialPriceList(PwMaterialPrice pwMaterialPrice) + { + return pwMaterialPriceMapper.selectPwMaterialPriceList(pwMaterialPrice); + } + + /** + * 新增物料价格校验 + * + * @param pwMaterialPrice 物料价格校验 + * @return 结果 + */ + @Override + public int insertPwMaterialPrice(PwMaterialPrice pwMaterialPrice) + { + pwMaterialPrice.setCreateTime(DateUtils.getNowDate()); + return pwMaterialPriceMapper.insertPwMaterialPrice(pwMaterialPrice); + } + + /** + * 修改物料价格校验 + * + * @param pwMaterialPrice 物料价格校验 + * @return 结果 + */ + @Override + public int updatePwMaterialPrice(PwMaterialPrice pwMaterialPrice) + { + return pwMaterialPriceMapper.updatePwMaterialPrice(pwMaterialPrice); + } + + /** + * 批量删除物料价格校验 + * + * @param ids 需要删除的物料价格校验ID + * @return 结果 + */ + @Override + public int deletePwMaterialPriceByIds(Long[] ids) + { + return pwMaterialPriceMapper.deletePwMaterialPriceByIds(ids); + } + + /** + * 删除物料价格校验信息 + * + * @param id 物料价格校验ID + * @return 结果 + */ + @Override + public int deletePwMaterialPriceById(Long id) + { + return pwMaterialPriceMapper.deletePwMaterialPriceById(id); + } + + @Override + public PwMaterialPrice selectPwMaterialPriceByNameAndFigureNumber(String name, String figureNumber) { + // TODO Auto-generated method stub + return pwMaterialPriceMapper.selectPwMaterialPriceByNameAndFigureNumber(name,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialProcessServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialProcessServiceImpl.java new file mode 100644 index 0000000..453edf3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwMaterialProcessServiceImpl.java @@ -0,0 +1,109 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwMaterialProcessMapper; +import com.ruoyi.project.management.domain.PwMaterialProcess; +import com.ruoyi.project.management.service.IPwMaterialProcessService; + +/** + * 物料工序信息Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-04 + */ +@Service +public class PwMaterialProcessServiceImpl implements IPwMaterialProcessService +{ + @Autowired + private PwMaterialProcessMapper pwMaterialProcessMapper; + + /** + * 查询物料工序信息 + * + * @param id 物料工序信息ID + * @return 物料工序信息 + */ + @Override + public PwMaterialProcess selectPwMaterialProcessById(Long id) + { + return pwMaterialProcessMapper.selectPwMaterialProcessById(id); + } + + /** + * 查询物料工序信息列表 + * + * @param pwMaterialProcess 物料工序信息 + * @return 物料工序信息 + */ + @Override + public List selectPwMaterialProcessList(PwMaterialProcess pwMaterialProcess) + { + return pwMaterialProcessMapper.selectPwMaterialProcessList(pwMaterialProcess); + } + + /** + * 新增物料工序信息 + * + * @param pwMaterialProcess 物料工序信息 + * @return 结果 + */ + @Override + public int insertPwMaterialProcess(PwMaterialProcess pwMaterialProcess) + { + pwMaterialProcess.setCreateTime(DateUtils.getNowDate()); + return pwMaterialProcessMapper.insertPwMaterialProcess(pwMaterialProcess); + } + + /** + * 修改物料工序信息 + * + * @param pwMaterialProcess 物料工序信息 + * @return 结果 + */ + @Override + public int updatePwMaterialProcess(PwMaterialProcess pwMaterialProcess) + { + return pwMaterialProcessMapper.updatePwMaterialProcess(pwMaterialProcess); + } + + /** + * 批量删除物料工序信息 + * + * @param ids 需要删除的物料工序信息ID + * @return 结果 + */ + @Override + public int deletePwMaterialProcessByIds(Long[] ids) + { + return pwMaterialProcessMapper.deletePwMaterialProcessByIds(ids); + } + + /** + * 删除物料工序信息信息 + * + * @param id 物料工序信息ID + * @return 结果 + */ + @Override + public int deletePwMaterialProcessById(String id) + { + return pwMaterialProcessMapper.deletePwMaterialProcessById(id); + } + + @Override + public List selectPwMaterialProcessByNameAndFigureNumber(String name, String figureNumber) { + + return pwMaterialProcessMapper.selectPwMaterialProcessByNameAndFigureNumber(name,figureNumber); + } + @Override + public List queryPwMaterialProcesssByFigureNumber(String figureNumber){ + return pwMaterialProcessMapper.queryPwMaterialProcesssByFigureNumber(figureNumber); + } + @Override + public List queryPwMaterialProcesssById(Long id){ + return pwMaterialProcessMapper.queryPwMaterialProcesssById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwModulePartServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwModulePartServiceImpl.java new file mode 100644 index 0000000..0966b7b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwModulePartServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwModulePartMapper; +import com.ruoyi.project.management.domain.PwModulePart; +import com.ruoyi.project.management.service.IPwModulePartService; + +/** + * 零部件关联Service业务层处理 + * + * @author zhukangchao + * @date 2022-11-28 + */ +@Service +public class PwModulePartServiceImpl implements IPwModulePartService +{ + @Autowired + private PwModulePartMapper pwModulePartMapper; + + /** + * 查询零部件关联 + * + * @param id 零部件关联ID + * @return 零部件关联 + */ + @Override + public PwModulePart selectPwModulePartById(Long id) + { + return pwModulePartMapper.selectPwModulePartById(id); + } + + /** + * 查询零部件关联列表 + * + * @param pwModulePart 零部件关联 + * @return 零部件关联 + */ + @Override + public List selectPwModulePartList(PwModulePart pwModulePart) + { + return pwModulePartMapper.selectPwModulePartList(pwModulePart); + } + + /** + * 新增零部件关联 + * + * @param pwModulePart 零部件关联 + * @return 结果 + */ + @Override + public int insertPwModulePart(PwModulePart pwModulePart) + { + pwModulePart.setCreateTime(DateUtils.getNowDate()); + return pwModulePartMapper.insertPwModulePart(pwModulePart); + } + + /** + * 修改零部件关联 + * + * @param pwModulePart 零部件关联 + * @return 结果 + */ + @Override + public int updatePwModulePart(PwModulePart pwModulePart) + { + return pwModulePartMapper.updatePwModulePart(pwModulePart); + } + + /** + * 批量删除零部件关联 + * + * @param ids 需要删除的零部件关联ID + * @return 结果 + */ + @Override + public int deletePwModulePartByIds(Long[] ids) + { + return pwModulePartMapper.deletePwModulePartByIds(ids); + } + + /** + * 删除零部件关联信息 + * + * @param id 零部件关联ID + * @return 结果 + */ + @Override + public int deletePwModulePartById(Long id) + { + return pwModulePartMapper.deletePwModulePartById(id); + } + + @Override + public List selectPwModulePartByMaterialId(Long id) { + // TODO Auto-generated method stub + return pwModulePartMapper.selectPwModulePartByMaterialId(id); + } + + @Override + public List selectPwModulePartByMaterialNameAndFigureNumber(String name, String figureNumber) { + // TODO Auto-generated method stub + return pwModulePartMapper.selectPwModulePartByMaterialNameAndFigureNumber(name,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOtherCorrespondentServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOtherCorrespondentServiceImpl.java new file mode 100644 index 0000000..9ca1b75 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOtherCorrespondentServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwOtherCorrespondentMapper; +import com.ruoyi.project.management.domain.PwOtherCorrespondent; +import com.ruoyi.project.management.service.IPwOtherCorrespondentService; + +/** + * 其它往来单位信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-04 + */ +@Service +public class PwOtherCorrespondentServiceImpl implements IPwOtherCorrespondentService +{ + @Autowired + private PwOtherCorrespondentMapper pwOtherCorrespondentMapper; + + /** + * 查询其它往来单位信息 + * + * @param id 其它往来单位信息ID + * @return 其它往来单位信息 + */ + @Override + public PwOtherCorrespondent selectPwOtherCorrespondentById(Long id) + { + return pwOtherCorrespondentMapper.selectPwOtherCorrespondentById(id); + } + + /** + * 查询其它往来单位信息列表 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 其它往来单位信息 + */ + @Override + public List selectPwOtherCorrespondentList(PwOtherCorrespondent pwOtherCorrespondent) + { + return pwOtherCorrespondentMapper.selectPwOtherCorrespondentList(pwOtherCorrespondent); + } + + /** + * 新增其它往来单位信息 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 结果 + */ + @Override + public int insertPwOtherCorrespondent(PwOtherCorrespondent pwOtherCorrespondent) + { + pwOtherCorrespondent.setCreateTime(DateUtils.getNowDate()); + return pwOtherCorrespondentMapper.insertPwOtherCorrespondent(pwOtherCorrespondent); + } + + /** + * 修改其它往来单位信息 + * + * @param pwOtherCorrespondent 其它往来单位信息 + * @return 结果 + */ + @Override + public int updatePwOtherCorrespondent(PwOtherCorrespondent pwOtherCorrespondent) + { + return pwOtherCorrespondentMapper.updatePwOtherCorrespondent(pwOtherCorrespondent); + } + + /** + * 批量删除其它往来单位信息 + * + * @param ids 需要删除的其它往来单位信息ID + * @return 结果 + */ + @Override + public int deletePwOtherCorrespondentByIds(Long[] ids) + { + return pwOtherCorrespondentMapper.deletePwOtherCorrespondentByIds(ids); + } + + /** + * 删除其它往来单位信息信息 + * + * @param id 其它往来单位信息ID + * @return 结果 + */ + @Override + public int deletePwOtherCorrespondentById(Long id) + { + return pwOtherCorrespondentMapper.deletePwOtherCorrespondentById(id); + } + + @Override + public PwOtherCorrespondent selectPwOtherCorrespondentByName(String unitName) { + // TODO Auto-generated method stub + return pwOtherCorrespondentMapper.selectPwOtherCorrespondentByName(unitName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourceContractDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourceContractDetailServiceImpl.java new file mode 100644 index 0000000..fa83402 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourceContractDetailServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwOutsourceContractDetailMapper; +import com.ruoyi.project.management.domain.PwOutsourceContractDetail; +import com.ruoyi.project.management.service.IPwOutsourceContractDetailService; + +/** + * 外协合同详情信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-04-09 + */ +@Service +public class PwOutsourceContractDetailServiceImpl implements IPwOutsourceContractDetailService +{ + @Autowired + private PwOutsourceContractDetailMapper pwOutsourceContractDetailMapper; + + /** + * 查询外协合同详情信息 + * + * @param id 外协合同详情信息ID + * @return 外协合同详情信息 + */ + @Override + public PwOutsourceContractDetail selectPwOutsourceContractDetailById(Long id) + { + return pwOutsourceContractDetailMapper.selectPwOutsourceContractDetailById(id); + } + + /** + * 查询外协合同详情信息列表 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 外协合同详情信息 + */ + @Override + public List selectPwOutsourceContractDetailList(PwOutsourceContractDetail pwOutsourceContractDetail) + { + return pwOutsourceContractDetailMapper.selectPwOutsourceContractDetailList(pwOutsourceContractDetail); + } + + /** + * 新增外协合同详情信息 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 结果 + */ + @Override + public int insertPwOutsourceContractDetail(PwOutsourceContractDetail pwOutsourceContractDetail) + { + pwOutsourceContractDetail.setCreateTime(DateUtils.getNowDate()); + return pwOutsourceContractDetailMapper.insertPwOutsourceContractDetail(pwOutsourceContractDetail); + } + + /** + * 修改外协合同详情信息 + * + * @param pwOutsourceContractDetail 外协合同详情信息 + * @return 结果 + */ + @Override + public int updatePwOutsourceContractDetail(PwOutsourceContractDetail pwOutsourceContractDetail) + { + return pwOutsourceContractDetailMapper.updatePwOutsourceContractDetail(pwOutsourceContractDetail); + } + + /** + * 批量删除外协合同详情信息 + * + * @param ids 需要删除的外协合同详情信息ID + * @return 结果 + */ + @Override + public int deletePwOutsourceContractDetailByIds(Long[] ids) + { + return pwOutsourceContractDetailMapper.deletePwOutsourceContractDetailByIds(ids); + } + + /** + * 删除外协合同详情信息信息 + * + * @param id 外协合同详情信息ID + * @return 结果 + */ + @Override + public int deletePwOutsourceContractDetailById(Long id) + { + return pwOutsourceContractDetailMapper.deletePwOutsourceContractDetailById(id); + } + + @Override + public List selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber( + String productionCode, String name, String figureNumber) { + // TODO Auto-generated method stub + return pwOutsourceContractDetailMapper.selectPwOutsourceContractDetailByCodeAndNameAndFigureNumber(productionCode,name,figureNumber); + } + + @Override + public List selectPwOutsourceContractDetailByOutsourceContractId(Long id) { + // TODO Auto-generated method stub + return pwOutsourceContractDetailMapper.selectPwOutsourceContractDetailByOutsourceContractId(id); + } + + @Override + public List selectPwOutsourceContractDetailLists( + PwOutsourceContractDetail pwOutsourceContractDetail) { + // TODO Auto-generated method stub + return pwOutsourceContractDetailMapper.selectPwOutsourceContractDetailLists(pwOutsourceContractDetail); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourceContractServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourceContractServiceImpl.java new file mode 100644 index 0000000..e892ee9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourceContractServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwOutsourceContractMapper; +import com.ruoyi.project.management.domain.PwOutsourceContract; +import com.ruoyi.project.management.service.IPwOutsourceContractService; + +/** + * 外协合同信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-04-09 + */ +@Service +public class PwOutsourceContractServiceImpl implements IPwOutsourceContractService +{ + @Autowired + private PwOutsourceContractMapper pwOutsourceContractMapper; + + /** + * 查询外协合同信息 + * + * @param id 外协合同信息ID + * @return 外协合同信息 + */ + @Override + public PwOutsourceContract selectPwOutsourceContractById(Long id) + { + return pwOutsourceContractMapper.selectPwOutsourceContractById(id); + } + + /** + * 查询外协合同信息列表 + * + * @param pwOutsourceContract 外协合同信息 + * @return 外协合同信息 + */ + @Override + public List selectPwOutsourceContractList(PwOutsourceContract pwOutsourceContract) + { + return pwOutsourceContractMapper.selectPwOutsourceContractList(pwOutsourceContract); + } + + /** + * 新增外协合同信息 + * + * @param pwOutsourceContract 外协合同信息 + * @return 结果 + */ + @Override + public int insertPwOutsourceContract(PwOutsourceContract pwOutsourceContract) + { + pwOutsourceContract.setCreateTime(DateUtils.getNowDate()); + return pwOutsourceContractMapper.insertPwOutsourceContract(pwOutsourceContract); + } + + /** + * 修改外协合同信息 + * + * @param pwOutsourceContract 外协合同信息 + * @return 结果 + */ + @Override + public int updatePwOutsourceContract(PwOutsourceContract pwOutsourceContract) + { + return pwOutsourceContractMapper.updatePwOutsourceContract(pwOutsourceContract); + } + + /** + * 批量删除外协合同信息 + * + * @param ids 需要删除的外协合同信息ID + * @return 结果 + */ + @Override + public int deletePwOutsourceContractByIds(Long[] ids) + { + return pwOutsourceContractMapper.deletePwOutsourceContractByIds(ids); + } + + /** + * 删除外协合同信息信息 + * + * @param id 外协合同信息ID + * @return 结果 + */ + @Override + public int deletePwOutsourceContractById(Long id) + { + return pwOutsourceContractMapper.deletePwOutsourceContractById(id); + } + + @Override + public List selectPwOutsourceContractByInvoiceInfoId(Long id) { + // TODO Auto-generated method stub + return pwOutsourceContractMapper.selectPwOutsourceContractByInvoiceInfoId(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourcingContractMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourcingContractMaterialServiceImpl.java new file mode 100644 index 0000000..2c8f0b4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourcingContractMaterialServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwOutsourcingContractMaterialMapper; +import com.ruoyi.project.management.domain.PwOutsourcingContractMaterial; +import com.ruoyi.project.management.service.IPwOutsourcingContractMaterialService; + +/** + * 零件和外协合同关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-01 + */ +@Service +public class PwOutsourcingContractMaterialServiceImpl implements IPwOutsourcingContractMaterialService +{ + @Autowired + private PwOutsourcingContractMaterialMapper pwOutsourcingContractMaterialMapper; + + /** + * 查询零件和外协合同关联 + * + * @param id 零件和外协合同关联ID + * @return 零件和外协合同关联 + */ + @Override + public PwOutsourcingContractMaterial selectPwOutsourcingContractMaterialById(Long id) + { + return pwOutsourcingContractMaterialMapper.selectPwOutsourcingContractMaterialById(id); + } + + /** + * 查询零件和外协合同关联列表 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 零件和外协合同关联 + */ + @Override + public List selectPwOutsourcingContractMaterialList(PwOutsourcingContractMaterial pwOutsourcingContractMaterial) + { + return pwOutsourcingContractMaterialMapper.selectPwOutsourcingContractMaterialList(pwOutsourcingContractMaterial); + } + + /** + * 新增零件和外协合同关联 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 结果 + */ + @Override + public int insertPwOutsourcingContractMaterial(PwOutsourcingContractMaterial pwOutsourcingContractMaterial) + { + pwOutsourcingContractMaterial.setCreateTime(DateUtils.getNowDate()); + return pwOutsourcingContractMaterialMapper.insertPwOutsourcingContractMaterial(pwOutsourcingContractMaterial); + } + + /** + * 修改零件和外协合同关联 + * + * @param pwOutsourcingContractMaterial 零件和外协合同关联 + * @return 结果 + */ + @Override + public int updatePwOutsourcingContractMaterial(PwOutsourcingContractMaterial pwOutsourcingContractMaterial) + { + return pwOutsourcingContractMaterialMapper.updatePwOutsourcingContractMaterial(pwOutsourcingContractMaterial); + } + + /** + * 批量删除零件和外协合同关联 + * + * @param ids 需要删除的零件和外协合同关联ID + * @return 结果 + */ + @Override + public int deletePwOutsourcingContractMaterialByIds(Long[] ids) + { + return pwOutsourcingContractMaterialMapper.deletePwOutsourcingContractMaterialByIds(ids); + } + + /** + * 删除零件和外协合同关联信息 + * + * @param id 零件和外协合同关联ID + * @return 结果 + */ + @Override + public int deletePwOutsourcingContractMaterialById(Long id) + { + return pwOutsourcingContractMaterialMapper.deletePwOutsourcingContractMaterialById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourcingContractServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourcingContractServiceImpl.java new file mode 100644 index 0000000..8f23bab --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwOutsourcingContractServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwOutsourcingContractMapper; +import com.ruoyi.project.management.domain.PwOutsourcingContract; +import com.ruoyi.project.management.service.IPwOutsourcingContractService; + +/** + * 外协合同Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-01 + */ +@Service +public class PwOutsourcingContractServiceImpl implements IPwOutsourcingContractService +{ + @Autowired + private PwOutsourcingContractMapper pwOutsourcingContractMapper; + + /** + * 查询外协合同 + * + * @param id 外协合同ID + * @return 外协合同 + */ + @Override + public PwOutsourcingContract selectPwOutsourcingContractById(Long id) + { + return pwOutsourcingContractMapper.selectPwOutsourcingContractById(id); + } + + /** + * 查询外协合同列表 + * + * @param pwOutsourcingContract 外协合同 + * @return 外协合同 + */ + @Override + public List selectPwOutsourcingContractList(PwOutsourcingContract pwOutsourcingContract) + { + return pwOutsourcingContractMapper.selectPwOutsourcingContractList(pwOutsourcingContract); + } + + /** + * 新增外协合同 + * + * @param pwOutsourcingContract 外协合同 + * @return 结果 + */ + @Override + public int insertPwOutsourcingContract(PwOutsourcingContract pwOutsourcingContract) + { + pwOutsourcingContract.setCreateTime(DateUtils.getNowDate()); + return pwOutsourcingContractMapper.insertPwOutsourcingContract(pwOutsourcingContract); + } + + /** + * 修改外协合同 + * + * @param pwOutsourcingContract 外协合同 + * @return 结果 + */ + @Override + public int updatePwOutsourcingContract(PwOutsourcingContract pwOutsourcingContract) + { + return pwOutsourcingContractMapper.updatePwOutsourcingContract(pwOutsourcingContract); + } + + /** + * 批量删除外协合同 + * + * @param ids 需要删除的外协合同ID + * @return 结果 + */ + @Override + public int deletePwOutsourcingContractByIds(Long[] ids) + { + return pwOutsourcingContractMapper.deletePwOutsourcingContractByIds(ids); + } + + /** + * 删除外协合同信息 + * + * @param id 外协合同ID + * @return 结果 + */ + @Override + public int deletePwOutsourcingContractById(Long id) + { + return pwOutsourcingContractMapper.deletePwOutsourcingContractById(id); + } + + /** + * 根据外协合同编号查询外协合同信息 + */ + @Override + public PwOutsourcingContract selectByOutsourcingContractCode(String worksheetCode) { + PwOutsourcingContract outsourcingContract = pwOutsourcingContractMapper.selectByOutsourcingContractCode(worksheetCode); + return outsourcingContract; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPankuRecordServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPankuRecordServiceImpl.java new file mode 100644 index 0000000..d3b5b75 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPankuRecordServiceImpl.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.project.management.mapper.PwPankuRecordMapper; +import com.ruoyi.project.management.domain.PwInventoryDetail; +import com.ruoyi.project.management.domain.PwPankuRecord; +import com.ruoyi.project.management.service.IPwInventoryDetailService; +import com.ruoyi.project.management.service.IPwPankuRecordService; + +/** + * 盘库记录Service业务层处理 + * + * @author zhukangchao + * @date 2020-08-27 + */ +@Service +public class PwPankuRecordServiceImpl implements IPwPankuRecordService +{ + @Autowired + private PwPankuRecordMapper pwPankuRecordMapper; + @Autowired + private IPwInventoryDetailService pwInventoryDetailService; + + + /** + * 查询盘库记录 + * + * @param id 盘库记录ID + * @return 盘库记录 + */ + @Override + public PwPankuRecord selectPwPankuRecordById(Long id) + { + return pwPankuRecordMapper.selectPwPankuRecordById(id); + } + + /** + * 查询盘库记录列表 + * + * @param pwPankuRecord 盘库记录 + * @return 盘库记录 + */ + @Override + public List selectPwPankuRecordList(PwPankuRecord pwPankuRecord) + { + return pwPankuRecordMapper.selectPwPankuRecordList(pwPankuRecord); + } + + /** + * 新增盘库记录 + * + * @param pwPankuRecord 盘库记录 + * @return 结果 + */ + @Override + public int insertPwPankuRecord(PwPankuRecord pwPankuRecord) + { + pwPankuRecord.setCreateTime(DateUtils.getNowDate()); + return pwPankuRecordMapper.insertPwPankuRecord(pwPankuRecord); + } + + /** + * 修改盘库记录 + * + * @param pwPankuRecord 盘库记录 + * @return 结果 + */ + @Override + public int updatePwPankuRecord(PwPankuRecord pwPankuRecord) + { + return pwPankuRecordMapper.updatePwPankuRecord(pwPankuRecord); + } + + /** + * 批量删除盘库记录 + * + * @param ids 需要删除的盘库记录ID + * @return 结果 + */ + @Override + public int deletePwPankuRecordByIds(Long[] ids) + { + return pwPankuRecordMapper.deletePwPankuRecordByIds(ids); + } + + /** + * 删除盘库记录信息 + * + * @param id 盘库记录ID + * @return 结果 + */ + @Override + public int deletePwPankuRecordById(Long id) + { + return pwPankuRecordMapper.deletePwPankuRecordById(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int addCollateInventory(PwPankuRecord pwPankuRecord) { + pwPankuRecordMapper.insertPwPankuRecord(pwPankuRecord); + pwPankuRecord.getSparedThree(); + PwInventoryDetail inventoryDetail = pwInventoryDetailService.selectPwInventoryDetailById(pwPankuRecord.getSparedThree()); + inventoryDetail.setQuantity(pwPankuRecord.getPracticalQuantity()); + int i = pwInventoryDetailService.updatePwInventoryDetail(inventoryDetail); + return i; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPredictPurchaseServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPredictPurchaseServiceImpl.java new file mode 100644 index 0000000..6ff1204 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPredictPurchaseServiceImpl.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.project.management.domain.PwPredictPurchaseTwo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwPredictPurchaseMapper; +import com.ruoyi.project.management.domain.PwPredictPurchase; +import com.ruoyi.project.management.service.IPwPredictPurchaseService; + +/** + * 预采购单Service业务层处理 + * + * @author zhukangchao + * @date 2023-02-02 + */ +@Service +public class PwPredictPurchaseServiceImpl implements IPwPredictPurchaseService { + @Autowired + private PwPredictPurchaseMapper pwPredictPurchaseMapper; + @Autowired + private PwPredictPurchaseTwoServiceImpl pwPredictPurchaseTwoService; + + /** + * 查询预采购单 + * + * @param id 预采购单ID + * @return 预采购单 + */ + @Override + public PwPredictPurchase selectPwPredictPurchaseById(Long id) { + return pwPredictPurchaseMapper.selectPwPredictPurchaseById(id); + } + + /** + * 查询预采购单列表 + * + * @param pwPredictPurchase 预采购单 + * @return 预采购单 + */ + @Override + public List selectPwPredictPurchaseList(PwPredictPurchase pwPredictPurchase) { + return pwPredictPurchaseMapper.selectPwPredictPurchaseList(pwPredictPurchase); + } + + /** + * 新增预采购单 + * + * @param pwPredictPurchase 预采购单 + * @return 结果 + */ + @Override + public int insertPwPredictPurchase(PwPredictPurchase pwPredictPurchase) { + pwPredictPurchase.setCreateTime(DateUtils.getNowDate()); + return pwPredictPurchaseMapper.insertPwPredictPurchase(pwPredictPurchase); + } + + /** + * 修改预采购单 + * + * @param pwPredictPurchase 预采购单 + * @return 结果 + */ + @Override + public int updatePwPredictPurchase(PwPredictPurchase pwPredictPurchase) { + return pwPredictPurchaseMapper.updatePwPredictPurchase(pwPredictPurchase); + } + + /** + * 批量删除预采购单 + * + * @param ids 需要删除的预采购单ID + * @return 结果 + */ + @Override + public int deletePwPredictPurchaseByIds(Long[] ids) { + return pwPredictPurchaseMapper.deletePwPredictPurchaseByIds(ids); + } + + /** + * 删除预采购单信息 + * + * @param id 预采购单ID + * @return 结果 + */ + @Override + public int deletePwPredictPurchaseById(Long id) { + return pwPredictPurchaseMapper.deletePwPredictPurchaseById(id); + } + + /** + * 更新预采购单信息 + * + * @param id 预采购单ID + * @return 结果 + */ + @Override + public int updatePwPredictPurchaseTotalPrices(Long id) { + //创建外购件预采购单详情对象 + PwPredictPurchaseTwo pwPredictPurchaseTwo1 = new PwPredictPurchaseTwo(); + //传入父级id,利用父级id去查询预采购单详情中所有的子级对象 + pwPredictPurchaseTwo1.setPredictPurchaseId(id); + List list = pwPredictPurchaseTwoService.selectPwPredictPurchaseTwoList(pwPredictPurchaseTwo1); + //遍历所有子级对象,计算出该外购件预采购单的总价并更新 + Double zongjia = 0.0; + for (PwPredictPurchaseTwo pwPredictPurchaseTwo2 : list) { + zongjia += pwPredictPurchaseTwo2.getTotalprice(); + } + + PwPredictPurchase predictPurchase = pwPredictPurchaseMapper.selectPwPredictPurchaseById(id); + predictPurchase.setTotalPrices(zongjia); + return updatePwPredictPurchase(predictPurchase); + } + + @Override + public PwPredictPurchase selectPwPredictPurchaseByCode(String makeDocumentsCode) { + // TODO Auto-generated method stub + return pwPredictPurchaseMapper.selectPwPredictPurchaseByCode(makeDocumentsCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPredictPurchaseTwoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPredictPurchaseTwoServiceImpl.java new file mode 100644 index 0000000..41066e3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPredictPurchaseTwoServiceImpl.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwPredictPurchaseTwoMapper; +import com.ruoyi.project.management.domain.PwPredictPurchaseTwo; +import com.ruoyi.project.management.service.IPwPredictPurchaseTwoService; + +/** + * 预采购单详情Service业务层处理 + * + * @author zhukangchao + * @date 2023-02-02 + */ +@Service +public class PwPredictPurchaseTwoServiceImpl implements IPwPredictPurchaseTwoService +{ + @Autowired + private PwPredictPurchaseTwoMapper pwPredictPurchaseTwoMapper; + + /** + * 查询预采购单详情 + * + * @param id 预采购单详情ID + * @return 预采购单详情 + */ + @Override + public PwPredictPurchaseTwo selectPwPredictPurchaseTwoById(Long id) + { + return pwPredictPurchaseTwoMapper.selectPwPredictPurchaseTwoById(id); + } + + /** + * 查询预采购单详情列表 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 预采购单详情 + */ + @Override + public List selectPwPredictPurchaseTwoList(PwPredictPurchaseTwo pwPredictPurchaseTwo) + { + return pwPredictPurchaseTwoMapper.selectPwPredictPurchaseTwoList(pwPredictPurchaseTwo); + } + + /** + * 新增预采购单详情 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 结果 + */ + @Override + public int insertPwPredictPurchaseTwo(PwPredictPurchaseTwo pwPredictPurchaseTwo) + { + pwPredictPurchaseTwo.setCreateTime(DateUtils.getNowDate()); + return pwPredictPurchaseTwoMapper.insertPwPredictPurchaseTwo(pwPredictPurchaseTwo); + } + + /** + * 修改预采购单详情 + * + * @param pwPredictPurchaseTwo 预采购单详情 + * @return 结果 + */ + @Override + public int updatePwPredictPurchaseTwo(PwPredictPurchaseTwo pwPredictPurchaseTwo) + { + return pwPredictPurchaseTwoMapper.updatePwPredictPurchaseTwo(pwPredictPurchaseTwo); + } + + /** + * 批量删除预采购单详情 + * + * @param ids 需要删除的预采购单详情ID + * @return 结果 + */ + @Override + public int deletePwPredictPurchaseTwoByIds(Long[] ids) + { + return pwPredictPurchaseTwoMapper.deletePwPredictPurchaseTwoByIds(ids); + } + + /** + * 删除预采购单详情信息 + * + * @param id 预采购单详情ID + * @return 结果 + */ + @Override + public int deletePwPredictPurchaseTwoById(Long id) + { + return pwPredictPurchaseTwoMapper.deletePwPredictPurchaseTwoById(id); + } + + @Override + public PwPredictPurchaseTwo selectPwPredictPurchaseTwoByIdAndNameAndFigureNumber(Long id, String materialName, + String specification) { + // TODO Auto-generated method stub + return pwPredictPurchaseTwoMapper.selectPwPredictPurchaseTwoByIdAndNameAndFigureNumber(id,materialName,specification); + } + + @Override + public List selectPwPredictPurchaseTwoByPredictPurchaseId(Long predictPurchaseId) { + // TODO Auto-generated method stub + return pwPredictPurchaseTwoMapper.selectPwPredictPurchaseTwoByPredictPurchaseId(predictPurchaseId); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProcessOrDeptServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProcessOrDeptServiceImpl.java new file mode 100644 index 0000000..cef5938 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProcessOrDeptServiceImpl.java @@ -0,0 +1,87 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProcessOrDeptMapper; +import com.ruoyi.project.management.domain.PwProcessOrDept; +import com.ruoyi.project.management.service.IPwProcessOrDeptService; + +/** + * 工序部门Service业务层处理 + * + * @author chenyongjiang + * @date 2024-05-23 + */ +@Service +public class PwProcessOrDeptServiceImpl implements IPwProcessOrDeptService +{ + @Autowired + private PwProcessOrDeptMapper pwProcessOrDeptMapper; + + /** + * 查询工序部门 + * + * @param id 工序部门ID + * @return 工序部门 + */ + @Override + public PwProcessOrDept selectPwProcessOrDeptById(Long id) + { + return pwProcessOrDeptMapper.selectPwProcessOrDeptById(id); + } + + /** + * 查询工序部门列表 + * + * @param pwProcessOrDept 工序部门 + * @return 工序部门 + */ + @Override + public List selectPwProcessOrDeptList(PwProcessOrDept pwProcessOrDept) + { + return pwProcessOrDeptMapper.selectPwProcessOrDeptList(pwProcessOrDept); + } + + /** + * 新增工序部门 + * + * @param pwProcessOrDept 工序部门 + * @return 结果 + */ + @Override + public int insertPwProcessOrDept(PwProcessOrDept pwProcessOrDept) + { + pwProcessOrDept.setCreateTime(DateUtils.getNowDate()); + return pwProcessOrDeptMapper.insertPwProcessOrDept(pwProcessOrDept); + } + + /** + * 修改工序部门 + * + * @param pwProcessOrDept 工序部门 + * @return 结果 + */ + @Override + public int updatePwProcessOrDept(PwProcessOrDept pwProcessOrDept) + { + return pwProcessOrDeptMapper.updatePwProcessOrDept(pwProcessOrDept); + } + + /** + * 批量删除工序部门 + * + * @param ids 需要删除的工序部门ID + * @return 结果 + */ + @Override + public int deletePwProcessOrDeptByIds(Long[] ids) + { + return pwProcessOrDeptMapper.deletePwProcessOrDeptByIds(ids); + } + @Override + public PwProcessOrDept selectPwProcessOrDeptByProcessName(String processName){ + return pwProcessOrDeptMapper.selectPwProcessOrDeptByProcessName(processName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProcessServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProcessServiceImpl.java new file mode 100644 index 0000000..c8e02ad --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProcessServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProcessMapper; +import com.ruoyi.project.management.domain.PwProcess; +import com.ruoyi.project.management.service.IPwProcessService; + +/** + * 工序Service业务层处理 + * + * @author zhukangchao + * @date 2021-10-11 + */ +@Service +public class PwProcessServiceImpl implements IPwProcessService +{ + @Autowired + private PwProcessMapper pwProcessMapper; + + /** + * 查询工序 + * + * @param id 工序ID + * @return 工序 + */ + @Override + public PwProcess selectPwProcessById(Long id) + { + return pwProcessMapper.selectPwProcessById(id); + } + + /** + * 查询工序列表 + * + * @param pwProcess 工序 + * @return 工序 + */ + @Override + public List selectPwProcessList(PwProcess pwProcess) + { + return pwProcessMapper.selectPwProcessList(pwProcess); + } + + /** + * 新增工序 + * + * @param pwProcess 工序 + * @return 结果 + */ + @Override + public int insertPwProcess(PwProcess pwProcess) + { + pwProcess.setCreateTime(DateUtils.getNowDate()); + return pwProcessMapper.insertPwProcess(pwProcess); + } + + /** + * 修改工序 + * + * @param pwProcess 工序 + * @return 结果 + */ + @Override + public int updatePwProcess(PwProcess pwProcess) + { + return pwProcessMapper.updatePwProcess(pwProcess); + } + + /** + * 批量删除工序 + * + * @param ids 需要删除的工序ID + * @return 结果 + */ + @Override + public int deletePwProcessByIds(Long[] ids) + { + return pwProcessMapper.deletePwProcessByIds(ids); + } + + /** + * 删除工序信息 + * + * @param id 工序ID + * @return 结果 + */ + @Override + public int deletePwProcessById(Long id) + { + return pwProcessMapper.deletePwProcessById(id); + } + + @Override + public PwProcess selectPwProcessByName(String string) { + // TODO Auto-generated method stub + return pwProcessMapper.selectPwProcessByName(string); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductBillBomServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductBillBomServiceImpl.java new file mode 100644 index 0000000..e586366 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductBillBomServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductBillBomMapper; +import com.ruoyi.project.management.domain.PwProductBillBom; +import com.ruoyi.project.management.service.IPwProductBillBomService; + +/** + * 生产执行单bomService业务层处理 + * + * @author zhukangchao + * @date 2020-08-17 + */ +@Service +public class PwProductBillBomServiceImpl implements IPwProductBillBomService +{ + @Autowired + private PwProductBillBomMapper pwProductBillBomMapper; + + /** + * 查询生产执行单bom + * + * @param id 生产执行单bomID + * @return 生产执行单bom + */ + @Override + public PwProductBillBom selectPwProductBillBomById(Long id) + { + return pwProductBillBomMapper.selectPwProductBillBomById(id); + } + + /** + * 查询生产执行单bom列表 + * + * @param pwProductBillBom 生产执行单bom + * @return 生产执行单bom + */ + @Override + public List selectPwProductBillBomList(PwProductBillBom pwProductBillBom) + { + return pwProductBillBomMapper.selectPwProductBillBomList(pwProductBillBom); + } + + /** + * 新增生产执行单bom + * + * @param pwProductBillBom 生产执行单bom + * @return 结果 + */ + @Override + public int insertPwProductBillBom(PwProductBillBom pwProductBillBom) + { + pwProductBillBom.setCreateTime(DateUtils.getNowDate()); + return pwProductBillBomMapper.insertPwProductBillBom(pwProductBillBom); + } + + /** + * 修改生产执行单bom + * + * @param pwProductBillBom 生产执行单bom + * @return 结果 + */ + @Override + public int updatePwProductBillBom(PwProductBillBom pwProductBillBom) + { + return pwProductBillBomMapper.updatePwProductBillBom(pwProductBillBom); + } + + /** + * 批量删除生产执行单bom + * + * @param ids 需要删除的生产执行单bomID + * @return 结果 + */ + @Override + public int deletePwProductBillBomByIds(Long[] ids) + { + return pwProductBillBomMapper.deletePwProductBillBomByIds(ids); + } + + /** + * 删除生产执行单bom信息 + * + * @param id 生产执行单bomID + * @return 结果 + */ + @Override + public int deletePwProductBillBomById(Long id) + { + return pwProductBillBomMapper.deletePwProductBillBomById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductDetailServiceImpl.java new file mode 100644 index 0000000..68a0b78 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductDetailServiceImpl.java @@ -0,0 +1,84 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductDetailMapper; +import com.ruoyi.project.management.domain.PwProductDetail; +import com.ruoyi.project.management.service.IPwProductDetailService; + +import javax.annotation.Resource; + +/** + * 金蝶生产详情Service业务层处理 + * + * @author chenyongjiang + * @date 2024-04-23 + */ +@Service +public class PwProductDetailServiceImpl implements IPwProductDetailService +{ + @Resource + private PwProductDetailMapper pwProductDetailMapper; + + /** + * 查询金蝶生产详情 + * + * @param id 金蝶生产详情ID + * @return 金蝶生产详情 + */ + @Override + public PwProductDetail selectPwProductDetailById(Long id) + { + return pwProductDetailMapper.selectPwProductDetailById(id); + } + + /** + * 查询金蝶生产详情列表 + * + * @param pwProductDetail 金蝶生产详情 + * @return 金蝶生产详情 + */ + @Override + public List selectPwProductDetailList(PwProductDetail pwProductDetail) + { + return pwProductDetailMapper.selectPwProductDetailList(pwProductDetail); + } + + /** + * 新增金蝶生产详情 + * + * @param pwProductDetail 金蝶生产详情 + * @return 结果 + */ + @Override + public int insertPwProductDetail(PwProductDetail pwProductDetail) + { + pwProductDetail.setCreateTime(DateUtils.getNowDate()); + return pwProductDetailMapper.insertPwProductDetail(pwProductDetail); + } + + /** + * 修改金蝶生产详情 + * + * @param pwProductDetail 金蝶生产详情 + * @return 结果 + */ + @Override + public int updatePwProductDetail(PwProductDetail pwProductDetail) + { + return pwProductDetailMapper.updatePwProductDetail(pwProductDetail); + } + + /** + * 删除金蝶生产详情信息 + * + * @param id 金蝶生产详情ID + * @return 结果 + */ + @Override + public int deletePwProductDetailById(Long id) + { + return pwProductDetailMapper.deletePwProductDetailById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductQuotationServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductQuotationServiceImpl.java new file mode 100644 index 0000000..26edd72 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductQuotationServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductQuotationMapper; +import com.ruoyi.project.management.domain.PwProductQuotation; +import com.ruoyi.project.management.service.IPwProductQuotationService; + +/** + * 产品报价单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-07 + */ +@Service +public class PwProductQuotationServiceImpl implements IPwProductQuotationService +{ + @Autowired + private PwProductQuotationMapper pwProductQuotationMapper; + + /** + * 查询产品报价单关联 + * + * @param id 产品报价单关联ID + * @return 产品报价单关联 + */ + @Override + public PwProductQuotation selectPwProductQuotationById(Long id) + { + return pwProductQuotationMapper.selectPwProductQuotationById(id); + } + + /** + * 查询产品报价单关联列表 + * + * @param pwProductQuotation 产品报价单关联 + * @return 产品报价单关联 + */ + @Override + public List selectPwProductQuotationList(PwProductQuotation pwProductQuotation) + { + return pwProductQuotationMapper.selectPwProductQuotationList(pwProductQuotation); + } + + /** + * 新增产品报价单关联 + * + * @param pwProductQuotation 产品报价单关联 + * @return 结果 + */ + @Override + public int insertPwProductQuotation(PwProductQuotation pwProductQuotation) + { + pwProductQuotation.setCreateTime(DateUtils.getNowDate()); + return pwProductQuotationMapper.insertPwProductQuotation(pwProductQuotation); + } + + /** + * 修改产品报价单关联 + * + * @param pwProductQuotation 产品报价单关联 + * @return 结果 + */ + @Override + public int updatePwProductQuotation(PwProductQuotation pwProductQuotation) + { + return pwProductQuotationMapper.updatePwProductQuotation(pwProductQuotation); + } + + /** + * 批量删除产品报价单关联 + * + * @param ids 需要删除的产品报价单关联ID + * @return 结果 + */ + @Override + public int deletePwProductQuotationByIds(Long[] ids) + { + return pwProductQuotationMapper.deletePwProductQuotationByIds(ids); + } + + /** + * 删除产品报价单关联信息 + * + * @param id 产品报价单关联ID + * @return 结果 + */ + @Override + public int deletePwProductQuotationById(Long id) + { + return pwProductQuotationMapper.deletePwProductQuotationById(id); + } + + @Override + public PwProductQuotation selectPwProductQuotationByNameAndQuotationId(String figureNumber,Long quotationId) { + + return pwProductQuotationMapper.selectPwProductQuotationByNameAndQuotationId(figureNumber,quotationId); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductServiceImpl.java new file mode 100644 index 0000000..4c97acc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.project.management.mapper.PwProductMapper; +import com.ruoyi.project.management.domain.PwProduct; +import com.ruoyi.project.management.service.IPwProductService; + +/** + * 产品Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PwProductServiceImpl implements IPwProductService +{ + @Autowired + private PwProductMapper pwProductMapper; + + /** + * 查询产品 + * + * @param id 产品ID + * @return 产品 + */ + @Override + public PwProduct selectPwProductById(Long id) + { + return pwProductMapper.selectPwProductById(id); + } + + /** + * 查询产品列表 + * + * @param pwProduct 产品 + * @return 产品 + */ + @Override + public List selectPwProductList(PwProduct pwProduct) + { + return pwProductMapper.selectPwProductList(pwProduct); + } + + /** + * 新增产品 + * + * @param pwProduct 产品 + * @return 结果 + */ + @Override + @Transactional + public int insertPwProduct(PwProduct pwProduct) + { + pwProduct.setDelFlag(0); + pwProduct.setCreateTime(DateUtils.getNowDate()); + return pwProductMapper.insertPwProduct(pwProduct); + } + + /** + * 修改产品 + * + * @param pwProduct 产品 + * @return 结果 + */ + @Override + public int updatePwProduct(PwProduct pwProduct) + { + return pwProductMapper.updatePwProduct(pwProduct); + } + + /** + * 批量删除产品 + * + * @param ids 需要删除的产品ID + * @return 结果 + */ + @Override + public int deletePwProductByIds(Long[] ids) + { + return pwProductMapper.deletePwProductByIds(ids); + } + + /** + * 删除产品信息 + * + * @param id 产品ID + * @return 结果 + */ + @Override + public int deletePwProductById(Long id) + { + return pwProductMapper.deletePwProductById(id); + } + + /** + * 根据产品名称查询 + */ + @Override + public PwProduct selectByName(String name) { + + return pwProductMapper.selectByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillNonstandardServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillNonstandardServiceImpl.java new file mode 100644 index 0000000..a415ae2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillNonstandardServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductionBillNonstandardMapper; +import com.ruoyi.project.management.domain.PwProductionBillNonstandard; +import com.ruoyi.project.management.service.IPwProductionBillNonstandardService; + +/** + * 产品非标生产执行单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-21 + */ +@Service +public class PwProductionBillNonstandardServiceImpl implements IPwProductionBillNonstandardService +{ + @Autowired + private PwProductionBillNonstandardMapper pwProductionBillNonstandardMapper; + + /** + * 查询产品非标生产执行单关联 + * + * @param id 产品非标生产执行单关联ID + * @return 产品非标生产执行单关联 + */ + @Override + public PwProductionBillNonstandard selectPwProductionBillNonstandardById(Long id) + { + return pwProductionBillNonstandardMapper.selectPwProductionBillNonstandardById(id); + } + + /** + * 查询产品非标生产执行单关联列表 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 产品非标生产执行单关联 + */ + @Override + public List selectPwProductionBillNonstandardList(PwProductionBillNonstandard pwProductionBillNonstandard) + { + return pwProductionBillNonstandardMapper.selectPwProductionBillNonstandardList(pwProductionBillNonstandard); + } + + /** + * 新增产品非标生产执行单关联 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 结果 + */ + @Override + public int insertPwProductionBillNonstandard(PwProductionBillNonstandard pwProductionBillNonstandard) + { + pwProductionBillNonstandard.setCreateTime(DateUtils.getNowDate()); + return pwProductionBillNonstandardMapper.insertPwProductionBillNonstandard(pwProductionBillNonstandard); + } + + /** + * 修改产品非标生产执行单关联 + * + * @param pwProductionBillNonstandard 产品非标生产执行单关联 + * @return 结果 + */ + @Override + public int updatePwProductionBillNonstandard(PwProductionBillNonstandard pwProductionBillNonstandard) + { + return pwProductionBillNonstandardMapper.updatePwProductionBillNonstandard(pwProductionBillNonstandard); + } + + /** + * 批量删除产品非标生产执行单关联 + * + * @param ids 需要删除的产品非标生产执行单关联ID + * @return 结果 + */ + @Override + public int deletePwProductionBillNonstandardByIds(Long[] ids) + { + return pwProductionBillNonstandardMapper.deletePwProductionBillNonstandardByIds(ids); + } + + /** + * 删除产品非标生产执行单关联信息 + * + * @param id 产品非标生产执行单关联ID + * @return 结果 + */ + @Override + public int deletePwProductionBillNonstandardById(Long id) + { + return pwProductionBillNonstandardMapper.deletePwProductionBillNonstandardById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillProductServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillProductServiceImpl.java new file mode 100644 index 0000000..84b0adb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillProductServiceImpl.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductionBillProductMapper; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.service.IPwProductionBillProductService; + +/** + * 销齿链生产执行单关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-21 + */ +@Service +public class PwProductionBillProductServiceImpl implements IPwProductionBillProductService +{ + @Autowired + private PwProductionBillProductMapper pwProductionBillProductMapper; + + /** + * 查询销齿链生产执行单关联 + * + * @param id 销齿链生产执行单关联ID + * @return 销齿链生产执行单关联 + */ + @Override + public PwProductionBillProduct selectPwProductionBillProductById(Long id) + { + return pwProductionBillProductMapper.selectPwProductionBillProductById(id); + } + + /** + * 查询销齿链生产执行单关联列表 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 销齿链生产执行单关联 + */ + @Override + public List selectPwProductionBillProductList(PwProductionBillProduct pwProductionBillProduct) + { + return pwProductionBillProductMapper.selectPwProductionBillProductList(pwProductionBillProduct); + } + + /** + * 新增销齿链生产执行单关联 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 结果 + */ + @Override + public int insertPwProductionBillProduct(PwProductionBillProduct pwProductionBillProduct) + { + pwProductionBillProduct.setCreateTime(DateUtils.getNowDate()); + return pwProductionBillProductMapper.insertPwProductionBillProduct(pwProductionBillProduct); + } + + /** + * 修改销齿链生产执行单关联 + * + * @param pwProductionBillProduct 销齿链生产执行单关联 + * @return 结果 + */ + @Override + public int updatePwProductionBillProduct(PwProductionBillProduct pwProductionBillProduct) + { + return pwProductionBillProductMapper.updatePwProductionBillProduct(pwProductionBillProduct); + } + + /** + * 批量删除销齿链生产执行单关联 + * + * @param ids 需要删除的销齿链生产执行单关联ID + * @return 结果 + */ + @Override + public int deletePwProductionBillProductByIds(Long[] ids) + { + return pwProductionBillProductMapper.deletePwProductionBillProductByIds(ids); + } + + /** + * 删除销齿链生产执行单关联信息 + * + * @param id 销齿链生产执行单关联ID + * @return 结果 + */ + @Override + public int deletePwProductionBillProductById(Long id) + { + return pwProductionBillProductMapper.deletePwProductionBillProductById(id); + } + + @Override + public List selectPwProductionBillProductByProductionBillId(Long id) { + + return pwProductionBillProductMapper.selectPwProductionBillProductByProductionBillId(id); + } + + @Override + public PwProductionBillProduct selectPwProductionBillProductByProductionBillIdAndName(Long id, String typeName) { + + return pwProductionBillProductMapper.selectPwProductionBillProductByProductionBillIdAndName(id,typeName); + } + + @Override + public List selectPwProductionBillProductLists( + PwProductionBillProduct pwProductionBillProduct) { + // TODO Auto-generated method stub + return pwProductionBillProductMapper.selectPwProductionBillProductLists(pwProductionBillProduct); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillServiceImpl.java new file mode 100644 index 0000000..6af6bb2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionBillServiceImpl.java @@ -0,0 +1,2641 @@ +package com.ruoyi.project.management.service.impl; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.net.URL; +import java.net.URLConnection; +import java.text.SimpleDateFormat; +import java.util.*; + +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.*; +import com.ruoyi.project.management.mapper.*; +import com.ruoyi.project.management.utils.BaseDataTool; +import com.ruoyi.project.product.domain.ProdMaterial; +import com.ruoyi.project.product.mapper.ProdMaterialMapper; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.service.IPcRigidChainService; +import com.ruoyi.project.management.service.IPwBomNumberService; +import com.ruoyi.project.management.service.IPwBomNumberTwoLingliaoService; +import com.ruoyi.project.management.service.IPwBomNumberTwoService; +import com.ruoyi.project.management.service.IPwMaterialProcessService; +import com.ruoyi.project.management.service.IPwModulePartService; +import com.ruoyi.project.management.service.IPwProcessService; +import com.ruoyi.project.management.service.IPwProductionBillService; +import com.ruoyi.project.management.service.IPwProductionOrderService; +import com.ruoyi.project.management.service.ISysConfigIniService; + +import javax.annotation.Resource; + +/** + * 生产执行单Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-21 + */ +@Service +public class PwProductionBillServiceImpl implements IPwProductionBillService { + @Value("${ruoyi.productionUrl}") + private String generalAssemblyDrawingUrl; + @Value("${ruoyi.dwgAndPdf}") + private String dwgAndPdf; + + @Resource + private PwProductionBillMapper pwProductionBillMapper; + @Resource + private PwContractMapper pwContractMapper; + @Resource + private PwQuotationMapper pwQuotationMapper; + @Resource + private PwProductQuotationMapper pwProductQuotationMapper; + @Resource + private PwProductionBillProductMapper pwProductionBillProductMapper; + @Resource + private PwInventoryDetailMapper pwInventoryDetailMapper; + @Resource + private ImMaterialMapper imMaterialMapper; + @Resource + private PcRigidChainMapper pcRigidChainMapper; + //bom信息 + @Autowired + private IPwBomNumberService pwBomNumberService; + //计算了数量的bom + @Autowired + private IPwBomNumberTwoService pwBomNumberTwoService; + //领料专用bom + @Autowired + private IPwBomNumberTwoLingliaoService pwBomNumberTwoLingliaoService; + //预制单信息 + @Resource + private PwMakeDocumentsMapper pwMakeDocumentsMapper; + //预制单明细 + @Resource + private PwMakeDocumentsDetailMapper pwMakeDocumentsDetailMapper; + //采购明细信息 + @Resource + private PwPurchaseContractMaterialMapper pwPurchaseContractMaterialMapper; + //物料工序信息 + @Autowired + private IPwMaterialProcessService pwMaterialProcessService; + //零部件关联信息 + @Autowired + private IPwModulePartService pwModulePartService; + //销齿链型号信息 + @Autowired + private IPcRigidChainService pcRigidChainService; + //图纸路径 + @Autowired + private ISysConfigIniService sysConfigIniService; + //生产订单信息 + @Autowired + private IPwProductionOrderService pwProductionOrderService; + @Resource + private PwProductDetailMapper pwProductDetailMapper; + @Resource + private PwGxProcessMapper pwGxProcessMapper; + @Resource + private PwBomNumberMapper pwBomNumberMapper; + @Resource + private PwBomNumberTwoMapper pwBomNumberTwoMapper; + @Resource + private ProdMaterialMapper prodMaterialMapper; //物料管理 + + /** + * 查询生产执行单 + * + * @param id + * 生产执行单ID + * @return 生产执行单 + */ + @Override + public PwProductionBill selectPwProductionBillById(Long id) { + return pwProductionBillMapper.selectPwProductionBillById(id); + } + + /** + * 查询生产执行单列表 + * + * @param pwProductionBill + * 生产执行单 + * @return 生产执行单 + */ + @Override + public List selectPwProductionBillList(PwProductionBill pwProductionBill) { + return pwProductionBillMapper.selectPwProductionBillList(pwProductionBill); + } + + /** + * 新增生产执行单 + * + * @param pwProductionBill + * 生产执行单 + * @return 结果 + */ + @Override +// @Transactional(rollbackFor = Exception.class) + public int insertPwProductionBill(PwProductionBill pwProductionBill) throws Exception { + //数据生成时间 + pwProductionBill.setCreateTime(DateUtils.getNowDate()); + //判断是否有图 无图 + if("0".equals(pwProductionBill.getSign())){ + // 根据合同id查询合同信息 + PwContract pwContract = pwContractMapper.selectByContractCode(pwProductionBill.getContractCode()); + // 项目名称 + pwProductionBill.setProjectName(pwContract.getItemName()); + //客户名称 + pwProductionBill.setPurchaser(pwContract.getPurchaser()); + // 合同编号 + pwProductionBill.setContractCode(pwContract.getContractCode()); + // 发单日期默认为当前日期 + pwProductionBill.setBillDate(new Date()); + //销售业务员 + pwProductionBill.setSalesman(pwContract.getSalesman()); + // 审核状态默认为未审核 + pwProductionBill.setStatusId((long) 1); + // 删除标记默认为未删除 + pwProductionBill.setDelFlag(0); + int i = pwProductionBillMapper.insertPwProductionBill(pwProductionBill); + + //添加产品型号 + // 创建销齿链执行单详情信息 + PwProductionBillProduct pwProductionBillProduct = new PwProductionBillProduct(); + // 根据报价单id查询报价单信息 + PwQuotation pwQuotation = pwQuotationMapper.selectPwQuotationById(Long.valueOf(pwContract.getQuotationId())); + // 根据报价单id查询产品 + PwProductQuotation pwProductQuotation = new PwProductQuotation(); + pwProductQuotation.setQuotationId(Long.valueOf(pwContract.getQuotationId())); + List quotationList = pwProductQuotationMapper.selectPwProductQuotationList(pwProductQuotation); + for (PwProductQuotation pwProductQuotation2 : quotationList) { + // 执行单id + pwProductionBillProduct.setProductionBillId(pwProductionBill.getId()); + // 产品名称 + pwProductionBillProduct.setProductName(pwProductQuotation2.getProductName()); + // 产品型号 + pwProductionBillProduct.setProductType(pwProductQuotation2.getTypeName()); + // 数量 + pwProductionBillProduct.setQuantity(pwProductQuotation2.getNumber()); + // 完工日期 + Date deliveryTime = pwContract.getDeliveryTime(); + pwProductionBillProduct.setCompleteDate(deliveryTime); + // 包装方式 + pwProductionBillProduct.setPackType(pwQuotation.getModeOfPacking()); + // 删除标记 + pwProductionBillProduct.setDelFlag(0); + //保存零部件明细文件路径 + pwProductionBillProductMapper.insertPwProductionBillProduct(pwProductionBillProduct); + //创建保存pdf图纸的文件夹 + //创建第一层文件夹 + File file = new File(dwgAndPdf+pwProductionBill.getCode()); + if (!file.exists()){ + file.mkdir(); + } + //把产品型号中的/替换为- + String replaceAll = pwProductionBillProduct.getProductType().replaceAll("/","-"); + File files = new File(dwgAndPdf+pwProductionBill.getCode()+"/"+replaceAll+"-pdf"); + if (!files.exists()){ + files.mkdir(); + }else{ + files.delete(); + files.mkdir(); + } + } + + //修改合同状态 + // 修改合同状态为待生产状态 + pwContract.setContractStatus(3); + pwContractMapper.updatePwContract(pwContract); + return i; + }else{ + // 根据合同id查询合同信息 + PwContract pwContract = pwContractMapper.selectByContractCode(pwProductionBill.getContractCode()); + + // 项目名称 + pwProductionBill.setProjectName(pwContract.getItemName()); + //客户名称 + pwProductionBill.setPurchaser(pwContract.getPurchaser()); + // 合同编号 + pwProductionBill.setContractCode(pwContract.getContractCode()); + // 发单日期默认为当前日期 + pwProductionBill.setBillDate(new Date()); + //销售业务员 + pwProductionBill.setSalesman(pwContract.getSalesman()); + // 审核状态默认为未审核 + pwProductionBill.setStatusId((long) 1); + // 删除标记默认为未删除 + pwProductionBill.setDelFlag(0); + int i = pwProductionBillMapper.insertPwProductionBill(pwProductionBill); + + // 根据报价单id查询报价单信息 + PwQuotation pwQuotation = pwQuotationMapper.selectPwQuotationById(Long.valueOf(pwContract.getQuotationId())); + // 根据报价单id查询产品 + PwProductQuotation pwProductQuotation = new PwProductQuotation(); + pwProductQuotation.setQuotationId(Long.valueOf(pwContract.getQuotationId())); + List quotationList = pwProductQuotationMapper.selectPwProductQuotationList(pwProductQuotation); + + //判断是否是WF项目 + if(!pwProductionBill.getCode().contains("XCL")){ + // 把报价单中的产品添加到执行单中 + for (PwProductQuotation pwProductQuotation2 : quotationList) { + String typeName = pwProductQuotation2.getTypeName(); + // 拼接生产总图需要的参数 + String s = "typeName=" + typeName + "<ype=" + "" + "&num=" + "1" + "&productNumber=" + "000" + "&productId=" + "0000" + "&endTime=" + "2020-10-21"; + //请求bom表(直接添加到bom1表中) + int addBom = addBom(s,pwProductionBill.getCode(),pwProductQuotation2.getNumber(),typeName); + if(addBom<1){ + return addBom; + } + + //处理序号问题 + addSerial(pwProductionBill.getCode(),typeName); + + // 计算数量(计算完之后把物料添加到bom2和bom3中) + //counterNum(pwProductionBill.getCode(),typeName); + + //查库添加标记 + selectInventoryDetail(pwProductionBill.getCode()); + + //添加物料信息和库存信息 + addMaterialAndInventorydetail(pwProductionBill.getCode()); + + //添加标准价和外购件到采购明细表 + addPwPurchaseContractMaterial(pwProductionBill.getCode()); + +// // 调用三方接口回写数量和令号 +// // 拼接生产总图需要的参数 +// ss = "typeName=" + typeName+ "<ype=" + "" + "&num=" + pwProductQuotation2.getNumber() + "&productNumber=" +// +"000"+ "&productId="+pwProductionBill.getCode() +// + "&endTime=" + ""; + //需即时返回数据,如不能即时返回则需要回调接口或者三方程序操作数据库 + + //保存执行单产品明细信息 +// addProductionBillProduct(pwProductionBill,pwProductQuotation2,pwQuotation,pwContract); + + } + for (PwProductQuotation pwProductQuotation2 : quotationList) { + String typeName = pwProductQuotation2.getTypeName(); + // 调用三方接口回写数量和令号 + // 拼接生产总图需要的参数 + String ss = "typeName=" + typeName+ "<ype=" + "" + "&num=" + pwProductQuotation2.getNumber() + "&productNumber=" + +"000"+ "&productId="+pwProductionBill.getCode() + + "&endTime=" + ""; + // 获取生产总图 + try { + HttpUtils.sendGet(generalAssemblyDrawingUrl, ss, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + // 修改合同状态为待生产状态 + pwContract.setContractStatus(3); + pwContractMapper.updatePwContract(pwContract); + return i; + }else{ + //先调用出原始表的接口,然后计算数量,然后再调用出图的接口 + // 时间格式化 + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + for (PwProductQuotation pwProductQuotation2 : quotationList) { + String typeName = pwProductQuotation2.getTypeName(); + PcRigidChain rigidChain = pcRigidChainMapper.selectPcRigidChainByTypeName(typeName); + // 拼接生产总图需要的参数 + String s = "typeName=" + typeName + "<ype=" + rigidChain.getAxialDirection() + "&num=" + "1" + "&productNumber=" + "0000" + "&productId=" + "0000" + "&endTime=" + "2020-10-21"; + + //请求bom表(直接添加到bom1表中) + int addBom = addBom(s,pwProductionBill.getCode(),pwProductQuotation2.getNumber(),typeName); + if(addBom<1){ + return addBom; + } + + //处理序号问题 + addSerial(pwProductionBill.getCode(),typeName); + + // 计算数量(计算完之后把物料添加到bom2和bom3中) + //counterNum(pwProductionBill.getCode(),typeName); + + //查库添加标记 + int j = selectInventoryDetail(pwProductionBill.getCode()); + } + + //添加物料信息和库存信息 + addMaterialAndInventorydetail(pwProductionBill.getCode()); + + //添加标准价和外购件到采购明细表 + addPwPurchaseContractMaterial(pwProductionBill.getCode()); + + //自动添加工序 + addProcessName(pwProductionBill.getCode()); + + //自动生成企标单 TODO 暂时不根据执行单自动生成企标单,企标单会每个小时巡查 +// addMakeDocuments(); + + + // 创建销齿链执行单详情信息 + PwProductionBillProduct pwProductionBillProduct = null; + // 把报价单中的产品添加到执行单中 + Long p = 0L; + for (PwProductQuotation pwProductQuotation2 : quotationList) { + pwProductionBillProduct = new PwProductionBillProduct(); + // 执行单id + pwProductionBillProduct.setProductionBillId(pwProductionBill.getId()); + // 产品名称 + pwProductionBillProduct.setProductName(pwProductQuotation2.getProductName()); + // 产品型号 + pwProductionBillProduct.setProductType(pwProductQuotation2.getTypeName()); + // 数量 + pwProductionBillProduct.setQuantity(pwProductQuotation2.getNumber()); + // 自动补零 + String str = String.format("%03d", p + 1); + if (pwProductQuotation2.getNumber() > 1) { + String ss = String.format("%03d", pwProductQuotation2.getNumber() + p); + // 设备编号 + pwProductionBillProduct.setEquipmentCode(pwProductionBill.getCode() + "/" + str + "-" + ss); + } else { + // 设备编号 + pwProductionBillProduct.setEquipmentCode(pwProductionBill.getCode() + "/" + str); + } + p = pwProductQuotation2.getNumber() + p; + // 完工日期 + Date deliveryTime = pwContract.getDeliveryTime(); + pwProductionBillProduct.setCompleteDate(deliveryTime); + // 包装方式 + pwProductionBillProduct.setPackType(pwQuotation.getModeOfPacking()); + // 删除标记 + pwProductionBillProduct.setDelFlag(0); + //比较所有的型号,如果型号相同且行程与箱体都相同,则拼接成一个串儿获取图纸 + //拼接需要传的型号字段 + String typeNames = ""; + //拼接需要传的轴向字段 + String axialDirections = ""; + //拼接需要传的数量字段 + String quantitys = ""; + String typeName = pwProductQuotation2.getTypeName(); + String substring = typeName.substring(typeName.indexOf("/")+1,typeName.indexOf("-")); + if("L".equals(substring)){ + StringBuilder ss = new StringBuilder(typeName); + ss.replace(typeName.indexOf("/")+1,typeName.indexOf("-"), "R"); + PwProductQuotation pwProductQuotation3 = pwProductQuotationMapper.selectPwProductQuotationByNameAndQuotationId(ss.toString(),Long.valueOf(pwContract.getQuotationId())); + //如果不等于null说明此执行单下的当前型号有右出轴的型号 + if(null!=pwProductQuotation3){ + typeNames = typeName+","+pwProductQuotation3.getTypeName(); + axialDirections = "L"+","+"R"; + quantitys = pwProductQuotation2.getNumber()+","+pwProductQuotation3.getNumber(); + }else{ + typeNames = typeName; + axialDirections = "L"; + quantitys = pwProductQuotation2.getNumber()+""; + } + StringBuilder sss = new StringBuilder(typeName); + sss.replace(typeName.indexOf("/")+1,typeName.indexOf("-"), "R+L"); + PwProductQuotation pwProductQuotation4 = pwProductQuotationMapper.selectPwProductQuotationByNameAndQuotationId(sss.toString(),Long.valueOf(pwContract.getQuotationId())); + if(null!=pwProductQuotation4){ + typeNames = typeNames+","+pwProductQuotation4.getTypeName(); + axialDirections = axialDirections+","+"R+L"; + quantitys = quantitys+","+pwProductQuotation4.getNumber(); + } + }else if("R".equals(substring)){ + StringBuilder ss = new StringBuilder(typeName); + ss.replace(typeName.indexOf("/")+1,typeName.indexOf("-"), "L"); + PwProductQuotation pwProductQuotation3 = pwProductQuotationMapper.selectPwProductQuotationByNameAndQuotationId(ss.toString(),Long.valueOf(pwContract.getQuotationId())); + //如果不等于null说明此执行单下的当前型号有右出轴的型号 + if(null!=pwProductQuotation3){ + typeNames = typeName+","+pwProductQuotation3.getTypeName(); + axialDirections = "R"+","+"L"; + quantitys = pwProductQuotation2.getNumber()+","+pwProductQuotation3.getNumber(); + }else{ + typeNames = typeName; + axialDirections = "R"; + quantitys = pwProductQuotation2.getNumber()+""; + } + StringBuilder sss = new StringBuilder(typeName); + sss.replace(typeName.indexOf("/")+1,typeName.indexOf("-"), "R+L"); + PwProductQuotation pwProductQuotation4 = pwProductQuotationMapper.selectPwProductQuotationByNameAndQuotationId(sss.toString(),Long.valueOf(pwContract.getQuotationId())); + if(null!=pwProductQuotation4){ + typeNames = typeNames+","+pwProductQuotation4.getTypeName(); + axialDirections = axialDirections+","+"R+L"; + quantitys = quantitys+","+pwProductQuotation4.getNumber(); + } + }else if("R+L".equals(substring)){ + StringBuilder ss = new StringBuilder(typeName); + ss.replace(typeName.indexOf("/")+1,typeName.indexOf("-"), "L"); + PwProductQuotation pwProductQuotation3 = pwProductQuotationMapper.selectPwProductQuotationByNameAndQuotationId(ss.toString(),Long.valueOf(pwContract.getQuotationId())); + //如果不等于null说明此执行单下的当前型号有右出轴的型号 + if(null!=pwProductQuotation3){ + typeNames = typeName+","+pwProductQuotation3.getTypeName(); + axialDirections = "R+L"+","+"L"; + quantitys = pwProductQuotation2.getNumber()+","+pwProductQuotation3.getNumber(); + }else{ + typeNames = typeName; + axialDirections = "R+L"; + quantitys = pwProductQuotation2.getNumber()+""; + } + StringBuilder sss = new StringBuilder(typeName); + sss.replace(typeName.indexOf("/")+1,typeName.indexOf("-"), "R"); + PwProductQuotation pwProductQuotation4 = pwProductQuotationMapper.selectPwProductQuotationByNameAndQuotationId(sss.toString(),Long.valueOf(pwContract.getQuotationId())); + if(null!=pwProductQuotation4){ + typeNames = typeNames+","+pwProductQuotation4.getTypeName(); + axialDirections = axialDirections+","+"R"; + quantitys = quantitys+","+pwProductQuotation4.getNumber(); + } + } + String[] split = quantitys.split(","); + Long l = 0L; + for (String string2 : split) { + l = l+Long.valueOf(string2); + } + String strs = String.format("%03d", l); + String equipmentCode = pwProductionBillProduct.getEquipmentCode(); + String substring2 = equipmentCode.substring(0,equipmentCode.length()-3); + if("001".equals(strs)){ + substring2 = equipmentCode+"-001"; + }else{ + substring2 = equipmentCode; + } + + // 拼接生产总图需要的参数 + String s = "typeName=" + typeNames+ "<ype=" + axialDirections + "&num=" + quantitys + "&productNumber=" + +pwProductionBill.getCode()+"/001-"+strs+ "&productId="+pwProductionBill.getCode() + + "&endTime=" + sd.format(pwContract.getDeliveryTime()); + //需即时返回数据,如不能即时返回则需要回调接口或者三方程序操作数据库 + // 获取生产总图 + String sendGet = ""; + try { + sendGet = HttpUtils.sendGet(generalAssemblyDrawingUrl, s, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + } + // 保存生产总图路径 + String replaceAll = pwProductQuotation2.getTypeName().replaceAll("/", "-"); + //总装图 + pwProductionBillProduct.setGeneralAssemblyDrawing(pwProductionBill.getCode()+"/"+replaceAll+".dwg"); + //保存零部件明细文件路径 + pwProductionBillProductMapper.insertPwProductionBillProduct(pwProductionBillProduct); + } + + // 修改合同状态为待生产状态 + pwContract.setContractStatus(3); + pwContractMapper.updatePwContract(pwContract); + return i; + } + } + } + + + /** + * 修改生产执行单 + * + * @param pwProductionBill + * 生产执行单 + * @return 结果 + */ + @Override + public int updatePwProductionBill(PwProductionBill pwProductionBill) { + return pwProductionBillMapper.updatePwProductionBill(pwProductionBill); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int deletePwProductionBillByIds(Long[] ids) { + + int i = 0; + //根据id查询生产执行单 + for (Long long1 : ids) { + PwProductionBill pwProductionBill = pwProductionBillMapper.selectPwProductionBillById(long1); + //删除执行单明细(根据执行单id) + pwProductionBillProductMapper.deletePwProductionBillProductByProductionBillId(long1); + //删除执行单 + i = pwProductionBillMapper.deletePwProductionBillById(long1); + //根据生产令号删除当前令号下的bom表 + String code = pwProductionBill.getCode(); + //获取当前令号下的所有零部件,更新库存表的锁定数量和可用数量 + List list = pwBomNumberTwoService.selectPwBomNumberTwoByProductionCodeALL(code); + //遍历集合,根据名称和图号查询库存信息,减少锁定数量,重新计算可用数量 TODO 有安全库存标记和有库存标记的,不做在途减数 + for (PwBomNumberTwo pwBomNumberTwo : list) { + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + //更新锁定数量 + if(inventoryDetail.getLockNumber()-pwBomNumberTwo.getSumNumber()<0){ + inventoryDetail.setLockNumber(0L); + }else{ + inventoryDetail.setLockNumber(inventoryDetail.getLockNumber()-pwBomNumberTwo.getSumNumber()); + } + if(inventoryDetail.getQuantity()>=inventoryDetail.getLockNumber()){ + //更新可用数量 + inventoryDetail.setAvailableNumber(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()); + }else{ + inventoryDetail.setAvailableNumber(0L); + } + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + } + //更新采购明细表 + PwPurchaseContractMaterial pwPurchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByNameAndFigureNumberAndPurchaseContractNotNull(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=pwPurchaseContractMaterial){ + //判断点件表的数量是否大于需采购数量(如果大于或等于则直接把采购明细表的本条数据删除) + if(pwPurchaseContractMaterial.getAmount()-pwBomNumberTwo.getSumNumber()==0||pwPurchaseContractMaterial.getAmount()-pwBomNumberTwo.getSumNumber()<0){ + //删除此条数据 + pwPurchaseContractMaterialMapper.deletePwPurchaseContractMaterialById(pwPurchaseContractMaterial.getId()); + }else{ + //更新需采购数量 + pwPurchaseContractMaterial.setAmount(pwPurchaseContractMaterial.getAmount()-pwBomNumberTwo.getSumNumber()); + pwPurchaseContractMaterialMapper.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + } + } + } + //删除原始表数据 + pwBomNumberService.deletePwBomNumberByCode(code); + //删除计算后的表数据 + pwBomNumberTwoService.deletePwBomNumberTwoByCode(code); + //删除领料专用bom表数据 + pwBomNumberTwoLingliaoService.deletePwBomNumberTwoLingliaoByCode(code); + + //删除服务器上的图纸 + File file = new File("D:/evoEngine/static/product/"+code); + deleteFile(file); + } + return i; + } + + private static void deleteFile(File file){ + + if (file.exists()) { //测试文件或目录是否存在,存在进入下一步 + if (file.isFile()) { //判断file 是不是文件,如果是直接删除 + file.delete(); + }else{ //如果不是,则一定是文件夹 + File[] files = file.listFiles(); //获取文件夹下的file对象列表 + if (files.length==0) { //判断此文件夹下有没有文件或目录 + file.delete(); //没有的话,直接删除此路径,有的话,遍历此路径,重复以上动作 + }else{ + for (File file1 : files) { + deleteFile(file1); + } + file.delete(); //文件夹下所有文件和目录均被清空,删除本文件夹 + } + } + + }else{ + System.out.println("文件或目录不存在"); + } + } + + /** + * 删除生产执行单信息 + * + * @param id + * 生产执行单ID + * @return 结果 + */ + @Override + public int deletePwProductionBillById(Long id) { + return pwProductionBillMapper.deletePwProductionBillById(id); + } + + /** + * 根据生产令号查询生产执行信息 + * + * @param productionCode + */ + @Override + public PwProductionBill selectPwProductionBillByProductionCode(String productionCode) { + PwProductionBill productionBill = pwProductionBillMapper.selectPwProductionBillByProductionCode(productionCode); + return productionBill; + } + + /** + * 查库 + */ + public int selectInventoryDetail(String code){ + int i = 0; + //根据令号查询所有bom,执行物料查库添加有无库存标记 + List list3 = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndAll(code); + for (PwBomNumberTwo pwBomNumberTwo : list3) { + //根据图号查询库存数量够不够,如果够就添加有库存标记' + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=inventoryDetail){ + //根据名称和图号查询物料信息 + ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + //查询实际库存(库存-预定>=本批数量)设置为有库存 + if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>=pwBomNumberTwo.getSumNumber()){ + pwBomNumberTwo.setSparedTwo("有库存"); + }else{ + if(null != material&&material.getMinimum() != 0&&material.getHighest() != 0){ + pwBomNumberTwo.setSparedTwo("安全库存"); + } + } + } + if(null!=pwBomNumberTwo.getSparedTwo()&&!"".equals(pwBomNumberTwo.getSparedTwo())){ + i = pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + } + } + return i; + } + + + /** + * 直接添加生产执行单 + */ + @Override + public int insertPwProductionBillWF(PwProductionBill pwProductionBill) { + // 发单日期默认为当前日期 + pwProductionBill.setBillDate(new Date()); + // 审核状态默认为未审核 + pwProductionBill.setStatusId((long) 1); + // 删除标记默认为未删除 + pwProductionBill.setDelFlag(0); + return pwProductionBillMapper.insertPwProductionBill(pwProductionBill); + } + + /** + * 拼接参数 s + * 执行单令号 code + * 产品数量 number + * 产品型号 typeName + */ + public int addBom (String s, String code, Long number, String typeName) throws Exception{ + // 获取生产总图 + String sendGet = HttpUtils.sendGet("http://localhost:8900/product/product_mesh_list", s, "UTF-8"); + // json串转对象 + JSONObject rcm = JSONObject.parseObject(sendGet); + JSONObject result = JSONObject.parseObject(rcm.get("result").toString()); + // 保存零部件明细信息 + List> allRows = new ArrayList>(); + InputStream is = null; + Workbook wb = null; + try { + URL url = new URL(result.get("form").toString()); + URLConnection conn = url.openConnection(); + conn.setConnectTimeout(3000); + conn.setReadTimeout(3 * 60 * 1000); + is = conn.getInputStream(); + wb = WorkbookFactory.create(is); + Sheet sheet = wb.getSheetAt(0); + allRows = ExcelUtil.readExcel2007(sheet); + } catch (Exception e) { + throw new IOException(e); + } finally { + if (is != null) { + is.close(); + } + } + List list = new ArrayList<>(); + for (int y = 2; y < allRows.size(); y++) { + PwBomNumber bom = new PwBomNumber(); + for (int j = 0; j < allRows.get(y).size(); j++) { + //令号 + bom.setProductionCode(code); + if(null!=allRows.get(y).get(2).toString()){ + Boolean b = type(allRows.get(y).get(2).toString().trim().replaceAll(" ","")); + //如果b返回的是true说明是整数,否是是小数,除整数需要处理成整数外,其他的都不做处理 + if(b){ + bom.setName(Double.valueOf(allRows.get(y).get(2).toString().trim().replaceAll(" ","")).longValue()+""); + }else{ + //名称 + bom.setName(allRows.get(y).get(2).toString().trim().replaceAll(" ","")); + } + }else{ + bom.setName(allRows.get(y).get(2).toString()); + } + if(null!=allRows.get(y).get(1).toString()&&!"".equals(allRows.get(y).get(1).toString())){ + String substring = allRows.get(y).get(1).toString().substring(0, 3); + String substring10 = allRows.get(y).get(1).toString().substring(0, 2); + if("009".equals(substring) || "017".equals(substring) || " ".equals(substring10)){ + String replaceAll = allRows.get(y).get(1).toString().replaceAll(" ", ""); + replaceAll = " "+replaceAll; + String replaceAll2 = replaceAll.replaceAll("x", "X"); + //图号 + bom.setFigureNumber(replaceAll2); + }else{ + if(allRows.get(y).get(1).toString().contains("/2-1")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","").replaceAll("/2-1", "")); + }else if(allRows.get(y).get(1).toString().contains("/2-2")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","").replaceAll("/2-2", "")); + }else if(allRows.get(y).get(1).toString().contains("/3-1")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","").replaceAll("/3-1", "")); + }else if(allRows.get(y).get(1).toString().contains("/3-2")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","").replaceAll("/3-2", "")); + }else if(allRows.get(y).get(1).toString().contains("/3-3")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","").replaceAll("/3-3", "")); + }else{ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll(" ","")); + } + } + }else{ + bom.setFigureNumber(allRows.get(y).get(1).toString()); + } + //单台数量 + if (null != allRows.get(y).get(3).toString() && !"".equals(allRows.get(y).get(3).toString())) { + bom.setOneNumber(Double.valueOf(allRows.get(y).get(3).toString()).longValue()); + } + Boolean b = type(allRows.get(y).get(4).toString().trim().replaceAll(" ","")); + if(b){ + bom.setType(Double.valueOf(allRows.get(y).get(4).toString().trim().replaceAll(" ","")).longValue()+""); + }else{ + //材料 + bom.setType(allRows.get(y).get(4).toString()); + } + //单重 + if (null != allRows.get(y).get(5).toString() && !"".equals(allRows.get(y).get(5).toString())) { + bom.setPieceWeight(Double.valueOf(allRows.get(y).get(5).toString())); + } + if("-9.0".equals(allRows.get(y).get(9).toString())){ + bom.setSumNumber(number); + bom.setNum("0"); + } + //父级名称 + bom.setParentLevelName((allRows.get(y).get(8).toString())); + //备注 + bom.setRemarks(allRows.get(y).get(7).toString()); + //父级图号 + if("-9.0".equals(allRows.get(y).get(9).toString())){ +// bom.setParentLevelFigureNumber(null); + }else{ + if(allRows.get(y).get(9).toString().contains("/2-1")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","").replaceAll("/2-1", "")); + }else if(allRows.get(y).get(9).toString().contains("/2-2")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","").replaceAll("/2-2", "")); + }else if(allRows.get(y).get(9).toString().contains("/3-1")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","").replaceAll("/3-1", "")); + }else if(allRows.get(y).get(9).toString().contains("/3-2")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","").replaceAll("/3-2", "")); + }else if(allRows.get(y).get(9).toString().contains("/3-3")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","").replaceAll("/3-3", "")); + }else{ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll(" ","")); + } + } + //型号 + bom.setTypeName(typeName); + break; + } + // 保存到list,然后批量添加 + list.add(bom); + //计算数量保存到bomNumber表中,然后通知python出图 + } + int i2 = pwBomNumberService.insertPwBoms(list); + return i2; + } + + /** + * 处理序号问题 + * @param typeName + * @param code + */ + public void addSerial(String code, String typeName) { + // TODO Auto-generated method stub + //根据令号和型号查询出所有的物料信息 + List list3 = pwBomNumberService.selectPwBomNumberByCodeAndTypeName(code,typeName); + for (PwBomNumber pwBomNumber : list3) { + if(null!=pwBomNumber.getNum()){ + //查询其下一级 + List list2 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber.getFigureNumber(), typeName, code); + int o = 0; + for (PwBomNumber pwBomNumber2 : list2) { + if(pwBomNumber2.getNum()==null){ + pwBomNumber2.setNum(o+1+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber2); + } + o++; + //查询其下一级 + List list4 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber2.getFigureNumber(), typeName, code); + int a = 0; + for (PwBomNumber pwBomNumber3 : list4) { + if(pwBomNumber3.getNum()==null){ + pwBomNumber3.setNum(pwBomNumber2.getNum()+"."+(a+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber3); + } + a++; + //查询其下一级 + List list5 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber3.getFigureNumber(), typeName, code); + int f = 0; + for (PwBomNumber pwBomNumber4 : list5) { + if(pwBomNumber4.getNum()==null){ + pwBomNumber4.setNum(pwBomNumber3.getNum()+"."+(f+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber4); + } + f++; + //查询其下一级 + List list6 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber4.getFigureNumber(), typeName, code); + int w = 0; + for (PwBomNumber pwBomNumber5 : list6) { + if(pwBomNumber5.getNum()==null){ + pwBomNumber5.setNum(pwBomNumber4.getNum()+"."+(w+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber5); + } + f++; + //查询其下一级 + List list7 = pwBomNumberService.selectPwBomNumberByParentLevelFigureNumber(pwBomNumber5.getFigureNumber(), typeName, code); + int r = 0; + for (PwBomNumber pwBomNumber6 : list7) { + if(pwBomNumber6.getNum()==null){ + pwBomNumber6.setNum(pwBomNumber5.getNum()+"."+(r+1)+""); + pwBomNumberService.updatePwBomNumber(pwBomNumber6); + } + r++; + } + } + } + } + } + } + } + } + + /** + * 把bom表中的物料信息添加到物料表和库存信息表 + * 参数:执行单令号 + * + */ + public void addMaterialAndInventorydetail(String code){ + //根据令号查询当前令号下所有的零部件,加入到物料信息表和库存信息表中 + List list2 = pwBomNumberTwoService.selectPwBomNumberTwoByProductionCode(code); + + for (PwBomNumberTwo pwBomNumberTwo : list2) { + //判断是否已经添加了此物料 + ImMaterial imMaterial2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=imMaterial2){ + //根据名称和图号获取库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(imMaterial2.getMaterialName(), imMaterial2.getFigureNumber()); + //修改库存信息的材料 + if(null == inventoryDetail){ + inventoryDetail = new PwInventoryDetail(); + //名称 + inventoryDetail.setName(pwBomNumberTwo.getName()); + //图号 + inventoryDetail.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + inventoryDetail.setMaterials(pwBomNumberTwo.getType()); + //单重 + inventoryDetail.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + if(pwBomNumberTwo.getFigureNumber().length() > 3){ + //物料类型 + if("009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || "017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || " ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2))){ + inventoryDetail.setType("标准件"); + inventoryDetail.setWarehouseName("标准件库"); + }else if(pwBomNumberTwo.getRemarks().contains("外购件")){ + inventoryDetail.setType("外购件"); + }else if(pwBomNumberTwo.getRemarks().contains("甲供件")){ + inventoryDetail.setType("甲供件"); + }else if(null==pwBomNumberTwo.getParentLevelFigureNumber()){ + inventoryDetail.setType("成品"); + inventoryDetail.setWarehouseName("成品库"); + }else{ + inventoryDetail.setType("自制件"); + inventoryDetail.setWarehouseName("零件成品库"); + } + }else{ + if(pwBomNumberTwo.getRemarks().contains("外购件")){ + inventoryDetail.setType("外购件"); + }else if(pwBomNumberTwo.getRemarks().contains("甲供件")){ + inventoryDetail.setType("甲供件"); + }else if(null==pwBomNumberTwo.getParentLevelFigureNumber()){ + inventoryDetail.setType("成品"); + inventoryDetail.setWarehouseName("成品库"); + }else{ + inventoryDetail.setType("自制件"); + inventoryDetail.setWarehouseName("零件成品库"); + } + } + inventoryDetail.setMinimum(0l); + inventoryDetail.setHighest(0l); + //删除标记 + inventoryDetail.setDelFlag(0); + //添加库存信息 + pwInventoryDetailMapper.insertPwInventoryDetail(inventoryDetail); + }else{ + //更新库存信息 + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + } + }else{ + //创建物料对象 + ImMaterial imMaterial = new ImMaterial(); + //名称 + imMaterial.setMaterialName(pwBomNumberTwo.getName()); + //图号 + imMaterial.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + imMaterial.setMaterials(pwBomNumberTwo.getType()); + //单重 + imMaterial.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + if(pwBomNumberTwo.getFigureNumber().length() > 3){ + //物料类型 + if("009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || "017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || " ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2))){ + imMaterial.setMaterialTypeName("标准件"); + imMaterial.setWarehouseName("标准件库"); + }else if(pwBomNumberTwo.getRemarks().contains("外购件")){ + imMaterial.setMaterialTypeName("外购件"); + }else if(pwBomNumberTwo.getRemarks().contains("甲供件")){ + imMaterial.setMaterialTypeName("甲供件"); + }else if(null==pwBomNumberTwo.getParentLevelFigureNumber()){ + imMaterial.setMaterialTypeName("成品"); + imMaterial.setWarehouseName("成品库"); + }else{ + imMaterial.setMaterialTypeName("自制件"); + imMaterial.setWarehouseName("零件成品库"); + } + }else{ + if(pwBomNumberTwo.getRemarks().contains("外购件")){ + imMaterial.setMaterialTypeName("外购件"); + }else if(pwBomNumberTwo.getRemarks().contains("甲供件")){ + imMaterial.setMaterialTypeName("甲供件"); + }else if(null==pwBomNumberTwo.getParentLevelFigureNumber()){ + imMaterial.setMaterialTypeName("成品"); + imMaterial.setWarehouseName("成品库"); + }else{ + imMaterial.setMaterialTypeName("自制件"); + imMaterial.setWarehouseName("零件成品库"); + } + } + imMaterial.setMinimum(0l); + imMaterial.setUnitPrice(new BigDecimal(0.00)); + imMaterial.setHighest(0l); + //删除标记 + imMaterial.setDelFlag(0); + + //添加物料信息 + imMaterialMapper.insertImMaterial(imMaterial); + //根据名称和图号获取库存信息 + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(imMaterial.getMaterialName(), imMaterial.getFigureNumber()); + //修改库存信息的材料 + if(null == inventoryDetail){ + //创建库存对象 + PwInventoryDetail pid = new PwInventoryDetail(); + //名称 + pid.setName(pwBomNumberTwo.getName()); + //图号 + pid.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + pid.setMaterials(pwBomNumberTwo.getType()); + //单重 + pid.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + if(pwBomNumberTwo.getFigureNumber().length() > 3){ + //物料类型 + if("009".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || "017".equals(pwBomNumberTwo.getFigureNumber().substring(0,3)) || " ".equals(pwBomNumberTwo.getFigureNumber().substring(0,2))){ + pid.setType("标准件"); + pid.setWarehouseName("标准件库"); + }else if(pwBomNumberTwo.getRemarks().contains("外购件")){ + pid.setType("外购件"); + }else if(pwBomNumberTwo.getRemarks().contains("甲供件")){ + pid.setType("甲供件"); + }else if(null==pwBomNumberTwo.getParentLevelFigureNumber()){ + pid.setType("成品"); + pid.setWarehouseName("成品库"); + }else{ + pid.setType("自制件"); + pid.setWarehouseName("零件成品库"); + } + }else{ + if(pwBomNumberTwo.getRemarks().contains("外购件")){ + pid.setType("外购件"); + }else if(pwBomNumberTwo.getRemarks().contains("甲供件")){ + pid.setType("甲供件"); + }else if(null==pwBomNumberTwo.getParentLevelFigureNumber()){ + pid.setType("成品"); + pid.setWarehouseName("成品库"); + }else{ + pid.setType("自制件"); + pid.setWarehouseName("零件成品库"); + } + } + //删除标记 + pid.setDelFlag(0); + //添加库存信息 + pwInventoryDetailMapper.insertPwInventoryDetail(pid); + } + } + } + } + + public void addPwPurchaseContractMaterial(String code){ + + PwProductionBill productionBill = pwProductionBillMapper.selectPwProductionBillByProductionCode(code); + + //根据生产订单编号查询生产订单信息 + PwProductionOrder productionOrder = pwProductionOrderService.selectPwProductionOrderByCode(productionBill.getContractCode()); + //查询合同信息 + PwContract contract = pwContractMapper.selectByContractCode(productionOrder.getSparedOne()); + + //根据令号查询所有的以空格开头的零部件(空格开头的默认为标准件或外购件) + List list = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndIsSpacing(code); + for (PwBomNumberTwo pwBomNumberTwo : list) { + //判断是否已经添加了此物料 + ImMaterial imMaterial2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + //遍历此集合,根据图号和名称去库存表里查询,判断其是否有安全库存(如果有,则判断) + if(null!=imMaterial2){ + PwInventoryDetail inventoryDetail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(!"有库存".equals(pwBomNumberTwo.getSparedTwo())&&!"安全库存".equals(pwBomNumberTwo.getSparedTwo())){ + //添加采购单 + //创建采购明细 + PwPurchaseContractMaterial pcm = new PwPurchaseContractMaterial(); + pcm.setCreateTime(DateUtils.getNowDate()); + //执行单code + pcm.setCode(code); + //物料名称 + pcm.setMaterialName(pwBomNumberTwo.getName()); + //图号 + pcm.setFigureNumber(pwBomNumberTwo.getFigureNumber()); + //材料 + pcm.setMaterials(pwBomNumberTwo.getType()); + //含税单价 + pcm.setUnivalence(imMaterial2.getUnitPrice().doubleValue()); + +// if(pwBomNumberTwo.getSumNumber()-inventoryDetail.getQuantity()<=0){ +// //采购数量 +// pcm.setAmount(pwBomNumberTwo.getSumNumber()); +// }else{ +// //采购数量 = 本批数量-(库存+在途-预定) +// pcm.setAmount(pwBomNumberTwo.getSumNumber()-(inventoryDetail.getQuantity()+inventoryDetail.getPreliminaryInventory()-inventoryDetail.getLockNumber())); +// } + //采购数量 + //1、判断其他项目用完之后还会有库存 + /*if(inventoryDetail.getQuantity()-inventoryDetail.getLockNumber()>0){ + //采购数量 = 本批数量-(库存+在途-预定) + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + }else{ + //采购数量 + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + }*/ + pcm.setAmount(pwBomNumberTwo.getSumNumber()); + + //总价 + pcm.setTotalPrices(imMaterial2.getUnitPrice().doubleValue()*pcm.getAmount()); + //入库状态默认为未入库 + pcm.setInventoryStatus("未入库"); + + //记录采购数量的由来 + pcm.setQuantity(inventoryDetail.getQuantity()); + pcm.setPreliminaryInventory(inventoryDetail.getPreliminaryInventory()); + pcm.setLockNumber(inventoryDetail.getLockNumber()); + + //根据合同完成时间推算采购完成时间 + Date deliveryTime = contract.getDeliveryTime(); + + //获取当前时间,获取发货时间,对比这两个日期相差的天数,除以2(发货时间的百分之50)为采购时间 + int days = differentDays(new Date(),deliveryTime); + if(days%2 == 0){ + //采购完成时间 + int s = days/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + }else{ + //如果为单数时,减少一天再计算 + int s = (days-1)/2; + Calendar ca = Calendar.getInstance(); + ca.setTime(new Date()); + ca.add(Calendar.DATE, s);// s为增加的天数,可以改变的 + Date d = ca.getTime(); + pcm.setCompleteDate(d); + } + + pwBomNumberTwo.setCompletionDate(pcm.getCompleteDate()); + + pwBomNumberTwoService.updatePwBomNumberTwo(pwBomNumberTwo); + //重新更新在途数量 + inventoryDetail.setPreliminaryInventory(pcm.getAmount()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail); + + //根据名称和图号查询采购明细表采购合同id为null的数据(如果查询结果不为null,则说明有相同数据,直接累加其数量) + PwPurchaseContractMaterial pwPurchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByNameAndFigureNumberAndPurchaseContractNotNull(pwBomNumberTwo.getProductionCode(),pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + if(null!=pwPurchaseContractMaterial){ + //说明有此条数据,直接合并数量 + pwPurchaseContractMaterial.setAmount(pwPurchaseContractMaterial.getAmount()+pcm.getAmount()); + pwPurchaseContractMaterialMapper.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + }else{ + pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pcm); + } + } + } + } + } + + /** + * 自动添加工序 + * 执行单code + */ + public void addProcessName(String code) { + //自动添加工序 TODO 判断当前物料是否有安全库存设置,如果有安全库存设置则不在点件表中添加工序,反之则添加工序 + //查询当前令号下所有的物料(不包含标准件和数量为0的数据,遍历此集合查询物料工序表,如果查询到则添加到bomtwo中) + List list6 = pwBomNumberTwoService.selectPwBomNumberTwoByCode(code); + for (PwBomNumberTwo pwBomNumberTwo : list6) { + //添加之前先去物料表和库存表查询有没有此物料 + ImMaterial materials = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo.getName(), pwBomNumberTwo.getFigureNumber()); + if(null!=materials&&materials.getMinimum()>0&&materials.getHighest()>0){ + + }else{ + if(!"有库存".equals(pwBomNumberTwo.getSparedTwo())){ + List list3 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pwBomNumberTwo.getName(),pwBomNumberTwo.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess : list3) { + //创建新对象 + PwBomNumberTwo pwBomNumberTwo2 = new PwBomNumberTwo(); + //令号 + pwBomNumberTwo2.setProductionCode(pwBomNumberTwo.getProductionCode()); + //序号 + pwBomNumberTwo2.setNum(pwBomNumberTwo.getNum()); + //图号 + pwBomNumberTwo2.setFigureNumber(pwBomNumberTwo.getFigureNumber()+"-"+pwMaterialProcess.getSerialNumber()); + //物料名称 + pwBomNumberTwo2.setName(pwBomNumberTwo.getName()+"-"+pwMaterialProcess.getProcess()+"(M)"); + //单台数量 + pwBomNumberTwo2.setOneNumber(pwBomNumberTwo.getOneNumber()); + //材料 + pwBomNumberTwo2.setType(pwBomNumberTwo.getType()); + //单重 + pwBomNumberTwo2.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + //父级图号 + pwBomNumberTwo2.setParentLevelFigureNumber(pwBomNumberTwo.getFigureNumber()); + //父级名称 + pwBomNumberTwo2.setParentLevelName(pwBomNumberTwo.getName()); + //本批数量 + pwBomNumberTwo2.setSumNumber(pwBomNumberTwo.getSumNumber()); + //是否入库 + pwBomNumberTwo2.setGodownEntry(pwMaterialProcess.getStorage()); + //所属型号 + pwBomNumberTwo2.setSparedOne(pwBomNumberTwo.getSparedOne()); + //上级id + pwBomNumberTwo2.setSuperiorId(pwBomNumberTwo.getId()); + //序名称 + pwBomNumberTwo2.setProcessName(pwMaterialProcess.getName()); + //备注 + pwBomNumberTwo2.setRemarks(pwBomNumberTwo.getRemarks()); + //派工部门 + pwBomNumberTwo2.setDepartmentName(pwMaterialProcess.getDispatchingDept()); + //删除标记 + pwBomNumberTwo2.setDelFlag(0); + + //判断是否有原材料信息 + if(null!=pwMaterialProcess.getMaterialsId()){ + //原材料id + pwBomNumberTwo2.setMaterialId(pwMaterialProcess.getMaterialsId()); + //材料名称 + pwBomNumberTwo2.setMaterialsName(pwMaterialProcess.getMaterialsName()); + //材料规格 + pwBomNumberTwo2.setMaterialsSpecification(pwMaterialProcess.getMaterialsSpecification()); + if(null!=pwMaterialProcess.getLen()){ + //下料长度 + pwBomNumberTwo2.setLen(pwMaterialProcess.getLen().longValue()); + } + if(null!=pwMaterialProcess.getWid()){ + //下料宽度 + pwBomNumberTwo2.setWid(pwMaterialProcess.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess.getSerialNumber()==1){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess.getWorkblank()&&pwMaterialProcess.getWorkblank()!=0){ + if(pwBomNumberTwo2.getSumNumber()%pwMaterialProcess.getWorkblank()!=0){ + pwBomNumberTwo2.setWorkblank((pwBomNumberTwo2.getSumNumber()/pwMaterialProcess.getWorkblank())+1); + }else{ + pwBomNumberTwo2.setWorkblank(pwBomNumberTwo2.getSumNumber()/pwMaterialProcess.getWorkblank()); + } + }else{ + pwBomNumberTwo2.setWorkblank(pwBomNumberTwo2.getSumNumber()); + } + //成品数量(本批数量) + pwBomNumberTwo2.setFinished(pwBomNumberTwo2.getSumNumber()); + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess.getLen()&&pwMaterialProcess.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess.getWid()&&pwMaterialProcess.getWid()!=0){ + pwBomNumberTwo2.setMeasure((pwMaterialProcess.getLen().longValue()*pwMaterialProcess.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwBomNumberTwo2.setSpecification(pwMaterialProcess.getLen().longValue()+"*"+pwMaterialProcess.getWid().longValue()); + }else{ + pwBomNumberTwo2.setMeasure(pwMaterialProcess.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwBomNumberTwo2.setSpecification(pwMaterialProcess.getLen().longValue()+""); + } + } + if(pwBomNumberTwo2.getWorkblank()>0){ + + } + //领料数量 + pwBomNumberTwo2.setReceiveNumber(pwBomNumberTwo2.getWorkblank()*Long.valueOf(pwBomNumberTwo2.getMeasure())); + } + } + + //序描述 + pwBomNumberTwo2.setXuDescribe(pwMaterialProcess.getSparedOne()); + pwBomNumberTwoService.insertPwBomNumberTwo(pwBomNumberTwo2); + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + if(null == material){ + //添加物料信息 + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwBomNumberTwo2.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwBomNumberTwo2.getFigureNumber()); + imMaterialMapper.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo2.getName(), pwBomNumberTwo2.getFigureNumber()); + if(null == detail){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwBomNumberTwo2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwBomNumberTwo2.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + + //查询原材料是否有安全库存 + ImMaterial material2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwBomNumberTwo2.getMaterialsName(), pwBomNumberTwo2.getMaterialsSpecification()); + if(null!=material2){ + //查询库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwBomNumberTwo2.getMaterialsName(), pwBomNumberTwo2.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 + if(material2.getMinimum()!=0&&material2.getHighest()!=0){ + //锁定库存数量 + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwBomNumberTwo2.getWorkblank()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); + //计算安全库存是否触发 + if(inventoryDetail2.getQuantity()-inventoryDetail2.getLockNumber()<=material2.getMinimum()){ + //生成企标单 + //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + //令号 +// pdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd.setName(material2.getMaterialName()); + //图号 + pdd.setFigureNumber(material2.getFigureNumber()); + //材料 + pdd.setMaterialType(material2.getMaterials()); + //数量(最高库存数量-(库存数量+在途数量-本批数量)) + pdd.setQuantity(material2.getHighest()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd); + + //判断此物料是否在零部件关联表中配置,如果配置了,则把部件的子零件全部加入到库存制作单中 + List lists = pwModulePartService.selectPwModulePartByMaterialId(material2.getId()); + for (PwModulePart pwModulePart : lists) { + //根据零件id查询零件信息 + ImMaterial materialTwo = imMaterialMapper.selectImMaterialById(pwModulePart.getPartId()); + + PwMakeDocumentsDetail pdd2 = new PwMakeDocumentsDetail(); + //名称 + pdd2.setName(pwModulePart.getName()); + //图号 + pdd2.setFigureNumber(pwModulePart.getSpecification()); + //材料 + pdd2.setMaterialType(materialTwo.getMaterials()); + //数量(部件的安全库存*零部件的配比) + pdd2.setQuantity(pdd.getQuantity()*pwModulePart.getNumber()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd2); + + PwInventoryDetail inventoryDetailTwo = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndTypeName(materialTwo.getMaterialName(), materialTwo.getFigureNumber()); + inventoryDetailTwo.setPreliminaryInventory(pdd2.getQuantity()); + //更新库存信息 + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetailTwo); + } + + //自动添加工序 + List list5 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pdd.getName(),pdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess2 : list5) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail3 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail3.setMakeDocumentsCode(pdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail3.setFigureNumber(pdd.getFigureNumber()+"-"+pwMaterialProcess2.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail3.setName(pdd.getName()+"-"+pwMaterialProcess2.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail3.setMaterialType(pdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail3.setQuantity(pdd.getQuantity()); + //上级id + pwMakeDocumentsDetail3.setSuperiorId(pdd.getId()); + //上级名称 + pwMakeDocumentsDetail3.setParentLevelName(pdd.getName()); + //上级图号 + pwMakeDocumentsDetail3.setParentLevelFigureNumber(pdd.getFigureNumber()); + //派工部门 + pwMakeDocumentsDetail3.setDepartmentName(pwMaterialProcess2.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail3.setGodownEntry(pwMaterialProcess2.getStorage()); + //原材料id + pwMakeDocumentsDetail3.setMaterialId(pwMaterialProcess2.getMaterialsId()); + //材料名称 + pwMakeDocumentsDetail3.setMaterialsName(pwMaterialProcess2.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail3.setMaterialsSpecification(pwMaterialProcess2.getMaterialsSpecification()); + if(null!=pwMaterialProcess2.getLen()){ + //下料长度 + pwMakeDocumentsDetail3.setLen(pwMaterialProcess2.getLen().longValue()); + } + if(null!=pwMaterialProcess2.getWid()){ + //下料宽度 + pwMakeDocumentsDetail3.setWid(pwMaterialProcess2.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess2.getSerialNumber()==1){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess2.getWorkblank()&&pwMaterialProcess2.getWorkblank()!=0){ + if(pwMakeDocumentsDetail3.getQuantity()%pwMaterialProcess2.getWorkblank()!=0){ + pwMakeDocumentsDetail3.setWorkblank((pwMakeDocumentsDetail3.getQuantity()/pwMaterialProcess2.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail3.setWorkblank(pwMakeDocumentsDetail3.getQuantity()/pwMaterialProcess2.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail3.setWorkblank(pwMakeDocumentsDetail3.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail3.setFinished(pwMakeDocumentsDetail3.getQuantity()); + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess2.getLen()&&pwMaterialProcess2.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess2.getWid()&&pwMaterialProcess2.getWid()!=0){ + pwMakeDocumentsDetail3.setMeasure((pwMaterialProcess2.getLen().longValue()*pwMaterialProcess2.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail3.setSpecification(pwMaterialProcess2.getLen().longValue()+"*"+pwMaterialProcess2.getWid().longValue()); + }else{ + pwMakeDocumentsDetail3.setMeasure(pwMaterialProcess2.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail3.setSpecification(pwMaterialProcess2.getLen().longValue()+""); + } + } + if(null==pwMakeDocumentsDetail3.getMeasure()){ + //领料数量 + pwMakeDocumentsDetail3.setReceiveNumber(pwMakeDocumentsDetail3.getWorkblank()); + }else{ + //领料数量 + pwMakeDocumentsDetail3.setReceiveNumber(pwMakeDocumentsDetail3.getWorkblank()*Long.valueOf(pwMakeDocumentsDetail3.getMeasure())); + } + } + //序描述 + pwMakeDocumentsDetail3.setXuDescribe(pwMaterialProcess2.getSparedOne()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail3); + + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material3 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail3.getName(), pwMakeDocumentsDetail3.getFigureNumber()); + if(null == material3){ + //添加物料信息 + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail3.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail3.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialMapper.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail3.getName(), pwMakeDocumentsDetail3.getFigureNumber()); + if(null == detail2){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail3.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail3.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + } + //添加在途数量 + inventoryDetail2.setPreliminaryInventory(pdd.getQuantity()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); + } + } + } + } + } + } + } + } + } + + + /** + * 自动出企标单 + * + */ + private void addMakeDocuments() { + //查询预制单详情表没有预制单号的数据 + List list3 = pwMakeDocumentsDetailMapper.selectByMakeDocumentsCodeIsNull(); + //编号 + String str = ""; + //型号 + String str2 = ""; + //获取当前年份 + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + String ss = year+""; + //年份 + String substring2 = ss.substring(2); + + //每颗物料生成一个企标单 + for (PwMakeDocumentsDetail pwMakeDocumentsDetail : list3) { + PwMakeDocuments pwMakeDocuments = new PwMakeDocuments(); + + //遍历其图号 + String figureNumber = pwMakeDocumentsDetail.getFigureNumber(); + //判断图号中是否包函点 + + if(figureNumber.contains(".")){ + //截取图号第一个点之前的字符,用于区分图纸类型 + str2 = figureNumber.substring(0, figureNumber.indexOf(".")); + } + //获取预制单的最后一条数据 + PwMakeDocuments documents = pwMakeDocumentsMapper.selectList(); + String code = documents.getCode(); + String substring = code.substring(code.length()-7,code.length()-3); + Integer valueOf = Integer.valueOf(substring); + valueOf = valueOf+1; + str = String.format("%04d", valueOf); + //code + pwMakeDocuments.setCode("QB-XCL"+str2+"-"+str+"-"+substring2); + + //单据名称 + pwMakeDocuments.setName(str2+"预制清单"); + //日期 + pwMakeDocuments.setDate(new Date()); + //出单人 + pwMakeDocuments.setPrepared("系统出单"); + //是否审批(初始为未审批) + pwMakeDocuments.setPass(0); + //入库状态 + pwMakeDocuments.setStatus("未入库"); + //判断图纸类型是否是XCL开头 + if("XCL".equals(str2)){ + //图纸类型(如果是XCL开头的类型,则图纸型号为通用图纸,通用图纸暂时还没有整理好) TODO + pwMakeDocuments.setSparedOne("XCL"); + }else if(figureNumber.contains("(M)")||(null!=pwMakeDocumentsDetail.getMaterialType()&&pwMakeDocumentsDetail.getMaterialType().equals("组件"))||(null!=pwMakeDocumentsDetail.getMaterialType()&&pwMakeDocumentsDetail.getMaterialType().equals("部件"))){ + //图纸类型 + pwMakeDocuments.setSparedOne(str2+"组件"); + }else{ + //图纸类型 + pwMakeDocuments.setSparedOne(str2); + } + pwMakeDocumentsMapper.insertPwMakeDocuments(pwMakeDocuments); + + pwMakeDocumentsDetail.setMakeDocumentsCode(pwMakeDocuments.getCode()); + pwMakeDocumentsDetailMapper.updatePwMakeDocumentsDetail(pwMakeDocumentsDetail); + + //把详情信息保存到企标单中 + pwMakeDocuments.setDeclares(pwMakeDocumentsDetail.getName()); + pwMakeDocumentsMapper.updatePwMakeDocuments(pwMakeDocuments); + + //自动添加工序 + //查询当前令号下所有的物料(不包含标准件和数量为0的数据,遍历此集合查询物料工序表,如果查询到则添加到bomtwo中) + List list5 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pwMakeDocumentsDetail.getName(),pwMakeDocumentsDetail.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess : list5) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail2 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail2.setMakeDocumentsCode(pwMakeDocumentsDetail.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail2.setFigureNumber(pwMakeDocumentsDetail.getFigureNumber()+"-"+pwMaterialProcess.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail2.setName(pwMakeDocumentsDetail.getName()+"-"+pwMaterialProcess.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail2.setMaterialType(pwMakeDocumentsDetail.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail2.setQuantity(pwMakeDocumentsDetail.getQuantity()); + //上级id + pwMakeDocumentsDetail2.setSuperiorId(pwMakeDocumentsDetail.getId()); + //上级名称 + pwMakeDocumentsDetail2.setParentLevelName(pwMakeDocumentsDetail.getName()); + //上级图号 + pwMakeDocumentsDetail2.setParentLevelFigureNumber(pwMakeDocumentsDetail.getFigureNumber()); + //派工部门 + pwMakeDocumentsDetail2.setDepartmentName(pwMaterialProcess.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail2.setGodownEntry(pwMaterialProcess.getStorage()); + //材料名称 + pwMakeDocumentsDetail2.setMaterialsName(pwMaterialProcess.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail2.setMaterialsSpecification(pwMaterialProcess.getMaterialsSpecification()); + if(null!=pwMaterialProcess.getLen()){ + //下料长度 + pwMakeDocumentsDetail2.setLen(pwMaterialProcess.getLen().longValue()); + } + if(null!=pwMaterialProcess.getWid()){ + //下料宽度 + pwMakeDocumentsDetail2.setWid(pwMaterialProcess.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess.getSerialNumber()==1){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess.getWorkblank()&&pwMaterialProcess.getWorkblank()!=0){ + if(pwMakeDocumentsDetail2.getQuantity()%pwMaterialProcess.getWorkblank()!=0){ + pwMakeDocumentsDetail2.setWorkblank((pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()/pwMaterialProcess.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail2.setWorkblank(pwMakeDocumentsDetail2.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail2.setFinished(pwMakeDocumentsDetail2.getQuantity()); + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess.getLen()&&pwMaterialProcess.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess.getWid()&&pwMaterialProcess.getWid()!=0){ + pwMakeDocumentsDetail2.setMeasure((pwMaterialProcess.getLen().longValue()*pwMaterialProcess.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen()+"*"+pwMaterialProcess.getWid()); + }else{ + pwMakeDocumentsDetail2.setMeasure(pwMaterialProcess.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail2.setSpecification(pwMaterialProcess.getLen()+""); + } + } + } + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail2); + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == material){ + //添加物料信息 + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail2.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + + imMaterialMapper.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getName(), pwMakeDocumentsDetail2.getFigureNumber()); + if(null == detail){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail2.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail2.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + + //查询原材料是否有安全库存 + ImMaterial material2 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail2.getMaterialsName(), pwMakeDocumentsDetail2.getMaterialsSpecification()); + if(null!=material2){ + //查询库存信息 + PwInventoryDetail inventoryDetail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail2.getMaterialsName(), pwMakeDocumentsDetail2.getMaterialsSpecification()); + if(null!=inventoryDetail2){ + //判断有没有安全库存,如果有,则计算安全库存数量,如果没有则不处理 + if(material2.getMinimum()!=0&&material2.getHighest()!=0){ + //锁定库存数量 + inventoryDetail2.setLockNumber(inventoryDetail2.getLockNumber()+pwMakeDocumentsDetail2.getWorkblank()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); + //计算安全库存是否触发 + if(inventoryDetail2.getQuantity()-inventoryDetail2.getLockNumber()<=material2.getMinimum()){ + //生成企标单 + //把可用数量低于安全库存的物料添加到预制单明细中,等待生成预制单 + PwMakeDocumentsDetail pdd = new PwMakeDocumentsDetail(); + //令号 + pdd.setMakeDocumentsCode(pwMakeDocuments.getCode()); + //名称 + pdd.setName(material2.getMaterialName()); + //图号 + pdd.setFigureNumber(material2.getFigureNumber()); + //材料 + pdd.setMaterialType(material2.getMaterials()); + //数量(最高库存数量-(库存数量+在途数量-本批数量)) + pdd.setQuantity(material2.getHighest()); + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pdd); + + //自动添加工序 + List list6 = pwMaterialProcessService.selectPwMaterialProcessByNameAndFigureNumber(pdd.getName(),pdd.getFigureNumber()); + for (PwMaterialProcess pwMaterialProcess2 : list6) { + //创建新对象 + PwMakeDocumentsDetail pwMakeDocumentsDetail3 = new PwMakeDocumentsDetail(); + //令号 + pwMakeDocumentsDetail3.setMakeDocumentsCode(pdd.getMakeDocumentsCode()); + //图号 + pwMakeDocumentsDetail3.setFigureNumber(pdd.getFigureNumber()+"-"+pwMaterialProcess2.getSerialNumber()); + //物料名称 + pwMakeDocumentsDetail3.setName(pdd.getName()+"-"+pwMaterialProcess2.getProcess()+"(M)"); + //材料 + pwMakeDocumentsDetail3.setMaterialType(pdd.getMaterialType()); + //本批数量 + pwMakeDocumentsDetail3.setQuantity(pdd.getQuantity()); + //上级id + pwMakeDocumentsDetail3.setSuperiorId(pdd.getId()); + //上级名称 + pwMakeDocumentsDetail3.setParentLevelName(pdd.getName()); + //上级图号 + pwMakeDocumentsDetail3.setParentLevelFigureNumber(pdd.getFigureNumber()); + //派工部门 + pwMakeDocumentsDetail3.setDepartmentName(pwMaterialProcess2.getDispatchingDept()); + //是否入库 + pwMakeDocumentsDetail3.setGodownEntry(pwMaterialProcess2.getStorage()); + //材料id + pwMakeDocumentsDetail3.setMaterialId(pwMaterialProcess2.getMaterialsId()); + //材料名称 + pwMakeDocumentsDetail3.setMaterialsName(pwMaterialProcess2.getMaterialsName()); + //材料规格 + pwMakeDocumentsDetail3.setMaterialsSpecification(pwMaterialProcess2.getMaterialsSpecification()); + if(null!=pwMaterialProcess2.getLen()){ + //下料长度 + pwMakeDocumentsDetail3.setLen(pwMaterialProcess2.getLen().longValue()); + } + if(null!=pwMaterialProcess2.getWid()){ + //下料宽度 + pwMakeDocumentsDetail3.setWid(pwMaterialProcess2.getWid().longValue()); + } + //只有第一道序有 + if(pwMaterialProcess2.getSerialNumber()==1){ + //毛坯数量(如果毛坯数量不为0或者null,则用本批数量/当前数量 +1,否则为本批数量) + if(null!=pwMaterialProcess2.getWorkblank()&&pwMaterialProcess2.getWorkblank()!=0){ + if(pwMakeDocumentsDetail3.getQuantity()%pwMaterialProcess2.getWorkblank()!=0){ + pwMakeDocumentsDetail3.setWorkblank((pwMakeDocumentsDetail3.getQuantity()/pwMaterialProcess2.getWorkblank())+1); + }else{ + pwMakeDocumentsDetail3.setWorkblank(pwMakeDocumentsDetail3.getQuantity()/pwMaterialProcess2.getWorkblank()); + } + }else{ + pwMakeDocumentsDetail3.setWorkblank(pwMakeDocumentsDetail3.getQuantity()); + } + //成品数量(本批数量) + pwMakeDocumentsDetail3.setFinished(pwMakeDocumentsDetail3.getQuantity()); + //下料尺寸(宽短为null时,长*毛坯数量,宽短不为null时,长*宽*毛坯数量) + if(null!=pwMaterialProcess2.getLen()&&pwMaterialProcess2.getLen()!=0){ + //判断宽度 + if(null!=pwMaterialProcess2.getWid()&&pwMaterialProcess2.getWid()!=0){ + pwMakeDocumentsDetail3.setMeasure((pwMaterialProcess2.getLen().longValue()*pwMaterialProcess2.getWid().longValue())+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail3.setSpecification(pwMaterialProcess2.getLen()+"*"+pwMaterialProcess2.getWid()); + }else{ + pwMakeDocumentsDetail3.setMeasure(pwMaterialProcess2.getLen().longValue()+""); + + //下料规格(宽短为null时只记录长度,不为null时,长*宽) + pwMakeDocumentsDetail3.setSpecification(pwMaterialProcess2.getLen()+""); + } + } + } + + pwMakeDocumentsDetailMapper.insertPwMakeDocumentsDetail(pwMakeDocumentsDetail3); + + //判断物料表和库存表是否有添加工序后的物料信息 + ImMaterial material3 = imMaterialMapper.selectImMaterialByMaterialNameAndSpecificationType(pwMakeDocumentsDetail3.getName(), pwMakeDocumentsDetail3.getFigureNumber()); + if(null == material3){ + //添加物料信息 + //添加物料信息 + ImMaterial imMaterial3 = new ImMaterial(); + //物料名称 + imMaterial3.setMaterialName(pwMakeDocumentsDetail3.getName()); + //物料图号 + imMaterial3.setFigureNumber(pwMakeDocumentsDetail3.getFigureNumber()); + //删除标记 + imMaterial3.setDelFlag(0); + + imMaterialMapper.insertImMaterial(imMaterial3); + } + //判断库存信息是否存在 + PwInventoryDetail detail2 = pwInventoryDetailMapper.selectPwInventoryDetailByNameAndFigureNumber(pwMakeDocumentsDetail3.getName(), pwMakeDocumentsDetail3.getFigureNumber()); + if(null == detail2){ + //把物料信息保存到库存表中 + PwInventoryDetail pwInventoryDetail = new PwInventoryDetail(); + //物料名称 + pwInventoryDetail.setName(pwMakeDocumentsDetail3.getName()); + //物料图号 + pwInventoryDetail.setFigureNumber(pwMakeDocumentsDetail3.getFigureNumber()); + //删除标记 + pwInventoryDetail.setDelFlag(0); + + pwInventoryDetailMapper.insertPwInventoryDetail(pwInventoryDetail); + } + } + //添加在途数量 + inventoryDetail2.setPreliminaryInventory(pdd.getQuantity()); + pwInventoryDetailMapper.updatePwInventoryDetail(inventoryDetail2); + } + } + } + } + } + } + } + + /** + * 新增执行单产品明细信息 + * + * + */ + public void addProductionBillProduct(PwProductionBill pwProductionBill, PwProductionOrderInfo pwProductionOrderInfo2,PwQuotation pwQuotation,PwContract pwContract) { + // 创建销齿链执行单详情信息 + PwProductionBillProduct pwProductionBillProduct = new PwProductionBillProduct(); + // 保存生产总图路径 + String replaceAll = pwProductionOrderInfo2.getFigureNumber().replaceAll("/", "-"); + //总装图 + pwProductionBillProduct.setGeneralAssemblyDrawing(pwProductionBill.getCode()+"/"+replaceAll+".dwg"); + + pwProductionBillProduct = new PwProductionBillProduct(); + // 执行单id + pwProductionBillProduct.setProductionBillId(pwProductionBill.getId()); + // 产品名称 + pwProductionBillProduct.setProductName(pwProductionOrderInfo2.getMaterialName()); + // 产品型号 + pwProductionBillProduct.setProductType(pwProductionOrderInfo2.getFigureNumber()); + // 数量 + pwProductionBillProduct.setQuantity(pwProductionOrderInfo2.getNumber()); + // 完工日期 + Date deliveryTime = pwContract.getDeliveryTime(); + pwProductionBillProduct.setCompleteDate(deliveryTime); + // 包装方式 + pwProductionBillProduct.setPackType(pwQuotation.getModeOfPacking()); + // 删除标记 + pwProductionBillProduct.setDelFlag(0); + //保存零部件明细文件路径 + pwProductionBillProductMapper.insertPwProductionBillProduct(pwProductionBillProduct); + } + + /** + * 判断一个字符串是整数还是小数 + */ + public Boolean type(String str){ + if(null==str||"".equals(str)){ + return false; + } + boolean b = str.matches("-?\\d+(\\.\\d+)?"); + if(!b){ + return false; + } + Double valueOf = Double.valueOf(str); + if(valueOf%1==0.0){ + return true; + } + return false; + } + + +/** + * date2比date1多的天数 + * @param date1 + * @param date2 + * @return + */ + private static int differentDays(Date date1,Date date2) { + Calendar cal1 = Calendar.getInstance(); + cal1.setTime(date1); + + Calendar cal2 = Calendar.getInstance(); + cal2.setTime(date2); + int day1= cal1.get(Calendar.DAY_OF_YEAR); + int day2 = cal2.get(Calendar.DAY_OF_YEAR); + + int year1 = cal1.get(Calendar.YEAR); + int year2 = cal2.get(Calendar.YEAR); + if(year1 != year2) {//同一年 + int timeDistance = 0 ; + for(int i = year1 ; i < year2 ; i ++) + { + if(i%4==0 && i%100!=0 || i%400==0) //闰年 + { + timeDistance += 366; + } + else //不是闰年 + { + timeDistance += 365; + } + } + + return timeDistance + (day2-day1) ; + } else { + // 不同年 + return day2-day1; + } + } + + /** + * 查询所有未完成的执行单 + * 状态:未完成 + */ + @Override + public List selectPwProductionBillByStatus(String string) { + // TODO Auto-generated method stub + return pwProductionBillMapper.selectPwProductionBillByStatus(string); + } + + /** + * 金蝶程序出图 + * @param pwProductionBill + * @return + * @throws Exception + */ + @Override + public AjaxResult insertPwProductionBillNew(PwProductionBill pwProductionBill){ + //保存完成时间 + Date date = pwProductionBill.getBillDate(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + //请求参数 + PwProductionBillNew json = new PwProductionBillNew(); + //令号 + json.setProducitonorder(pwProductionBill.getCode()); + String arr = ""; + if("-".equals(pwProductionBill.getCode().substring(2,3))){ + arr += "F:/20"+pwProductionBill.getCode().substring(3,5); + json.setDestpath("F:\\20"+pwProductionBill.getCode().substring(3,5)); + }else{ + arr += "F:/20"+pwProductionBill.getCode().substring(2,4); + json.setDestpath("F:\\20"+pwProductionBill.getCode().substring(2,4)); + } + File file = new File(arr); + if (!file.exists()) { + file.mkdir(); + } + //图纸输出路径 + //json.setDestpath("D:\\evoEngine\\static\\product"); + //发图时间 + json.setReleasedate(sdf.format(new Date())); + //产品型号集合 + List productList = new ArrayList(); + //根据生产令号查询生产型号 + List prList = pwProductDetailMapper.selectPwProductDetailByCode(pwProductionBill.getCode()); + ProductInfoNew productInfoNew = null; + for(PwProductDetail pwProductDetail : prList){ + productInfoNew = new ProductInfoNew(); + //型号名称 + productInfoNew.setAssembledrawing(pwProductDetail.getFigureNumber()); + //直接找图 + SysConfigIni configIni = sysConfigIniService.selectSysConfigIniByFileType(pwProductionBill.getSign()); + if(StringUtils.isEmpty(configIni.getFileUrl())){ + return AjaxResult.error("请先配置图纸类型!!"); + } + productInfoNew.setSourcefile(configIni.getFileUrl()); + //数量 + productInfoNew.setNumber(pwProductDetail.getNumber().toString()); + //根据型号查询销齿链产品表 + PcRigidChain rigidChain = pcRigidChainService.selectPcRigidChainByTypeName(pwProductDetail.getFigureNumber()); + DataInfo datainfo = new DataInfo(); + if(null!=rigidChain){ + //变量 + datainfo = new DataInfo(); + datainfo.setV1(rigidChain.getvOne().toString()); + datainfo.setV2(rigidChain.getvTwo().toString()); + datainfo.setV3(rigidChain.getvThree().toString()); + datainfo.setV4(rigidChain.getvFour().toString()); + datainfo.setV5(rigidChain.getvFive().toString()); + datainfo.setV6(rigidChain.getvSix().toString()); + datainfo.setV7(rigidChain.getvSeven().toString()); + datainfo.setV8(rigidChain.getvEight().toString()); + datainfo.setV9(rigidChain.getvNine().toString()); + datainfo.setV10(rigidChain.getvTen().toString()); + datainfo.setV11(rigidChain.getvEleven().toString()); + datainfo.setV12(rigidChain.getvTwelve().toString()); + datainfo.setV13(rigidChain.getvThirteen().toString()); + datainfo.setV14(rigidChain.getvFourteen().toString()); + datainfo.setV15(rigidChain.getvFifteen().toString()); + datainfo.setV16(rigidChain.getvSixteen().toString()); + datainfo.setV17(rigidChain.getvSeveteen().toString()); + datainfo.setV18(rigidChain.getvEighteen().toString()); + datainfo.setV19(rigidChain.getvNineteen().toString()); + datainfo.setV20(rigidChain.getvTwenty().toString()); + datainfo.setV21(rigidChain.getvTwentyOne().toString()); + datainfo.setV22(rigidChain.getvTwentyTwo().toString()); + datainfo.setV23(rigidChain.getvTwentyThree().toString()); + datainfo.setV24(rigidChain.getvTwentyFour().toString()); + datainfo.setV25(rigidChain.getvTwentyFive().toString()); + datainfo.setV26(rigidChain.getvTwentySix().toString()); + datainfo.setV27(rigidChain.getvTwentySeven().toString()); + datainfo.setV28(rigidChain.getvTwentyEight().toString()); + datainfo.setV29(rigidChain.getvTwentyNine().toString()); + datainfo.setV30(rigidChain.getvThirty().toString()); + datainfo.setV31(rigidChain.getvThirtyOne().toString()); + datainfo.setV32(rigidChain.getvThirtyTwo().toString()); + datainfo.setV33(rigidChain.getvThirtyThree().toString()); + datainfo.setV34(rigidChain.getvThirtyFour().toString()); + datainfo.setV35(rigidChain.getvThirtyFive().toString()); + datainfo.setV36(rigidChain.getvThirtySix().toString()); + datainfo.setV37(rigidChain.getvThirtySeven().toString()); + datainfo.setV38(rigidChain.getvThirtyEight().toString()); + datainfo.setV39(rigidChain.getvThirtyNine().toString()); + datainfo.setV40(rigidChain.getvForty().toString()); + datainfo.setV41(rigidChain.getvFortyOne().toString()); + datainfo.setV42(rigidChain.getvFortyTwo().toString()); + datainfo.setV43(rigidChain.getvFortyThree().toString()); + datainfo.setV44(rigidChain.getvFortyFour().toString()); + datainfo.setV45(rigidChain.getvFortyFive().toString()); + datainfo.setV46(rigidChain.getvFortySix().toString()); + datainfo.setV47(rigidChain.getvFortySeven().toString()); + datainfo.setV48(rigidChain.getvFortyEight().toString()); + datainfo.setV49(rigidChain.getvFortyNine().toString()); + datainfo.setV50(rigidChain.getvFifty().toString()); + datainfo.setV51(rigidChain.getvFiftyOne().toString()); + datainfo.setV52(rigidChain.getvFiftyTwo().toString()); + datainfo.setV53(rigidChain.getvFiftyThree().toString()); + + datainfo.setG1(rigidChain.getgOne().toString()); + datainfo.setG2(rigidChain.getgTwo().toString()); + datainfo.setG3(rigidChain.getgThree().toString()); + datainfo.setG4(rigidChain.getgFour().toString()); + datainfo.setG5(rigidChain.getgFive().toString()); + datainfo.setG6(rigidChain.getgSix().toString()); + datainfo.setG7(rigidChain.getgSeven().toString()); + datainfo.setG8(rigidChain.getgEight().toString()); + datainfo.setG9(rigidChain.getgNine().toString()); + datainfo.setG10(rigidChain.getgTen().toString()); + datainfo.setG11(rigidChain.getgEleven().toString()); + datainfo.setG12(rigidChain.getgTwelve().toString()); + datainfo.setG13(rigidChain.getgThirteen().toString()); + datainfo.setG14(rigidChain.getgFifteen().toString()); + datainfo.setG15(rigidChain.getgFifteen().toString()); + datainfo.setG16(rigidChain.getgSixteen().toString()); + datainfo.setG17(rigidChain.getgSeveteen().toString()); + datainfo.setG18(rigidChain.getgEighteen().toString()); + datainfo.setG19(rigidChain.getgNineteen().toString()); + datainfo.setG20(rigidChain.getgTwenty().toString()); + } + productInfoNew.setVars(datainfo); + productList.add(productInfoNew); + } + json.setProduct(productList); + String jsonString = JSONObject.toJSONString(json); + //请求bom表(直接添加到bom1表中) + List bomList = addBomNewForJd(jsonString,pwProductionBill.getCode(),prList); + if(null == bomList || bomList.size() == 0){ + return AjaxResult.error(" !!"); + } + // 把报价单中的产品添加到执行单中 + Long p = 0L; + // 计算数量(计算完之后把物料添加到bom2和bom3中) + createBomNumberTwo(pwProductionBill.getCode(),prList); + + //添加工序 + addProcesses(pwProductionBill.getCode()); + + //添加物料信息和库存信息 ERP生产执行 + addMaterialAndInventorydetail(pwProductionBill.getCode()); + + //生成生成执行单 + pwProductionBill.setCreateTime(DateUtils.getNowDate()); + pwProductionBill.setIllustrate("金蝶出单"); + // 发单日期默认为当前日期 + pwProductionBill.setBillDate(new Date()); + // 审核状态默认为未审核 + pwProductionBill.setStatusId((long) 1); + // 删除标记默认为未删除 + pwProductionBill.setDelFlag(0); + int i = pwProductionBillMapper.insertPwProductionBill(pwProductionBill); + if(i < 1){ + return AjaxResult.error("生成生产执行单错误!!"); + } + // 创建执行单详情信息 + PwProductionBillProduct pwProductionBillProduct = null; + for (PwProductDetail pwProductDetail : prList) { + pwProductionBillProduct = new PwProductionBillProduct(); + // 执行单id + pwProductionBillProduct.setProductionBillId(pwProductionBill.getId()); + // 产品名称 + pwProductionBillProduct.setProductName(pwProductDetail.getProductName()); + // 产品型号 + pwProductionBillProduct.setProductType(pwProductDetail.getFigureNumber()); + // 数量 + pwProductionBillProduct.setQuantity(pwProductDetail.getNumber()); + //完成时间 + pwProductionBillProduct.setCompleteDate(date); + //备注 + pwProductionBillProduct.setSparedTwo(pwProductionBill.getIllustrate()); + // 自动补零 + String str = String.format("%03d", p + 1); + if (pwProductDetail.getNumber() > 1) { + String ss = String.format("%03d", pwProductDetail.getNumber() + p); + // 设备编号 + pwProductionBillProduct.setEquipmentCode(pwProductionBill.getCode() + "/" + str + "-" + ss); + } else { + // 设备编号 + pwProductionBillProduct.setEquipmentCode(pwProductionBill.getCode() + "/" + str); + } + p = pwProductDetail.getNumber() + p; + // 删除标记 + pwProductionBillProduct.setDelFlag(0); + //保存零部件明细文件路径 + i = pwProductionBillProductMapper.insertPwProductionBillProduct(pwProductionBillProduct); + if(i < 1){ + return AjaxResult.error("生成生产执行单详情错误!!"); + } + } + return AjaxResult.success(); + } + + /** + * 拼接参数 s + * 执行单令号 code + * 产品数量 number + * 产品型号 typeName + */ + public List addBomNewForJd (String json,String code,List param_list){ + + //先删除bom中已有的项目 + pwBomNumberService.deletePwBomNumberByCode(code); + // 获取生产总图 + HttpUtils.sendPost("http://localhost:9000/generatedrawingscompatible", json); + //等待出图,一直到获取图为止 + List> allRows = recursionStatus(code); + + if(allRows == null || allRows.size() == 0){ + return new ArrayList(); + } + + List list = new ArrayList<>(); + String typeName = ""; + for (int y = 2; y < allRows.size(); y++) { + PwBomNumber bom = new PwBomNumber(); + bom.setNum(allRows.get(y).get(0).toString()); + //令号 + bom.setProductionCode(code); + if(null!=allRows.get(y).get(1).toString()&&!"".equals(allRows.get(y).get(1).toString())){ + if(allRows.get(y).get(1).toString().length() > 3){ + String substring = allRows.get(y).get(1).toString().substring(0, 3); + String substring5 = allRows.get(y).get(1).toString().substring(0, 2); + if("009".equals(substring) || " ".equals(substring5) || "017".equals(substring)){ + bom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WG); + String replaceAll = allRows.get(y).get(1).toString(); + String replaceAll2 = replaceAll.replaceAll("x", "X"); + //图号 + bom.setFigureNumber(replaceAll2); + }else { + if(StringUtils.isNotEmpty(allRows.get(y).get(7).toString()) && allRows.get(y).get(7).toString().indexOf(Constants.MATERIAL_ATTRIBUTE_WG) != -1){ + bom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_WG); + }else{ + bom.setPurchaseMark(Constants.MATERIAL_ATTRIBUTE_ZZ); + } + if(allRows.get(y).get(1).toString().contains("/2-1")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll("/2-1", "")); + }else if(allRows.get(y).get(1).toString().contains("/2-2")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll("/2-2", "")); + }else if(allRows.get(y).get(1).toString().contains("/3-1")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll("/3-1", "")); + }else if(allRows.get(y).get(1).toString().contains("/3-2")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll("/3-2", "")); + }else if(allRows.get(y).get(1).toString().contains("/3-3")){ + bom.setFigureNumber(allRows.get(y).get(1).toString().replaceAll("/3-3", "")); + }else{ + bom.setFigureNumber(allRows.get(y).get(1).toString()); + } + } + }else { + bom.setFigureNumber(allRows.get(y).get(1).toString()); + } + }else{ + bom.setFigureNumber(allRows.get(y).get(1).toString()); + } + bom.setName(allRows.get(y).get(2).toString()); + //材料 + bom.setType(allRows.get(y).get(4).toString()); + //单重 + if (StringUtils.isNotEmpty(allRows.get(y).get(5).toString())) { + bom.setPieceWeight(Double.valueOf(allRows.get(y).get(5).toString())); + } + //备注 + bom.setRemarks(allRows.get(y).get(7).toString()); + + //父级名称 + bom.setParentLevelName((allRows.get(y).get(8).toString())); + //父级图号 + if("-9.0".equals(allRows.get(y).get(9).toString())||"-9".equals(allRows.get(y).get(9).toString())){ + for (PwProductDetail pwMaterialParams : param_list) { + if(allRows.get(y).get(1).toString().equals(pwMaterialParams.getFigureNumber())){ + bom.setSumNumber(Long.valueOf(pwMaterialParams.getNumber())); + } + } + typeName = bom.getFigureNumber(); + //型号 + bom.setTypeName(typeName); + bom.setOneNumber(1l); + }else{ + //单台数量 + if (StringUtils.isNotEmpty(allRows.get(y).get(3).toString())) { + bom.setOneNumber(Double.valueOf(allRows.get(y).get(3).toString()).longValue()); + } + if(allRows.get(y).get(9).toString().contains("/2-1")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll("/2-1", "")); + }else if(allRows.get(y).get(9).toString().contains("/2-2")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll("/2-2", "")); + }else if(allRows.get(y).get(9).toString().contains("/3-1")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll("/3-1", "")); + }else if(allRows.get(y).get(9).toString().contains("/3-2")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll("/3-2", "")); + }else if(allRows.get(y).get(9).toString().contains("/3-3")){ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString().replaceAll("/3-3", "")); + }else{ + bom.setParentLevelFigureNumber(allRows.get(y).get(9).toString()); + } + } + //型号 + bom.setTypeName(typeName); + // 保存到list,然后批量添加 + list.add(bom); + } + //插入新数据 + pwBomNumberService.insertPwBoms(list); + return list; + } + + private List> recursionStatus(String code){ + try { + Thread.sleep(3000); + //调用进度接口 + String sendGet = HttpUtils.sendGet("http://localhost:9000/getstate","UTF-8"); + // json串转对象 + JSONObject rcm = JSONObject.parseObject(sendGet); + String result = rcm.get("processstate").toString(); + if("1".equals(result) || "2".equals(result) || "3".equals(result)){ + recursionStatus(code); + } + if("0".equals(result)|| "5".equals(result) || "6".equals(result)){ + return null; + } + + Workbook wb = null; + try { + String arr = ""; + if("-".equals(code.substring(2,3))){ + arr += "F:/20"+code.substring(3,5)+"/"; + }else{ + arr += "F:/20"+code.substring(2,4)+"/"; + } + File files = new File(arr +code+"/RawDataTable_Tree.xlsx"); + wb = WorkbookFactory.create(files); + Sheet sheet = wb.getSheetAt(0); + return ExcelUtil.readExcel2007(sheet); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (wb != null) { + wb.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 生成生产BOM + * @param code 生产单号 + * @param param_list 每张总图的生产数量 + */ + private void createBomNumberTwo(String code,List param_list){ + //删除此执行单原有数据 + pwBomNumberTwoService.deletePwBomNumberTwoByCode(code); + pwBomNumberTwoLingliaoService.deletePwBomNumberTwoLingliaoByCode(code); + + List bom_list = pwBomNumberService.queryPwBomNumberZTByCode(code); + for (PwBomNumber pwBomNumber : bom_list) { + //把数据保存到数量保存表中 + PwBomNumberTwo pbt = new PwBomNumberTwo(); + PwBomNumberTwoLingliao pbtLingliao = new PwBomNumberTwoLingliao(); + pbt.setProductionCode(pwBomNumber.getProductionCode()); + pbt.setNum(pwBomNumber.getNum()); + pbt.setFigureNumber(pwBomNumber.getFigureNumber()); + pbt.setName(pwBomNumber.getName()); + pbt.setOneNumber(pwBomNumber.getOneNumber()); + pbt.setType(pwBomNumber.getType()); + pbt.setPieceWeight(pwBomNumber.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber.getParentLevelName()); + //把总装图的单台数量保存到本批数量中 + for (PwProductDetail pwMaterialParams : param_list) { + if(pwMaterialParams.getFigureNumber().equals(pwBomNumber.getFigureNumber())){ + pbt.setSumNumber(Long.valueOf(pwMaterialParams.getNumber())); + pbtLingliao.setSumNumber(Long.valueOf(pwMaterialParams.getNumber())); + } + } + pbt.setSparedOne(pwBomNumber.getTypeName()); + pbt.setRemarks(pwBomNumber.getRemarks()); + pbt.setDelFlag(0); + //计算后的bom表添加数据bom + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + + pbtLingliao.setProductionCode(pwBomNumber.getProductionCode()); + pbtLingliao.setNum(pwBomNumber.getNum()); + pbtLingliao.setFigureNumber(pwBomNumber.getFigureNumber()); + pbtLingliao.setName(pwBomNumber.getName()); + pbtLingliao.setOneNumber(pwBomNumber.getOneNumber()); + pbtLingliao.setType(pwBomNumber.getType()); + pbtLingliao.setPieceWeight(pwBomNumber.getPieceWeight()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelName(pwBomNumber.getParentLevelName()); + //把总装图的单台数量保存到本批数量中 + pbtLingliao.setSparedOne(pwBomNumber.getTypeName()); + pbtLingliao.setRemarks(pwBomNumber.getRemarks()); + pbtLingliao.setDelFlag(0); + //领料专用bom添加数据 + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + //递归查询所有子集 + recursionCountNum(pwBomNumber.getFigureNumber(),code,pwBomNumber.getOneNumber(),pwBomNumber.getSumNumber(),pwBomNumber.getNum()); + } + } + + /** + * 递归查询所有子集 + * @param figureNumber 父级图号 + * @param code 执行单号 + * @param number 单台数量 + * @param sumNumber 本批产品数量 + */ + private void recursionCountNum(String figureNumber,String code,Long number,Long sumNumber,String num){ + //根据父级的图号,执行令号,序号查找其下所有子集 + List bomList = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(figureNumber,code,num); + //数据临时保存 + PwBomNumberTwo pbt = null; + PwBomNumberTwoLingliao pbtLingliao = null; + Long p = 0l; + for (PwBomNumber pwBomNumber : bomList) { + p = number * pwBomNumber.getOneNumber(); + //根据令号,名称和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + pbt = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(code, pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + if(null != pbt){ + pbt.setOneNumber(pbt.getOneNumber() + number * pwBomNumber.getOneNumber()); + pbt.setSumNumber(pbt.getSumNumber() + number * pwBomNumber.getOneNumber() * sumNumber); + pwBomNumberTwoService.updatePwBomNumberTwo(pbt); + }else{ + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbt.setProductionCode(code); + pbt.setNum(pwBomNumber.getNum()); + pbt.setFigureNumber(pwBomNumber.getFigureNumber()); + pbt.setName(pwBomNumber.getName()); + pbt.setOneNumber(number * pwBomNumber.getOneNumber()); + pbt.setType(pwBomNumber.getType()); + pbt.setPieceWeight(pwBomNumber.getPieceWeight()); + pbt.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber.getParentLevelName()); + //把单台数量保存到本批数量中,最后单台数量乘以总台数,就是本批数量 + pbt.setSumNumber(number * pwBomNumber.getOneNumber() * sumNumber); + pbt.setSparedOne(pwBomNumber.getTypeName()); + pbt.setInventoryStatus("未完成"); + pbt.setRemarks(pwBomNumber.getRemarks()); + pbt.setReceiveNumber(0l); + pbt.setDelFlag(0); + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + pbtLingliao = pwBomNumberTwoLingliaoService.selectPwBomNumberTwoLingLiaoByCodeAndNameAndFigureNumber(code, pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + if (null != pbtLingliao) { + pbtLingliao.setOneNumber(pbtLingliao.getOneNumber() + number * pwBomNumber.getOneNumber()); + pbtLingliao.setSumNumber(pbtLingliao.getSumNumber() + number * pwBomNumber.getOneNumber() * sumNumber); + pwBomNumberTwoLingliaoService.updatePwBomNumberTwoLingliao(pbtLingliao); + } else { + pbtLingliao = new PwBomNumberTwoLingliao(); + pbtLingliao.setProductionCode(code); + pbtLingliao.setNum(pwBomNumber.getNum()); + pbtLingliao.setFigureNumber(pwBomNumber.getFigureNumber()); + pbtLingliao.setName(pwBomNumber.getName()); + pbtLingliao.setOneNumber(number * pwBomNumber.getOneNumber()); + pbtLingliao.setType(pwBomNumber.getType()); + pbtLingliao.setPieceWeight(pwBomNumber.getPieceWeight()); + pbtLingliao.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbtLingliao.setParentLevelName(pwBomNumber.getParentLevelName()); + //把单台数量保存到本批数量中,最后单台数量乘以总台数,就是本批数量 + pbtLingliao.setSumNumber(number * pwBomNumber.getOneNumber() * sumNumber); + pbtLingliao.setSparedOne(pwBomNumber.getTypeName()); + pbtLingliao.setRemarks(pwBomNumber.getRemarks()); + pbtLingliao.setDelFlag(0); + pwBomNumberTwoLingliaoService.insertPwBomNumberTwoLingliao(pbtLingliao); + } + recursionCountNum(pwBomNumber.getFigureNumber(),code,p,sumNumber,pwBomNumber.getNum()); + } + } + + /** + * 添加工序 + * @param code + */ + private void addProcesses(String code){ + //查询BOM + List list = pwBomNumberTwoService.selectPwBomNumberTwoListForJd(code); + for (PwBomNumberTwo pwBomNumberTwo : list) { + //判断每一颗物料是否有工序 + PwGxProcess pwGxProcess = pwGxProcessMapper.queryPwGxProcesssByFigureNumber(pwBomNumberTwo.getFigureNumber()); + if(StringUtils.isNull(pwGxProcess)){ + continue; + } + PwBomNumberTwo pwBomTwo = null; + //查询工序 + List process_list = pwGxProcessMapper.selectPwGxProcessByParengId(pwGxProcess.getId()); + //循环把工序添加到生产BOM中 + for (PwGxProcess gxProcess : process_list) { + pwBomTwo = new PwBomNumberTwo(); + pwBomTwo.setFigureNumber(gxProcess.getFigureNumber()); + pwBomTwo.setName(gxProcess.getName()); + pwBomTwo.setSuperiorId(pwBomNumberTwo.getId()); + pwBomTwo.setProductionCode(pwBomNumberTwo.getProductionCode()); + pwBomTwo.setNum(pwBomNumberTwo.getNum()); + pwBomTwo.setPieceWeight(pwBomNumberTwo.getPieceWeight()); + pwBomTwo.setType(pwBomNumberTwo.getType()); + //毛坯和原材料不添加数量 + if(!"015".equals(gxProcess.getFigureNumber().substring(0,3)) && gxProcess.getFigureNumber().indexOf("(M)") == -1){ + pwBomTwo.setOneNumber(pwBomNumberTwo.getOneNumber()); + pwBomTwo.setSumNumber(pwBomNumberTwo.getSumNumber()); + } + pwBomTwo.setDepartmentName(gxProcess.getDispatchingDept()); + if(StringUtils.isNotNull(gxProcess.getDispatchingDept())){ + pwBomTwo.setXuTime(gxProcess.getSerialTime().doubleValue()); + } + pwBomTwo.setXuDescribe(gxProcess.getRemarks()); + pwBomTwo.setParentLevelName(pwBomNumberTwo.getName()); + pwBomTwo.setParentLevelFigureNumber(pwBomNumberTwo.getFigureNumber()); + pwBomNumberTwoService.insertPwBomNumberTwo(pwBomTwo); + } + } + } + + /** + * 上传电气BOM + * @param list TODO 推送金蝶单独推还是批量推 + * @return + */ + @Transactional + public String importProductBill(List list){ + if(list == null || list.size() == 0){ + return "上传数据为空!"; + } + PwProductionBill pwProductionBill = pwProductionBillMapper.selectPwProductionBillByProductionCode(list.get(0).getCode()); + if(pwProductionBill != null){ + return "执行令号已存在!"; + } + //获取生产令号 + String code = list.get(0).getCode(); + //生成生产执行单 + pwProductionBill = new PwProductionBill(); + pwProductionBill.setCode(code); + pwProductionBill.setStatus("未完成"); + pwProductionBill.setStatusId(1l); + pwProductionBill.setDelFlag(0); + pwProductionBill.setBillDate(new Date()); + pwProductionBill.setIllustrate("BOM 上传"); + pwProductionBill.setCreateTime(new Date()); + pwProductionBill.setCommitFlag("DQ"); + pwProductionBillMapper.insertPwProductionBill(pwProductionBill); + //生产执行单详情 + PwProductionBillProduct pwProductionBillProduct = null; + int order = 1; + //删除数据 + pwBomNumberMapper.deletePwBomNumberByCode(code); + //存储原始BOM信息 + List ys_list = new ArrayList(); + //循环数据添加物料,库存,原始BOM,生成BOM信息 + List ts_list = new ArrayList(); + for (ProdictBillBom prodictBillBom : list) { + if(StringUtils.isEmpty(prodictBillBom.getFigureNumber())){ + //根据图号查询物料库,判断物料是否存在 + ProdMaterial prodMaterial = prodMaterialMapper.queryMaterialByNameAndBrand(prodictBillBom.getName(),prodictBillBom.getTypeName(),prodictBillBom.getSpecification()); + if(prodMaterial == null){ + //查询电气的最大编码 + ProdMaterial maxProdMaterial = prodMaterialMapper.queryMaxMaterial(); + String s_code = ""; + if(maxProdMaterial == null){ + s_code = "D00000000001"; + }else{ + Long number = Long.parseLong(maxProdMaterial.getCode().substring(1)) + 1; + if(number <10){ + s_code = "D0000000000" + number; + }else if(number <100l){ + s_code = "D000000000" + number; + }else if(number <1000l){ + s_code = "D00000000" + number; + }else if(number <10000l){ + s_code = "D0000000" + number; + }else if(number <100000l){ + s_code = "D000000" + number; + }else if(number <1000000l){ + s_code = "D00000" + number; + }else if(number <10000000l){ + s_code = "D0000" + number; + }else if(number <100000000l){ + s_code = "D000" + number; + }else if(number <1000000000l){ + s_code = "D00" + number; + }else if(number < 10000000000l){ + s_code = "D0" + number; + }else{ + s_code = "D" + number; + } + } + prodictBillBom.setFigureNumber(s_code); + prodMaterial = new ProdMaterial(); + prodMaterial.setCode(s_code); + prodMaterial.setFlag("DQ"); + prodMaterial.setDelFlag(Constants.DELETE_FLAG_0); + prodMaterial.setName(prodictBillBom.getName()); + prodMaterial.setBrand(prodictBillBom.getTypeName()); + prodMaterial.setCreateTime(new Date()); + prodMaterial.setCreateBy(SecurityUtils.getUsername()); + prodMaterial.setType(prodictBillBom.getType()); + prodMaterial.setSpecifications(prodictBillBom.getSpecification()); + prodMaterialMapper.insertProdMaterial(prodMaterial); + ts_list.add(prodMaterial); + }else{ + prodictBillBom.setFigureNumber(prodMaterial.getCode()); + } + }else{ + //判断图号是否已经生成还是自己新添加的 + ProdMaterial prodMaterial = prodMaterialMapper.queryCodeByCategoryIdAndType(prodictBillBom.getFigureNumber()); + if(StringUtils.isNull(prodMaterial)){ + prodMaterial = new ProdMaterial(); + prodMaterial.setCode(prodictBillBom.getFigureNumber()); + prodMaterial.setFlag("DQ"); + prodMaterial.setDelFlag(Constants.DELETE_FLAG_0); + prodMaterial.setName(prodictBillBom.getName()); + prodMaterial.setBrand(prodictBillBom.getTypeName()); + prodMaterial.setCreateTime(new Date()); + prodMaterial.setCreateBy(SecurityUtils.getUsername()); + prodMaterial.setType(prodictBillBom.getType()); + prodMaterial.setSpecifications(prodictBillBom.getSpecification()); + prodMaterialMapper.insertProdMaterial(prodMaterial); + } + } + } + for (ProdictBillBom prodictBillBom : list) { + //获取主产品 + if(prodictBillBom.getNum().indexOf(".") == -1){ + prodictBillBom.setCode(code); + pwProductionBillProduct = new PwProductionBillProduct(); + pwProductionBillProduct.setProductionBillId(pwProductionBill.getId()); + pwProductionBillProduct.setProductName(prodictBillBom.getName()); + pwProductionBillProduct.setProductType(prodictBillBom.getFigureNumber()); + pwProductionBillProduct.setQuantity(Long.valueOf(prodictBillBom.getOneNumber())); + String num = prodictBillBom.getCode() + "/"; + if(order < 10){ + num += "00" + order + "-" ; + order = prodictBillBom.getOneNumber() + order - 1; + if(order < 10){ + num += "00" + order; + }else if(order < 100){ + num += "0" + order; + }else{ + num += order; + } + order = order + 1; + }else if(order < 100){ + num += "0" + order + "-" ; + order = prodictBillBom.getOneNumber() + order - 1; + if(order < 100){ + num += "0" + order; + }else{ + num += order; + } + order = order + 1; + }else{ + num += order + "-" ; + order = prodictBillBom.getOneNumber() + order - 1; + num += order; + order = order + 1; + } + pwProductionBillProduct.setEquipmentCode(num); + pwProductionBillProduct.setSparedTwo("BOM 上传"); + pwProductionBillProduct.setDelFlag(0); + pwProductionBillProduct.setCreateTime(new Date()); + pwProductionBillProductMapper.insertPwProductionBillProduct(pwProductionBillProduct); + PwBomNumber pwBomNumber = new PwBomNumber(); + pwBomNumber.setProductionCode(code); + pwBomNumber.setNum(prodictBillBom.getNum()); + pwBomNumber.setFigureNumber(prodictBillBom.getFigureNumber()); + pwBomNumber.setName(prodictBillBom.getName()); + pwBomNumber.setOneNumber(1l); + pwBomNumber.setSumNumber(Long.valueOf(prodictBillBom.getOneNumber())); + pwBomNumber.setTypeName(prodictBillBom.getFigureNumber()); + pwBomNumber.setType(prodictBillBom.getSpecification()); //型号 + pwBomNumber.setSparedTwo(prodictBillBom.getTypeName()); //品牌 + pwBomNumber.setRemarks(prodictBillBom.getRemarks()); + pwBomNumber.setCreateTime(new Date()); + ys_list.add(pwBomNumber); + isnertBom(ys_list,list,prodictBillBom,pwBomNumber.getFigureNumber()); + } + } + pwBomNumberMapper.insertPwBoms(ys_list); + //生成生成BOM + isnertBomTwo(code); + return "上传成功!"; + } + + private void isnertBom(List ys_list,List list,ProdictBillBom bom,String figureNumber){ + PwBomNumber pwBomNumber = null; + int index = bom.getNum().length() + 1; + + for (ProdictBillBom prodictBillBom : list) { + if(prodictBillBom.getNum().length() <= index || prodictBillBom.getNum().indexOf(bom.getNum()+".") == -1){ + continue; + } + String len = prodictBillBom.getNum().substring(index); + //判断下一层级的物料 + if(len.indexOf(".") == -1){ + prodictBillBom.setCode(bom.getCode()); + //生成原始BOM + pwBomNumber = new PwBomNumber(); + pwBomNumber.setProductionCode(bom.getCode()); + pwBomNumber.setNum(prodictBillBom.getNum()); + pwBomNumber.setFigureNumber(prodictBillBom.getFigureNumber()); + pwBomNumber.setName(prodictBillBom.getName()); + pwBomNumber.setOneNumber(Long.valueOf(prodictBillBom.getOneNumber())); + pwBomNumber.setParentLevelName(bom.getName()); + pwBomNumber.setParentLevelFigureNumber(bom.getFigureNumber()); + pwBomNumber.setTypeName(figureNumber); + pwBomNumber.setType(prodictBillBom.getSpecification()); + pwBomNumber.setSparedTwo(prodictBillBom.getTypeName()); //品牌 + pwBomNumber.setRemarks(prodictBillBom.getRemarks()); + pwBomNumber.setCreateTime(new Date()); + ys_list.add(pwBomNumber); + isnertBom(ys_list,list,prodictBillBom,figureNumber); + } + } + } + + + private void isnertBomTwo(String code){ + pwBomNumberTwoMapper.deletePwBomNumberTwoByCode(code); + //总装图 + List bom_list = pwBomNumberMapper.queryPwBomNumberZTByCode(code); + PwBomNumberTwo pwBomNumberTwo = null; + for (PwBomNumber pwBomNumber : bom_list) { + pwBomNumberTwo = new PwBomNumberTwo(); + pwBomNumberTwo.setFigureNumber(pwBomNumber.getFigureNumber()); + pwBomNumberTwo.setDelFlag(0); + pwBomNumberTwo.setOneNumber(pwBomNumber.getOneNumber()); + pwBomNumberTwo.setSumNumber(pwBomNumber.getSumNumber()); + pwBomNumberTwo.setParentLevelName(pwBomNumber.getParentLevelName()); + pwBomNumberTwo.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pwBomNumberTwo.setProductionCode(pwBomNumber.getProductionCode()); + pwBomNumberTwo.setType(pwBomNumber.getType()); + pwBomNumberTwo.setNum(pwBomNumber.getNum()); + pwBomNumberTwo.setName(pwBomNumber.getName()); + pwBomNumberTwo.setXuDescribe(pwBomNumber.getSparedTwo()); + pwBomNumberTwo.setSparedOne(pwBomNumber.getTypeName()); + pwBomNumberTwo.setCreateTime(new Date()); + pwBomNumberTwoMapper.insertPwBomNumberTwo(pwBomNumberTwo); + dqCountNum(pwBomNumber.getFigureNumber(),code,pwBomNumberTwo.getOneNumber(),pwBomNumberTwo.getSumNumber(),pwBomNumber.getNum()); + } + } + + private void dqCountNum(String figureNumber,String code,Long number,Long sumNumber,String num){ + //根据父级的图号,执行令号,序号查找其下所有子集 + List bomList = pwBomNumberService.queryPwBomNumberByParentFigureNumberAndNum(figureNumber,code,num); + //数据临时保存 + PwBomNumberTwo pbt = null; + Long p = 0l; + for (PwBomNumber pwBomNumber : bomList) { + p = number * pwBomNumber.getOneNumber(); + //根据令号,名称和图号查询,如果有相同零部件存在,则直接把数量累加到已有的零部件中 + pbt = pwBomNumberTwoService.selectPwBomNumberTwoByCodeAndTypeNameAndFigureNumber(code, pwBomNumber.getName(), pwBomNumber.getFigureNumber()); + if(null != pbt){ + pbt.setOneNumber(pbt.getOneNumber() + number * pwBomNumber.getOneNumber()); + pbt.setSumNumber(pbt.getSumNumber() + number * pwBomNumber.getOneNumber() * sumNumber); + pwBomNumberTwoService.updatePwBomNumberTwo(pbt); + }else{ + //把数据保存到数量保存表中 + pbt = new PwBomNumberTwo(); + pbt.setProductionCode(code); + pbt.setNum(pwBomNumber.getNum()); + pbt.setFigureNumber(pwBomNumber.getFigureNumber()); + pbt.setName(pwBomNumber.getName()); + pbt.setOneNumber(number * pwBomNumber.getOneNumber()); + pbt.setParentLevelFigureNumber(pwBomNumber.getParentLevelFigureNumber()); + pbt.setParentLevelName(pwBomNumber.getParentLevelName()); + //把单台数量保存到本批数量中,最后单台数量乘以总台数,就是本批数量 + pbt.setSumNumber(number * pwBomNumber.getOneNumber() * sumNumber); + pbt.setSparedOne(pwBomNumber.getTypeName()); + pbt.setType(pwBomNumber.getType()); + pbt.setXuDescribe(pwBomNumber.getSparedTwo()); + pbt.setInventoryStatus("未完成"); + pbt.setRemarks(pwBomNumber.getRemarks()); + pbt.setDelFlag(0); + pwBomNumberTwoService.insertPwBomNumberTwo(pbt); + } + dqCountNum(pwBomNumber.getFigureNumber(),code,p,sumNumber,pwBomNumber.getNum()); + } + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionOrderInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionOrderInfoServiceImpl.java new file mode 100644 index 0000000..292605c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionOrderInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductionOrderInfoMapper; +import com.ruoyi.project.management.domain.PwProductionOrderInfo; +import com.ruoyi.project.management.service.IPwProductionOrderInfoService; + +/** + * 生产订单详情信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-06 + */ +@Service +public class PwProductionOrderInfoServiceImpl implements IPwProductionOrderInfoService +{ + @Autowired + private PwProductionOrderInfoMapper pwProductionOrderInfoMapper; + + /** + * 查询生产订单详情信息 + * + * @param id 生产订单详情信息ID + * @return 生产订单详情信息 + */ + @Override + public PwProductionOrderInfo selectPwProductionOrderInfoById(Long id) + { + return pwProductionOrderInfoMapper.selectPwProductionOrderInfoById(id); + } + + /** + * 查询生产订单详情信息列表 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 生产订单详情信息 + */ + @Override + public List selectPwProductionOrderInfoList(PwProductionOrderInfo pwProductionOrderInfo) + { + return pwProductionOrderInfoMapper.selectPwProductionOrderInfoList(pwProductionOrderInfo); + } + + /** + * 新增生产订单详情信息 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 结果 + */ + @Override + public int insertPwProductionOrderInfo(PwProductionOrderInfo pwProductionOrderInfo) + { + pwProductionOrderInfo.setCreateTime(DateUtils.getNowDate()); + return pwProductionOrderInfoMapper.insertPwProductionOrderInfo(pwProductionOrderInfo); + } + + /** + * 修改生产订单详情信息 + * + * @param pwProductionOrderInfo 生产订单详情信息 + * @return 结果 + */ + @Override + public int updatePwProductionOrderInfo(PwProductionOrderInfo pwProductionOrderInfo) + { + return pwProductionOrderInfoMapper.updatePwProductionOrderInfo(pwProductionOrderInfo); + } + + /** + * 批量删除生产订单详情信息 + * + * @param ids 需要删除的生产订单详情信息ID + * @return 结果 + */ + @Override + public int deletePwProductionOrderInfoByIds(Long[] ids) + { + return pwProductionOrderInfoMapper.deletePwProductionOrderInfoByIds(ids); + } + + /** + * 删除生产订单详情信息信息 + * + * @param id 生产订单详情信息ID + * @return 结果 + */ + @Override + public int deletePwProductionOrderInfoById(Long id) + { + return pwProductionOrderInfoMapper.deletePwProductionOrderInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionOrderServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionOrderServiceImpl.java new file mode 100644 index 0000000..168dfbc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionOrderServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductionOrderMapper; +import com.ruoyi.project.management.domain.PwProductionOrder; +import com.ruoyi.project.management.service.IPwProductionOrderService; + +/** + * 生产订单信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-12-06 + */ +@Service +public class PwProductionOrderServiceImpl implements IPwProductionOrderService +{ + @Autowired + private PwProductionOrderMapper pwProductionOrderMapper; + + /** + * 查询生产订单信息 + * + * @param id 生产订单信息ID + * @return 生产订单信息 + */ + @Override + public PwProductionOrder selectPwProductionOrderById(Long id) + { + return pwProductionOrderMapper.selectPwProductionOrderById(id); + } + + /** + * 查询生产订单信息列表 + * + * @param pwProductionOrder 生产订单信息 + * @return 生产订单信息 + */ + @Override + public List selectPwProductionOrderList(PwProductionOrder pwProductionOrder) + { + return pwProductionOrderMapper.selectPwProductionOrderList(pwProductionOrder); + } + + /** + * 新增生产订单信息 + * + * @param pwProductionOrder 生产订单信息 + * @return 结果 + */ + @Override + public int insertPwProductionOrder(PwProductionOrder pwProductionOrder) + { + pwProductionOrder.setCreateTime(DateUtils.getNowDate()); + return pwProductionOrderMapper.insertPwProductionOrder(pwProductionOrder); + } + + /** + * 修改生产订单信息 + * + * @param pwProductionOrder 生产订单信息 + * @return 结果 + */ + @Override + public int updatePwProductionOrder(PwProductionOrder pwProductionOrder) + { + return pwProductionOrderMapper.updatePwProductionOrder(pwProductionOrder); + } + + /** + * 批量删除生产订单信息 + * + * @param ids 需要删除的生产订单信息ID + * @return 结果 + */ + @Override + public int deletePwProductionOrderByIds(Long[] ids) + { + return pwProductionOrderMapper.deletePwProductionOrderByIds(ids); + } + + /** + * 删除生产订单信息信息 + * + * @param id 生产订单信息ID + * @return 结果 + */ + @Override + public int deletePwProductionOrderById(Long id) + { + return pwProductionOrderMapper.deletePwProductionOrderById(id); + } + + @Override + public PwProductionOrder selectPwProductionOrderByCode(String contractCode) { + // TODO Auto-generated method stub + return pwProductionOrderMapper.selectPwProductionOrderByCode(contractCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionSchedulingNumberServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionSchedulingNumberServiceImpl.java new file mode 100644 index 0000000..073b82f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionSchedulingNumberServiceImpl.java @@ -0,0 +1,120 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductionSchedulingNumberMapper; +import com.ruoyi.project.management.domain.PwProductionSchedulingNumber; +import com.ruoyi.project.management.service.IPwProductionSchedulingNumberService; + +/** + * 排产缺料统计Service业务层处理 + * + * @author zhukangchao + * @date 2023-06-08 + */ +@Service +public class PwProductionSchedulingNumberServiceImpl implements IPwProductionSchedulingNumberService +{ + @Autowired + private PwProductionSchedulingNumberMapper pwProductionSchedulingNumberMapper; + + /** + * 查询排产缺料统计 + * + * @param id 排产缺料统计ID + * @return 排产缺料统计 + */ + @Override + public PwProductionSchedulingNumber selectPwProductionSchedulingNumberById(Long id) + { + return pwProductionSchedulingNumberMapper.selectPwProductionSchedulingNumberById(id); + } + + /** + * 查询排产缺料统计列表 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 排产缺料统计 + */ + @Override + public List selectPwProductionSchedulingNumberList(PwProductionSchedulingNumber pwProductionSchedulingNumber) + { + return pwProductionSchedulingNumberMapper.selectPwProductionSchedulingNumberList(pwProductionSchedulingNumber); + } + + /** + * 新增排产缺料统计 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 结果 + */ + @Override + public int insertPwProductionSchedulingNumber(PwProductionSchedulingNumber pwProductionSchedulingNumber) + { + pwProductionSchedulingNumber.setCreateTime(DateUtils.getNowDate()); + return pwProductionSchedulingNumberMapper.insertPwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + + /** + * 修改排产缺料统计 + * + * @param pwProductionSchedulingNumber 排产缺料统计 + * @return 结果 + */ + @Override + public int updatePwProductionSchedulingNumber(PwProductionSchedulingNumber pwProductionSchedulingNumber) + { + return pwProductionSchedulingNumberMapper.updatePwProductionSchedulingNumber(pwProductionSchedulingNumber); + } + + /** + * 批量删除排产缺料统计 + * + * @param ids 需要删除的排产缺料统计ID + * @return 结果 + */ + @Override + public int deletePwProductionSchedulingNumberByIds(Long[] ids) + { + return pwProductionSchedulingNumberMapper.deletePwProductionSchedulingNumberByIds(ids); + } + + /** + * 删除排产缺料统计信息 + * + * @param id 排产缺料统计ID + * @return 结果 + */ + @Override + public int deletePwProductionSchedulingNumberById(Long id) + { + return pwProductionSchedulingNumberMapper.deletePwProductionSchedulingNumberById(id); + } + + @Override + public void insertPwProductionSchedulingNumbers(List list3) { + // TODO Auto-generated method stub + pwProductionSchedulingNumberMapper.insertPwProductionSchedulingNumbers(list3); + } + + @Override + public void celerPwProductionSchedulingNumber() { + // TODO Auto-generated method stub + pwProductionSchedulingNumberMapper.celerPwProductionSchedulingNumber(); + } + + @Override + public List selectPwProductionSchedulingNumberLists() { + // TODO Auto-generated method stub + return pwProductionSchedulingNumberMapper.selectPwProductionSchedulingNumberLists(); + } + + @Override + public PwProductionSchedulingNumber selectPwProductionSchedulingNumberByNameAndFigureNumber(String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwProductionSchedulingNumberMapper.selectPwProductionSchedulingNumberByNameAndFigureNumber(name,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionSchedulingServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionSchedulingServiceImpl.java new file mode 100644 index 0000000..1b4f4eb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwProductionSchedulingServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwProductionSchedulingMapper; +import com.ruoyi.project.management.domain.PwProductionScheduling; +import com.ruoyi.project.management.service.IPwProductionSchedulingService; + +/** + * 排产信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-06-08 + */ +@Service +public class PwProductionSchedulingServiceImpl implements IPwProductionSchedulingService +{ + @Autowired + private PwProductionSchedulingMapper pwProductionSchedulingMapper; + + /** + * 查询排产信息 + * + * @param id 排产信息ID + * @return 排产信息 + */ + @Override + public PwProductionScheduling selectPwProductionSchedulingById(Long id) + { + return pwProductionSchedulingMapper.selectPwProductionSchedulingById(id); + } + + /** + * 查询排产信息列表 + * + * @param pwProductionScheduling 排产信息 + * @return 排产信息 + */ + @Override + public List selectPwProductionSchedulingList(PwProductionScheduling pwProductionScheduling) + { + return pwProductionSchedulingMapper.selectPwProductionSchedulingList(pwProductionScheduling); + } + + /** + * 新增排产信息 + * + * @param pwProductionScheduling 排产信息 + * @return 结果 + */ + @Override + public int insertPwProductionScheduling(PwProductionScheduling pwProductionScheduling) + { + pwProductionScheduling.setCreateTime(DateUtils.getNowDate()); + return pwProductionSchedulingMapper.insertPwProductionScheduling(pwProductionScheduling); + } + + /** + * 修改排产信息 + * + * @param pwProductionScheduling 排产信息 + * @return 结果 + */ + @Override + public int updatePwProductionScheduling(PwProductionScheduling pwProductionScheduling) + { + return pwProductionSchedulingMapper.updatePwProductionScheduling(pwProductionScheduling); + } + + /** + * 批量删除排产信息 + * + * @param ids 需要删除的排产信息ID + * @return 结果 + */ + @Override + public int deletePwProductionSchedulingByIds(Long[] ids) + { + return pwProductionSchedulingMapper.deletePwProductionSchedulingByIds(ids); + } + + /** + * 删除排产信息信息 + * + * @param id 排产信息ID + * @return 结果 + */ + @Override + public int deletePwProductionSchedulingById(Long id) + { + return pwProductionSchedulingMapper.deletePwProductionSchedulingById(id); + } + + @Override + public List selectPwProductionSchedulingLists() { + // TODO Auto-generated method stub + return pwProductionSchedulingMapper.selectPwProductionSchedulingLists(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseContractMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseContractMaterialServiceImpl.java new file mode 100644 index 0000000..3748e91 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseContractMaterialServiceImpl.java @@ -0,0 +1,259 @@ +package com.ruoyi.project.management.service.impl; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.web.domain.AjaxResult; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.project.management.mapper.PwPurchaseContractMaterialMapper; +import com.ruoyi.project.management.domain.PwOutsourceContract; +import com.ruoyi.project.management.domain.PwOutsourceContractDetail; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.domain.PwPurchaseContractMaterial; +import com.ruoyi.project.management.service.IPwPurchaseContractMaterialService; +import com.ruoyi.project.management.service.IPwPurchaseContractService; +import com.ruoyi.project.management.utils.MoneyUtil; +import com.ruoyi.project.system.domain.SysUser; + +import io.lettuce.core.dynamic.annotation.Param; + +/** + * 物料和采购合同关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-07-06 + */ +@Service +public class PwPurchaseContractMaterialServiceImpl implements IPwPurchaseContractMaterialService +{ + @Autowired + private PwPurchaseContractMaterialMapper pwPurchaseContractMaterialMapper; + @Autowired + private IPwPurchaseContractService pwPurchaseContractService; + + /** + * 查询物料和采购合同关联 + * + * @param id 物料和采购合同关联ID + * @return 物料和采购合同关联 + */ + @Override + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialById(Long id) + { + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialById(id); + } + + /** + * 查询物料和采购合同关联列表 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 物料和采购合同关联 + */ + @Override + public List selectPwPurchaseContractMaterialList(PwPurchaseContractMaterial pwPurchaseContractMaterial) + { + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialList(pwPurchaseContractMaterial); + } + + /** + * 新增物料和采购合同关联 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 结果 + */ + @Override + public int insertPwPurchaseContractMaterial(PwPurchaseContractMaterial pwPurchaseContractMaterial) + { + pwPurchaseContractMaterial.setCreateTime(DateUtils.getNowDate()); + return pwPurchaseContractMaterialMapper.insertPwPurchaseContractMaterial(pwPurchaseContractMaterial); + } + + /** + * 修改物料和采购合同关联 + * + * @param pwPurchaseContractMaterial 物料和采购合同关联 + * @return 结果 + */ + @Override + public int updatePwPurchaseContractMaterial(PwPurchaseContractMaterial pwPurchaseContractMaterial) + { + return pwPurchaseContractMaterialMapper.updatePwPurchaseContractMaterial(pwPurchaseContractMaterial); + } + + /** + * 批量删除物料和采购合同关联 + * + * @param ids 需要删除的物料和采购合同关联ID + * @return 结果 + */ + @Override + public int deletePwPurchaseContractMaterialByIds(Long[] ids) + { + return pwPurchaseContractMaterialMapper.deletePwPurchaseContractMaterialByIds(ids); + } + + /** + * 删除物料和采购合同关联信息 + * + * @param id 物料和采购合同关联ID + * @return 结果 + */ + @Override + public int deletePwPurchaseContractMaterialById(Long id) + { + return pwPurchaseContractMaterialMapper.deletePwPurchaseContractMaterialById(id); + } + + @Override + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByFnAndName(String name, String all) { + PwPurchaseContractMaterial pwPurchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByFnAndName(name,all); + return pwPurchaseContractMaterial; + } + + /** + * 生成采购合同 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int createPurchaseContract(Long[] ids) { + +// //获取当前登录用户 +// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); +// // 发料人名称默认为当前账号 +// SysUser user = loginUser.getUser(); + + //判断是否有了单价 + for (Long id : ids) { + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialById(id); + //判断是否已经生成了合同 + if(null!=purchaseContractMaterial.getPurchaseContractId()){ + //重复生成合同标识 + int i = 201; + return i; + } + if(null==purchaseContractMaterial.getUnivalence()||0==purchaseContractMaterial.getUnivalence()||"".equals(purchaseContractMaterial.getUnivalence())){ + int i = 202; + return i; + } + } + + //判断是否是同一生产令号下的 + PwPurchaseContractMaterial purchaseContractMaterial = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialById(ids[0]); + int s = 1; + for (Long long1 : ids) { + PwPurchaseContractMaterial purchaseContractMaterials = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialById(long1); + if(!purchaseContractMaterials.getCode().equals(purchaseContractMaterial.getCode())){ + s = 805; + } + } + if(s == 805){ + return s; + } + + //创建采购合同 + PwPurchaseContract pwPurchaseContract = new PwPurchaseContract(); + pwPurchaseContract.setCerateTime(DateUtils.getNowDate()); + // 买方名称(默认本公司名称) + pwPurchaseContract.setPurchaserName("河北伊特机械制造有限公司"); + // 买方地址 + pwPurchaseContract.setPurchaserAddress("石家庄市裕华区东岗路164号东方官邸5-3-401"); + // 买方电话 + pwPurchaseContract.setPurchaserPhone("0311-86106496"); + // 买方传真 + pwPurchaseContract.setPurchaserFax("0311-86106496"); + // 买方纳税人识别号 + pwPurchaseContract.setPurchaserDutyParagraph("91130133MA08JW7T7B"); + // 买方开户行 + pwPurchaseContract.setPurchaserBankOfDeposit("中国农业银行石家庄中山东路支行"); + // 买方账号 + pwPurchaseContract.setPurchaserAccount("50356301040011696"); + //生成采购合同编号,合同编号格式为CG+当前日期时间串 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm-ss"); + String string = sdf.format(new Date()); + //采购合同编号 + pwPurchaseContract.setContractCode("CG"+string); + //关联单据 + pwPurchaseContract.setCode(purchaseContractMaterial.getCode()); + pwPurchaseContract.setContractStatus((long)1); + //合同签订时间 + pwPurchaseContract.setAppointTime(new Date()); + pwPurchaseContract.setDelFlag(0); + pwPurchaseContractService.insertPwPurchaseContract(pwPurchaseContract); + for (Long id : ids) { + //根据id查询 + PwPurchaseContractMaterial purchaseContractMaterial2 = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialById(id); + purchaseContractMaterial2.setPurchaseContractId(pwPurchaseContract.getId()); + pwPurchaseContractMaterialMapper.updatePwPurchaseContractMaterial(purchaseContractMaterial2); + } + + //记录金额 + Double d = 0.0; + for (Long id : ids) { + PwPurchaseContractMaterial purchaseContractMaterial2 = pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialById(id); + //总价累计 + d += purchaseContractMaterial2.getTotalPrices(); + } + PwPurchaseContract purchaseContract = pwPurchaseContractService.selectPwPurchaseContractById(pwPurchaseContract.getId()); + purchaseContract.setTotalPrices(d); + //把小写转为大写 + MoneyUtil moneyUtil = new MoneyUtil(); + String chinese = moneyUtil.toChinese(purchaseContract.getTotalPrices()+""); + purchaseContract.setBigTotalPrices(chinese); + int j = pwPurchaseContractService.updatePwPurchaseContract(purchaseContract); + return j; + } + + @Override + public List selectPwPurchaseContractMaterialByPurchaseContractId( + Long purchaseContractId) { + + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByPurchaseContractId(purchaseContractId); + } + + @Override + public List selectPwPurchaseContractMaterialByPurchaseContractIdList() { + + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByPurchaseContractIdList(); + } + + @Override + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByPurchaseContractIdAndNameAndFigureNumber( + Long id, String materialName, String specification) { + + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByPurchaseContractIdAndNameAndFigureNumber(id,materialName,specification); + } + + @Override + public List selectPwPurchaseContractMaterialByFigureNumberAndAllGB() { + // TODO Auto-generated method stub + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByFigureNumberAndAllGB(); + } + + @Override + public PwPurchaseContractMaterial selectPwPurchaseContractMaterialByCodeAndNameAndFigureNumber( + String productionCode, String name, String figureNumber,String string) { + // TODO Auto-generated method stub + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByCodeAndNameAndFigureNumber(productionCode, name, figureNumber,string); + } + + @Override + public List selectPwPurchaseContractMaterialByNameAndFigureNumber(String name, + String figureNumber) { + // TODO Auto-generated method stub + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByNameAndFigureNumber(name,figureNumber); + } + + @Override + public List selectPwPurchaseContractMaterialByName(String name) { + // TODO Auto-generated method stub + return pwPurchaseContractMaterialMapper.selectPwPurchaseContractMaterialByName(name); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseContractServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseContractServiceImpl.java new file mode 100644 index 0000000..7ca87a2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseContractServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwPurchaseContractMapper; +import com.ruoyi.project.management.domain.PwPurchaseContract; +import com.ruoyi.project.management.service.IPwPurchaseContractService; + +/** + * 采购合同Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PwPurchaseContractServiceImpl implements IPwPurchaseContractService +{ + @Autowired + private PwPurchaseContractMapper pwPurchaseContractMapper; + + /** + * 查询采购合同 + * + * @param id 采购合同ID + * @return 采购合同 + */ + @Override + public PwPurchaseContract selectPwPurchaseContractById(Long id) + { + return pwPurchaseContractMapper.selectPwPurchaseContractById(id); + } + + /** + * 查询采购合同列表 + * + * @param pwPurchaseContract 采购合同 + * @return 采购合同 + */ + @Override + public List selectPwPurchaseContractList(PwPurchaseContract pwPurchaseContract) + { + return pwPurchaseContractMapper.selectPwPurchaseContractList(pwPurchaseContract); + } + + /** + * 新增采购合同 + * + * @param pwPurchaseContract 采购合同 + * @return 结果 + */ + @Override + public int insertPwPurchaseContract(PwPurchaseContract pwPurchaseContract) + { + return pwPurchaseContractMapper.insertPwPurchaseContract(pwPurchaseContract); + } + + /** + * 修改采购合同 + * + * @param pwPurchaseContract 采购合同 + * @return 结果 + */ + @Override + public int updatePwPurchaseContract(PwPurchaseContract pwPurchaseContract) + { + return pwPurchaseContractMapper.updatePwPurchaseContract(pwPurchaseContract); + } + + /** + * 批量删除采购合同 + * + * @param ids 需要删除的采购合同ID + * @return 结果 + */ + @Override + public int deletePwPurchaseContractByIds(Long[] ids) + { + return pwPurchaseContractMapper.deletePwPurchaseContractByIds(ids); + } + + /** + * 删除采购合同信息 + * + * @param id 采购合同ID + * @return 结果 + */ + @Override + public int deletePwPurchaseContractById(Long id) + { + return pwPurchaseContractMapper.deletePwPurchaseContractById(id); + } + + @Override + public PwPurchaseContract selectPwPurchaseContractByCode(String makeDocumentsCode) { + + return pwPurchaseContractMapper.selectPwPurchaseContractByCode(makeDocumentsCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseServiceImpl.java new file mode 100644 index 0000000..f1b53f9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwPurchaseServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwPurchaseMapper; +import com.ruoyi.project.management.domain.PwPurchase; +import com.ruoyi.project.management.service.IPwPurchaseService; + +/** + * 部件Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PwPurchaseServiceImpl implements IPwPurchaseService +{ + @Autowired + private PwPurchaseMapper pwPurchaseMapper; + + /** + * 查询部件 + * + * @param id 部件ID + * @return 部件 + */ + @Override + public PwPurchase selectPwPurchaseById(Long id) + { + return pwPurchaseMapper.selectPwPurchaseById(id); + } + + /** + * 查询部件列表 + * + * @param pwPurchase 部件 + * @return 部件 + */ + @Override + public List selectPwPurchaseList(PwPurchase pwPurchase) + { + return pwPurchaseMapper.selectPwPurchaseList(pwPurchase); + } + + /** + * 新增部件 + * + * @param pwPurchase 部件 + * @return 结果 + */ + @Override + public int insertPwPurchase(PwPurchase pwPurchase) + { + pwPurchase.setCreateTime(DateUtils.getNowDate()); + return pwPurchaseMapper.insertPwPurchase(pwPurchase); + } + + /** + * 修改部件 + * + * @param pwPurchase 部件 + * @return 结果 + */ + @Override + public int updatePwPurchase(PwPurchase pwPurchase) + { + return pwPurchaseMapper.updatePwPurchase(pwPurchase); + } + + /** + * 批量删除部件 + * + * @param ids 需要删除的部件ID + * @return 结果 + */ + @Override + public int deletePwPurchaseByIds(Long[] ids) + { + return pwPurchaseMapper.deletePwPurchaseByIds(ids); + } + + /** + * 删除部件信息 + * + * @param id 部件ID + * @return 结果 + */ + @Override + public int deletePwPurchaseById(Long id) + { + return pwPurchaseMapper.deletePwPurchaseById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwQrcodeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwQrcodeServiceImpl.java new file mode 100644 index 0000000..c6a50f3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwQrcodeServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwQrcodeMapper; +import com.ruoyi.project.management.domain.PwQrcode; +import com.ruoyi.project.management.service.IPwQrcodeService; + +/** + * 二维码信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-04-19 + */ +@Service +public class PwQrcodeServiceImpl implements IPwQrcodeService +{ + @Autowired + private PwQrcodeMapper pwQrcodeMapper; + + /** + * 查询二维码信息 + * + * @param id 二维码信息ID + * @return 二维码信息 + */ + @Override + public PwQrcode selectPwQrcodeById(Long id) + { + return pwQrcodeMapper.selectPwQrcodeById(id); + } + + /** + * 查询二维码信息列表 + * + * @param pwQrcode 二维码信息 + * @return 二维码信息 + */ + @Override + public List selectPwQrcodeList(PwQrcode pwQrcode) + { + return pwQrcodeMapper.selectPwQrcodeList(pwQrcode); + } + + /** + * 新增二维码信息 + * + * @param pwQrcode 二维码信息 + * @return 结果 + */ + @Override + public int insertPwQrcode(PwQrcode pwQrcode) + { + pwQrcode.setCreateTime(DateUtils.getNowDate()); + return pwQrcodeMapper.insertPwQrcode(pwQrcode); + } + + /** + * 修改二维码信息 + * + * @param pwQrcode 二维码信息 + * @return 结果 + */ + @Override + public int updatePwQrcode(PwQrcode pwQrcode) + { + return pwQrcodeMapper.updatePwQrcode(pwQrcode); + } + + /** + * 批量删除二维码信息 + * + * @param ids 需要删除的二维码信息ID + * @return 结果 + */ + @Override + public int deletePwQrcodeByIds(Long[] ids) + { + return pwQrcodeMapper.deletePwQrcodeByIds(ids); + } + + /** + * 删除二维码信息信息 + * + * @param id 二维码信息ID + * @return 结果 + */ + @Override + public int deletePwQrcodeById(Long id) + { + return pwQrcodeMapper.deletePwQrcodeById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwQuotationServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwQuotationServiceImpl.java new file mode 100644 index 0000000..2764428 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwQuotationServiceImpl.java @@ -0,0 +1,121 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.framework.web.domain.AjaxResult; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.project.management.mapper.PwProductQuotationMapper; +import com.ruoyi.project.management.mapper.PwQuotationMapper; +import com.ruoyi.project.management.domain.PcRigidChain; +import com.ruoyi.project.management.domain.PwDanceNotStandard; +import com.ruoyi.project.management.domain.PwProductQuotation; +import com.ruoyi.project.management.domain.PwQuotation; +import com.ruoyi.project.management.service.IPwDanceNotStandardService; +import com.ruoyi.project.management.service.IPwQuotationService; + +/** + * 报价单Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PwQuotationServiceImpl implements IPwQuotationService +{ + @Autowired + private PwQuotationMapper pwQuotationMapper; + @Autowired + private PwProductQuotationMapper pwProductQuotationMapper; + //非标产品表信息 + @Autowired + private IPwDanceNotStandardService pwDanceNotStandardService; + + /** + * 查询报价单 + * + * @param id 报价单ID + * @return 报价单 + */ + @Override + public PwQuotation selectPwQuotationById(Long id) + { + return pwQuotationMapper.selectPwQuotationById(id); + } + + /** + * 查询报价单列表 + * + * @param pwQuotation 报价单 + * @return 报价单 + */ + @Override + public List selectPwQuotationList(PwQuotation pwQuotation) + { + return pwQuotationMapper.selectPwQuotationList(pwQuotation); + } + + /** + * 新增报价单 + * + * @param pwQuotation 报价单 + * @return 结果 + */ + @Override + public int insertPwQuotation(PwQuotation pwQuotation){ + pwQuotation.setCreateTime(DateUtils.getNowDate()); + + return pwQuotationMapper.insertPwQuotation(pwQuotation); + } + + /** + * 修改报价单 + * + * @param pwQuotation 报价单 + * @return 结果 + */ + @Override + public int updatePwQuotation(PwQuotation pwQuotation) + { + return pwQuotationMapper.updatePwQuotation(pwQuotation); + } + + /** + * 批量删除报价单 + * + * @param ids 需要删除的报价单ID + * @return 结果 + */ + @Override + public int deletePwQuotationByIds(Long[] ids) + { + return pwQuotationMapper.deletePwQuotationByIds(ids); + } + + /** + * 删除报价单信息 + * + * @param id 报价单ID + * @return 结果 + */ + @Override + public int deletePwQuotationById(Long id) + { + return pwQuotationMapper.deletePwQuotationById(id); + } + + /** + * 根据项目名称查询报价单信息 + * @param itemName + * @return + */ + @Override + public PwQuotation selectPwQuotationByItemName(String itemName) { + PwQuotation quotation = pwQuotationMapper.selectPwQuotationByItemName(itemName); + return quotation; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSafetyInventoryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSafetyInventoryServiceImpl.java new file mode 100644 index 0000000..fe23797 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSafetyInventoryServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwSafetyInventoryMapper; +import com.ruoyi.project.management.domain.PwSafetyInventory; +import com.ruoyi.project.management.service.IPwSafetyInventoryService; + +/** + * 安全库存明细Service业务层处理 + * + * @author zhukangchao + * @date 2022-12-31 + */ +@Service +public class PwSafetyInventoryServiceImpl implements IPwSafetyInventoryService +{ + @Autowired + private PwSafetyInventoryMapper pwSafetyInventoryMapper; + + /** + * 查询安全库存明细 + * + * @param id 安全库存明细ID + * @return 安全库存明细 + */ + @Override + public PwSafetyInventory selectPwSafetyInventoryById(Long id) + { + return pwSafetyInventoryMapper.selectPwSafetyInventoryById(id); + } + + /** + * 查询安全库存明细列表 + * + * @param pwSafetyInventory 安全库存明细 + * @return 安全库存明细 + */ + @Override + public List selectPwSafetyInventoryList(PwSafetyInventory pwSafetyInventory) + { + return pwSafetyInventoryMapper.selectPwSafetyInventoryList(pwSafetyInventory); + } + + /** + * 新增安全库存明细 + * + * @param pwSafetyInventory 安全库存明细 + * @return 结果 + */ + @Override + public int insertPwSafetyInventory(PwSafetyInventory pwSafetyInventory) + { + pwSafetyInventory.setCreateTime(DateUtils.getNowDate()); + return pwSafetyInventoryMapper.insertPwSafetyInventory(pwSafetyInventory); + } + + /** + * 修改安全库存明细 + * + * @param pwSafetyInventory 安全库存明细 + * @return 结果 + */ + @Override + public int updatePwSafetyInventory(PwSafetyInventory pwSafetyInventory) + { + return pwSafetyInventoryMapper.updatePwSafetyInventory(pwSafetyInventory); + } + + /** + * 批量删除安全库存明细 + * + * @param ids 需要删除的安全库存明细ID + * @return 结果 + */ + @Override + public int deletePwSafetyInventoryByIds(Long[] ids) + { + return pwSafetyInventoryMapper.deletePwSafetyInventoryByIds(ids); + } + + /** + * 删除安全库存明细信息 + * + * @param id 安全库存明细ID + * @return 结果 + */ + @Override + public int deletePwSafetyInventoryById(Long id) + { + return pwSafetyInventoryMapper.deletePwSafetyInventoryById(id); + } + + @Override + public PwSafetyInventory selectPwSafetyInventoryByNameAndFigureNumber(String materialName, String figureNumber) { + // TODO Auto-generated method stub + return pwSafetyInventoryMapper.selectPwSafetyInventoryByNameAndFigureNumber(materialName,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSchemeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSchemeServiceImpl.java new file mode 100644 index 0000000..da3d001 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSchemeServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwSchemeMapper; +import com.ruoyi.project.management.domain.PwScheme; +import com.ruoyi.project.management.service.IPwSchemeService; + +/** + * 方案Service业务层处理 + * + * @author zhukangchao + * @date 2020-06-09 + */ +@Service +public class PwSchemeServiceImpl implements IPwSchemeService +{ + @Autowired + private PwSchemeMapper pwSchemeMapper; + + /** + * 查询方案 + * + * @param id 方案ID + * @return 方案 + */ + @Override + public PwScheme selectPwSchemeById(Long id) + { + return pwSchemeMapper.selectPwSchemeById(id); + } + + /** + * 查询方案列表 + * + * @param pwScheme 方案 + * @return 方案 + */ + @Override + public List selectPwSchemeList(PwScheme pwScheme) + { + return pwSchemeMapper.selectPwSchemeList(pwScheme); + } + + /** + * 新增方案 + * + * @param pwScheme 方案 + * @return 结果 + */ + @Override + public int insertPwScheme(PwScheme pwScheme) + { + pwScheme.setCreateTime(DateUtils.getNowDate()); + return pwSchemeMapper.insertPwScheme(pwScheme); + } + + /** + * 修改方案 + * + * @param pwScheme 方案 + * @return 结果 + */ + @Override + public int updatePwScheme(PwScheme pwScheme) + { + return pwSchemeMapper.updatePwScheme(pwScheme); + } + + /** + * 批量删除方案 + * + * @param ids 需要删除的方案ID + * @return 结果 + */ + @Override + public int deletePwSchemeByIds(Long[] ids) + { + return pwSchemeMapper.deletePwSchemeByIds(ids); + } + + /** + * 删除方案信息 + * + * @param id 方案ID + * @return 结果 + */ + @Override + public int deletePwSchemeById(Long id) + { + return pwSchemeMapper.deletePwSchemeById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwScrapInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwScrapInfoServiceImpl.java new file mode 100644 index 0000000..2de376b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwScrapInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwScrapInfoMapper; +import com.ruoyi.project.management.domain.PwScrapInfo; +import com.ruoyi.project.management.service.IPwScrapInfoService; + +/** + * 报废信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-04-01 + */ +@Service +public class PwScrapInfoServiceImpl implements IPwScrapInfoService +{ + @Autowired + private PwScrapInfoMapper pwScrapInfoMapper; + + /** + * 查询报废信息 + * + * @param id 报废信息ID + * @return 报废信息 + */ + @Override + public PwScrapInfo selectPwScrapInfoById(Long id) + { + return pwScrapInfoMapper.selectPwScrapInfoById(id); + } + + /** + * 查询报废信息列表 + * + * @param pwScrapInfo 报废信息 + * @return 报废信息 + */ + @Override + public List selectPwScrapInfoList(PwScrapInfo pwScrapInfo) + { + return pwScrapInfoMapper.selectPwScrapInfoList(pwScrapInfo); + } + + /** + * 新增报废信息 + * + * @param pwScrapInfo 报废信息 + * @return 结果 + */ + @Override + public int insertPwScrapInfo(PwScrapInfo pwScrapInfo) + { + pwScrapInfo.setCreateTime(DateUtils.getNowDate()); + return pwScrapInfoMapper.insertPwScrapInfo(pwScrapInfo); + } + + /** + * 修改报废信息 + * + * @param pwScrapInfo 报废信息 + * @return 结果 + */ + @Override + public int updatePwScrapInfo(PwScrapInfo pwScrapInfo) + { + return pwScrapInfoMapper.updatePwScrapInfo(pwScrapInfo); + } + + /** + * 批量删除报废信息 + * + * @param ids 需要删除的报废信息ID + * @return 结果 + */ + @Override + public int deletePwScrapInfoByIds(Long[] ids) + { + return pwScrapInfoMapper.deletePwScrapInfoByIds(ids); + } + + /** + * 删除报废信息信息 + * + * @param id 报废信息ID + * @return 结果 + */ + @Override + public int deletePwScrapInfoById(Long id) + { + return pwScrapInfoMapper.deletePwScrapInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSpectacularsInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSpectacularsInfoServiceImpl.java new file mode 100644 index 0000000..92da858 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSpectacularsInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwSpectacularsInfoMapper; +import com.ruoyi.project.management.domain.PwSpectacularsInfo; +import com.ruoyi.project.management.service.IPwSpectacularsInfoService; + +/** + * 新生产看板信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-04-03 + */ +@Service +public class PwSpectacularsInfoServiceImpl implements IPwSpectacularsInfoService +{ + @Autowired + private PwSpectacularsInfoMapper pwSpectacularsInfoMapper; + + /** + * 查询新生产看板信息 + * + * @param id 新生产看板信息ID + * @return 新生产看板信息 + */ + @Override + public PwSpectacularsInfo selectPwSpectacularsInfoById(Long id) + { + return pwSpectacularsInfoMapper.selectPwSpectacularsInfoById(id); + } + + /** + * 查询新生产看板信息列表 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 新生产看板信息 + */ + @Override + public List selectPwSpectacularsInfoList(PwSpectacularsInfo pwSpectacularsInfo) + { + return pwSpectacularsInfoMapper.selectPwSpectacularsInfoList(pwSpectacularsInfo); + } + + /** + * 新增新生产看板信息 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 结果 + */ + @Override + public int insertPwSpectacularsInfo(PwSpectacularsInfo pwSpectacularsInfo) + { + pwSpectacularsInfo.setCreateTime(DateUtils.getNowDate()); + return pwSpectacularsInfoMapper.insertPwSpectacularsInfo(pwSpectacularsInfo); + } + + /** + * 修改新生产看板信息 + * + * @param pwSpectacularsInfo 新生产看板信息 + * @return 结果 + */ + @Override + public int updatePwSpectacularsInfo(PwSpectacularsInfo pwSpectacularsInfo) + { + return pwSpectacularsInfoMapper.updatePwSpectacularsInfo(pwSpectacularsInfo); + } + + /** + * 批量删除新生产看板信息 + * + * @param ids 需要删除的新生产看板信息ID + * @return 结果 + */ + @Override + public int deletePwSpectacularsInfoByIds(Long[] ids) + { + return pwSpectacularsInfoMapper.deletePwSpectacularsInfoByIds(ids); + } + + /** + * 删除新生产看板信息信息 + * + * @param id 新生产看板信息ID + * @return 结果 + */ + @Override + public int deletePwSpectacularsInfoById(Long id) + { + return pwSpectacularsInfoMapper.deletePwSpectacularsInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSpectacularsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSpectacularsServiceImpl.java new file mode 100644 index 0000000..0de640a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwSpectacularsServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwSpectacularsMapper; +import com.ruoyi.project.management.domain.PwSpectaculars; +import com.ruoyi.project.management.service.IPwSpectacularsService; + +/** + * 生产看板Service业务层处理 + * + * @author zhukangchao + * @date 2023-02-01 + */ +@Service +public class PwSpectacularsServiceImpl implements IPwSpectacularsService +{ + @Autowired + private PwSpectacularsMapper pwSpectacularsMapper; + + /** + * 查询生产看板 + * + * @param id 生产看板ID + * @return 生产看板 + */ + @Override + public PwSpectaculars selectPwSpectacularsById(Long id) + { + return pwSpectacularsMapper.selectPwSpectacularsById(id); + } + + /** + * 查询生产看板列表 + * + * @param pwSpectaculars 生产看板 + * @return 生产看板 + */ + @Override + public List selectPwSpectacularsList(PwSpectaculars pwSpectaculars) + { + return pwSpectacularsMapper.selectPwSpectacularsList(pwSpectaculars); + } + + /** + * 新增生产看板 + * + * @param pwSpectaculars 生产看板 + * @return 结果 + */ + @Override + public int insertPwSpectaculars(PwSpectaculars pwSpectaculars) + { + pwSpectaculars.setCreateTime(DateUtils.getNowDate()); + return pwSpectacularsMapper.insertPwSpectaculars(pwSpectaculars); + } + + /** + * 修改生产看板 + * + * @param pwSpectaculars 生产看板 + * @return 结果 + */ + @Override + public int updatePwSpectaculars(PwSpectaculars pwSpectaculars) + { + return pwSpectacularsMapper.updatePwSpectaculars(pwSpectaculars); + } + + /** + * 批量删除生产看板 + * + * @param ids 需要删除的生产看板ID + * @return 结果 + */ + @Override + public int deletePwSpectacularsByIds(Long[] ids) + { + return pwSpectacularsMapper.deletePwSpectacularsByIds(ids); + } + + /** + * 删除生产看板信息 + * + * @param id 生产看板ID + * @return 结果 + */ + @Override + public int deletePwSpectacularsById(Long id) + { + return pwSpectacularsMapper.deletePwSpectacularsById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwStoresRequisitionServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwStoresRequisitionServiceImpl.java new file mode 100644 index 0000000..e00e1d0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwStoresRequisitionServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwStoresRequisitionMapper; +import com.ruoyi.project.management.domain.PwStoresRequisition; +import com.ruoyi.project.management.service.IPwStoresRequisitionService; + +/** + * 物品领料单Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-14 + */ +@Service +public class PwStoresRequisitionServiceImpl implements IPwStoresRequisitionService +{ + @Autowired + private PwStoresRequisitionMapper pwStoresRequisitionMapper; + + /** + * 查询物品领料单 + * + * @param id 物品领料单ID + * @return 物品领料单 + */ + @Override + public PwStoresRequisition selectPwStoresRequisitionById(Long id) + { + return pwStoresRequisitionMapper.selectPwStoresRequisitionById(id); + } + + /** + * 查询物品领料单列表 + * + * @param pwStoresRequisition 物品领料单 + * @return 物品领料单 + */ + @Override + public List selectPwStoresRequisitionList(PwStoresRequisition pwStoresRequisition) + { + return pwStoresRequisitionMapper.selectPwStoresRequisitionList(pwStoresRequisition); + } + + /** + * 新增物品领料单 + * + * @param pwStoresRequisition 物品领料单 + * @return 结果 + */ + @Override + public int insertPwStoresRequisition(PwStoresRequisition pwStoresRequisition) + { + pwStoresRequisition.setCreateTime(DateUtils.getNowDate()); + return pwStoresRequisitionMapper.insertPwStoresRequisition(pwStoresRequisition); + } + + /** + * 修改物品领料单 + * + * @param pwStoresRequisition 物品领料单 + * @return 结果 + */ + @Override + public int updatePwStoresRequisition(PwStoresRequisition pwStoresRequisition) + { + return pwStoresRequisitionMapper.updatePwStoresRequisition(pwStoresRequisition); + } + + /** + * 批量删除物品领料单 + * + * @param ids 需要删除的物品领料单ID + * @return 结果 + */ + @Override + public int deletePwStoresRequisitionByIds(Long[] ids) + { + return pwStoresRequisitionMapper.deletePwStoresRequisitionByIds(ids); + } + + /** + * 删除物品领料单信息 + * + * @param id 物品领料单ID + * @return 结果 + */ + @Override + public int deletePwStoresRequisitionById(Long id) + { + return pwStoresRequisitionMapper.deletePwStoresRequisitionById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwStoresRequistionDetailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwStoresRequistionDetailServiceImpl.java new file mode 100644 index 0000000..e371e1f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwStoresRequistionDetailServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwStoresRequistionDetailMapper; +import com.ruoyi.project.management.domain.PwStoresRequistionDetail; +import com.ruoyi.project.management.service.IPwStoresRequistionDetailService; + +/** + * 领料单详情Service业务层处理 + * + * @author zhukangchao + * @date 2022-03-14 + */ +@Service +public class PwStoresRequistionDetailServiceImpl implements IPwStoresRequistionDetailService +{ + @Autowired + private PwStoresRequistionDetailMapper pwStoresRequistionDetailMapper; + + /** + * 查询领料单详情 + * + * @param id 领料单详情ID + * @return 领料单详情 + */ + @Override + public PwStoresRequistionDetail selectPwStoresRequistionDetailById(Long id) + { + return pwStoresRequistionDetailMapper.selectPwStoresRequistionDetailById(id); + } + + /** + * 查询领料单详情列表 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 领料单详情 + */ + @Override + public List selectPwStoresRequistionDetailList(PwStoresRequistionDetail pwStoresRequistionDetail) + { + return pwStoresRequistionDetailMapper.selectPwStoresRequistionDetailList(pwStoresRequistionDetail); + } + + /** + * 新增领料单详情 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 结果 + */ + @Override + public int insertPwStoresRequistionDetail(PwStoresRequistionDetail pwStoresRequistionDetail) + { + pwStoresRequistionDetail.setCreateTime(DateUtils.getNowDate()); + return pwStoresRequistionDetailMapper.insertPwStoresRequistionDetail(pwStoresRequistionDetail); + } + + /** + * 修改领料单详情 + * + * @param pwStoresRequistionDetail 领料单详情 + * @return 结果 + */ + @Override + public int updatePwStoresRequistionDetail(PwStoresRequistionDetail pwStoresRequistionDetail) + { + return pwStoresRequistionDetailMapper.updatePwStoresRequistionDetail(pwStoresRequistionDetail); + } + + /** + * 批量删除领料单详情 + * + * @param ids 需要删除的领料单详情ID + * @return 结果 + */ + @Override + public int deletePwStoresRequistionDetailByIds(Long[] ids) + { + return pwStoresRequistionDetailMapper.deletePwStoresRequistionDetailByIds(ids); + } + + /** + * 删除领料单详情信息 + * + * @param id 领料单详情ID + * @return 结果 + */ + @Override + public int deletePwStoresRequistionDetailById(Long id) + { + return pwStoresRequistionDetailMapper.deletePwStoresRequistionDetailById(id); + } + + @Override + public List selectPwStoresRequistionDetailByStoresRequistionId(Long id) { + // TODO Auto-generated method stub + return pwStoresRequistionDetailMapper.selectPwStoresRequistionDetailByStoresRequistionId(id); + } + + @Override + public List selectPwStoresRequistionDetailByName(String materialName) { + // TODO Auto-generated method stub + return pwStoresRequistionDetailMapper.selectPwStoresRequistionDetailByName(materialName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskBomServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskBomServiceImpl.java new file mode 100644 index 0000000..6248711 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskBomServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwTaskBomMapper; +import com.ruoyi.project.management.domain.PwTaskBom; +import com.ruoyi.project.management.service.IPwTaskBomService; + +/** + * 任务零部件关联Service业务层处理 + * + * @author zhukangchao + * @date 2020-08-20 + */ +@Service +public class PwTaskBomServiceImpl implements IPwTaskBomService +{ + @Autowired + private PwTaskBomMapper pwTaskBomMapper; + + /** + * 查询任务零部件关联 + * + * @param id 任务零部件关联ID + * @return 任务零部件关联 + */ + @Override + public PwTaskBom selectPwTaskBomById(Long id) + { + return pwTaskBomMapper.selectPwTaskBomById(id); + } + + /** + * 查询任务零部件关联列表 + * + * @param pwTaskBom 任务零部件关联 + * @return 任务零部件关联 + */ + @Override + public List selectPwTaskBomList(PwTaskBom pwTaskBom) + { + return pwTaskBomMapper.selectPwTaskBomList(pwTaskBom); + } + + /** + * 新增任务零部件关联 + * + * @param pwTaskBom 任务零部件关联 + * @return 结果 + */ + @Override + public int insertPwTaskBom(PwTaskBom pwTaskBom) + { + pwTaskBom.setCreateTime(DateUtils.getNowDate()); + return pwTaskBomMapper.insertPwTaskBom(pwTaskBom); + } + + /** + * 修改任务零部件关联 + * + * @param pwTaskBom 任务零部件关联 + * @return 结果 + */ + @Override + public int updatePwTaskBom(PwTaskBom pwTaskBom) + { + return pwTaskBomMapper.updatePwTaskBom(pwTaskBom); + } + + /** + * 批量删除任务零部件关联 + * + * @param ids 需要删除的任务零部件关联ID + * @return 结果 + */ + @Override + public int deletePwTaskBomByIds(Long[] ids) + { + return pwTaskBomMapper.deletePwTaskBomByIds(ids); + } + + /** + * 删除任务零部件关联信息 + * + * @param id 任务零部件关联ID + * @return 结果 + */ + @Override + public int deletePwTaskBomById(Long id) + { + return pwTaskBomMapper.deletePwTaskBomById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskOverTimeInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskOverTimeInfoServiceImpl.java new file mode 100644 index 0000000..1f46f5f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskOverTimeInfoServiceImpl.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwTaskOverTimeInfoMapper; +import com.ruoyi.project.management.domain.PwTaskOverTimeInfo; +import com.ruoyi.project.management.service.IPwTaskOverTimeInfoService; + +/** + * 任务超时信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-09-01 + */ +@Service +public class PwTaskOverTimeInfoServiceImpl implements IPwTaskOverTimeInfoService +{ + @Autowired + private PwTaskOverTimeInfoMapper pwTaskOverTimeInfoMapper; + + /** + * 查询任务超时信息 + * + * @param id 任务超时信息ID + * @return 任务超时信息 + */ + @Override + public PwTaskOverTimeInfo selectPwTaskOverTimeInfoById(Long id) + { + return pwTaskOverTimeInfoMapper.selectPwTaskOverTimeInfoById(id); + } + + /** + * 查询任务超时信息列表 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 任务超时信息 + */ + @Override + public List selectPwTaskOverTimeInfoList(PwTaskOverTimeInfo pwTaskOverTimeInfo) + { + return pwTaskOverTimeInfoMapper.selectPwTaskOverTimeInfoList(pwTaskOverTimeInfo); + } + + /** + * 新增任务超时信息 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 结果 + */ + @Override + public int insertPwTaskOverTimeInfo(PwTaskOverTimeInfo pwTaskOverTimeInfo) + { + pwTaskOverTimeInfo.setCreateTime(DateUtils.getNowDate()); + return pwTaskOverTimeInfoMapper.insertPwTaskOverTimeInfo(pwTaskOverTimeInfo); + } + + /** + * 修改任务超时信息 + * + * @param pwTaskOverTimeInfo 任务超时信息 + * @return 结果 + */ + @Override + public int updatePwTaskOverTimeInfo(PwTaskOverTimeInfo pwTaskOverTimeInfo) + { + return pwTaskOverTimeInfoMapper.updatePwTaskOverTimeInfo(pwTaskOverTimeInfo); + } + + /** + * 批量删除任务超时信息 + * + * @param ids 需要删除的任务超时信息ID + * @return 结果 + */ + @Override + public int deletePwTaskOverTimeInfoByIds(Long[] ids) + { + return pwTaskOverTimeInfoMapper.deletePwTaskOverTimeInfoByIds(ids); + } + + /** + * 删除任务超时信息信息 + * + * @param id 任务超时信息ID + * @return 结果 + */ + @Override + public int deletePwTaskOverTimeInfoById(Long id) + { + return pwTaskOverTimeInfoMapper.deletePwTaskOverTimeInfoById(id); + } + + @Override + public void insertPwTaskOverTimeInfos(List lists) { + // TODO Auto-generated method stub + pwTaskOverTimeInfoMapper.insertPwTaskOverTimeInfos(lists); + } + + @Override + public void eliminate() { + // TODO Auto-generated method stub + pwTaskOverTimeInfoMapper.eliminate(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskServiceImpl.java new file mode 100644 index 0000000..02ff2c8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTaskServiceImpl.java @@ -0,0 +1,195 @@ +package com.ruoyi.project.management.service.impl; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.project.management.mapper.PwTaskMapper; +import com.ruoyi.project.management.domain.PwBom; +import com.ruoyi.project.management.domain.PwProductionBillProduct; +import com.ruoyi.project.management.domain.PwTask; +import com.ruoyi.project.management.domain.PwTaskBom; +import com.ruoyi.project.management.service.IPwBomService; +import com.ruoyi.project.management.service.IPwProductionBillProductService; +import com.ruoyi.project.management.service.IPwTaskBomService; +import com.ruoyi.project.management.service.IPwTaskService; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 任务Service业务层处理 + * + * @author zhukangchao + * @date 2020-08-11 + */ +@Service +public class PwTaskServiceImpl implements IPwTaskService { + @Autowired + private PwTaskMapper pwTaskMapper; + // 用户标识信息 + @Autowired + private TokenService tokenService; + @Autowired + private IPwBomService pwBomService; + @Autowired + private IPwTaskBomService pwTaskBomService; + @Autowired + private IPwProductionBillProductService pwProductionBillProductService; + + /** + * 查询任务 + * + * @param id + * 任务ID + * @return 任务 + */ + @Override + public PwTask selectPwTaskById(Long id) { + return pwTaskMapper.selectPwTaskById(id); + } + + /** + * 查询任务列表 + * + * @param pwTask + * 任务 + * @return 任务 + */ + @Override + public List selectPwTaskList(PwTask pwTask) { + return pwTaskMapper.selectPwTaskList(pwTask); + } + + /** + * 新增任务 + * + * @param pwTask + * 任务 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertPwTask(PwTask pwTask) { + pwTask.setCreateTime(DateUtils.getNowDate()); + // 合同编号自动生成 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss-SSS"); + String string = sdf.format(new Date()); + pwTask.setTaskCode("RW-" + string); + // 获取当前登录用户信息,查询当前登录用户的vip等级 + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + pwTask.setTaskPromulgatorName(user.getNickName()); + // 任务状态为0(未发布) + pwTask.setTaskStatus(0); + //获取此任务的零部件图号,根据零部件图号去bom表中查询此零部件信息 + //根据生产执行单产品id查询产品信息 + pwTask.getProductionBillProduceId(); + PwProductionBillProduct billProduct = pwProductionBillProductService.selectPwProductionBillProductById(pwTask.getProductionBillProduceId()); + String productType = billProduct.getProductType(); + List list2 = pwBomService.selectPwBomByFigureNumberAndProductType(pwTask.getPartGather(),productType); + long s = 0; + if(list2.size()>1){ + for (PwBom pwBom2 : list2) { + s = s + pwBom2.getSingleQuantity(); + } + }else{ + s = list2.get(0).getSingleQuantity(); + } + pwTask.setQuantity(pwTask.getQuantity()*s); + int i = pwTaskMapper.insertPwTask(pwTask); + //判断是否为部件,如果是部件,则把此部件下所有的的零部件都添加到任务零件关联表中 + if("部件".equals(list2.get(0).getType())){ + PwBom bom = new PwBom(); + bom.setParentLevelFigureNumber(list2.get(0).getFigureNumber()); + bom.setTypeName(productType); + //查询此部件下所有的零部件 + List list = pwBomService.selectPwBomList(bom); + for (PwBom pwBom2 : list) { + PwTaskBom taskBom = new PwTaskBom(); + taskBom.setTaskId(pwTask.getId()); + taskBom.setMaterial(pwBom2.getName()); + taskBom.setFigureNumber(pwBom2.getFigureNumber()); + //零件数量 + taskBom.setQuantity(pwBom2.getSingleQuantity()*pwTask.getQuantity()*list2.get(0).getSingleQuantity()); + pwTaskBomService.insertPwTaskBom(taskBom); + } + } + return i; + } + + /** + * 修改任务 + * + * @param pwTask + * 任务 + * @return 结果 + */ + @Override + public int updatePwTask(PwTask pwTask) { + return pwTaskMapper.updatePwTask(pwTask); + } + + /** + * 批量删除任务 + * + * @param ids + * 需要删除的任务ID + * @return 结果 + */ + @Override + public int deletePwTaskByIds(Long[] ids) { + return pwTaskMapper.deletePwTaskByIds(ids); + } + + /** + * 删除任务信息 + * + * @param id + * 任务ID + * @return 结果 + */ + @Override + public int deletePwTaskById(Long id) { + return pwTaskMapper.deletePwTaskById(id); + } + + /** + * 完成任务按钮 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int accomplishTask(Long id) { + PwTask pwTask = pwTaskMapper.selectPwTaskById(id); + pwTask.setRealityCompletionTime(new Date()); + //计算领取时间至完成时间的差,则为任务用时(最终以小时为单位展示) + double l = pwTask.getRealityCompletionTime().getTime()-pwTask.getBeginTimes().getTime(); + double d = l/1000/3600; + pwTask.setWorkingTime(d); + //3为待质检状态,通知质检部 + pwTask.setTaskStatus(3); + int i = pwTaskMapper.updatePwTask(pwTask); + return i; + } + + /** + * 根据任务编号查询 + * @param productiveTaskCode + * @return + */ + @Override + public PwTask selectPwTaskByTaskCode(String productiveTaskCode) { + + return pwTaskMapper.selectPwTaskByTaskCode(productiveTaskCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTicketInfoServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTicketInfoServiceImpl.java new file mode 100644 index 0000000..2184199 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwTicketInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwTicketInfoMapper; +import com.ruoyi.project.management.domain.PwTicketInfo; +import com.ruoyi.project.management.service.IPwTicketInfoService; + +/** + * 处罚单信息Service业务层处理 + * + * @author zhukangchao + * @date 2023-08-01 + */ +@Service +public class PwTicketInfoServiceImpl implements IPwTicketInfoService +{ + @Autowired + private PwTicketInfoMapper pwTicketInfoMapper; + + /** + * 查询处罚单信息 + * + * @param id 处罚单信息ID + * @return 处罚单信息 + */ + @Override + public PwTicketInfo selectPwTicketInfoById(Long id) + { + return pwTicketInfoMapper.selectPwTicketInfoById(id); + } + + /** + * 查询处罚单信息列表 + * + * @param pwTicketInfo 处罚单信息 + * @return 处罚单信息 + */ + @Override + public List selectPwTicketInfoList(PwTicketInfo pwTicketInfo) + { + return pwTicketInfoMapper.selectPwTicketInfoList(pwTicketInfo); + } + + /** + * 新增处罚单信息 + * + * @param pwTicketInfo 处罚单信息 + * @return 结果 + */ + @Override + public int insertPwTicketInfo(PwTicketInfo pwTicketInfo) + { + pwTicketInfo.setCreateTime(DateUtils.getNowDate()); + return pwTicketInfoMapper.insertPwTicketInfo(pwTicketInfo); + } + + /** + * 修改处罚单信息 + * + * @param pwTicketInfo 处罚单信息 + * @return 结果 + */ + @Override + public int updatePwTicketInfo(PwTicketInfo pwTicketInfo) + { + return pwTicketInfoMapper.updatePwTicketInfo(pwTicketInfo); + } + + /** + * 批量删除处罚单信息 + * + * @param ids 需要删除的处罚单信息ID + * @return 结果 + */ + @Override + public int deletePwTicketInfoByIds(Long[] ids) + { + return pwTicketInfoMapper.deletePwTicketInfoByIds(ids); + } + + /** + * 删除处罚单信息信息 + * + * @param id 处罚单信息ID + * @return 结果 + */ + @Override + public int deletePwTicketInfoById(Long id) + { + return pwTicketInfoMapper.deletePwTicketInfoById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/PwUserEmailServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwUserEmailServiceImpl.java new file mode 100644 index 0000000..8f3a754 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/PwUserEmailServiceImpl.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.PwUserEmailMapper; +import com.ruoyi.project.management.domain.PwUserEmail; +import com.ruoyi.project.management.service.IPwUserEmailService; + +/** + * 邮箱Service业务层处理 + * + * @author zhukangchao + * @date 2022-09-24 + */ +@Service +public class PwUserEmailServiceImpl implements IPwUserEmailService +{ + @Autowired + private PwUserEmailMapper pwUserEmailMapper; + + /** + * 查询邮箱 + * + * @param id 邮箱ID + * @return 邮箱 + */ + @Override + public PwUserEmail selectPwUserEmailById(Long id) + { + return pwUserEmailMapper.selectPwUserEmailById(id); + } + + /** + * 查询邮箱列表 + * + * @param pwUserEmail 邮箱 + * @return 邮箱 + */ + @Override + public List selectPwUserEmailList(PwUserEmail pwUserEmail) + { + return pwUserEmailMapper.selectPwUserEmailList(pwUserEmail); + } + + /** + * 新增邮箱 + * + * @param pwUserEmail 邮箱 + * @return 结果 + */ + @Override + public int insertPwUserEmail(PwUserEmail pwUserEmail) + { + pwUserEmail.setCreateTime(DateUtils.getNowDate()); + return pwUserEmailMapper.insertPwUserEmail(pwUserEmail); + } + + /** + * 修改邮箱 + * + * @param pwUserEmail 邮箱 + * @return 结果 + */ + @Override + public int updatePwUserEmail(PwUserEmail pwUserEmail) + { + return pwUserEmailMapper.updatePwUserEmail(pwUserEmail); + } + + /** + * 批量删除邮箱 + * + * @param ids 需要删除的邮箱ID + * @return 结果 + */ + @Override + public int deletePwUserEmailByIds(Long[] ids) + { + return pwUserEmailMapper.deletePwUserEmailByIds(ids); + } + + /** + * 删除邮箱信息 + * + * @param id 邮箱ID + * @return 结果 + */ + @Override + public int deletePwUserEmailById(Long id) + { + return pwUserEmailMapper.deletePwUserEmailById(id); + } + + @Override + public PwUserEmail selectPwUserEmailByName(String userName) { + // TODO Auto-generated method stub + return pwUserEmailMapper.selectPwUserEmailByName(userName); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/SysConfigIniServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/SysConfigIniServiceImpl.java new file mode 100644 index 0000000..2aa1914 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/SysConfigIniServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.SysConfigIniMapper; +import com.ruoyi.project.management.domain.SysConfigIni; +import com.ruoyi.project.management.service.ISysConfigIniService; + +/** + * 图纸配置 +Service业务层处理 + * + * @author zhukangchao + * @date 2021-03-05 + */ +@Service +public class SysConfigIniServiceImpl implements ISysConfigIniService +{ + @Autowired + private SysConfigIniMapper sysConfigIniMapper; + + /** + * 查询图纸配置 + + * + * @param id 图纸配置 +ID + * @return 图纸配置 + + */ + @Override + public SysConfigIni selectSysConfigIniById(Long id) + { + return sysConfigIniMapper.selectSysConfigIniById(id); + } + + /** + * 查询图纸配置 +列表 + * + * @param sysConfigIni 图纸配置 + + * @return 图纸配置 + + */ + @Override + public List selectSysConfigIniList(SysConfigIni sysConfigIni) + { + return sysConfigIniMapper.selectSysConfigIniList(sysConfigIni); + } + + /** + * 新增图纸配置 + + * + * @param sysConfigIni 图纸配置 + + * @return 结果 + */ + @Override + public int insertSysConfigIni(SysConfigIni sysConfigIni){ + sysConfigIni.setCreateTime(DateUtils.getNowDate()); + return sysConfigIniMapper.insertSysConfigIni(sysConfigIni); + } + + /** + * 修改图纸配置 + + * + * @param sysConfigIni 图纸配置 + + * @return 结果 + */ + @Override + public int updateSysConfigIni(SysConfigIni sysConfigIni) + { + return sysConfigIniMapper.updateSysConfigIni(sysConfigIni); + } + + /** + * 批量删除图纸配置 + + * + * @param ids 需要删除的图纸配置 +ID + * @return 结果 + */ + @Override + public int deleteSysConfigIniByIds(Long[] ids) + { + return sysConfigIniMapper.deleteSysConfigIniByIds(ids); + } + + /** + * 删除图纸配置 +信息 + * + * @param id 图纸配置 +ID + * @return 结果 + */ + @Override + public int deleteSysConfigIniById(Long id) + { + return sysConfigIniMapper.deleteSysConfigIniById(id); + } + + @Override + public SysConfigIni selectSysConfigIniByFileType(String fileType) { + + return sysConfigIniMapper.selectSysConfigIniByFileType(fileType); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/YcBomNumberPreliminaryInquiryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/YcBomNumberPreliminaryInquiryServiceImpl.java new file mode 100644 index 0000000..e0f0af6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/YcBomNumberPreliminaryInquiryServiceImpl.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.YcBomNumberPreliminaryInquiryMapper; +import com.ruoyi.project.management.domain.YcBomNumberPreliminaryInquiry; +import com.ruoyi.project.management.service.IYcBomNumberPreliminaryInquiryService; + +/** + * 预查询点件Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-08 + */ +@Service +public class YcBomNumberPreliminaryInquiryServiceImpl implements IYcBomNumberPreliminaryInquiryService +{ + @Autowired + private YcBomNumberPreliminaryInquiryMapper ycBomNumberPreliminaryInquiryMapper; + + /** + * 查询预查询点件 + * + * @param id 预查询点件ID + * @return 预查询点件 + */ + @Override + public YcBomNumberPreliminaryInquiry selectYcBomNumberPreliminaryInquiryById(Long id) + { + return ycBomNumberPreliminaryInquiryMapper.selectYcBomNumberPreliminaryInquiryById(id); + } + + /** + * 查询预查询点件列表 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 预查询点件 + */ + @Override + public List selectYcBomNumberPreliminaryInquiryList(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry) + { + return ycBomNumberPreliminaryInquiryMapper.selectYcBomNumberPreliminaryInquiryList(ycBomNumberPreliminaryInquiry); + } + + /** + * 新增预查询点件 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 结果 + */ + @Override + public int insertYcBomNumberPreliminaryInquiry(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry) + { + ycBomNumberPreliminaryInquiry.setCreateTime(DateUtils.getNowDate()); + return ycBomNumberPreliminaryInquiryMapper.insertYcBomNumberPreliminaryInquiry(ycBomNumberPreliminaryInquiry); + } + + /** + * 修改预查询点件 + * + * @param ycBomNumberPreliminaryInquiry 预查询点件 + * @return 结果 + */ + @Override + public int updateYcBomNumberPreliminaryInquiry(YcBomNumberPreliminaryInquiry ycBomNumberPreliminaryInquiry) + { + return ycBomNumberPreliminaryInquiryMapper.updateYcBomNumberPreliminaryInquiry(ycBomNumberPreliminaryInquiry); + } + + /** + * 批量删除预查询点件 + * + * @param ids 需要删除的预查询点件ID + * @return 结果 + */ + @Override + public int deleteYcBomNumberPreliminaryInquiryByIds(Long[] ids) + { + return ycBomNumberPreliminaryInquiryMapper.deleteYcBomNumberPreliminaryInquiryByIds(ids); + } + + /** + * 删除预查询点件信息 + * + * @param id 预查询点件ID + * @return 结果 + */ + @Override + public int deleteYcBomNumberPreliminaryInquiryById(Long id) + { + return ycBomNumberPreliminaryInquiryMapper.deleteYcBomNumberPreliminaryInquiryById(id); + } + + @Override + public int insertYcBomNumberPreliminaryInquirys(List list) { + // TODO Auto-generated method stub + return ycBomNumberPreliminaryInquiryMapper.insertYcBomNumberPreliminaryInquirys(list); + } + + @Override + public List selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber( + String figureNumber, String typeName, String productionCode) { + // TODO Auto-generated method stub + return ycBomNumberPreliminaryInquiryMapper.selectYcBomNumberPreliminaryInquiryByParentLevelFigureNumber(figureNumber,figureNumber+"/2-1",figureNumber+"/2-2",typeName,productionCode); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/YcBomNumberTwoPreliminaryInquiryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/YcBomNumberTwoPreliminaryInquiryServiceImpl.java new file mode 100644 index 0000000..b02e395 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/YcBomNumberTwoPreliminaryInquiryServiceImpl.java @@ -0,0 +1,102 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.YcBomNumberTwoPreliminaryInquiryMapper; +import com.ruoyi.project.management.domain.YcBomNumberTwoPreliminaryInquiry; +import com.ruoyi.project.management.service.IYcBomNumberTwoPreliminaryInquiryService; + +/** + * 预查询计算后的点件Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-08 + */ +@Service +public class YcBomNumberTwoPreliminaryInquiryServiceImpl implements IYcBomNumberTwoPreliminaryInquiryService +{ + @Autowired + private YcBomNumberTwoPreliminaryInquiryMapper ycBomNumberTwoPreliminaryInquiryMapper; + + /** + * 查询预查询计算后的点件 + * + * @param id 预查询计算后的点件ID + * @return 预查询计算后的点件 + */ + @Override + public YcBomNumberTwoPreliminaryInquiry selectYcBomNumberTwoPreliminaryInquiryById(Long id) + { + return ycBomNumberTwoPreliminaryInquiryMapper.selectYcBomNumberTwoPreliminaryInquiryById(id); + } + + /** + * 查询预查询计算后的点件列表 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 预查询计算后的点件 + */ + @Override + public List selectYcBomNumberTwoPreliminaryInquiryList(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry) + { + return ycBomNumberTwoPreliminaryInquiryMapper.selectYcBomNumberTwoPreliminaryInquiryList(ycBomNumberTwoPreliminaryInquiry); + } + + /** + * 新增预查询计算后的点件 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 结果 + */ + @Override + public int insertYcBomNumberTwoPreliminaryInquiry(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry) + { + ycBomNumberTwoPreliminaryInquiry.setCreateTime(DateUtils.getNowDate()); + return ycBomNumberTwoPreliminaryInquiryMapper.insertYcBomNumberTwoPreliminaryInquiry(ycBomNumberTwoPreliminaryInquiry); + } + + /** + * 修改预查询计算后的点件 + * + * @param ycBomNumberTwoPreliminaryInquiry 预查询计算后的点件 + * @return 结果 + */ + @Override + public int updateYcBomNumberTwoPreliminaryInquiry(YcBomNumberTwoPreliminaryInquiry ycBomNumberTwoPreliminaryInquiry) + { + return ycBomNumberTwoPreliminaryInquiryMapper.updateYcBomNumberTwoPreliminaryInquiry(ycBomNumberTwoPreliminaryInquiry); + } + + /** + * 批量删除预查询计算后的点件 + * + * @param ids 需要删除的预查询计算后的点件ID + * @return 结果 + */ + @Override + public int deleteYcBomNumberTwoPreliminaryInquiryByIds(Long[] ids) + { + return ycBomNumberTwoPreliminaryInquiryMapper.deleteYcBomNumberTwoPreliminaryInquiryByIds(ids); + } + + /** + * 删除预查询计算后的点件信息 + * + * @param id 预查询计算后的点件ID + * @return 结果 + */ + @Override + public int deleteYcBomNumberTwoPreliminaryInquiryById(Long id) + { + return ycBomNumberTwoPreliminaryInquiryMapper.deleteYcBomNumberTwoPreliminaryInquiryById(id); + } + + @Override + public YcBomNumberTwoPreliminaryInquiry selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber( + String productionCode, String name, String figureNumber) { + // TODO Auto-generated method stub + return ycBomNumberTwoPreliminaryInquiryMapper.selectYcBomNumberTwoPreliminaryInquiryByCodeAndTypeNameAndFigureNumber(productionCode,name,figureNumber); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/service/impl/YcProductServiceImpl.java b/evo/src/main/java/com/ruoyi/project/management/service/impl/YcProductServiceImpl.java new file mode 100644 index 0000000..ee86332 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/service/impl/YcProductServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.management.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.management.mapper.YcProductMapper; +import com.ruoyi.project.management.domain.YcProduct; +import com.ruoyi.project.management.service.IYcProductService; + +/** + * 预查询产品Service业务层处理 + * + * @author zhukangchao + * @date 2021-12-08 + */ +@Service +public class YcProductServiceImpl implements IYcProductService +{ + @Autowired + private YcProductMapper ycProductMapper; + + /** + * 查询预查询产品 + * + * @param int 预查询产品ID + * @return 预查询产品 + */ + @Override + public YcProduct selectYcProductById(Long id) + { + return ycProductMapper.selectYcProductById(id); + } + + /** + * 查询预查询产品列表 + * + * @param ycProduct 预查询产品 + * @return 预查询产品 + */ + @Override + public List selectYcProductList(YcProduct ycProduct) + { + return ycProductMapper.selectYcProductList(ycProduct); + } + + /** + * 新增预查询产品 + * + * @param ycProduct 预查询产品 + * @return 结果 + */ + @Override + public int insertYcProduct(YcProduct ycProduct) + { + ycProduct.setCreateTime(DateUtils.getNowDate()); + return ycProductMapper.insertYcProduct(ycProduct); + } + + /** + * 修改预查询产品 + * + * @param ycProduct 预查询产品 + * @return 结果 + */ + @Override + public int updateYcProduct(YcProduct ycProduct) + { + return ycProductMapper.updateYcProduct(ycProduct); + } + + /** + * 批量删除预查询产品 + * + * @param ints 需要删除的预查询产品ID + * @return 结果 + */ + @Override + public int deleteYcProductByIds(Long[] ids) + { + return ycProductMapper.deleteYcProductByIds(ids); + } + + /** + * 删除预查询产品信息 + * + * @param int 预查询产品ID + * @return 结果 + */ + @Override + public int deleteYcProductById(Long id) + { + return ycProductMapper.deleteYcProductById(id); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/AddLogs.java b/evo/src/main/java/com/ruoyi/project/management/utils/AddLogs.java new file mode 100644 index 0000000..d456a29 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/AddLogs.java @@ -0,0 +1,63 @@ +package com.ruoyi.project.management.utils; + +import com.ruoyi.project.management.domain.PwBacklog; +import com.ruoyi.project.management.service.IPwBacklogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import java.util.Date; + + +@Component +public class AddLogs { + private IPwBacklogService iPwBacklogService; + + @Autowired + public AddLogs(IPwBacklogService iPwBacklogService){ + this.iPwBacklogService = iPwBacklogService; + } + + public int insertPwBacklog(PwBacklog pwBacklog){ + return iPwBacklogService.insertPwBacklog(pwBacklog); + } + /** + * 创建待办事项 + * @param matterName + * @param code + * @param materialName + * @param figureNumber + * @param nickName + * @param recipientName + * @param processMode + * @param address + * @param moduleName + */ + public void addBacklog(String matterName, String code,String materialName,String figureNumber,String nickName, String recipientName, String processMode,String moduleName, String address) { + //创建新的待办事项 + PwBacklog pwBacklog = new PwBacklog(); + //事项名称 + pwBacklog.setMatterName(matterName); + //关联令号 + pwBacklog.setCode(code); + //关联令号 + pwBacklog.setMaterialName(materialName); + //关联令号 + pwBacklog.setFigureNumber(figureNumber); + //推送人 + pwBacklog.setPushName(nickName); + //推送时间 + pwBacklog.setPushTime(new Date()); + //办理人 + pwBacklog.setRecipientName(recipientName); + //办理方式 + pwBacklog.setProcessMode(processMode); + //是否完成(默认为否) + pwBacklog.setSchedule("否"); + //模块名称 + pwBacklog.setModuleName(moduleName); + //路由地址 + pwBacklog.setAddress(address); + //是否已阅(默认为否) + pwBacklog.setStatus("否"); + insertPwBacklog(pwBacklog); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/BaseDataTool.java b/evo/src/main/java/com/ruoyi/project/management/utils/BaseDataTool.java new file mode 100644 index 0000000..f3bcc40 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/BaseDataTool.java @@ -0,0 +1,720 @@ +package com.ruoyi.project.management.utils; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.gson.Gson; +import com.kingdee.bos.webapi.entity.RepoRet; +import com.kingdee.bos.webapi.sdk.K3CloudApi; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.management.domain.*; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BaseDataTool { + + //读取配置,初始化SDK + public static K3CloudApi client = new K3CloudApi(); + + public static int analysisMaterial(ImMaterial imMaterial) throws Exception{ + + String jsonData = "{\"IsAutoSubmitAndAudit\":true,\n" + + " \"NeedUpDateFields\": [],\n" + + " \"NeedReturnFields\": [],\n" + + " \"IsDeleteEntry\": \"true\",\n" + + " \"SubSystemId\": \"\",\n" + + " \"IsVerifyBaseDataField\": \"false\",\n" + + " \"IsEntryBatchFill\": \"true\",\n" + + " \"ValidateFlag\": \"true\",\n" + + " \"NumberSearch\": \"true\",\n" + + " \"IsAutoAdjustField\": \"false\",\n" + + " \"InterationFlags\": \"\",\n" + + " \"IgnoreInterationFlag\": \"\",\n" + + " \"IsControlPrecision\": \"false\",\n" + + " \"ValidateRepeatJson\": \"false\",\n" + + " \"Model\": {\n" + + " \"FMATERIALID\": 0,\n" + + " \"FNumber\": \""+imMaterial.getFigureNumber()+"\",\n" + + " \"FName\": \""+imMaterial.getMaterialName()+"\",\n" + + " \"FSpecification\":\""+imMaterial.getSpecificationType()+"\",\n"+ + " \"FMaterialGroup\":{\"FNumber\":\""+imMaterial.getMaterialGroup()+"\"},\n"+ + " \"FDSMatchByLot\": false,\n" + + " \"FImgStorageType\": \"A\",\n" + + " \"FIsSalseByNet\": false,\n" + + " \"FIsHandleReserve\": true,\n" + + " \"FSubHeadEntity\": {\n" + + " \"FIsControlSal\": false,\n" + + " \"FLowerPercent\": 0.0,\n" + + " \"FUpPercent\": 0.0,\n" + + " \"FCalculateBase\": \"0\",\n" + + " \"FMaxSalPrice_CMK\": 0.0,\n" + + " \"FMinSalPrice_CMK\": 0.0,\n" + + " \"FIsAutoRemove\": false,\n" + + " \"FIsMailVirtual\": false,\n" + + " \"FIsFreeSend\": \"0\",\n" + + " \"FTimeUnit\": \"H\",\n" + + " \"FRentFreeDura\": 0.0,\n" + + " \"FPricingStep\": 0.0,\n" + + " \"FMinRentDura\": 0.0,\n" + + " \"FRentBeginPrice\": 0.0,\n" + + " \"FPriceType\": \"0\",\n" + + " \"FRentStepPrice\": 0.0,\n" + + " \"FDepositAmount\": 0.0,\n" + + " \"FLogisticsCount\": 0.0,\n" + + " \"FRequestMinPackQty\": 0.0,\n" + + " \"FMinRequestQty\": 0.0,\n" + + " \"FIsPrinttAg\": false,\n" + + " \"FIsAccessory\": false,\n" + + " \"FUploadSkuImage\": false\n" + + " },\n" + + " \"SubHeadEntity\": {\n" + + " \"FErpClsID\": \""+imMaterial.getPurchaseMarkId()+"\",\n" + + " \"FFeatureItem\": \"1\",\n" + + " \"FCategoryID\": {\n" + + " \"FNumber\": \""+imMaterial.getCategoryId()+"\"\n" + + " },\n" + + " \"FTaxType\": {\n" + + " \"FNumber\": \"WLDSFL01_SYS\"\n" + + " },\n" + + " \"FTaxRateId\": {\n" + + " \"FNUMBER\": \"SL02_SYS\"\n" + + " },\n" + + " \"FBaseUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FIsPurchase\": true,\n" + + " \"FIsInventory\": true,\n" + + " \"FIsSubContract\": true,\n" + + " \"FIsSale\": true,\n" + + " \"FIsProduce\": true,\n" + + " \"FIsAsset\": true,\n" + + " \"FGROSSWEIGHT\": 0.0,\n" + + " \"FNETWEIGHT\": "+imMaterial.getPieceWeight()+",\n" + + " \"FWEIGHTUNITID\": {\n" + + " \"FNUMBER\": \"kg\"\n" + + " },\n" + + " \"FLENGTH\": 0.0,\n" + + " \"FWIDTH\": 0.0,\n" + + " \"FHEIGHT\": 0.0,\n" + + " \"FVOLUME\": 0.0,\n" + + " \"FVOLUMEUNITID\": {\n" + + " \"FNUMBER\": \"m\"\n" + + " },\n" + + " \"FSuite\": \"0\",\n" + + " \"FCostPriceRate\": 0.0\n" + + " },\n" + + " \"SubHeadEntity1\": {\n" + + " \"FStoreUnitID\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FUnitConvertDir\": \"1\",\n" + + " \"FIsLockStock\": true,\n" + + " \"FIsCycleCounting\": false,\n" + + " \"FCountCycle\": \"1\",\n" + + " \"FCountDay\": 1,\n" + + " \"FIsMustCounting\": false,\n" + + " \"FIsBatchManage\": false,\n" + + " \"FIsKFPeriod\": false,\n" + + " \"FIsExpParToFlot\": false,\n" + + " \"FExpPeriod\": 0,\n" + + " \"FOnlineLife\": 0,\n" + + " \"FRefCost\": 0.0,\n" + + " \"FCurrencyId\": {\n" + + " \"FNumber\": \"PRE001\"\n" + + " },\n" + + " \"FStockId\": {\n" + + " \"FNumber\": \""+imMaterial.getWarehouseId()+"\"\n" + + " },\n" + + " \"FIsEnableMinStock\": false,\n" + + " \"FIsEnableMaxStock\": false,\n" + + " \"FIsEnableSafeStock\": false,\n" + + " \"FIsEnableReOrder\": false,\n" + + " \"FMinStock\": 0.0,\n" + + " \"FSafeStock\": 0.0,\n" + + " \"FReOrderGood\": 0.0,\n" + + " \"FEconReOrderQty\": 0.0,\n" + + " \"FMaxStock\": 0.0,\n" + + " \"FIsSNManage\": false,\n" + + " \"FIsSNPRDTracy\": false,\n" + + " \"FSNManageType\": \"1\",\n" + + " \"FSNGenerateTime\": \"1\",\n" + + " \"FBoxStandardQty\": 0.0\n" + + " },\n" + + " \"SubHeadEntity2\": {\n" + + " \"FSaleUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FSalePriceUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FOrderQty\": 0.0,\n" + + " \"FMinQty\": 0.0,\n" + + " \"FMaxQty\": 100000.0,\n" + + " \"FOutStockLmtH\": 0.0,\n" + + " \"FOutStockLmtL\": 0.0,\n" + + " \"FAgentSalReduceRate\": 0.0,\n" + + " \"FIsATPCheck\": false,\n" + + " \"FIsReturnPart\": false,\n" + + " \"FIsInvoice\": false,\n" + + " \"FIsReturn\": true,\n" + + " \"FAllowPublish\": false,\n" + + " \"FISAFTERSALE\": true,\n" + + " \"FISPRODUCTFILES\": true,\n" + + " \"FISWARRANTED\": false,\n" + + " \"FWARRANTY\": 0,\n" + + " \"FWARRANTYUNITID\": \"D\",\n" + + " \"FOutLmtUnit\": \"SAL\",\n" + + " \"FIsTaxEnjoy\": false,\n" + + " \"FTaxDiscountsType\": \"0\",\n" + + " \"FUnValidateExpQty\": false\n" + + " },\n" + + " \"SubHeadEntity3\": {\n" + + " \"FBaseMinSplitQty\": 0.0,\n" + + " \"FPurchaseUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FPurchasePriceUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FIsQuota\": false,\n" + + " \"FQuotaType\": \"1\",\n" + + " \"FMinSplitQty\": 0.0,\n" + + " \"FIsVmiBusiness\": false,\n" + + " \"FEnableSL\": false,\n" + + " \"FIsPR\": false,\n" + + " \"FIsReturnMaterial\": true,\n" + + " \"FIsSourceControl\": false,\n" + + " \"FReceiveMaxScale\": 0.0,\n" + + " \"FReceiveMinScale\": 0.0,\n" + + " \"FReceiveAdvanceDays\": 0,\n" + + " \"FReceiveDelayDays\": 0,\n" + + " \"FPOBillTypeId\": {\n" + + " \"FNUMBER\": \"CGSQD01_SYS\"\n" + + " },\n" + + " \"FAgentPurPlusRate\": 0.0,\n" + + " \"FPrintCount\": 1,\n" + + " \"FMinPackCount\": 1.0,\n" + + " \"FDailyOutQtySub\": 0.0,\n" + + " \"FIsEnableScheduleSub\": false\n" + + " },\n" + + " \"SubHeadEntity4\": {\n" + + " \"FPlanMode\": \"0\",\n" + + " \"FBaseVarLeadTimeLotSize\": 0.0,\n" + + " \"FPlanningStrategy\": \"1\",\n" + + " \"FMfgPolicyId\": {\n" + + " \"FNumber\": \"ZZCL001_SYS\"\n" + + " },\n" + + " \"FOrderPolicy\": \"0\",\n" + + " \"FFixLeadTime\": 0,\n" + + " \"FFixLeadTimeType\": \"1\",\n" + + " \"FVarLeadTime\": 0,\n" + + " \"FVarLeadTimeType\": \"1\",\n" + + " \"FCheckLeadTime\": 0,\n" + + " \"FCheckLeadTimeType\": \"1\",\n" + + " \"FOrderIntervalTimeType\": \"3\",\n" + + " \"FOrderIntervalTime\": 0,\n" + + " \"FMaxPOQty\": 100000.0,\n" + + " \"FMinPOQty\": 0.0,\n" + + " \"FIncreaseQty\": 0.0,\n" + + " \"FEOQ\": 1.0,\n" + + " \"FVarLeadTimeLotSize\": 1.0,\n" + + " \"FPlanIntervalsDays\": 0,\n" + + " \"FPlanBatchSplitQty\": 0.0,\n" + + " \"FRequestTimeZone\": 0,\n" + + " \"FPlanTimeZone\": 0,\n" + + " \"FIsMrpComBill\": true,\n" + + " \"FCanLeadDays\": 0,\n" + + " \"FIsMrpComReq\": false,\n" + + " \"FLeadExtendDay\": 0,\n" + + " \"FReserveType\": \"1\",\n" + + " \"FPlanSafeStockQty\": 0.0,\n" + + " \"FAllowPartAhead\": false,\n" + + " \"FCanDelayDays\": 999,\n" + + " \"FDelayExtendDay\": 0,\n" + + " \"FAllowPartDelay\": true,\n" + + " \"FPlanOffsetTimeType\": \"1\",\n" + + " \"FPlanOffsetTime\": 0,\n" + + " \"FWriteOffQty\": 1.0,\n" + + " \"FDailyOutQty\": 0.0\n" + + " },\n" + + " \"SubHeadEntity5\": {\n" + + " \"FProduceUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FFinishReceiptOverRate\": 0.0,\n" + + " \"FFinishReceiptShortRate\": 0.0,\n" + + " \"FProduceBillType\": {\n" + + " \"FNUMBER\": \"SCDD03_SYS\"\n" + + " },\n" + + " \"FIsSNCarryToParent\": false,\n" + + " \"FIsProductLine\": false,\n" + + " \"FBOMUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FLOSSPERCENT\": 0.0,\n" + + " \"FConsumVolatility\": 0.0,\n" + + " \"FIsMainPrd\": true,\n" + + " \"FIsCoby\": false,\n" + + " \"FIsECN\": false,\n" + + " \"FIssueType\": \"1\",\n" + + " \"FOverControlMode\": \"1\",\n" + + " \"FMinIssueQty\": 1.0,\n" + + " \"FISMinIssueQty\": false,\n" + + " \"FIsKitting\": false,\n" + + " \"FIsCompleteSet\": false,\n" + + " \"FStdLaborPrePareTime\": 0.0,\n" + + " \"FStdLaborProcessTime\": 0.0,\n" + + " \"FStdMachinePrepareTime\": 0.0,\n" + + " \"FStdMachineProcessTime\": 0.0,\n" + + " \"FMinIssueUnitId\": {\n" + + " \"FNUMBER\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FStandHourUnitId\": \"3600\",\n" + + " \"FBackFlushType\": \"1\",\n" + + " \"FFIXLOSS\": 0.0,\n" + + " \"FIsEnableSchedule\": false\n" + + " },\n" + + " \"SubHeadEntity7\": {\n" + + " \"FSubconUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FSubconPriceUnitId\": {\n" + + " \"FNumber\": \""+imMaterial.getUnitOfMeasurementId()+"\"\n" + + " },\n" + + " \"FSubBillType\": {\n" + + " \"FNUMBER\": \"WWDD01_SYS\"\n" + + " }\n" + + " },\n" + + " \"SubHeadEntity6\": {\n" + + " \"FCheckIncoming\": false,\n" + + " \"FCheckProduct\": true,\n" + + " \"FCheckStock\": false,\n" + + " \"FCheckReturn\": false,\n" + + " \"FCheckDelivery\": false,\n" + + " \"FEnableCyclistQCSTK\": false,\n" + + " \"FStockCycle\": 0,\n" + + " \"FEnableCyclistQCSTKEW\": false,\n" + + " \"FEWLeadDay\": 0,\n" + + " \"FCheckEntrusted\": false,\n" + + " \"FCheckOther\": false,\n" + + " \"FIsFirstInspect\": false,\n" + + " \"FCheckReturnMtrl\": false,\n" + + " \"FCheckSubRtnMtrl\": false,\n" + + " \"FFirstQCControlType\": \"0\"\n" + + " }\n" + + " }\n" + + "}"; + + //业务对象标识 + String formId = "BD_MATERIAL"; + return saveDatasToJindie(formId,jsonData); + } + /** + * 保存数据到金蝶 + * @param formId + * @param jsonData + * @return + */ + private static int saveDatasToJindie(String formId,String jsonData) throws Exception{ + int flag = 0; + //调用接口 + String resultJson = client.save(formId,jsonData); + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + flag = 1; + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + } else { + flag = 0; + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult().getResponseStatus())); + } + return flag; + } + /** + * 金蝶查询物料参数接口 + * @return + */ + public static String queryMaterialsParams(String formId) throws Exception{ + String jsonData = "{\n" + + " \"FormId\": \""+formId+"\",\n" + + " \"FieldKeys\": \"FNumber,FName\",\n" + + " \"FilterString\": [],\n" + + " \"OrderString\": \"\",\n" + + " \"TopRowCount\": 0,\n" + + " \"StartRow\": 0,\n" + + " \"Limit\": 2000,\n" + + " \"SubSystemId\": \"\"\n" + + "}"; + //调用接口 + String resultJson = String.valueOf(client.billQuery(jsonData)); + System.out.println("接口返回结果: " + resultJson); + return resultJson; + } + /** + * 金蝶查询物料材料接口 + * @return + */ + public static String queryMaterialsType() throws Exception{ + String jsonData = "{\n" + + " \"FormId\": \"BOS_ASSISTANTDATA_DETAIL\",\n" + + " \"FieldKeys\": \"FNumber,FDataValue\",\n" + + " \"FilterString\": [{\"FieldName\":\"FId.FName\",\"Compare\":\"67\",\"Value\":\"材料\",\"Left\":\"\",\"Right\":\"\",\"Logic\":\"0\"}],\n" + + " \"OrderString\": \"\",\n" + + " \"TopRowCount\": 0,\n" + + " \"StartRow\": 0,\n" + + " \"Limit\": 2000,\n" + + " \"SubSystemId\": \"\"\n" + + "}"; + //调用接口 + String resultJson = String.valueOf(client.billQuery(jsonData)); + System.out.println("接口返回结果: " + resultJson); + return resultJson; + } + /** + * 根据图号查询物料信息 + * @param params + * @return + */ + public static List queryMaterials(String params) throws Exception{ + List material_list = new ArrayList(); + int startPage = 0; + while(true){ + String jsonData = "{\"FormId\":\"BD_MATERIAL\"," + + "\"FieldKeys\":\"FNumber,FName,FBaseUnitId.FNumber,FErpClsID,FCategoryID.FNumber,FStockId.FNumber,FMaterialGroup.FNumber,F_SVRI_Assistant.FDataValue\"," + + "\"FilterString\":[{\"FieldName\":\"FForbidStatus\",\"Compare\":\"105\",\"Value\":\"A\",\"Left\":\"\",\"Right\":\"\",\"Logic\":0}," + + "{\"FieldName\":\"FDocumentStatus\",\"Compare\":\"106\",\"Value\":\"Z\",\"Left\":\"\",\"Right\":\"\",\"Logic\":0}," + + "{\"Left\":\"\",\"FieldName\":\"FNumber\",\"Compare\":\"338\",\"Value\":\""+params+"\",\"Right\":\"\",\"Logic\":0}]," + + "\"OrderString\":\"FNumber\"," + + "\"TopRowCount\":0," + + "\"StartRow\":"+startPage+"," + + "\"Limit\":10000," + + "\"SubSystemId\":\"\"}"; + //调用接口 + String resultJson = String.valueOf(client.billQuery(jsonData)); + JSONArray arrays = JSONArray.parseArray(resultJson); + ImMaterial imMaterial = null; + for (int p=0;p queryMaterialsByName(String name) throws Exception{ + List material_list = new ArrayList(); + String jsonData = "{\"FormId\":\"BD_MATERIAL\"," + + "\"FieldKeys\":\"FNumber,FName,FBaseUnitId.FNumber,FErpClsID,FCategoryID.FNumber,FStockId.FNumber,FMaterialGroup.FNumber,F_SVRI_Assistant.FDataValue\"," + + "\"FilterString\":[{\"FieldName\":\"FName\",\"Compare\":\"17\",\"Value\":\""+name+"\",\"Left\":\"\",\"Right\":\"\",\"Logic\":\"1\"}]," + + "\"OrderString\":\"FNumber\"," + + "\"TopRowCount\":0," + + "\"StartRow\":0," + + "\"Limit\":10000," + + "\"SubSystemId\":\"\"}"; + //调用接口 + String resultJson = String.valueOf(client.billQuery(jsonData)); + JSONArray arrays = JSONArray.parseArray(resultJson); + ImMaterial imMaterial = null; + for (int p=0;p queryMaterialsForInstantLibrary(String params) throws Exception{ + List res_list = new ArrayList(); + int start = 0; + while(true){ + //可用数量:可用量=库存量-锁库量/预留量 ,库存量 FBaseQty, 仓库:FStockID.FNumber + String jsonData = "{\"FormId\":\"STK_Inventory\"," + + "\"FieldKeys\":\"FMaterialId.FNumber,FBaseQty\"," + + "\"FilterString\":[{\"Left\":\"\",\"FieldName\":\"FMaterialId.FNumber\",\"Compare\":\"338\",\"Value\":\""+params+"\",\"Right\":\"\",\"Logic\":0}]," + + "\"OrderString\":\"FMaterialId.FNumber\"," + + "\"TopRowCount\":0," + + "\"StartRow\":"+start+"," + + "\"Limit\":10000," + + "\"SubSystemId\":\"\"}"; + //调用接口 + String resultJson = String.valueOf(client.billQuery(jsonData)); + if(StringUtils.isNotEmpty(resultJson) && !Constants.JD_RESULT.equals(resultJson)){ + JSONArray arrays = JSONArray.parseArray(resultJson); + JDInvertoryVo jDInvertoryVo = null; + for(int p=0;p sk_list = new ArrayList(); + if(StringUtils.isNotEmpty(sk_resultJson) && !Constants.JD_RESULT.equals(sk_resultJson)){ + JSONArray arrays = JSONArray.parseArray(sk_resultJson); + JDInvertoryVo jDInvertoryVo = null; + for(int p=0;p yll_list = new ArrayList(); + JSONArray arrays = JSONArray.parseArray(yll_object.getString("Rows")); + JDInvertoryVo jDInvertoryVo = null; + for(int p=0;p> readExcel(File file) { + if (file == null) { + return null; + } + if (file.getName().endsWith("xlsx")) { + //处理ecxel2007 + return readExcel2007(file); + } else { + //处理ecxel2003 + return readExcel2003(file); + } + } + + /* + * @return 将返回结果存储在ArrayList内,存储结构与二位数组类似 + * lists.get(0).get(0)表示过去Excel中0行0列单元格 + */ + public static ArrayList> readExcel2003(File file) { + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(file)); + HSSFSheet sheet = wb.getSheetAt(0); + HSSFRow row; + HSSFCell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + //当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {//判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + //当该单元格为空 + if (j != row.getLastCellNum()) {//判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: +// System.out.println(i + "行" + j + " 列 is String type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle().getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell + .getNumericCellValue())); + } +// value = cell.getStringCellValue(); +// System.out.println(i + "行" + j +// + " 列 is Number type ; DateFormt:" +// + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: +// System.out.println(i + "行" + j + " 列 is Boolean type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: +// System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: +// System.out.println(i + "行" + j + " 列 is default type"); + value = cell.toString(); + }// end switch + colList.add(value); + }//end for j + rowList.add(colList); + }//end for i + + return rowList; + } catch (Exception e) { + return null; + } + } + + public static ArrayList> readExcel2007(File file) { + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(file)); + XSSFSheet sheet = wb.getSheetAt(0); + XSSFRow row; + XSSFCell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + //当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {//判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + //当该单元格为空 + if (j != row.getLastCellNum()) {//判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: +// System.out.println(i + "行" + j + " 列 is String type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle() + .getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell + .getNumericCellValue())); + } +// value = cell.getStringCellValue(); +// System.out.println(i + "行" + j +// + " 列 is Number type ; DateFormt:" +// + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: +// System.out.println(i + "行" + j + " 列 is Boolean type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: +// System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: +// System.out.println(i + "行" + j + " 列 is default type"); + value = cell.toString(); + }// end switch + colList.add(value); + }//end for j + rowList.add(colList); + }//end for i + + return rowList; + } catch (Exception e) { + System.out.println(e); + return null; + } + } + + public static void writeExcel(ArrayList> result, String path) { + if (result == null) { + return; + } + HSSFWorkbook wb = new HSSFWorkbook(); + HSSFSheet sheet = wb.createSheet("sheet1"); + for (int i = 0; i < result.size(); i++) { + HSSFRow row = sheet.createRow(i); + if (result.get(i) != null) { + for (int j = 0; j < result.get(i).size(); j++) { + HSSFCell cell = row.createCell(j); + cell.setCellValue(result.get(i).get(j).toString()); + } + } + } + ByteArrayOutputStream os = new ByteArrayOutputStream(); + try { + wb.write(os); + } catch (IOException e) { + e.printStackTrace(); + } + byte[] content = os.toByteArray(); + File file = new File(path);//Excel文件生成后存储的位置。 + OutputStream fos = null; + try { + fos = new FileOutputStream(file); + fos.write(content); + os.close(); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelU.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelU.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelU.nf = nf; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/ExcelUPg.java b/evo/src/main/java/com/ruoyi/project/management/utils/ExcelUPg.java new file mode 100644 index 0000000..263d10e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/ExcelUPg.java @@ -0,0 +1,242 @@ +package com.ruoyi.project.management.utils; + +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.io.*; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; + +public class ExcelUPg { + //默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.0"); + + public static ArrayList> readExcel(File file) { + if (file == null) { + return null; + } + if (file.getName().endsWith("xlsx")) { + //处理ecxel2007 + return readExcel2007(file); + } else { + //处理ecxel2003 + return readExcel2003(file); + } + } + + /* + * @return 将返回结果存储在ArrayList内,存储结构与二位数组类似 + * lists.get(0).get(0)表示过去Excel中0行0列单元格 + */ + public static ArrayList> readExcel2003(File file) { + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(file)); + HSSFSheet sheet = wb.getSheetAt(0); + HSSFRow row; + HSSFCell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + //当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {//判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + //当该单元格为空 + if (j != row.getLastCellNum()) {//判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: +// System.out.println(i + "行" + j + " 列 is String type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle().getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell + .getNumericCellValue())); + } +// value = cell.getStringCellValue(); +// System.out.println(i + "行" + j +// + " 列 is Number type ; DateFormt:" +// + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: +// System.out.println(i + "行" + j + " 列 is Boolean type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: +// System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: +// System.out.println(i + "行" + j + " 列 is default type"); + value = cell.toString(); + }// end switch + colList.add(value); + }//end for j + rowList.add(colList); + }//end for i + + return rowList; + } catch (Exception e) { + return null; + } + } + + public static ArrayList> readExcel2007(File file) { + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(file)); + XSSFSheet sheet = wb.getSheetAt(1); + XSSFRow row; + XSSFCell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + //当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {//判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + //当该单元格为空 + if (j != row.getLastCellNum()) {//判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: +// System.out.println(i + "行" + j + " 列 is String type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle() + .getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell + .getNumericCellValue())); + } +// value = cell.getStringCellValue(); +// System.out.println(i + "行" + j +// + " 列 is Number type ; DateFormt:" +// + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: +// System.out.println(i + "行" + j + " 列 is Boolean type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: +// System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: +// System.out.println(i + "行" + j + " 列 is default type"); + value = cell.toString(); + }// end switch + colList.add(value); + }//end for j + rowList.add(colList); + }//end for i + + return rowList; + } catch (Exception e) { + System.out.println(e); + return null; + } + } + + public static void writeExcel(ArrayList> result, String path) { + if (result == null) { + return; + } + HSSFWorkbook wb = new HSSFWorkbook(); + HSSFSheet sheet = wb.createSheet("sheet1"); + for (int i = 0; i < result.size(); i++) { + HSSFRow row = sheet.createRow(i); + if (result.get(i) != null) { + for (int j = 0; j < result.get(i).size(); j++) { + HSSFCell cell = row.createCell(j); + cell.setCellValue(result.get(i).get(j).toString()); + } + } + } + ByteArrayOutputStream os = new ByteArrayOutputStream(); + try { + wb.write(os); + } catch (IOException e) { + e.printStackTrace(); + } + byte[] content = os.toByteArray(); + File file = new File(path);//Excel文件生成后存储的位置。 + OutputStream fos = null; + try { + fos = new FileOutputStream(file); + fos.write(content); + os.close(); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUPg.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUPg.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUPg.nf = nf; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/ExcelUs.java b/evo/src/main/java/com/ruoyi/project/management/utils/ExcelUs.java new file mode 100644 index 0000000..03e5107 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/ExcelUs.java @@ -0,0 +1,250 @@ +package com.ruoyi.project.management.utils; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +public class ExcelUs { + //默认单元格内容为数字时格式 + private static DecimalFormat df = new DecimalFormat("0"); + // 默认单元格格式化日期字符串 + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 格式化数字 + private static DecimalFormat nf = new DecimalFormat("0.00"); + + public static ArrayList> readExcel(File file) { + if (file == null) { + return null; + } + if (file.getName().endsWith("xlsx")) { + //处理ecxel2007 + return readExcel2007(file); + } else { + //处理ecxel2003 + return readExcel2003(file); + } + } + + /* + * @return 将返回结果存储在ArrayList内,存储结构与二位数组类似 + * lists.get(0).get(0)表示过去Excel中0行0列单元格 + */ + public static ArrayList> readExcel2003(File file) { + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(file)); + HSSFSheet sheet = wb.getSheetAt(0); + HSSFRow row; + HSSFCell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + //当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {//判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + //当该单元格为空 + if (j != row.getLastCellNum()) {//判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: +// System.out.println(i + "行" + j + " 列 is String type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle() + .getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell + .getNumericCellValue())); + } +// System.out.println(i + "行" + j +// + " 列 is Number type ; DateFormt:" +// + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: +// System.out.println(i + "行" + j + " 列 is Boolean type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: +// System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: +// System.out.println(i + "行" + j + " 列 is default type"); + value = cell.toString(); + }// end switch + colList.add(value); + }//end for j + rowList.add(colList); + }//end for i + + return rowList; + } catch (Exception e) { + return null; + } + } + + public static ArrayList> readExcel2007(File file) { + try { + ArrayList> rowList = new ArrayList>(); + ArrayList colList; + XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(file)); + XSSFSheet sheet = wb.getSheetAt(0); + XSSFRow row; + XSSFCell cell; + Object value; + for (int i = sheet.getFirstRowNum(), rowCount = 0; rowCount < sheet.getPhysicalNumberOfRows(); i++) { + row = sheet.getRow(i); + colList = new ArrayList(); + if (row == null) { + //当读取行为空时 + if (i != sheet.getPhysicalNumberOfRows()) {//判断是否是最后一行 + rowList.add(colList); + } + continue; + } else { + rowCount++; + } + for (int j = row.getFirstCellNum(); j <= row.getLastCellNum(); j++) { + cell = row.getCell(j); + if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) { + //当该单元格为空 + if (j != row.getLastCellNum()) {//判断是否是该行中最后一个单元格 + colList.add(""); + } + continue; + } + switch (cell.getCellType()) { + case XSSFCell.CELL_TYPE_STRING: +// System.out.println(i + "行" + j + " 列 is String type"); + value = cell.getStringCellValue(); + break; + case XSSFCell.CELL_TYPE_NUMERIC: + if ("@".equals(cell.getCellStyle().getDataFormatString())) { + value = df.format(cell.getNumericCellValue()); + } else if ("General".equals(cell.getCellStyle() + .getDataFormatString())) { + value = nf.format(cell.getNumericCellValue()); + } else { + value = sdf.format(HSSFDateUtil.getJavaDate(cell + .getNumericCellValue())); + } +// System.out.println(i + "行" + j +// + " 列 is Number type ; DateFormt:" +// + value.toString()); + break; + case XSSFCell.CELL_TYPE_BOOLEAN: +// System.out.println(i + "行" + j + " 列 is Boolean type"); + value = Boolean.valueOf(cell.getBooleanCellValue()); + break; + case XSSFCell.CELL_TYPE_BLANK: +// System.out.println(i + "行" + j + " 列 is Blank type"); + value = ""; + break; + default: +// System.out.println(i + "行" + j + " 列 is default type"); + value = cell.toString(); + }// end switch + colList.add(value); + }//end for j + rowList.add(colList); + }//end for i + + return rowList; + } catch (Exception e) { + System.out.println("exception"); + return null; + } + } + + public static void writeExcel(ArrayList> result, String path) { + if (result == null) { + return; + } + HSSFWorkbook wb = new HSSFWorkbook(); + HSSFSheet sheet = wb.createSheet("sheet1"); + for (int i = 0; i < result.size(); i++) { + HSSFRow row = sheet.createRow(i); + if (result.get(i) != null) { + for (int j = 0; j < result.get(i).size(); j++) { + HSSFCell cell = row.createCell(j); + cell.setCellValue(result.get(i).get(j).toString()); + } + } + } + ByteArrayOutputStream os = new ByteArrayOutputStream(); + try { + wb.write(os); + } catch (IOException e) { + e.printStackTrace(); + } + byte[] content = os.toByteArray(); + File file = new File(path);//Excel文件生成后存储的位置。 + OutputStream fos = null; + try { + fos = new FileOutputStream(file); + fos.write(content); + os.close(); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static DecimalFormat getDf() { + return df; + } + + public static void setDf(DecimalFormat df) { + ExcelUs.df = df; + } + + public static SimpleDateFormat getSdf() { + return sdf; + } + + public static void setSdf(SimpleDateFormat sdf) { + ExcelUs.sdf = sdf; + } + + public static DecimalFormat getNf() { + return nf; + } + + public static void setNf(DecimalFormat nf) { + ExcelUs.nf = nf; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/FileToZip.java b/evo/src/main/java/com/ruoyi/project/management/utils/FileToZip.java new file mode 100644 index 0000000..c41c287 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/FileToZip.java @@ -0,0 +1,82 @@ +package com.ruoyi.project.management.utils; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class FileToZip { + + /** + * 将存放在sourceFilePath目录下的源文件,打包成fileName名称的zip文件,并存放到zipFilePath路径下 + * @param sourceFilePath :待压缩的文件路径 + * @param zipFilePath :压缩后存放路径 + * @param fileName :压缩后文件的名称 + * @return + */ + public static boolean fileToZip(String sourceFilePath,String zipFilePath,String fileName){ + boolean flag = false; + File sourceFile = new File(sourceFilePath); + FileInputStream fis = null; + BufferedInputStream bis = null; + FileOutputStream fos = null; + ZipOutputStream zos = null; + + if(sourceFile.exists() == false){ + System.out.println("待压缩的文件目录:"+sourceFilePath+"不存在."); + }else{ + try { + File zipFile = new File(zipFilePath + "/" + fileName +".zip"); + if(zipFile.exists()){ + zipFile.delete(); + }else{ + File[] sourceFiles = sourceFile.listFiles(); + if(null == sourceFiles || sourceFiles.length<1){ + System.out.println("待压缩的文件目录:" + sourceFilePath + "里面不存在文件,无需压缩."); + }else{ + fos = new FileOutputStream(zipFile); + zos = new ZipOutputStream(new BufferedOutputStream(fos)); + byte[] bufs = new byte[1024*10]; + for(int i=0;i ruKuNumMap) { + + + K3CloudApi client = new K3CloudApi(); + JsonObject jsonObject = new JsonObject(); + + // 创建空的 JSON 数组 + JsonArray emptyArray = new JsonArray(); + + // 设置需要更新的字段 + jsonObject.add("NeedUpDateFields", emptyArray); + + // 设置需要返回的字段 + jsonObject.add("NeedReturnFields", emptyArray); + + // 设置是否删除条目 + jsonObject.addProperty("IsDeleteEntry", "true"); + + // 设置子系统ID + jsonObject.addProperty("SubSystemId", ""); + + // 设置是否验证基础数据字段 + jsonObject.addProperty("IsVerifyBaseDataField", "false"); + + // 设置是否批量填写条目 + jsonObject.addProperty("IsEntryBatchFill", "true"); + + // 设置验证标志 + jsonObject.addProperty("ValidateFlag", "true"); + + // 设置编号搜索 + jsonObject.addProperty("NumberSearch", "true"); + + // 设置是否自动调整字段 + jsonObject.addProperty("IsAutoAdjustField", "false"); + + // 设置交互标志 + jsonObject.addProperty("InterationFlags", ""); + + // 设置是否忽略交互标志 + jsonObject.addProperty("IgnoreInterationFlag", ""); + + // 设置是否控制精度 + jsonObject.addProperty("IsControlPrecision", "false"); + + // 设置验证重复 JSON + jsonObject.addProperty("ValidateRepeatJson", "false"); + + // 创建嵌套的 Model 对象 + JsonObject modelObject = new JsonObject(); + modelObject.addProperty("FID", ruKuNumMap.get("FID")); + + // 创建 FEntity 数组 + JsonArray fEntityArray = new JsonArray(); + JsonObject fEntityObject = new JsonObject(); + fEntityObject.addProperty("FEntryID", ruKuNumMap.get("FENTITY_FEntryID")); + fEntityObject.addProperty("FRealQty", ruKuNumMap.get("FRealQty")); + + fEntityArray.add(fEntityObject); + + modelObject.add("FEntity", fEntityArray); + + // 将 Model 对象添加到主对象中 + jsonObject.add("Model", modelObject); + + // 使用 Gson 将 JsonObject 转换为 JSON 字符串 + Gson gson = new Gson(); + String jsonString = gson.toJson(jsonObject); + System.out.println(jsonString); + try { + //业务对象标识 + String formId = "PRD_INSTOCK"; + //调用接口 + String resultJson = client.save(formId, jsonString); + //用于记录结果 + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + return true; + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + return false; + } + } catch (Exception e) { + fail(e.getMessage()); + return false; + } + + + } + + /** + * 检验单保存 + */ + public static boolean updateQc(HashMap jianYanMap) { + + K3CloudApi client = new K3CloudApi(); + // 创建空的 JSON 对象 + JsonObject jsonObject = new JsonObject(); + + // 创建空的 JSON 数组 + JsonArray emptyArray = new JsonArray(); + + // 设置需要更新的字段 + jsonObject.add("NeedUpDateFields", emptyArray); + + // 设置需要返回的字段 + jsonObject.add("NeedReturnFields", emptyArray); + + // 设置是否删除条目 + jsonObject.addProperty("IsDeleteEntry", "true"); + + // 设置子系统ID + jsonObject.addProperty("SubSystemId", ""); + + // 设置是否验证基础数据字段 + jsonObject.addProperty("IsVerifyBaseDataField", "false"); + + // 设置是否批量填写条目 + jsonObject.addProperty("IsEntryBatchFill", "true"); + + // 设置验证标志 + jsonObject.addProperty("ValidateFlag", "true"); + + // 设置编号搜索 + jsonObject.addProperty("NumberSearch", "true"); + + // 设置是否自动调整字段 + jsonObject.addProperty("IsAutoAdjustField", "false"); + + // 设置交互标志 + jsonObject.addProperty("InterationFlags", ""); + + // 设置是否忽略交互标志 + jsonObject.addProperty("IgnoreInterationFlag", ""); + + // 设置是否控制精度 + jsonObject.addProperty("IsControlPrecision", "false"); + + // 设置验证重复 JSON + jsonObject.addProperty("ValidateRepeatJson", "false"); + + // 创建嵌套的 Model 对象 + JsonObject modelObject = new JsonObject(); + modelObject.addProperty("FID", jianYanMap.get("FID")); + + // 创建 FEntity 数组 + JsonArray fEntityArray = new JsonArray(); + JsonObject fEntityObject = new JsonObject(); + fEntityObject.addProperty("FEntryID", jianYanMap.get("FID")); + fEntityObject.addProperty("FQualifiedQty", jianYanMap.get("FQualifiedQty")); + fEntityObject.addProperty("FUnqualifiedQty", jianYanMap.get("FUnqualifiedQty")); + + // 创建 FPolicyDetail 数组 + JsonArray fPolicyDetailArray = new JsonArray(); + JsonObject fPolicyDetailObject = new JsonObject(); + fPolicyDetailObject.addProperty("FDetailID", jianYanMap.get("FDetailID")); + fPolicyDetailObject.addProperty("FPolicyQty", jianYanMap.get("FPolicyQty")); + fPolicyDetailObject.addProperty("FPolicyStatus", "A"); + fPolicyDetailArray.add(fPolicyDetailObject); + + fEntityObject.add("FPolicyDetail", fPolicyDetailArray); + fEntityArray.add(fEntityObject); + + modelObject.add("FEntity", fEntityArray); + + // 将 Model 对象添加到主对象中 + jsonObject.add("Model", modelObject); + + // 使用 Gson 将 JsonObject 转换为 JSON 字符串 + Gson gson = new Gson(); + String jsonString = gson.toJson(jsonObject); + System.out.println(jsonString); + try { + //业务对象标识 + String formId = "PRD_PickMtrl"; + //调用接口 + String resultJson = client.save(formId, jsonString); + + //用于记录结果 + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + return true; + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + return false; + } + } catch (Exception e) { + fail(e.getMessage()); + return false; + } + + } + + /** + * 领料单保存 + * + * @return + */ + public static String updateLinliao(HashMap linLiaoMap) { + + K3CloudApi client = new K3CloudApi(); + // 创建空的 JSON 对象 + JsonObject jsonObject = new JsonObject(); + + // 创建空的 JSON 数组 + JsonArray emptyArray = new JsonArray(); + + // 设置需要更新的字段 + jsonObject.add("NeedUpDateFields", emptyArray); + + // 设置需要返回的字段 + jsonObject.add("NeedReturnFields", emptyArray); + + // 设置是否删除条目 + jsonObject.addProperty("IsDeleteEntry", "true"); + + // 设置子系统ID + jsonObject.addProperty("SubSystemId", ""); + + // 设置是否验证基础数据字段 + jsonObject.addProperty("IsVerifyBaseDataField", "false"); + + // 设置是否批量填写条目 + jsonObject.addProperty("IsEntryBatchFill", "true"); + + // 设置验证标志 + jsonObject.addProperty("ValidateFlag", "true"); + + // 设置编号搜索 + jsonObject.addProperty("NumberSearch", "true"); + + // 设置是否自动调整字段 + jsonObject.addProperty("IsAutoAdjustField", "false"); + + // 设置交互标志 + jsonObject.addProperty("InterationFlags", ""); + + // 设置是否忽略交互标志 + jsonObject.addProperty("IgnoreInterationFlag", ""); + + // 设置是否控制精度 + jsonObject.addProperty("IsControlPrecision", "false"); + + // 设置验证重复 JSON + jsonObject.addProperty("ValidateRepeatJson", "false"); + + // 创建嵌套的 Model 对象 + JsonObject modelObject = new JsonObject(); + //在更新时FID为必填 + modelObject.addProperty("FID", linLiaoMap.get("FID")); + + // 创建 FEntity 数组 + JsonArray fEntityArray = new JsonArray(); + JsonObject fEntityObject = new JsonObject(); + //在更新时分录明细单额的FEntryID为必填 + fEntityObject.addProperty("FEntryID", linLiaoMap.get("FENTITY_FEntryID")); + fEntityObject.addProperty("FActualQty", 2); + fEntityArray.add(fEntityObject); + + modelObject.add("FEntity", fEntityArray); + + // 将 Model 对象添加到主对象中 + jsonObject.add("Model", modelObject); + String jsonString = jsonObject.toString(); + + System.out.println(jsonString); + + try { + //业务对象标识 + String formId = "PRD_PickMtrl"; + //调用接口 + String resultJson = client.save(formId, jsonString); + + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + return "success"; + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + return "faile"; + } + } catch (Exception e) { + fail(e.getMessage()); + } + return jsonString; + } + + /** + * 入库单查询 + * @return + */ + public static HashMap ruKuSel(String ruKuNum ) { + HashMap resultMap = new HashMap<>(); + K3CloudApi client = new K3CloudApi(); + JsonObject filterString = new JsonObject(); + filterString.addProperty("FieldName", "FBillNo"); + filterString.addProperty("Compare", "67"); + filterString.addProperty("Value", ruKuNum); + filterString.addProperty("Left", ""); + filterString.addProperty("Right", ""); + filterString.addProperty("Logic", "0"); + + JsonArray filterArray = new JsonArray(); + filterArray.add(filterString); + JsonObject data = new JsonObject(); + data.addProperty("FormId", "PRD_INSTOCK"); + data.addProperty("FieldKeys", "FID,FENTITY_FEntryID,FRealQty, "); + data.add("FilterString", filterArray); + data.addProperty("OrderString", ""); + data.addProperty("TopRowCount", 0); + data.addProperty("StartRow", 0); + data.addProperty("Limit", 2000); + data.addProperty("SubSystemId", ""); + System.out.println(data.toString()); + String jsonString = data.toString(); + + //调用接口 + String resultJson = null; + try { + resultJson = String.valueOf(client.executeBillQuery(jsonString)); + System.out.println("接口返回结果: " + resultJson); + // 解析 resultJson 数据 + JsonParser parser = new JsonParser(); + JsonArray jsonArray = parser.parse(resultJson).getAsJsonArray(); + // 用于记录结果的HashMap + for (int i = 0; i < jsonArray.size(); i++) { + JsonArray innerArray = jsonArray.get(i).getAsJsonArray(); + String FID = innerArray.get(0).getAsString(); + String FENTITY_FEntryID = innerArray.get(1).getAsString(); + String FRealQty = innerArray.get(2).getAsString(); + + resultMap.put("FID", FID); + resultMap.put("FENTITY_FEntryID", FENTITY_FEntryID); + resultMap.put("FRealQty", FRealQty); + + } + return resultMap; + } catch (Exception e) { + throw new RuntimeException(e); + } + + + } + + /** + * 检验单查询 + * + * @return + */ + public static HashMap qcSelect(String jianYanNum) { + HashMap resultMap = new HashMap<>(); + K3CloudApi client = new K3CloudApi(); + JsonObject filterString = new JsonObject(); + filterString.addProperty("FieldName", "FBillNo"); + filterString.addProperty("Compare", "67"); + filterString.addProperty("Value", jianYanNum); + filterString.addProperty("Left", ""); + filterString.addProperty("Right", ""); + filterString.addProperty("Logic", "0"); + + JsonArray filterArray = new JsonArray(); + filterArray.add(filterString); + JsonObject data = new JsonObject(); + data.addProperty("FormId", "QM_InspectBill"); + data.addProperty("FieldKeys", "FID,FENTITY_FEntryID,FDetailID,FQualifiedQty,FUnqualifiedQty "); + data.add("FilterString", filterArray); + data.addProperty("OrderString", ""); + data.addProperty("TopRowCount", 0); + data.addProperty("StartRow", 0); + data.addProperty("Limit", 2000); + data.addProperty("SubSystemId", ""); + System.out.println(data.toString()); + String jsonString = data.toString(); + + //调用接口 + String resultJson = null; + try { + resultJson = String.valueOf(client.executeBillQuery(jsonString)); + System.out.println("接口返回结果: " + resultJson); + // 解析 resultJson 数据 + JsonParser parser = new JsonParser(); + JsonArray jsonArray = parser.parse(resultJson).getAsJsonArray(); + // 用于记录结果的HashMap + for (int i = 0; i < jsonArray.size(); i++) { + JsonArray innerArray = jsonArray.get(i).getAsJsonArray(); + String FID = innerArray.get(0).getAsString(); + String FENTITY_FEntryID = innerArray.get(1).getAsString(); + String FDetailID = innerArray.get(2).getAsString(); + String FQualifiedQty = innerArray.get(3).getAsString(); + String FUnqualifiedQty = innerArray.get(4).getAsString(); + + resultMap.put("FID", FID); + resultMap.put("FENTITY_FEntryID", FENTITY_FEntryID); + resultMap.put("FDetailID", FDetailID); + resultMap.put("FQualifiedQty", FQualifiedQty); + resultMap.put("FUnqualifiedQty", FUnqualifiedQty); + } + return resultMap; + } catch (Exception e) { + throw new RuntimeException(e); + } + + } + + /** + * 领料单查询 + * + * @return + */ + public static HashMap linLiaoSelect(String soutNum) { + HashMap resultMap = new HashMap<>(); + K3CloudApi client = new K3CloudApi(); + JsonObject filterString = new JsonObject(); + filterString.addProperty("FieldName", "FBillNo"); + filterString.addProperty("Compare", "67"); + filterString.addProperty("Value", soutNum); + filterString.addProperty("Left", ""); + filterString.addProperty("Right", ""); + filterString.addProperty("Logic", "0"); + + JsonArray filterArray = new JsonArray(); + filterArray.add(filterString); + + JsonObject data = new JsonObject(); + data.addProperty("FormId", "PRD_PickMtrl"); + data.addProperty("FieldKeys", "FID,FENTITY_FEntryID,FMaterialId.FNumber,FActualQty"); + data.add("FilterString", filterArray); + data.addProperty("OrderString", ""); + data.addProperty("TopRowCount", 0); + data.addProperty("StartRow", 0); + data.addProperty("Limit", 2000); + data.addProperty("SubSystemId", ""); + + System.out.println(data.toString()); + + + String jsonString = data.toString(); + try { + //调用接口 + String resultJson = String.valueOf(client.executeBillQuery(jsonString)); + System.out.println("接口返回结果: " + resultJson); + // 解析 resultJson 数据 + JsonParser parser = new JsonParser(); + JsonArray jsonArray = parser.parse(resultJson).getAsJsonArray(); + // 用于记录结果的HashMap + for (int i = 0; i < jsonArray.size(); i++) { + JsonArray innerArray = jsonArray.get(i).getAsJsonArray(); + String FID = innerArray.get(0).getAsString(); + String FENTITY_FEntryID = innerArray.get(1).getAsString(); + String FMaterialId = innerArray.get(2).getAsString(); + String FActualQty = innerArray.get(3).getAsString(); + + resultMap.put("FID", FID); + resultMap.put("FENTITY_FEntryID", FENTITY_FEntryID); + resultMap.put("FMaterialId", FMaterialId); + resultMap.put("FActualQty", FActualQty); + } + } catch (Exception e) { + e.printStackTrace(); + } + return resultMap; + } + + /** + * 检验单审核 + * + * @return + */ + public static void audit(PwBomNumberTwo pwBomNumberTwo) { + K3CloudApi client = new K3CloudApi(); + //请求参数,要求为json字符串 + JsonObject jsonObject = new JsonObject(); + JsonArray numbers = new JsonArray(); + numbers.add("FQC000003"); + jsonObject.add("Numbers", numbers); + jsonObject.addProperty("Ids", ""); + jsonObject.addProperty("SelectedPostId", 0); + jsonObject.addProperty("UseOrgId", 0); + jsonObject.addProperty("NetworkCtrl", ""); + jsonObject.addProperty("IgnoreInterationFlag", ""); + + String jsonData = jsonObject.toString(); + try { + //业务对象标识 + String formId = "QM_InspectBill"; + //调用接口 + String resultJson = client.audit(formId, jsonData); + + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + } + } catch (Exception e) { + fail(e.getMessage()); + } + ObjectMapper objectMapper = new ObjectMapper(); + + } + + /** + * 检验单提交 + * + * @return + */ + public static void submit11() { + K3CloudApi client = new K3CloudApi(); + JsonObject jsonObject = new JsonObject(); + JsonArray numbers = new JsonArray(); + numbers.add("FQC000003");//汇报单下推成功后会有生成的检验单编码 + jsonObject.add("Numbers", numbers); + jsonObject.addProperty("Ids", ""); + jsonObject.addProperty("SelectedPostId", 0); + jsonObject.addProperty("UseOrgId", 0); + jsonObject.addProperty("NetworkCtrl", ""); + jsonObject.addProperty("IgnoreInterationFlag", ""); + String jsonData = jsonObject.toString(); + try { + //业务对象标识 + String formId = "QM_InspectBill"; + //调用接口 + String resultJson = client.submit(formId, jsonData); + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + } + } catch (Exception e) { + fail(e.getMessage()); + } + } + + /** + * 汇报单下推至检验单 + */ + public static String hbToQc( String jianYanNum) { + K3CloudApi client = new K3CloudApi(); + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("Ids", ""); + JsonArray numbersArray = new JsonArray(); + numbersArray.add(jianYanNum); + jsonObject.add("Numbers", numbersArray); + jsonObject.addProperty("EntryIds", ""); + jsonObject.addProperty("RuleId", "QM_PRDMoRpt2Inspect"); + jsonObject.addProperty("TargetBillTypeId", ""); + jsonObject.addProperty("TargetFormId", ""); + jsonObject.addProperty("IsEnableDefaultRule", false); + jsonObject.addProperty("IsDraftWhenSaveFail", true); + jsonObject.add("CustomParams", new JsonObject()); + String jsonData = jsonObject.toString(); + + try { + //业务对象标识 + String formId = "PRD_MORPT"; + //调用接口 + String resultJson = client.push(formId, jsonData); + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + JsonParser parser = new JsonParser(); + JsonObject resultObject = parser.parse(resultJson).getAsJsonObject(); + String extractedValue = resultObject.getAsJsonObject("ResponseStatus") + .getAsJsonArray("SuccessEntitys") + .get(0) + .getAsJsonObject() + .get("Number") + .getAsString(); + return extractedValue;//返回检验单编号 + + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + return "0"; + } + } catch (Exception e) { + fail(e.getMessage()); + return null; + } + } + + /** + * 汇报单下推至入库单 + * return extractedValue 返回入库单 + */ + public static String submitToRuku(String hbNum) { + K3CloudApi client = new K3CloudApi(); + //调用汇报单查询接口 + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("Ids", ""); + JsonArray numbersArray = new JsonArray(); + numbersArray.add(hbNum); + jsonObject.add("Numbers", numbersArray); + jsonObject.addProperty("EntryIds", ""); + jsonObject.addProperty("RuleId", "PRD_MODIRECTSENDTOINSTOCK"); + jsonObject.addProperty("TargetBillTypeId", ""); + jsonObject.addProperty("TargetFormId", ""); + jsonObject.addProperty("IsEnableDefaultRule", false); + jsonObject.addProperty("IsDraftWhenSaveFail", false); + jsonObject.add("CustomParams", new JsonObject()); + String jsonData = jsonObject.toString(); + try { + //业务对象标识 + String formId = "PRD_MORPT"; + //调用接口 + String resultJson = client.push(formId, jsonData); + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + JsonParser parser = new JsonParser(); + JsonObject resultObject = parser.parse(resultJson).getAsJsonObject(); + String extractedValue = resultObject.getAsJsonObject("ResponseStatus") + .getAsJsonArray("SuccessEntitys") + .get(0) + .getAsJsonObject() + .get("Number") + .getAsString(); + return extractedValue;//返入库单编号 + + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + return "0"; + } + } catch (Exception e) { + fail(e.getMessage()); + return null; + } + } + + /** + * 提交 + * + * @return + */ + public static int submit() { + K3CloudApi client = new K3CloudApi(); + //请求参数,要求为json字符串 + String jsonData = "{\"CreateOrgId\":0,\"Numbers\":[],\"Ids\":\"\",\"SelectedPostId\":0,\"UseOrgId\":0,\"NetworkCtrl\":\"\",\"IgnoreInterationFlag\":\"\"}"; + try { + //业务对象标识 + String formId = "PRD_PPBOM"; + //调用接口 + String resultJson = client.submit(formId, jsonData); + + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + } + } catch (Exception e) { + fail(e.getMessage()); + } + + return 1; + } + + public static int pickingPush() { + K3CloudApi client = new K3CloudApi(); + //请求参数,要求为json字符串 + JsonObject jsonObject = new JsonObject(); + JsonArray numbersArray = new JsonArray(); + numbersArray.add("SOUT00000012"); + jsonObject.add("Numbers", numbersArray); + jsonObject.addProperty("Ids", "100018"); + jsonObject.addProperty("SelectedPostId", 0); + jsonObject.addProperty("UseOrgId", 0); + jsonObject.addProperty("NetworkCtrl", ""); + jsonObject.addProperty("IgnoreInterationFlag", ""); + String jsonData = jsonObject.toString(); + try { + //业务对象标识 + String formId = "PRD_PPBOM"; + //调用接口 + String resultJson = client.audit(formId, jsonData); + + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + } + } catch (Exception e) { + fail(e.getMessage()); + } + return 1; + } + + /* + * 用料清单下推生产领料单 + */ + public static String pickingPushLinliao(PwBomNumberTwo pwBomNumberTwo) { + K3CloudApi client = new K3CloudApi(); + //生产订单查询出用料单号 + String yongLiaoNum = yongliaodanSel(pwBomNumberTwo); + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("Ids", ""); + JsonArray numbersArray = new JsonArray(); + numbersArray.add(yongLiaoNum); + jsonObject.add("Numbers", new JsonArray()); + jsonObject.addProperty("EntryIds", ""); + jsonObject.addProperty("RuleId", "PRD_PPBOM2PICKMTRL_NORMAL"); + jsonObject.addProperty("TargetBillTypeId", ""); + jsonObject.addProperty("TargetFormId", ""); + jsonObject.addProperty("IsEnableDefaultRule", false); + jsonObject.addProperty("IsDraftWhenSaveFail", false); + jsonObject.add("CustomParams", new JsonObject()); + String jsonData = jsonObject.toString(); + + try { + //业务对象标识 + String formId = "PRD_PPBOM"; + //调用接口 + String resultJson = client.push(formId, jsonData); + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + JsonParser parser = new JsonParser(); + JsonObject resultObject = parser.parse(resultJson).getAsJsonObject(); + String extractedValue = resultObject.getAsJsonObject("ResponseStatus") + .getAsJsonArray("SuccessEntitys") + .get(0) + .getAsJsonObject() + .get("Number") + .getAsString(); + return extractedValue;//返回领料单编号 + + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + return "0"; + } + } catch (Exception e) { + fail(e.getMessage()); + return null; + } + } + + /** + * 生产订单查询 + * + * @return + */ + public static String[] documentInquiry(PwBomNumberTwo pwBomNumberTwo) { + K3CloudApi client = new K3CloudApi(); + + JsonObject json = new JsonObject(); + json.addProperty("FormId", "PRD_MO"); + json.addProperty("FieldKeys", "FID,FBillNo,FMaterialId.FNumber,FYieldQty,FQty,F_UCHN_Text"); + JsonArray filterString = new JsonArray(); + JsonObject filter = new JsonObject(); + filter.addProperty("FieldName", "F_UCHN_Text"); + filter.addProperty("Compare", "17"); + filter.addProperty("Value", pwBomNumberTwo.getProductionCode()); + filter.addProperty("Left", ""); + filter.addProperty("Right", ""); + filter.addProperty("Logic", "0"); + filterString.add(filter); + json.add("FilterString", filterString); + json.addProperty("OrderString", ""); + json.addProperty("TopRowCount", 0); + json.addProperty("StartRow", 0); + json.addProperty("Limit", 2000); + json.addProperty("SubSystemId", ""); + + String jsonString = json.toString(); + try { + //调用接口 + String resultJson = String.valueOf(client.executeBillQuery(jsonString)); + System.out.println("接口返回结果: " + resultJson); + // 解析 resultJson 数据 + JsonArray jsonArray = new JsonParser().parse(resultJson).getAsJsonArray(); + String[] resultArray = new String[jsonArray.size()]; + int index = 0; + for (JsonElement element : jsonArray) { + JsonObject obj = element.getAsJsonObject(); + String fid = obj.get("FID").getAsString(); + String fMaterialId = obj.get("FMaterialId.FNumber").getAsString(); + String fUchnText = obj.get("F.UCHN.Text").getAsString(); + String fYieldQty = obj.get("FYieldQty").getAsString(); + resultArray[index] = "FMaterialId.FNumber: " + fMaterialId + ", F.UCHN.Text: " + fUchnText + ",FID: " + fid + ",FYieldQty: " + fYieldQty; + index++; + } + return resultArray; + //用于记录结果 + } catch (Exception e) { + e.printStackTrace(); + return new String[0]; + } + + } + + /** + * 生产用料清单单据查询 + * + * @return + */ + public static String[] documentInquiry1(String FMOBillNO) { + K3CloudApi client = new K3CloudApi(); + + JsonObject json = new JsonObject(); + json.addProperty("FormId", "PRD_PPBOM"); + json.addProperty("FieldKeys", "FID,FBillNo,FMaterialId.FNumber,FQty,F_UCHN_Text"); + JsonArray filterString = new JsonArray(); + JsonObject filter = new JsonObject(); + filter.addProperty("FieldName", "F_UCHN_Text"); + filter.addProperty("Compare", "17"); + filter.addProperty("Value", FMOBillNO); + filter.addProperty("Left", ""); + filter.addProperty("Right", ""); + filter.addProperty("Logic", "0"); + filterString.add(filter); + json.add("FilterString", filterString); + json.addProperty("OrderString", ""); + json.addProperty("TopRowCount", 0); + json.addProperty("StartRow", 0); + json.addProperty("Limit", 2000); + json.addProperty("SubSystemId", ""); + + String jsonString = json.toString(); + try { + //调用接口 + String resultJson = String.valueOf(client.executeBillQuery(jsonString)); + System.out.println("接口返回结果: " + resultJson); + // 解析 resultJson 数据 + JsonArray jsonArray = new JsonParser().parse(resultJson).getAsJsonArray(); + String[] resultArray = new String[jsonArray.size()]; + int index = 0; + for (JsonElement element : jsonArray) { + JsonObject obj = element.getAsJsonObject(); + String fid = obj.get("FID").getAsString(); + String fMaterialId = obj.get("FMaterialId.FNumber").getAsString(); + String fUchnText = obj.get("F.UCHN.Text").getAsString(); + String fQty = obj.get("FQty").getAsString(); + resultArray[index] = "FMaterialId.FNumber: " + fMaterialId + ", F.UCHN.Text: " + fUchnText + ",FID: " + fid + ",FQty: " + fQty; + index++; + } + return resultArray; + //用于记录结果 + } catch (Exception e) { + e.printStackTrace(); + return new String[0]; + } + + } + + /** + * 生产汇报单查询 + * + * @return + */ + public static String[] reportSheetInquiry() { + + JsonObject json = new JsonObject(); + json.addProperty("FormId", "PRD_MORPT"); + json.addProperty("FieldKeys", "FMaterialId.FNumber,F_UCHN_Text"); + JsonArray filterString = new JsonArray(); + JsonObject filter = new JsonObject(); + filter.addProperty("FieldName", "F_UCHN_Text"); + filter.addProperty("Compare", "17"); + filter.addProperty("Value", "YF-001-24"); + filter.addProperty("Left", ""); + filter.addProperty("Right", ""); + filter.addProperty("Logic", "0"); + filterString.add(filter); + json.add("FilterString", filterString); + json.addProperty("OrderString", ""); + json.addProperty("TopRowCount", 0); + json.addProperty("StartRow", 0); + json.addProperty("Limit", 2000); + json.addProperty("SubSystemId", ""); + + String jsonString = json.toString(); + K3CloudApi client = new K3CloudApi(); + try { + //调用接口 + String resultJson = String.valueOf(client.executeBillQuery(jsonString)); + System.out.println("接口返回结果: " + resultJson); + // 解析 resultJson 数据 + JsonArray jsonArray = new JsonParser().parse(resultJson).getAsJsonArray(); + String[] resultArray = new String[jsonArray.size()]; + int index = 0; + for (JsonElement element : jsonArray) { + JsonObject obj = element.getAsJsonObject(); + String fMaterialId = obj.get("FMaterialId.FNumber").getAsString(); + String fUchnText = obj.get("F.UCHN.Text").getAsString(); + resultArray[index] = "FMaterialId.FNumber: " + fMaterialId + ", F.UCHN.Text: " + fUchnText; + index++; + } + return resultArray; + //用于记录结果 + } catch (Exception e) { + e.printStackTrace(); + return new String[0]; + } + + } + + /** + * 生产领料单保存 + * + * @return + */ + + public static String pickingUpdate() { + K3CloudApi client = new K3CloudApi(); + String jsonData = "{\n" + + " \"NeedUpDateFields\":[\n" + + "\n" + + " ],\n" + + " \"NeedReturnFields\":[\n" + + "\n" + + " ],\n" + + " \"IsDeleteEntry\":\"true\",\n" + + " \"SubSystemId\":\"\",\n" + + " \"IsVerifyBaseDataField\":\"false\",\n" + + " \"IsEntryBatchFill\":\"true\",\n" + + " \"ValidateFlag\":\"true\",\n" + + " \"NumberSearch\":\"true\",\n" + + " \"IsAutoAdjustField\":\"false\",\n" + + " \"InterationFlags\":\"\",\n" + + " \"IgnoreInterationFlag\":\"\",\n" + + " \"IsControlPrecision\":\"false\",\n" + + " \"ValidateRepeatJson\":\"false\",\n" + + " \"Model\":{\n" + + " \"FID\":0,\n" + + " \"FBillType\":{\n" + + " \"FNUMBER\":\"\"\n" + + " },\n" + + " \"FDate\":\"1900-01-01\",\n" + + " \"FStockOrgId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FStockId0\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FPrdOrgId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FWorkShopId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FOwnerTypeId0\":\"\",\n" + + " \"FOwnerId0\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FPickerId\":{\n" + + "\n" + + " },\n" + + " \"FSTOCKERID\":{\n" + + " \"FNAME\":\"\"\n" + + " },\n" + + " \"FDescription\":\"\",\n" + + " \"FCurrId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FIsCrossTrade\":\"false\",\n" + + " \"FVmiBusiness\":\"false\",\n" + + " \"FScanBox\":\"\",\n" + + " \"FSourceType\":\"\",\n" + + " \"FIsOwnerTInclOrg\":\"false\",\n" + + " \"FEntity\":[\n" + + " {\n" + + " \"FEntryID\":0,\n" + + " \"FParentMaterialId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FBaseStockActualQty\":0,\n" + + " \"FConsome\":\"\",\n" + + " \"FFPMBillNo\":\"\",\n" + + " \"FOptQueue\":\"\",\n" + + " \"FReserveType\":\"\",\n" + + " \"FMaterialId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FUnitID\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FAppQty\":0,\n" + + " \"FActualQty\":0,\n" + + " \"FEntryVmiBusiness\":\"false\",\n" + + " \"FOptPlanBillNo\":\"\",\n" + + " \"FStockId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FOptPlanBillId\":0,\n" + + " \"FStockLocId\":{\n" + + "\n" + + " },\n" + + " \"FWorkCenterId\":{\n" + + " \"FNUMBER\":\"\"\n" + + " },\n" + + " \"FOptDetailId\":0,\n" + + " \"FLot\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FCobyBomEntryID\":0,\n" + + " \"FProcessId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FBomId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FGroupRow\":\"\",\n" + + " \"FSrcPickEntryId\":0,\n" + + " \"FSrcBusinessType\":\"\",\n" + + " \"FQueryStockUpdate\":\"\",\n" + + " \"FStockStatusId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FProduceDate\":\"1900-01-01\",\n" + + " \"FTransRetFormId\":\"\",\n" + + " \"FTransRetBillNo\":\"\",\n" + + " \"FTransRetId\":0,\n" + + " \"FTransRetEntryId\":0,\n" + + " \"FSendRowId\":\"\",\n" + + " \"FTransRetEntrySeq\":0,\n" + + " \"FCheckReturnMtrl\":\"false\",\n" + + " \"FIsOverLegalOrg\":\"false\",\n" + + " \"FPlanEntryID\":0,\n" + + " \"FEntrtyMemo\":\"\",\n" + + " \"FISSUEINFOENTRYID\":0,\n" + + " \"FMtoNo\":\"\",\n" + + " \"FProjectNo\":\"\",\n" + + " \"FMoBillNo\":\"\",\n" + + " \"FMoEntryId\":0,\n" + + " \"FPPBomEntryId\":0,\n" + + " \"FOperId\":0,\n" + + " \"FOwnerTypeId\":\"\",\n" + + " \"FStockUnitId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FStockAppQty\":0,\n" + + " \"FStockActualQty\":0,\n" + + " \"FStockAllowOverQty\":0,\n" + + " \"FSecUnitId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FSecActualQty\":0,\n" + + " \"FSecAllowOverQty\":0,\n" + + " \"FMoId\":0,\n" + + " \"FMoEntrySeq\":0,\n" + + " \"FAllowOverQty\":0,\n" + + " \"FPPBomBillNo\":\"\",\n" + + " \"FBaseUnitId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FBaseAppQty\":0,\n" + + " \"FBaseActualQty\":0,\n" + + " \"FBaseAllowOverQty\":0,\n" + + " \"FEntryWorkShopId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FAuxPropId\":{\n" + + "\n" + + " },\n" + + " \"FKeeperTypeId\":\"\",\n" + + " \"FKeeperId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FOwnerId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FExpiryDate\":\"1900-01-01\",\n" + + " \"FSrcBillType\":\"\",\n" + + " \"FSrcBillNo\":\"\",\n" + + " \"FPrice\":0,\n" + + " \"FEntrySrcInterId\":0,\n" + + " \"FAmount\":0,\n" + + " \"FEntrySrcEnteryId\":0,\n" + + " \"FEntrySrcEntrySeq\":0,\n" + + " \"FParentOwnerTypeId\":\"\",\n" + + " \"FParentOwnerId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FSRCBIZBILLTYPE\":{\n" + + " \"FNAME\":\"\"\n" + + " },\n" + + " \"FSRCBIZBILLNO\":\"\",\n" + + " \"FSRCBIZINTERID\":0,\n" + + " \"FSRCBIZENTRYID\":0,\n" + + " \"FSRCBIZENTRYSEQ\":0,\n" + + " \"FPickingStatus\":0,\n" + + " \"FSerialSubEntity\":[\n" + + " {\n" + + " \"FDetailID\":0,\n" + + " \"FSerialNo\":\"\",\n" + + " \"FSerialId\":{\n" + + " \"FNumber\":\"\"\n" + + " },\n" + + " \"FSerialNote\":\"\",\n" + + " \"FIsAppInspect\":\"\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + "}"; + try { + //业务对象标识 + String formId = "PRD_PickMtrl"; + //调用接口 + String resultJson = client.save(formId, jsonData); + + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + } else { + fail("接口返回结果: " + gson.toJson(repoRet.getResult().getResponseStatus())); + } + } catch (Exception e) { + fail(e.getMessage()); + } + return null; + } + + /** + * 通用查询 + * + * @param jsonData + * @return + */ + public static void documentInquiry(String jsonData) { + int flag = 0; + //读取配置,初始化SDK + K3CloudApi client = new K3CloudApi(); + try { + //调用接口 + String resultJson = String.valueOf(client.executeBillQuery(jsonData)); + System.out.println("接口返回结果: " + resultJson); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 通用下推 + * + * @param formId + * @param jsonData + * @return + */ + public static String pushDatasToJd(String formId, String jsonData) { + int flag = 0; + //读取配置,初始化SDK + K3CloudApi client = new K3CloudApi(); + try { + //调用接口 + String resultJson = client.push(formId, jsonData); + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + if (repoRet.getResult().getResponseStatus().isIsSuccess()) { + flag = 1; + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult())); + return gson.toJson(repoRet.getResult()); + } else { + flag = 0; + System.out.printf("接口返回结果: %s%n", gson.toJson(repoRet.getResult().getResponseStatus())); + return gson.toJson(repoRet.getResult()); + } + } catch (Exception e) { + e.printStackTrace(); + + } + return "1"; + } + + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/MoneyUtil.java b/evo/src/main/java/com/ruoyi/project/management/utils/MoneyUtil.java new file mode 100644 index 0000000..0e04572 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/MoneyUtil.java @@ -0,0 +1,131 @@ +package com.ruoyi.project.management.utils; + +/** + * + * @author qizhenglong + * + */ +public class MoneyUtil { + /** 大写数字 */ + private static final String[] NUMBERS = { "零", "壹", "贰", "叁", "肆", "伍", + "陆", "柒", "捌", "玖" }; + + /** 整数部分的单位 */ + private static final String[] IUNIT = { "元", "拾", "佰", "仟", "万", "拾", "佰", + "仟", "亿", "拾", "佰", "仟", "万", "拾", "佰", "仟","兆","拾", "佰", "仟","京","拾", "佰", "仟"}; + + /** 小数部分的单位 */ + private static final String[] DUNIT = { "角", "分", "厘" }; + + /** + * 得到大写金额。 + */ + public static String toChinese(String str) { + str = str.replaceAll(",", "");// 去掉"," + String integerStr;// 整数部分数字 + String decimalStr;// 小数部分数字 + // 初始化:分离整数部分和小数部分 + if (str.indexOf(".") > 0) { + integerStr = str.substring(0, str.indexOf(".")); + decimalStr = str.substring(str.indexOf(".") + 1); + } else if (str.indexOf(".") == 0) { + integerStr = ""; + decimalStr = str.substring(1); + } else { + integerStr = str; + decimalStr = ""; + } + // integerStr去掉首0,不必去掉decimalStr的尾0(超出部分舍去) + if (!integerStr.equals("")) { + integerStr = Long.toString(Long.parseLong(integerStr)); + if (integerStr.equals("0")) { + integerStr = ""; + } + } + // overflow超出处理能力,直接返回 + if (integerStr.length() > IUNIT.length) { + System.out.println(str + ":超出处理能力"); + return str; + } + + int[] integers = toArray(integerStr);// 整数部分数字 + boolean isMust5 = isMust5(integerStr);// 设置万单位 + int[] decimals = toArray(decimalStr);// 小数部分数字 + return getChineseInteger(integers, isMust5) + + getChineseDecimal(decimals); + } + + /** + * 整数部分和小数部分转换为数组,从高位至低位 + */ + private static int[] toArray(String number) { + int[] array = new int[number.length()]; + for (int i = 0; i < number.length(); i++) { + array[i] = Integer.parseInt(number.substring(i, i + 1)); + } + return array; + } + + /** + * 得到中文金额的整数部分。 + */ + private static String getChineseInteger(int[] integers, boolean isMust5) { + StringBuffer chineseInteger = new StringBuffer(""); + int length = integers.length; + for (int i = 0; i < length; i++) { + // 0出现在关键位置:1234(万)5678(亿)9012(万)3456(元) + // 特殊情况:10(拾元、壹拾元、壹拾万元、拾万元) + String key = ""; + if (integers[i] == 0) { + if ((length - i) == 13)// 万(亿)(必填) + key = IUNIT[4]; + else if ((length - i) == 9)// 亿(必填) + key = IUNIT[8]; + else if ((length - i) == 5 && isMust5)// 万(不必填) + key = IUNIT[4]; + else if ((length - i) == 1)// 元(必填) + key = IUNIT[0]; + // 0遇非0时补零,不包含最后一位 + if ((length - i) > 1 && integers[i + 1] != 0) + key += NUMBERS[0]; + } + chineseInteger.append(integers[i] == 0 ? key + : (NUMBERS[integers[i]] + IUNIT[length - i - 1])); + } + return chineseInteger.toString(); + } + + /** + * 得到中文金额的小数部分。 + */ + private static String getChineseDecimal(int[] decimals) { + StringBuffer chineseDecimal = new StringBuffer(""); + for (int i = 0; i < decimals.length; i++) { + // 舍去3位小数之后的 + if (i == 3) + break; + chineseDecimal.append(decimals[i] == 0 ? "" + : (NUMBERS[decimals[i]] + DUNIT[i])); + } + return chineseDecimal.toString(); + } + + /** + * 判断第5位数字的单位"万"是否应加。 + */ + private static boolean isMust5(String integerStr) { + int length = integerStr.length(); + if (length > 4) { + String subInteger = ""; + if (length > 8) { + // 取得从低位数,第5到第8位的字串 + subInteger = integerStr.substring(length - 8, length - 4); + } else { + subInteger = integerStr.substring(0, length - 4); + } + return Integer.parseInt(subInteger) > 0; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/PDFDocHelper.java b/evo/src/main/java/com/ruoyi/project/management/utils/PDFDocHelper.java new file mode 100644 index 0000000..ead9664 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/PDFDocHelper.java @@ -0,0 +1,336 @@ +package com.ruoyi.project.management.utils; + +import com.itextpdf.text.BaseColor; +import com.itextpdf.text.DocumentException; +import com.itextpdf.text.Element; +import com.itextpdf.text.FontFactory; +import com.itextpdf.text.Image; +import com.itextpdf.text.Rectangle; +import com.itextpdf.text.pdf.BaseFont; +import com.itextpdf.text.pdf.PdfContentByte; +import com.itextpdf.text.pdf.PdfGState; +import com.itextpdf.text.pdf.PdfReader; +import com.itextpdf.text.pdf.PdfStamper; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.apache.pdfbox.io.MemoryUsageSetting; +import org.apache.pdfbox.multipdf.PDFMergerUtility; + +/** + * @Author AlphaJunS + * @Date 19:25 2020/3/7 + * @Description 文档帮助类 + */ +public class PDFDocHelper { + private static BaseFont base = null; + // 获取基础文字 + public static BaseFont getBaseFont() throws DocumentException, IOException { + if (base == null) { + try { + base = BaseFont.createFont("/u01/config/simsun.ttc,1", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); + } catch (Throwable th) { + base = BaseFont.createFont("C:\\WINDOWS\\Fonts\\SIMSUN.TTC,1", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); + } + } + return base; + } + + /** + * 原始图路径 + * 水印内容集合 + * X坐标点集合 + * Y坐标点集合 + */ + public static String signPsw(String oldPswFilePath, List> reviews,float[] pswX,float[] pswY,String biaoji) throws IOException, DocumentException { + int pos = oldPswFilePath.lastIndexOf('.'); + // 获取文件后缀 + String suffix = oldPswFilePath.substring(pos + 1); + // 判断是否为pdf文件 + if (!"pdf".equals(suffix.toLowerCase())) { + throw new RuntimeException("Not supported PSW file"); + } + return signSinglePsw(oldPswFilePath, reviews,pswX,pswY); + } + + //单个psw文件签名 + private static String signSinglePsw(String oldPswFilePath,List> reviews,float[] pswX,float[] pswY) throws IOException, DocumentException { + String newPswPath = oldPswFilePath; + int pos = oldPswFilePath.lastIndexOf('.'); + int ii = oldPswFilePath.lastIndexOf('/'); + // 获取文件后缀名 + String suffix = oldPswFilePath.substring(pos + 1); + //获取文件名 + String name = oldPswFilePath.substring(ii+1); + // 生成新的文件路径 + newPswPath =oldPswFilePath.substring(0, ii+1) + name; + File newfile = new File(newPswPath); + //获取父目录 + File fileParent = newfile.getParentFile().getParentFile(); + //判断是否存在 + if (!newfile.exists()) { + // 创建父目录文件夹 + newfile.mkdirs(); + } + + FileOutputStream fout = null; + if("1".equals(1)){ + + }else{ + File filesBom = new File(fileParent+"/bomThree/"); + if (!filesBom.exists()) { + filesBom.mkdir(); + } + fout = new FileOutputStream(filesBom+"/"+name); + } + PdfReader reader = new PdfReader(oldPswFilePath); + PdfStamper stp = new PdfStamper(reader, fout); + for (int i = 0; i < reader.getNumberOfPages(); ) { + // 需要从第一页开始,i放在循环中会报空指针异常 + i++; + PdfContentByte content = stp.getOverContent(i); + content.beginText(); + // 设置字体及字号 + content.setFontAndSize(getBaseFont(), 10); + for(int t = 0; t review = (Map) reviews.get(t); + addDeptReview(content, review,pswX[t],pswY[t]); + } + content.endText(); + } + stp.close(); + // 将输出流关闭 + fout.close(); + reader.close(); + // 文件读写结束 + System.out.println("PSW文件读写完毕"); + + return newPswPath; + } + + /** + * @Author AlphaJunS + * @Date 18:48 2020/3/7 + * @Description 添加水印 + * @param content + * @param review + * @return void + */ + private static void addDeptReview(PdfContentByte content, Map review,float pswX,float pswY) { + if (Integer.parseInt(String.valueOf(review.get("type"))) == 1) { + content.setColorFill(BaseColor.BLACK); + } else { + content.setColorFill(BaseColor.RED); + } + // 设置水印位置和内容 + String result = (String) review.get("result"); + System.out.println("水印内容:" + result); + System.out.println("打印位置坐标:" + pswX + "," + pswY); + content.showTextAligned(Element.ALIGN_LEFT, result, pswX, pswY, 0); + } + + /** + * 合并打印文字水印和图纸章水印 + * inputPath 原始图路径 + * outputPath 打上水印后的路径 + * images 水印图片路径 + * reviews 水印内容集合 + * pswX X坐标点集合 + * pswY Y坐标点集合 + */ + public static boolean imageWatermark(String inputPath, String outputPath,String images,List> reviews,float[] pswX,float[] pswY) throws IOException, DocumentException { + //打图纸章水印 + PdfReader reader = new PdfReader(inputPath); + PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(outputPath)); + PdfGState gs1 = new PdfGState(); + try{ + gs1.setFillOpacity(1f); + + Image image = Image.getInstance(images); + int n = reader.getNumberOfPages(); + PdfContentByte under; + // 获取pdf的宽和高 + Rectangle pageSize = reader.getPageSize(1); + float height = pageSize.getHeight(); + float width = pageSize.getWidth(); + PdfContentByte pdfContentByte = stamper.getOverContent(1); + // 获得PDF最顶层 + under = stamper.getOverContent(1); + pdfContentByte.setGState(gs1); + // 水印文字成45度角倾斜 + image.setRotation(30);// 旋转 弧度 + // 设置旋转角度 + image.setRotationDegrees(0);// 旋转 角度 + // 设置等比缩放 + under.setColorFill(BaseColor.RED); + //设置水印的大小,同比缩小 + // image.scaleToFit(180,280); + image.scaleToFit(100,190); + image.setRotation(45); + image.setAbsolutePosition(0, height-220); // set the first background image of the absolute + pdfContentByte.addImage(image); + }catch (Exception e){ + e.printStackTrace(); + return false; + }finally{ + stamper.close(); + reader.close(); + } + //打文字水印 + try { + signSinglePsw(outputPath,reviews,pswX,pswY); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return true; + } + + public static boolean imageWatermark(String inputPath, String outputPath,String name,String images,List> reviews,float[] pswX,float[] pswY) throws IOException, DocumentException { + //打图纸章水印 + PdfReader reader = new PdfReader(inputPath); + FileOutputStream foc = new FileOutputStream(outputPath+"/bom/"+ name); + PdfStamper stamper = new PdfStamper(reader, foc); + PdfGState gs1 = new PdfGState(); + float height = 0.0f; + try{ + gs1.setFillOpacity(1f); + Image image = Image.getInstance(images); + int n = reader.getNumberOfPages(); + PdfContentByte under; + // 获取pdf的宽和高 + Rectangle pageSize = reader.getPageSize(1); + height = pageSize.getHeight(); + PdfContentByte pdfContentByte = stamper.getOverContent(1); + PdfContentByte pdunder = stamper.getUnderContent(1); + // 获得PDF最顶层 + under = stamper.getOverContent(1); + pdfContentByte.setGState(gs1); + pdunder.setGState(gs1); + // 水印文字成45度角倾斜 + image.setRotation(30);// 旋转 弧度 + // 设置旋转角度 + image.setRotationDegrees(0);// 旋转 角度 + // 设置等比缩放 + under.setColorFill(BaseColor.RED); + //设置水印的大小,同比缩小 + image.scaleToFit(100,190); + image.setRotation(45); + image.setAbsolutePosition(0, height-190); // set the first background image of the absolute + pdfContentByte.addImage(image); + }catch (Exception e){ + e.printStackTrace(); + return false; + }finally{ + stamper.close(); + foc.close(); + reader.close(); + } + //打文字水印 + try { + signSinglePsw(outputPath,name,reviews,pswX,pswY); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return true; + } + /** + * pdf合并 + * @param files + * @param targetPath + * @return + * @throws IOException + */ + public static File mulFile2One(List files,String targetPath) throws IOException{ + // pdf合并工具类 + PDFMergerUtility mergePdf = new PDFMergerUtility(); + for (File f : files) { + if(f.exists() && f.isFile()){ + // 循环添加要合并的pdf + mergePdf.addSource(f); + } + } + // 设置合并生成pdf文件名称 + mergePdf.setDestinationFileName(targetPath); + // 合并pdf + mergePdf.mergeDocuments(MemoryUsageSetting.setupMainMemoryOnly()); + return new File(targetPath); + } + + private static String signSinglePsw(String oldPswFilePath,String name,List> reviews,float[] pswX,float[] pswY) throws IOException, DocumentException { + + PdfReader reader = new PdfReader(oldPswFilePath + "/bom/" + name); + FileOutputStream foc = new FileOutputStream(oldPswFilePath + "/zip/" + name); + PdfStamper stp = new PdfStamper(reader, foc); + for (int i = 0; i < reader.getNumberOfPages(); ) { + i++; + PdfContentByte content = stp.getOverContent(i); + content.beginText(); + // 设置字体及字号 + content.setFontAndSize(getBaseFont(), 10); + Map review = (Map) reviews.get(0); + addDeptReview(content, review,pswX[0],pswY[0]); + content.endText(); + } + stp.close(); + foc.close(); + reader.close(); + return oldPswFilePath + "/zip/" + name; + } + + /** + * 合并打印文字水印和图纸章水印 + * inputPath 原始图路径 + * outputPath 打上水印后的路径 + * images 水印图片路径 + * reviews 水印内容集合 + * pswX X坐标点集合 + * pswY Y坐标点集合 + */ + public static boolean imageWatermark(String inputPath, String outputPath,String images) throws IOException, DocumentException { + //打图纸章水印 + PdfReader reader = new PdfReader(inputPath); + PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(outputPath)); + PdfGState gs1 = new PdfGState(); + try{ + gs1.setFillOpacity(1f); + + Image image = Image.getInstance(images); + int n = reader.getNumberOfPages(); + PdfContentByte under; + // 获取pdf的宽和高 + Rectangle pageSize = reader.getPageSize(1); + float height = pageSize.getHeight(); + float width = pageSize.getWidth(); + PdfContentByte pdfContentByte = stamper.getOverContent(1); + // 获得PDF最顶层 + under = stamper.getOverContent(1); + pdfContentByte.setGState(gs1); + // 水印文字成45度角倾斜 + image.setRotation(30);// 旋转 弧度 + // 设置旋转角度 + image.setRotationDegrees(0);// 旋转 角度 + // 设置等比缩放 + under.setColorFill(BaseColor.RED); + //设置水印的大小,同比缩小 + // image.scaleToFit(180,280); + image.scaleToFit(100,190); + image.setRotation(45); + image.setAbsolutePosition(0, height-220); // set the first background image of the absolute + pdfContentByte.addImage(image); + }catch (Exception e){ + e.printStackTrace(); + return false; + }finally{ + stamper.close(); + reader.close(); + } + return true; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/PcRigidChain.class b/evo/src/main/java/com/ruoyi/project/management/utils/PcRigidChain.class new file mode 100644 index 0000000..116b7dd Binary files /dev/null and b/evo/src/main/java/com/ruoyi/project/management/utils/PcRigidChain.class differ diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/PinYinUtil.java b/evo/src/main/java/com/ruoyi/project/management/utils/PinYinUtil.java new file mode 100644 index 0000000..7151967 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/PinYinUtil.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.management.utils; + +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; + +public class PinYinUtil { + + /** + * 获取字符串拼音的第一个字母 + * @param chinese + * @return + */ + public static String toFirstChar(String chinese){ + String pinyinStr = ""; + char[] newChar = chinese.toCharArray(); //转为单个字符 + HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); + defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + for (int i = 0; i < newChar.length; i++) { + if (newChar[i] > 128) { + try { + pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0].charAt(0); + } catch (BadHanyuPinyinOutputFormatCombination e) { + e.printStackTrace(); + } + }else{ + pinyinStr += newChar[i]; + } + } + return pinyinStr; + } + + /** + * 汉字转为拼音 + * @param chinese + * @return + */ + public static String toPinyin(String chinese){ + String pinyinStr = ""; + char[] newChar = chinese.toCharArray(); + HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); + defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + for (int i = 0; i < newChar.length; i++) { + if (newChar[i] > 128) { + try { + pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0]; + } catch (BadHanyuPinyinOutputFormatCombination e) { + e.printStackTrace(); + } + }else{ + pinyinStr += newChar[i]; + } + } + return pinyinStr; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/Print.java b/evo/src/main/java/com/ruoyi/project/management/utils/Print.java new file mode 100644 index 0000000..0b39bef --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/Print.java @@ -0,0 +1,100 @@ +package com.ruoyi.project.management.utils; + +import java.io.File; + +import com.jacob.activeX.ActiveXComponent; +import com.jacob.com.ComThread; +import com.jacob.com.Dispatch; +import com.jacob.com.Variant; + +public class Print { + + public static boolean printOfficeFile(File f) { + if (f != null && f.exists()) { + String fileNameString = f.getName(); + String postfixString = "xlsx"; + + if (postfixString.equalsIgnoreCase("xls") || postfixString.equalsIgnoreCase("xlsx")) { + /** + * 功能:实现excel打印工作 + */ + ComThread.InitSTA(); + ActiveXComponent xl = new ActiveXComponent("Excel.Application"); + try { + // System.out.println("version=" + + // xl.getProperty("Version")); + // 不打开文档 + Dispatch.put(xl, "Visible", new Variant(false)); + Dispatch workbooks = xl.getProperty("Workbooks").toDispatch(); + // 打开文档 + Dispatch excel = Dispatch.call(workbooks, "Open", f.getAbsolutePath()).toDispatch(); + // 横向打印(2013/05/24) + // Dispatch currentSheet = Dispatch.get(excel,"ActiveSheet").toDispatch(); + // Dispatch pageSetup = Dispatch.get(currentSheet, "PageSetup").toDispatch(); + // Dispatch.put(pageSetup, "Orientation", new Variant(2)); + // 每张表都横向打印2013-10-31 + Dispatch sheets = Dispatch.get((Dispatch) excel, "Sheets").toDispatch(); + // 获得几个sheet + int count = Dispatch.get(sheets, "Count").getInt(); + for (int j = 1; j <= count; j++) { + Dispatch sheet = Dispatch.invoke(sheets, "Item", Dispatch.Get, new Object[] { new Integer(j) }, new int[1]).toDispatch(); + Dispatch pageSetup = Dispatch.get(sheet, "PageSetup").toDispatch(); + Dispatch.put(pageSetup, "Orientation", new Variant(1)); + Dispatch.call(sheet, "PrintOut"); + } + // 开始打印 + if (excel != null) { + // Dispatch.call(excel, "PrintOut"); + // 增加以下三行代码解决文件无法删除bug + Dispatch.call(excel, "save"); + Dispatch.call(excel, "Close", new Variant(true)); + excel = null; + } + xl.invoke("Quit", new Variant[] {}); + xl = null; + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } finally { + // 始终释放资源 + ComThread.Release(); + } + } else if (postfixString.equalsIgnoreCase("doc") || postfixString.equalsIgnoreCase("docx")) { + ComThread.InitSTA(); + ActiveXComponent wd = new ActiveXComponent("Word.Application"); + try { + // 不打开文档 + Dispatch.put(wd, "Visible", new Variant(false)); + Dispatch document = wd.getProperty("Documents").toDispatch(); + // 打开文档 + Dispatch doc = Dispatch + .invoke(document, "Open", Dispatch.Method, new Object[] { f.getAbsolutePath() }, new int[1]) + .toDispatch(); + // 开始打印 + if (doc != null) { + Dispatch.call(doc, "PrintOut"); + // 增加以下三行代码解决文件无法删除bug + Dispatch.call(doc, "save"); + Dispatch.call(doc, "Close", new Variant(true)); + doc = null; + } + + wd.invoke("Quit", new Variant[] {}); + wd = null; + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } finally { + // 始终释放资源 + ComThread.Release(); + } + } else { + return false; + } + } else { + return false; + } + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/PrintUtil.java b/evo/src/main/java/com/ruoyi/project/management/utils/PrintUtil.java new file mode 100644 index 0000000..d9b641f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/PrintUtil.java @@ -0,0 +1,349 @@ +package com.ruoyi.project.management.utils; + +import com.jacob.activeX.ActiveXComponent; +import com.jacob.com.ComThread; +import com.jacob.com.Dispatch; +import com.jacob.com.Variant; + +import javax.imageio.ImageIO; +import javax.print.*; +import javax.print.attribute.DocAttributeSet; +import javax.print.attribute.HashDocAttributeSet; +import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.print.attribute.standard.OrientationRequested; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +public class PrintUtil { + + /** + * 竖屏模式 + */ + public static OrientationRequested PORTRAIT = OrientationRequested.PORTRAIT; + + /** + * 横屏模式 + */ + public static OrientationRequested LANDSCAPE = OrientationRequested.LANDSCAPE; + + + + /** + * 获取全部打印设备信息 + * @return 返回全部能用的打印服务的List + */ + public static List getDeviceList() { + // 构建打印请求属性集 + HashPrintRequestAttributeSet pras = new HashPrintRequestAttributeSet(); + // 设置打印格式,因为未确定类型,所以选择autosense + DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE; + // 查找所有的可用的打印服务 + PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras); + List list = Arrays.asList(printService); + return list; + } + + + /** + * 根据文件类型不同调用不同代码去打印 + * @param filePath 文件路径 + */ + public static void print(String filePath) throws Exception { + PrintService printService = PrintServiceLookup.lookupDefaultPrintService(); + String defaultDeviceName = printService.getName(); + print(filePath, defaultDeviceName); + } + + /** + * 额外传入一个 AfterPrint,会在打印完成后调用 afterPrint.run() + * @param filePath + * @param afterPrint + * @throws Exception + */ + public static void print(String filePath, AfterPrint afterPrint) throws Exception { + print(filePath); + afterPrint.run(); + } + + /** + * 根据文件类型不同调用不同代码去打印 + * @param filePath 文件路径 + * @param deviceName 设备名称,传入哪个设备的名称,就让哪个设备去打印 + */ + public static void print(String filePath, String deviceName) throws Exception{ + List list = getDeviceList(); + PrintService printService = null; + for (PrintService p : list) { + if(p.getName().equals(deviceName)) { + printService = p; + break; + } + } + if(printService == null) { + throw new Exception("Device not found"); + } + String type = filePath.replaceAll(".*\\.",""); + if("jpg".equalsIgnoreCase(type)) { + normalPrint(new File(filePath), DocFlavor.INPUT_STREAM.JPEG, printService); + return; + } + if("jpeg".equalsIgnoreCase(type)) { + normalPrint(new File(filePath), DocFlavor.INPUT_STREAM.JPEG, printService); + return; + } + if("gif".equalsIgnoreCase(type)) { + normalPrint(new File(filePath), DocFlavor.INPUT_STREAM.GIF, printService); + return; + } +// if("pdf".equalsIgnoreCase(type)) { +// printPDF(new File(filePath), DocFlavor.INPUT_STREAM.PNG, printService); +// return; +// } + if("png".equalsIgnoreCase(type)) { + normalPrint(new File(filePath), DocFlavor.INPUT_STREAM.PNG, printService); + return; + } + if("doc".equalsIgnoreCase(type)) { + printWord(filePath, deviceName); + return; + } + if("docx".equalsIgnoreCase(type)) { + printWord(filePath, deviceName); + return; + } + if("xls".equalsIgnoreCase(type)) { + printExcel(filePath, deviceName); + return; + } + if("xlsx".equalsIgnoreCase(type)) { + printExcel(filePath, deviceName); + return; + } + if("ppt".equalsIgnoreCase(type)) { + printPPT(filePath, deviceName); + return; + } + if("pptx".equalsIgnoreCase(type)) { + printPPT(filePath, deviceName); + return; + } + + } + + /** + * 会在打印完成后调用 afterPrint.run() + * @param filePath + * @param deviceName + * @param afterPrint + * @throws Exception + */ + public static void print(String filePath, String deviceName, AfterPrint afterPrint) throws Exception{ + print(filePath, deviceName); + afterPrint.run(); + } + + + /** + * javase的打印机打印文件,支持jpg,png,gif,pdf等等 + * @param file 要打印的文件 + * @param flavor 打印格式 + */ + private static void normalPrint(File file, DocFlavor flavor) { + //构建打印请求属性集 + HashPrintRequestAttributeSet pras = new HashPrintRequestAttributeSet(); + //查找所有的可用的打印服务 + PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras); + for (PrintService printService2 : printService) { + System.out.println(printService2); + } + //定位默认的打印服务 + PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService(); + //显示打印对话框 + PrintService service = ServiceUI.printDialog(null, 200, 200, printService,printService[2], flavor, pras); + if(service != null){ + try { + DocPrintJob job = service.createPrintJob(); //创建打印作业 + FileInputStream fis = new FileInputStream(file); //构造待打印的文件流 + DocAttributeSet das = new HashDocAttributeSet(); + Doc doc = new SimpleDoc(fis, flavor, das); + job.print(doc, pras); + } catch (Exception e) { + e.printStackTrace(); + } + } + // 定位默认的打印服务 +// PrintService service = PrintServiceLookup.lookupDefaultPrintService(); + // 显示打印对话框 + normalPrint(file, flavor, service); + } + + + private static void normalPrint(File file, DocFlavor flavor, PrintService service) { + normalPrint(file, flavor, PORTRAIT, service); + } + + /** + * javase的打印机打印文件,支持jpg,png,gif等等 + * @param file 要打印的文件 + * @param service 打印机选择 + * @param requested 设定横屏还是竖屏 + * @param flavor 打印格式 + */ + private static void normalPrint(File file, DocFlavor flavor, OrientationRequested requested, PrintService service) { + // 构建打印请求属性集 + HashPrintRequestAttributeSet pras = new HashPrintRequestAttributeSet(); + pras.add(requested); + if (service != null) { + try { + DocPrintJob job = service.createPrintJob(); // 创建打印作业 + FileInputStream fis = new FileInputStream(file); // 构造待打印的文件流 + DocAttributeSet das = new HashDocAttributeSet(); + Doc doc = new SimpleDoc(fis, flavor, das); + job.print(doc, pras); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + /** + * 打印pdf的方法,因为java内置的打印pdf的方法有病,所以首先需要把pdf转换成png,然后打印png + * @param file 要打印的文件 + * @param flavor 要打印的文件 + * @param service 打印设备 + */ +// private static void printPDF(File file, DocFlavor flavor, PrintService service) { +// try { +// PDDocument doc = PDDocument.load(file); +// PDFRenderer renderer = new PDFRenderer(doc); +// int pageCount = doc.getNumberOfPages(); +// for(int i=0;i"+"详情如下:"+"\n
"+""; +// SendEmail send = new SendEmail(); +// try { +// send.sendEmail("就餐人员打卡通知",content,"278772102@qq.com"); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } + + + /** + * pdf合并拼接 + * @Title:mulFile2One + * @Description: TODO + * @date 2019年9月22日 上午10:05:37 + * @author yqwang + * @param files 文件列表 + * @param targetPath 合并到 + * @return + * @throws IOException + */ +// public static File mulFile2One(List files,String targetPath) throws IOException{ +// // pdf合并工具类 +// PDFMergerUtility mergePdf = new PDFMergerUtility(); +// for (File f : files) { +// if(f.exists() && f.isFile()){ +// // 循环添加要合并的pdf +// mergePdf.addSource(f); +// } +// } +// // 设置合并生成pdf文件名称 +// mergePdf.setDestinationFileName(targetPath); +// // 合并pdf +// mergePdf.mergeDocuments(MemoryUsageSetting.setupMainMemoryOnly()); +// return new File(targetPath); +// } +// +// public static void main(String[] args) throws IOException { +// List files = new ArrayList(); +// files.add(new File("D:\\download\\XCL-229-23\\34-40S.13.1-1168.pdf")); +// files.add(new File("D:\\download\\XCL-229-23\\35-40S.13.2--DL.pdf")); +// files.add(new File("D:\\download\\XCL-229-23\\36-40S.13.2--DR.pdf")); +// File f = mulFile2One(files, "D:\\download\\XCL-229-23\\zong.pdf"); +// System.out.println(f.length()); +// } + +// public static void main(String[] args) throws ParseException { +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// String s = "2023-10-18 11:54:07"; +// // 创建 Calendar 对象 +// Calendar calendar = Calendar.getInstance(); +// calendar.setTime(sdf.parse(s)); +// +// // 打印当前时间的小时数 +// System.out.println("当前时间的小时数:" + calendar.HOUR_OF_DAY); +// } + +// public static void main(String[] args) { +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// for (int i = 0; i < 100; i++) { +// System.out.println(i+"--"+sdf.format(new Date())); +// try { +// Thread.sleep(5000); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// } +// } + +// public static void main(String[] args) { +// BigDecimal bigDecimal = new BigDecimal("1000.0"); +// BigDecimal bigDecimal2 = new BigDecimal("30"); +// System.out.println(bigDecimal.divide(bigDecimal2,4,BigDecimal.ROUND_UP)); +// } +// public static void main(String[] args) { +// UUID uuid = UUID.randomUUID(); +// System.out.println(uuid); +// } + +// public static void main(String[] args){ +// File file=new File("D:\\测试"); //要删除的路径 +// deleteFile(file); //调用删除文件方法 +// } + + private static void deleteFile(File file){ + + if (file.exists()) { //测试文件或目录是否存在,存在进入下一步 + if (file.isFile()) { //判断file 是不是文件,如果是直接删除 + file.delete(); + }else{ //如果不是,则一定是文件夹 + File[] files = file.listFiles(); //获取文件夹下的file对象列表 + if (files.length==0) { //判断此文件夹下有没有文件或目录 + file.delete(); //没有的话,直接删除此路径,有的话,遍历此路径,重复以上动作 + }else{ + for (File file1 : files) { + deleteFile(file1); + } + file.delete(); //文件夹下所有文件和目录均被清空,删除本文件夹 + } + } + + }else{ + System.out.println("文件或目录不存在"); + } + } + +// public static void main(String[] args) { +// +// int i = 1; +// +// Long s = 1L; +// +// System.out.println(i==s); +// } + + +/** + * 汉字转换为拼音 + * @author Wjhsmart + */ + /** + * 测试main方法 + * @param args + */ +// public static void main(String[] args) { +// String string = PinYinUtil.toPinyin("张三"); +// System.out.println("‘张三’转成拼音:" + string); +// } + + +// public static void main(String[] args) { +// pdf2png("C:\\Users\\zhukangchao\\Desktop","新建 RTF 文件(1)","png"); +// } + + /** + * 转换全部的pdf + * @param fileAddress 文件地址 + * @param filename PDF文件名 + * @param type 图片类型 + */ + public static void pdf2png(String fileAddress,String filename,String type) { + // 将pdf装图片 并且自定义图片得格式大小 + File file = new File(fileAddress+"\\"+filename+".pdf"); + try { + PDDocument doc = PDDocument.load(file); + PDFRenderer renderer = new PDFRenderer(doc); + int pageCount = doc.getNumberOfPages(); + for (int i = 0; i < pageCount; i++) { + BufferedImage image = renderer.renderImageWithDPI(i, 144); // Windows native DPI + // BufferedImage srcImage = resize(image, 240, 240);//产生缩略图 + ImageIO.write(image, type, new File(fileAddress+"\\"+filename+"_"+(i+1)+"."+type)); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + +/** + *自由确定起始页和终止页 + * @param fileAddress 文件地址 + * @param filename pdf文件名 + * @param indexOfStart 开始页 开始转换的页码,从0开始 + * @param indexOfEnd 结束页 停止转换的页码,-1为全部 + * @param type 图片类型 + */ + public static void pdf2png(String fileAddress,String filename,int indexOfStart,int indexOfEnd,String type) { + // 将pdf装图片 并且自定义图片得格式大小 + File file = new File(fileAddress+"\\"+filename+".pdf"); + try { + PDDocument doc = PDDocument.load(file); + PDFRenderer renderer = new PDFRenderer(doc); + int pageCount = doc.getNumberOfPages(); + for (int i = indexOfStart; i < indexOfEnd; i++) { + BufferedImage image = renderer.renderImageWithDPI(i, 144); // Windows native DPI + // BufferedImage srcImage = resize(image, 240, 240);//产生缩略图 + ImageIO.write(image, type, new File(fileAddress+"\\"+filename+"_"+(i+1)+"."+type)); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + + //执行次数 +// private static int count = 0; +// +// public static void main(String[] args) { +// +// searchPerson("文件传输助手", "测试微信发送消息"); +// +// } + + + private static void searchPerson(String friendNickName, String content) { + // 创建Robot对象 + Robot robot = getRobot(); + //打开微信 Ctrl+Alt+W + assert robot != null; + robot.keyPress(KeyEvent.VK_CONTROL); + robot.keyPress(KeyEvent.VK_ALT); + robot.keyPress(KeyEvent.VK_W); + + //释放Ctrl按键,像Ctrl,退格键,删除键这样的功能性按键,在按下后一定要释放 + robot.keyRelease(KeyEvent.VK_CONTROL); + robot.keyRelease(KeyEvent.VK_ALT); + + // 该延迟不能少,否则无法搜索 + robot.delay(1000); + + // Ctrl + F 搜索指定好友 + robot.keyPress(KeyEvent.VK_CONTROL); + robot.keyPress(KeyEvent.VK_F); + robot.keyRelease(KeyEvent.VK_CONTROL); + + // 将好友昵称发送到剪切板 + Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); + Transferable tText = new StringSelection(friendNickName); + clip.setContents(tText, null); + + // 以下两行按下了ctrl+v,完成粘贴功能 + robot.keyPress(KeyEvent.VK_CONTROL); + robot.keyPress(KeyEvent.VK_V); + robot.keyRelease(KeyEvent.VK_CONTROL); + + robot.delay(1000); + + robot.keyPress(KeyEvent.VK_ENTER); + + robot.delay(1000); + + // 发送消息 + try { + sendMsg(content); + + } catch (InterruptedException e) { + e.printStackTrace(); + } + + // Ctrl + F4关闭窗口 + robot.keyPress(KeyEvent.VK_ALT); + robot.keyPress(KeyEvent.VK_F4); + robot.keyRelease(KeyEvent.VK_ALT); + } + + private static void sendMsg(String content) throws InterruptedException { + if (!content.equals("发送默认的信息")) { + sendOneMsg(content); + } else { + String[] msgArr = { + "能不能发", + "能不能", + "能", + "鸹貔", + "[Emm]", + "" + }; + ArrayList msgList = new ArrayList<>(); + int i = 1; + while (i <= 10) { + msgList.add("能不能发!"); + i++; + } + for (String item : msgList) { + sendOneMsg(item); + } + Thread.sleep(2000); + + sendOneMsg("就问你能不能发!"); + sendOneMsg("[坏笑]"); + sendOneMsg("鸹貔"); + } + + } + + private static Robot getRobot() { + // 创建Robot对象 + Robot robot = null; + try { + robot = new Robot(); + } catch (AWTException e) { + e.printStackTrace(); + } + return robot; + } + + private static void sendOneMsg(String msg) { + Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); + Transferable tText; + //创建Robot对象 + Robot robot = getRobot(); + //延迟十秒,主要是为了预留出打开窗口的时间,括号内的单位为毫秒 + if (null != robot) { + robot.delay(500); + tText = new StringSelection(msg); + clip.setContents(tText, null); + // 按下了ctrl+v,完成粘贴功能 + robot.keyPress(KeyEvent.VK_CONTROL); + robot.keyPress(KeyEvent.VK_V); + robot.keyRelease(KeyEvent.VK_CONTROL); + robot.delay(500); + //回车发送消息 + robot.keyPress(KeyEvent.VK_ENTER); + tText = new StringSelection(null); + robot.delay(500); + + } + } + + +// public static void main(String[] args) throws IOException, NotFoundException { +// String content="http://localhost:8090/production/pwQrcodeTwo?code=QB-XCL-0162-23&name=轴承压盖-激光下料(M)&figureNumber=35RBD.2-1"; +// //压缩 +// String zipContent=zipBase64(content); +// System.out.println("压缩内容"+zipContent); +// //生成二维码 +// QrCodeUtil.generate(zipContent, 300,300, FileUtil.file("D:/java/testQr2.jpg")); +// //获取二维码路径 +// String format="D:/java/testQr2.jpg"; +// //获取压缩内容 +// String analysis = Test.analysis(format, "UTF-8"); +// //解压已压缩内容 +// String unzipBase64 = unzipBase64(analysis); +// System.out.println(unzipBase64); +// } +// +// +// /** +// * 压缩文本 +// * @param text +// * @return +// */ +// public static String zipBase64(String text) { +// //创建一个新的字节数组输出流。缓冲区容量最初为 32 字节 +// try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { +// //使用默认压缩器和缓冲区大小创建新的输出流 +// try (DeflaterOutputStream deflaterOutputStream = new DeflaterOutputStream(out)) { +// deflaterOutputStream.write(text.getBytes(Charset.forName("UTF-8"))); +// } +// return Base64.getEncoder().encodeToString(out.toByteArray()); +// } catch (IOException e) { +// } +// return ""; +// } +// +// /** +// * 解压文本 +// * @param text +// * @return +// */ +// public static String unzipBase64(String text) { +// try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { +// //使用默认解压缩器和缓冲区创建新的输出流 +// try (OutputStream outputStream = new InflaterOutputStream(os)) { +// outputStream.write(Base64.getDecoder().decode(text.getBytes())); +// } +// return new String(os.toByteArray(), Charset.forName("UTF-8")); +// } catch (IOException e) { +// +// } +// return ""; +// } + + /** + * 解析本地二维码内容,自定义编码格式 + * @param filePath 二维码图片地址 + * @param character 二维码内容编码格式 + * @throws IOException + * @throws NotFoundException + */ + public static String analysis(String filePath,String character) throws IOException, NotFoundException { + BufferedImage image = ImageIO.read(new File(filePath)); + BinaryBitmap bb = new BinaryBitmap(new HybridBinarizer(new BufferedImageLuminanceSource(image))); + HashMap map = new HashMap(); + map.put(DecodeHintType.CHARACTER_SET,character); + map.put(DecodeHintType.TRY_HARDER, Boolean.TRUE); + //复杂模式 + map.put(DecodeHintType.PURE_BARCODE, Boolean.TRUE); + Result result = new MultiFormatReader().decode(bb, map); + String QRContents=result.getText(); + return QRContents; + } + +// public static void main(String[] args) { +// String s = "工序:1.火焰下料-04月07日 2.平磨-04月08日 3.立加-04月13日 4.攻丝-04月14日 5.发蓝处理"; +// System.out.println(s.length()); +// s = s.replaceAll("(.{52})", "$1\n"); +// System.out.println(s); +// } + +// public static void main(String[] args) { +// //根据申请人名称查询 +// SendEmail send = new SendEmail(); +// +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); +// //拼接邮件内容 +// String content = "测试2"; +// +// try { +// send.sendEmail("通知2",content,"631393826@qq.com"); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } + + +// public static void main(String[] args) throws ParseException { +// +// +// String s = "40S/R+L-880/S"; +// String replaceAll = s.replaceAll("R[+]L", "L+R"); +// System.out.println(replaceAll); +// +//// SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +//// +//// String start = "2022-12-29 12:43:30"; +//// String end = "2022-12-30 08:36:26"; +//// +//// Date parse = sf.parse(start); +//// Date parse2 = sf.parse(end); +//// +//// Long cha = parse2.getTime()-parse.getTime(); +//// +//// Double miao = (double) (cha/1000); +//// Double fenhzong = (double) (miao/60); +//// Double xiaoshi = (double) (fenhzong/60); +//// +//// +//// System.out.println(cha/1000); +//// System.out.println(miao); +//// System.out.println(fenhzong); +//// System.out.println(xiaoshi); +// +// +// +//// String format = sdf.format(new Date()); +//// +//// System.out.println(format); +//// String s = "2022-02-01"; +//// +//// Calendar cal = Calendar.getInstance(); +//// try { +//// cal.setTime(sdf.parse(s)); +//// } catch (ParseException e) { +//// e.printStackTrace(); +//// } +//// cal.set(Calendar.DAY_OF_MONTH, 1); +//// cal.roll(Calendar.DAY_OF_MONTH, -1); +//// String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); +//// int day = Integer.parseInt(format.substring((format.lastIndexOf("-") + 1)));// 得今天是2022年10月13号,所以这个月的最大天数是 31 +//// System.out.println(day); +// +//// String s = "1"; +//// +//// System.out.println(Double.valueOf(s)); +// +//// Date d = new Date(); +//// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +//// String currdate = format.format(d); +//// System.out.println("现在的日期是:" + currdate); +//// +//// Calendar ca = Calendar.getInstance(); +//// ca.setTime(d); +//// ca.add(Calendar.DATE, 55);// num为增加的天数,可以改变的 +//// d = ca.getTime(); +//// String enddate = format.format(d); +//// System.out.println("增加天数以后的日期:" + enddate); +// +// +//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +//// String date2 = "2022-12-14"; +//// +//// try { +//// int i = differentDays(new Date(),sdf.parse(date2)); +//// System.out.println(i); +//// } catch (ParseException e) { +//// e.printStackTrace(); +//// } +// +// } + + + /** + * date2比date1多的天数 + * @param date1 + * @param date2 + * @return + */ +// private static int differentDays(Date date1,Date date2) { +// Calendar cal1 = Calendar.getInstance(); +// cal1.setTime(date1); +// +// Calendar cal2 = Calendar.getInstance(); +// cal2.setTime(date2); +// int day1= cal1.get(Calendar.DAY_OF_YEAR); +// int day2 = cal2.get(Calendar.DAY_OF_YEAR); +// +// int year1 = cal1.get(Calendar.YEAR); +// int year2 = cal2.get(Calendar.YEAR); +// if(year1 != year2) {//同一年 +// int timeDistance = 0 ; +// for(int i = year1 ; i < year2 ; i ++) +// { +// if(i%4==0 && i%100!=0 || i%400==0) //闰年 +// { +// timeDistance += 366; +// } +// else //不是闰年 +// { +// timeDistance += 365; +// } +// } +// +// return timeDistance + (day2-day1) ; +// } else { +// // 不同年 +// return day2-day1; +// } +// } +// +// public static void main(String[] args) { +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// String s = "2022-11-26 00:00:00"; +// Date date = new Date(); +// //日期加上一个月 +// Calendar calendars = Calendar.getInstance(); +// calendars.setTime(date); +// calendars.add(Calendar.DATE, 3); +// Date time = calendars.getTime(); +// try { +// if(time.after(sdf.parse(s))){ +// System.out.println("111111111"); +// }else{ +// System.out.println("222222222"); +// } +// } catch (ParseException e) { +// e.printStackTrace(); +// } +// } + +// public static void main(String[] args) { +// String state = "2"; +// switch (state) { +// case "1": +// System.out.println("1"); +// break; +// case "2": +// System.out.println("2"); +// break; +// case "3": +// System.out.println("3"); +// break; +// } +// } + + +// public static void main(String[] args) { +// File file = new File("C:\\Users\\zhukangchao\\Desktop\\TFD.1.pdf"); +// try { +// PDDocument doc = PDDocument.load(file); +// PDFRenderer renderer = new PDFRenderer(doc); +// int pageCount = doc.getNumberOfPages(); +// for(int i=0;i errorIndex = new ArrayList<>(); + List> maps = new ArrayList<>(); + for (int i = 0; i < file.length; i++) { + Map map = new HashMap<>(); + String originalFilename = file[i].getOriginalFilename(); + //校验文件后缀 + String postfix = originalFilename.substring(originalFilename.length()-3); + String fileName = originalFilename.substring(0,originalFilename.length()-4); + long time = new Date().getTime(); + String hash = Md5Utils.hash(fileName+time); + String s = hash+originalFilename.substring(originalFilename.length()-4); + try { + if(file[i]!=null && !file[i].isEmpty()){ + InputStream is = file[i].getInputStream(); + byte[] bytes = new byte[is.available()]; + is.read(bytes); + File file1 = new File(uploadFilePath+s); + FileOutputStream fos = new FileOutputStream(file1); + BufferedOutputStream bos = new BufferedOutputStream(fos); + bos.write(bytes); + bos.flush(); + map.put("index", i); + map.put("url", s); + maps.add(map); + is.close(); + fos.close(); + bos.close(); + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + Collections.sort(maps, Comparator.comparingInt(map -> (int) map.get("index"))); + for (Map map1 : maps) { + if ("-1".equals(map1.get("status"))) { + errorIndex.add(map1.get("index")+""); + continue; + } + urls += map1.get("url") + ","; + } + urls = urls.substring(0, urls.length() - 1); + if (errorIndex.isEmpty()) + return AjaxResult.success(urls); + else { + String message = "第"; + for (String index : errorIndex) { + message += index; + message += ","; + } + message.substring(0, message.length() - 1); + message += "张图片上传失败!"; + return AjaxResult.error(message); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/project/management/utils/ZbUrl.java b/evo/src/main/java/com/ruoyi/project/management/utils/ZbUrl.java new file mode 100644 index 0000000..08b1d48 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/management/utils/ZbUrl.java @@ -0,0 +1,144 @@ +package com.ruoyi.project.management.utils; + +import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import com.ruoyi.project.management.domain.PwInventoryDetail; + +public class ZbUrl { + + /** + * 获取ERP系统的登录session + * @return + */ + public static String login(){ + String json = "{session:\"\", datas:["; + json += " {id:\"user\", val:\"txt:superadmin\"},"; //用户名 + json += " {id:\"password\", val:\"txt:888888\"},"; //用户名密码 + json += " {id:\"serialnum\", val:\"txt:abcd1232\"},"; //用户串号 + json += " {id:\"rndcode\", val:\"\"}"; //随机验证码 + json += "]}"; + String session = ""; + try{ + URL url = new URL("http://192.168.5.51:81/SYSA/mobilephone/login.asp"); + HttpURLConnection cn = (HttpURLConnection) url.openConnection(); + cn.setDoOutput(true); + cn.setDoInput(true); + cn.setUseCaches(false); + cn.setInstanceFollowRedirects(true); + cn.setRequestMethod("POST"); + //接口规定content-type值必须为application/zsml,本案例采用utf-8编码,该编码为默认编码方式,也可不写。 + cn.setRequestProperty("Content-Type", "application/zsml; charset=utf-8"); + cn.connect(); + OutputStreamWriter out = new OutputStreamWriter(cn.getOutputStream(), "UTF-8"); + out.append(json); + out.flush(); + out.close(); + int length = (int) cn.getContentLength(); + InputStream is = cn.getInputStream(); + if (length != -1) { + byte[] data = new byte[length]; + byte[] temp = new byte[512]; + int readLen = 0; + int destPos = 0; + while ((readLen = is.read(temp)) > 0) { + System.arraycopy(temp, 0, data, destPos, readLen); + destPos += readLen; + } + String result = new String(data, "UTF-8"); + JSONObject rcm = JSONObject.parseObject(result); + JSONObject s = JSONObject.parseObject(rcm.get("header").toString()); + session = s.get("session").toString(); +// System.out.println(result); //输出接口返回结果 + } + } catch(Exception e) { + System.out.println(e.getMessage()); + } + return session; + } + + /** + * 获取ERP库存详情,把库存备份到另一数据库 + * @return + */ + public static List inventoryDetails(){ + //创建返回的list集合 + List lists = new ArrayList(); + + //调用登录获取session + String session = login(); + String json = "{\"session\":\""+session+"\",cmdkey:\"refresh\", datas:["; + json += " {id:\"dataType\", val:\"\"},"; //列表模式 + json += " {id:\"ord\", val:\"0\"},"; //列表数据检索条件 + json += " {id:\"searchKey\", val:\"\"},"; //快速检索条件 + json += " {id:\"pagesize\", val:\"100000\"},"; //每页记录数 + json += " {id:\"pageindex\", val:\"1\"},"; //数据页标 + json += " {id:\"_rpt_sort\", val:\"\"}"; //排序字段 + json += "]}"; + try{ + URL url = new URL("http://192.168.5.51:81/SYSA/mobilephone/storemanage/store/list.asp"); + HttpURLConnection cn = (HttpURLConnection) url.openConnection(); + cn.setDoOutput(true); + cn.setDoInput(true); + cn.setUseCaches(false); + cn.setInstanceFollowRedirects(true); + cn.setRequestMethod("POST"); + //接口规定content-type值必须为application/zsml,本案例采用utf-8编码,该编码为默认编码方式,也可不写。 + cn.setRequestProperty("Content-Type", "application/zsml; charset=utf-8"); + cn.connect(); + OutputStreamWriter out = new OutputStreamWriter(cn.getOutputStream(), "UTF-8"); + out.append(json); + out.flush(); + out.close(); + int length = (int) cn.getContentLength(); + InputStream is = cn.getInputStream(); + if (length != -1) { + byte[] data = new byte[length]; + byte[] temp = new byte[512]; + int readLen = 0; + int destPos = 0; + while ((readLen = is.read(temp)) > 0) { + System.arraycopy(temp, 0, data, destPos, readLen); + destPos += readLen; + } + String result = new String(data, "UTF-8"); + JSONObject rcm = JSONObject.parseObject(result); + JSONObject body = JSONObject.parseObject(rcm.get("body").toString()); + JSONObject source = JSONObject.parseObject(body.get("source").toString()); + JSONObject table = JSONObject.parseObject(source.get("table").toString()); + JSONArray rows = JSONArray.parseArray(table.get("rows").toString()); + List list = new ArrayList<>(); + for (Object object : rows) { + list.add(object.toString()); + } + + for (Object object : list) { + //创建库存对象用于存储库存数据 + PwInventoryDetail pid = new PwInventoryDetail(); + JSONArray e = JSONArray.parseArray(object.toString()); + //名称 + pid.setName(e.get(1).toString()); + //图号(型号) + pid.setFigureNumber(e.get(2).toString()); + //库存数量 + pid.setQuantity(Long.valueOf(e.get(4).toString())); + //计量单位 + pid.setUnit(e.get(5).toString()); + lists.add(pid); + } + } + } catch(Exception e) { + System.out.println(e.getMessage()); + } + return lists; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java b/evo/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java new file mode 100644 index 0000000..c9d8007 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java @@ -0,0 +1,28 @@ +package com.ruoyi.project.monitor.controller; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.domain.Server; + +/** + * 服务器监控 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/monitor/server") +public class ServerController extends BaseController +{ + @PreAuthorize("@ss.hasPermi('monitor:server:list')") + @GetMapping() + public AjaxResult getInfo() throws Exception + { + Server server = new Server(); + server.copyTo(); + return AjaxResult.success(server); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/controller/SysJobController.java b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysJobController.java new file mode 100644 index 0000000..9894cd8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysJobController.java @@ -0,0 +1,130 @@ +package com.ruoyi.project.monitor.controller; + +import java.util.List; +import org.quartz.SchedulerException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.monitor.domain.SysJob; +import com.ruoyi.project.monitor.service.ISysJobService; + +/** + * 调度任务信息操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/monitor/job") +public class SysJobController extends BaseController +{ + @Autowired + private ISysJobService jobService; + + /** + * 查询定时任务列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:list')") + @GetMapping("/list") + public TableDataInfo list(SysJob sysJob) + { + startPage(); + List list = jobService.selectJobList(sysJob); + return getDataTable(list); + } + + /** + * 导出定时任务列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:export')") + @Log(title = "定时任务", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(SysJob sysJob) + { + List list = jobService.selectJobList(sysJob); + ExcelUtil util = new ExcelUtil(SysJob.class); + return util.exportExcel(list, "定时任务"); + } + + /** + * 获取定时任务详细信息 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:query')") + @GetMapping(value = "/{jobId}") + public AjaxResult getInfo(@PathVariable("jobId") Long jobId) + { + return AjaxResult.success(jobService.selectJobById(jobId)); + } + + /** + * 新增定时任务 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:add')") + @Log(title = "定时任务", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException + { + return toAjax(jobService.insertJob(sysJob)); + } + + /** + * 修改定时任务 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:edit')") + @Log(title = "定时任务", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException + { + return toAjax(jobService.updateJob(sysJob)); + } + + /** + * 定时任务状态修改 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") + @Log(title = "定时任务", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException + { + SysJob newJob = jobService.selectJobById(job.getJobId()); + newJob.setStatus(job.getStatus()); + return toAjax(jobService.changeStatus(newJob)); + } + + /** + * 定时任务立即执行一次 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") + @Log(title = "定时任务", businessType = BusinessType.UPDATE) + @PutMapping("/run") + public AjaxResult run(@RequestBody SysJob job) throws SchedulerException + { + jobService.run(job); + return AjaxResult.success(); + } + + /** + * 删除定时任务 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @Log(title = "定时任务", businessType = BusinessType.DELETE) + @DeleteMapping("/{jobIds}") + public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException + { + jobService.deleteJobByIds(jobIds); + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/controller/SysJobLogController.java b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysJobLogController.java new file mode 100644 index 0000000..ba11816 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysJobLogController.java @@ -0,0 +1,90 @@ +package com.ruoyi.project.monitor.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.project.monitor.domain.SysJobLog; +import com.ruoyi.project.monitor.service.ISysJobLogService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; + +/** + * 调度日志操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/monitor/jobLog") +public class SysJobLogController extends BaseController +{ + @Autowired + private ISysJobLogService jobLogService; + + /** + * 查询定时任务调度日志列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:list')") + @GetMapping("/list") + public TableDataInfo list(SysJobLog sysJobLog) + { + startPage(); + List list = jobLogService.selectJobLogList(sysJobLog); + return getDataTable(list); + } + + /** + * 导出定时任务调度日志列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:export')") + @Log(title = "任务调度日志", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(SysJobLog sysJobLog) + { + List list = jobLogService.selectJobLogList(sysJobLog); + ExcelUtil util = new ExcelUtil(SysJobLog.class); + return util.exportExcel(list, "调度日志"); + } + + /** + * 根据调度编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:query')") + @GetMapping(value = "/{configId}") + public AjaxResult getInfo(@PathVariable Long jobLogId) + { + return AjaxResult.success(jobLogService.selectJobLogById(jobLogId)); + } + + + /** + * 删除定时任务调度日志 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE) + @DeleteMapping("/{jobLogIds}") + public AjaxResult remove(@PathVariable Long[] jobLogIds) + { + return toAjax(jobLogService.deleteJobLogByIds(jobLogIds)); + } + + /** + * 清空定时任务调度日志 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @Log(title = "调度日志", businessType = BusinessType.CLEAN) + @DeleteMapping("/clean") + public AjaxResult clean() + { + jobLogService.cleanJobLog(); + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java new file mode 100644 index 0000000..d9258fe --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.monitor.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.monitor.domain.SysLogininfor; +import com.ruoyi.project.monitor.service.ISysLogininforService; + +/** + * 系统访问记录 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/monitor/logininfor") +public class SysLogininforController extends BaseController +{ + @Autowired + private ISysLogininforService logininforService; + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") + @GetMapping("/list") + public TableDataInfo list(SysLogininfor logininfor) + { + startPage(); + List list = logininforService.selectLogininforList(logininfor); + return getDataTable(list); + } + + @Log(title = "登陆日志", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") + @GetMapping("/export") + public AjaxResult export(SysLogininfor logininfor) + { + List list = logininforService.selectLogininforList(logininfor); + ExcelUtil util = new ExcelUtil(SysLogininfor.class); + return util.exportExcel(list, "登陆日志"); + } + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") + @Log(title = "登陆日志", businessType = BusinessType.DELETE) + @DeleteMapping("/{infoIds}") + public AjaxResult remove(@PathVariable Long[] infoIds) + { + return toAjax(logininforService.deleteLogininforByIds(infoIds)); + } + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") + @Log(title = "登陆日志", businessType = BusinessType.CLEAN) + @DeleteMapping("/clean") + public AjaxResult clean() + { + logininforService.cleanLogininfor(); + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java new file mode 100644 index 0000000..0cabf92 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java @@ -0,0 +1,66 @@ +package com.ruoyi.project.monitor.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.monitor.domain.SysOperLog; +import com.ruoyi.project.monitor.service.ISysOperLogService; + +/** + * 操作日志记录 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/monitor/operlog") +public class SysOperlogController extends BaseController +{ + @Autowired + private ISysOperLogService operLogService; + + @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") + @GetMapping("/list") + public TableDataInfo list(SysOperLog operLog) + { + startPage(); + List list = operLogService.selectOperLogList(operLog); + return getDataTable(list); + } + + @Log(title = "操作日志", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") + @GetMapping("/export") + public AjaxResult export(SysOperLog operLog) + { + List list = operLogService.selectOperLogList(operLog); + ExcelUtil util = new ExcelUtil(SysOperLog.class); + return util.exportExcel(list, "操作日志"); + } + + @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") + @DeleteMapping("/{operIds}") + public AjaxResult remove(@PathVariable Long[] operIds) + { + return toAjax(operLogService.deleteOperLogByIds(operIds)); + } + + @Log(title = "操作日志", businessType = BusinessType.CLEAN) + @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") + @DeleteMapping("/clean") + public AjaxResult clean() + { + operLogService.cleanOperLog(); + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java new file mode 100644 index 0000000..1d28b19 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java @@ -0,0 +1,92 @@ +package com.ruoyi.project.monitor.controller; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.redis.RedisCache; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.monitor.domain.SysUserOnline; +import com.ruoyi.project.system.service.ISysUserOnlineService; + +/** + * 在线用户监控 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/monitor/online") +public class SysUserOnlineController extends BaseController +{ + @Autowired + private ISysUserOnlineService userOnlineService; + + @Autowired + private RedisCache redisCache; + + @PreAuthorize("@ss.hasPermi('monitor:online:list')") + @GetMapping("/list") + public TableDataInfo list(String ipaddr, String userName) + { + Collection keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*"); + List userOnlineList = new ArrayList(); + for (String key : keys) + { + LoginUser user = redisCache.getCacheObject(key); + if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) + { + if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) + { + userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); + } + } + else if (StringUtils.isNotEmpty(ipaddr)) + { + if (StringUtils.equals(ipaddr, user.getIpaddr())) + { + userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); + } + } + else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) + { + if (StringUtils.equals(userName, user.getUsername())) + { + userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); + } + } + else + { + userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); + } + } + Collections.reverse(userOnlineList); + userOnlineList.removeAll(Collections.singleton(null)); + return getDataTable(userOnlineList); + } + + /** + * 强退用户 + */ + @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") + @Log(title = "在线用户", businessType = BusinessType.DELETE) + @DeleteMapping("/{tokenId}") + public AjaxResult forceLogout(@PathVariable String tokenId) + { + redisCache.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId); + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/domain/SysJob.java b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysJob.java new file mode 100644 index 0000000..126be47 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysJob.java @@ -0,0 +1,172 @@ +package com.ruoyi.project.monitor.domain; + +import java.io.Serializable; +import java.util.Date; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.job.CronUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 定时任务调度表 sys_job + * + * @author ruoyi + */ +public class SysJob extends BaseEntity implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 任务ID */ + @Excel(name = "任务序号", cellType = ColumnType.NUMERIC) + private Long jobId; + + /** 任务名称 */ + @Excel(name = "任务名称") + private String jobName; + + /** 任务组名 */ + @Excel(name = "任务组名") + private String jobGroup; + + /** 调用目标字符串 */ + @Excel(name = "调用目标字符串") + private String invokeTarget; + + /** cron执行表达式 */ + @Excel(name = "执行表达式 ") + private String cronExpression; + + /** cron计划策略 */ + @Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行") + private String misfirePolicy = ScheduleConstants.MISFIRE_DEFAULT; + + /** 是否并发执行(0允许 1禁止) */ + @Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止") + private String concurrent; + + /** 任务状态(0正常 1暂停) */ + @Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停") + private String status; + + public Long getJobId() + { + return jobId; + } + + public void setJobId(Long jobId) + { + this.jobId = jobId; + } + + @NotBlank(message = "任务名称不能为空") + @Size(min = 0, max = 64, message = "任务名称不能超过64个字符") + public String getJobName() + { + return jobName; + } + + public void setJobName(String jobName) + { + this.jobName = jobName; + } + + public String getJobGroup() + { + return jobGroup; + } + + public void setJobGroup(String jobGroup) + { + this.jobGroup = jobGroup; + } + + @NotBlank(message = "调用目标字符串不能为空") + @Size(min = 0, max = 1000, message = "调用目标字符串长度不能超过500个字符") + public String getInvokeTarget() + { + return invokeTarget; + } + + public void setInvokeTarget(String invokeTarget) + { + this.invokeTarget = invokeTarget; + } + + @NotBlank(message = "Cron执行表达式不能为空") + @Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符") + public String getCronExpression() + { + return cronExpression; + } + + public void setCronExpression(String cronExpression) + { + this.cronExpression = cronExpression; + } + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + public Date getNextValidTime() + { + if (StringUtils.isNotEmpty(cronExpression)) + { + return CronUtils.getNextExecution(cronExpression); + } + return null; + } + + public String getMisfirePolicy() + { + return misfirePolicy; + } + + public void setMisfirePolicy(String misfirePolicy) + { + this.misfirePolicy = misfirePolicy; + } + + public String getConcurrent() + { + return concurrent; + } + + public void setConcurrent(String concurrent) + { + this.concurrent = concurrent; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("jobId", getJobId()) + .append("jobName", getJobName()) + .append("jobGroup", getJobGroup()) + .append("cronExpression", getCronExpression()) + .append("nextValidTime", getNextValidTime()) + .append("misfirePolicy", getMisfirePolicy()) + .append("concurrent", getConcurrent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/monitor/domain/SysJobLog.java b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysJobLog.java new file mode 100644 index 0000000..c7a3cd2 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysJobLog.java @@ -0,0 +1,155 @@ +package com.ruoyi.project.monitor.domain; + +import java.util.Date; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 定时任务调度日志表 sys_job_log + * + * @author ruoyi + */ +public class SysJobLog extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + @Excel(name = "日志序号") + private Long jobLogId; + + /** 任务名称 */ + @Excel(name = "任务名称") + private String jobName; + + /** 任务组名 */ + @Excel(name = "任务组名") + private String jobGroup; + + /** 调用目标字符串 */ + @Excel(name = "调用目标字符串") + private String invokeTarget; + + /** 日志信息 */ + @Excel(name = "日志信息") + private String jobMessage; + + /** 执行状态(0正常 1失败) */ + @Excel(name = "执行状态", readConverterExp = "0=正常,1=失败") + private String status; + + /** 异常信息 */ + @Excel(name = "异常信息") + private String exceptionInfo; + + /** 开始时间 */ + private Date startTime; + + /** 停止时间 */ + private Date stopTime; + + public Long getJobLogId() + { + return jobLogId; + } + + public void setJobLogId(Long jobLogId) + { + this.jobLogId = jobLogId; + } + + public String getJobName() + { + return jobName; + } + + public void setJobName(String jobName) + { + this.jobName = jobName; + } + + public String getJobGroup() + { + return jobGroup; + } + + public void setJobGroup(String jobGroup) + { + this.jobGroup = jobGroup; + } + + public String getInvokeTarget() + { + return invokeTarget; + } + + public void setInvokeTarget(String invokeTarget) + { + this.invokeTarget = invokeTarget; + } + + public String getJobMessage() + { + return jobMessage; + } + + public void setJobMessage(String jobMessage) + { + this.jobMessage = jobMessage; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getExceptionInfo() + { + return exceptionInfo; + } + + public void setExceptionInfo(String exceptionInfo) + { + this.exceptionInfo = exceptionInfo; + } + + public Date getStartTime() + { + return startTime; + } + + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStopTime() + { + return stopTime; + } + + public void setStopTime(Date stopTime) + { + this.stopTime = stopTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("jobLogId", getJobLogId()) + .append("jobName", getJobName()) + .append("jobGroup", getJobGroup()) + .append("jobMessage", getJobMessage()) + .append("status", getStatus()) + .append("exceptionInfo", getExceptionInfo()) + .append("startTime", getStartTime()) + .append("stopTime", getStopTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/domain/SysLogininfor.java b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysLogininfor.java new file mode 100644 index 0000000..147a0a5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysLogininfor.java @@ -0,0 +1,144 @@ +package com.ruoyi.project.monitor.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 系统访问记录表 sys_logininfor + * + * @author ruoyi + */ +public class SysLogininfor extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + @Excel(name = "序号", cellType = ColumnType.NUMERIC) + private Long infoId; + + /** 用户账号 */ + @Excel(name = "用户账号") + private String userName; + + /** 登录状态 0成功 1失败 */ + @Excel(name = "登录状态", readConverterExp = "0=成功,1=失败") + private String status; + + /** 登录IP地址 */ + @Excel(name = "登录地址") + private String ipaddr; + + /** 登录地点 */ + @Excel(name = "登录地点") + private String loginLocation; + + /** 浏览器类型 */ + @Excel(name = "浏览器") + private String browser; + + /** 操作系统 */ + @Excel(name = "操作系统") + private String os; + + /** 提示消息 */ + @Excel(name = "提示消息") + private String msg; + + /** 访问时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date loginTime; + + public Long getInfoId() + { + return infoId; + } + + public void setInfoId(Long infoId) + { + this.infoId = infoId; + } + + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getIpaddr() + { + return ipaddr; + } + + public void setIpaddr(String ipaddr) + { + this.ipaddr = ipaddr; + } + + public String getLoginLocation() + { + return loginLocation; + } + + public void setLoginLocation(String loginLocation) + { + this.loginLocation = loginLocation; + } + + public String getBrowser() + { + return browser; + } + + public void setBrowser(String browser) + { + this.browser = browser; + } + + public String getOs() + { + return os; + } + + public void setOs(String os) + { + this.os = os; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } + + public Date getLoginTime() + { + return loginTime; + } + + public void setLoginTime(Date loginTime) + { + this.loginTime = loginTime; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/monitor/domain/SysOperLog.java b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysOperLog.java new file mode 100644 index 0000000..f17723d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysOperLog.java @@ -0,0 +1,255 @@ +package com.ruoyi.project.monitor.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 操作日志记录表 oper_log + * + * @author ruoyi + */ +public class SysOperLog extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 日志主键 */ + @Excel(name = "操作序号", cellType = ColumnType.NUMERIC) + private Long operId; + + /** 操作模块 */ + @Excel(name = "操作模块") + private String title; + + /** 业务类型(0其它 1新增 2修改 3删除) */ + @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") + private Integer businessType; + + /** 业务类型数组 */ + private Integer[] businessTypes; + + /** 请求方法 */ + @Excel(name = "请求方法") + private String method; + + /** 请求方式 */ + @Excel(name = "请求方式") + private String requestMethod; + + /** 操作类别(0其它 1后台用户 2手机端用户) */ + @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") + private Integer operatorType; + + /** 操作人员 */ + @Excel(name = "操作人员") + private String operName; + + /** 部门名称 */ + @Excel(name = "部门名称") + private String deptName; + + /** 请求url */ + @Excel(name = "请求地址") + private String operUrl; + + /** 操作地址 */ + @Excel(name = "操作地址") + private String operIp; + + /** 操作地点 */ + @Excel(name = "操作地点") + private String operLocation; + + /** 请求参数 */ + @Excel(name = "请求参数") + private String operParam; + + /** 返回参数 */ + @Excel(name = "返回参数") + private String jsonResult; + + /** 操作状态(0正常 1异常) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=异常") + private Integer status; + + /** 错误消息 */ + @Excel(name = "错误消息") + private String errorMsg; + + /** 操作时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date operTime; + + public Long getOperId() + { + return operId; + } + + public void setOperId(Long operId) + { + this.operId = operId; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public Integer getBusinessType() + { + return businessType; + } + + public void setBusinessType(Integer businessType) + { + this.businessType = businessType; + } + + public Integer[] getBusinessTypes() + { + return businessTypes; + } + + public void setBusinessTypes(Integer[] businessTypes) + { + this.businessTypes = businessTypes; + } + + public String getMethod() + { + return method; + } + + public void setMethod(String method) + { + this.method = method; + } + + public String getRequestMethod() + { + return requestMethod; + } + + public void setRequestMethod(String requestMethod) + { + this.requestMethod = requestMethod; + } + + public Integer getOperatorType() + { + return operatorType; + } + + public void setOperatorType(Integer operatorType) + { + this.operatorType = operatorType; + } + + public String getOperName() + { + return operName; + } + + public void setOperName(String operName) + { + this.operName = operName; + } + + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getOperUrl() + { + return operUrl; + } + + public void setOperUrl(String operUrl) + { + this.operUrl = operUrl; + } + + public String getOperIp() + { + return operIp; + } + + public void setOperIp(String operIp) + { + this.operIp = operIp; + } + + public String getOperLocation() + { + return operLocation; + } + + public void setOperLocation(String operLocation) + { + this.operLocation = operLocation; + } + + public String getOperParam() + { + return operParam; + } + + public void setOperParam(String operParam) + { + this.operParam = operParam; + } + + public String getJsonResult() + { + return jsonResult; + } + + public void setJsonResult(String jsonResult) + { + this.jsonResult = jsonResult; + } + + public Integer getStatus() + { + return status; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public String getErrorMsg() + { + return errorMsg; + } + + public void setErrorMsg(String errorMsg) + { + this.errorMsg = errorMsg; + } + + public Date getOperTime() + { + return operTime; + } + + public void setOperTime(Date operTime) + { + this.operTime = operTime; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/domain/SysUserOnline.java b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysUserOnline.java new file mode 100644 index 0000000..387d49c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/domain/SysUserOnline.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.monitor.domain; + +/** + * 当前在线会话 + * + * @author ruoyi + */ +public class SysUserOnline +{ + /** 会话编号 */ + private String tokenId; + + /** 部门名称 */ + private String deptName; + + /** 用户名称 */ + private String userName; + + /** 登录IP地址 */ + private String ipaddr; + + /** 登录地址 */ + private String loginLocation; + + /** 浏览器类型 */ + private String browser; + + /** 操作系统 */ + private String os; + + /** 登录时间 */ + private Long loginTime; + + public String getTokenId() + { + return tokenId; + } + + public void setTokenId(String tokenId) + { + this.tokenId = tokenId; + } + + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getIpaddr() + { + return ipaddr; + } + + public void setIpaddr(String ipaddr) + { + this.ipaddr = ipaddr; + } + + public String getLoginLocation() + { + return loginLocation; + } + + public void setLoginLocation(String loginLocation) + { + this.loginLocation = loginLocation; + } + + public String getBrowser() + { + return browser; + } + + public void setBrowser(String browser) + { + this.browser = browser; + } + + public String getOs() + { + return os; + } + + public void setOs(String os) + { + this.os = os; + } + + public Long getLoginTime() + { + return loginTime; + } + + public void setLoginTime(Long loginTime) + { + this.loginTime = loginTime; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysJobLogMapper.java b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysJobLogMapper.java new file mode 100644 index 0000000..39137dd --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysJobLogMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.project.monitor.mapper; + +import java.util.List; +import com.ruoyi.project.monitor.domain.SysJobLog; + +/** + * 调度任务日志信息 数据层 + * + * @author ruoyi + */ +public interface SysJobLogMapper +{ + /** + * 获取quartz调度器日志的计划任务 + * + * @param jobLog 调度日志信息 + * @return 调度任务日志集合 + */ + public List selectJobLogList(SysJobLog jobLog); + + /** + * 查询所有调度任务日志 + * + * @return 调度任务日志列表 + */ + public List selectJobLogAll(); + + /** + * 通过调度任务日志ID查询调度信息 + * + * @param jobLogId 调度任务日志ID + * @return 调度任务日志对象信息 + */ + public SysJobLog selectJobLogById(Long jobLogId); + + /** + * 新增任务日志 + * + * @param jobLog 调度日志信息 + * @return 结果 + */ + public int insertJobLog(SysJobLog jobLog); + + /** + * 批量删除调度日志信息 + * + * @param logIds 需要删除的数据ID + * @return 结果 + */ + public int deleteJobLogByIds(Long[] logIds); + + /** + * 删除任务日志 + * + * @param jobId 调度日志ID + * @return 结果 + */ + public int deleteJobLogById(Long jobId); + + /** + * 清空任务日志 + */ + public void cleanJobLog(); +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysJobMapper.java b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysJobMapper.java new file mode 100644 index 0000000..ab11461 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysJobMapper.java @@ -0,0 +1,67 @@ +package com.ruoyi.project.monitor.mapper; + +import java.util.List; +import com.ruoyi.project.monitor.domain.SysJob; + +/** + * 调度任务信息 数据层 + * + * @author ruoyi + */ +public interface SysJobMapper +{ + /** + * 查询调度任务日志集合 + * + * @param job 调度信息 + * @return 操作日志集合 + */ + public List selectJobList(SysJob job); + + /** + * 查询所有调度任务 + * + * @return 调度任务列表 + */ + public List selectJobAll(); + + /** + * 通过调度ID查询调度任务信息 + * + * @param jobId 调度ID + * @return 角色对象信息 + */ + public SysJob selectJobById(Long jobId); + + /** + * 通过调度ID删除调度任务信息 + * + * @param jobId 调度ID + * @return 结果 + */ + public int deleteJobById(Long jobId); + + /** + * 批量删除调度任务信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteJobByIds(Long[] ids); + + /** + * 修改调度任务信息 + * + * @param job 调度任务信息 + * @return 结果 + */ + public int updateJob(SysJob job); + + /** + * 新增调度任务信息 + * + * @param job 调度任务信息 + * @return 结果 + */ + public int insertJob(SysJob job); +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysLogininforMapper.java b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysLogininforMapper.java new file mode 100644 index 0000000..05b8c9b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysLogininforMapper.java @@ -0,0 +1,42 @@ +package com.ruoyi.project.monitor.mapper; + +import java.util.List; +import com.ruoyi.project.monitor.domain.SysLogininfor; + +/** + * 系统访问日志情况信息 数据层 + * + * @author ruoyi + */ +public interface SysLogininforMapper +{ + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + public void insertLogininfor(SysLogininfor logininfor); + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + public List selectLogininforList(SysLogininfor logininfor); + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + public int deleteLogininforByIds(Long[] infoIds); + + /** + * 清空系统登录日志 + * + * @return 结果 + */ + public int cleanLogininfor(); +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysOperLogMapper.java b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysOperLogMapper.java new file mode 100644 index 0000000..ed5d573 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/mapper/SysOperLogMapper.java @@ -0,0 +1,48 @@ +package com.ruoyi.project.monitor.mapper; + +import java.util.List; +import com.ruoyi.project.monitor.domain.SysOperLog; + +/** + * 操作日志 数据层 + * + * @author ruoyi + */ +public interface SysOperLogMapper +{ + /** + * 新增操作日志 + * + * @param operLog 操作日志对象 + */ + public void insertOperlog(SysOperLog operLog); + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + public List selectOperLogList(SysOperLog operLog); + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + public int deleteOperLogByIds(Long[] operIds); + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + public SysOperLog selectOperLogById(Long operId); + + /** + * 清空操作日志 + */ + public void cleanOperLog(); +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/ISysJobLogService.java b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysJobLogService.java new file mode 100644 index 0000000..85561e7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysJobLogService.java @@ -0,0 +1,56 @@ +package com.ruoyi.project.monitor.service; + +import java.util.List; +import com.ruoyi.project.monitor.domain.SysJobLog; + +/** + * 定时任务调度日志信息信息 服务层 + * + * @author ruoyi + */ +public interface ISysJobLogService +{ + /** + * 获取quartz调度器日志的计划任务 + * + * @param jobLog 调度日志信息 + * @return 调度任务日志集合 + */ + public List selectJobLogList(SysJobLog jobLog); + + /** + * 通过调度任务日志ID查询调度信息 + * + * @param jobLogId 调度任务日志ID + * @return 调度任务日志对象信息 + */ + public SysJobLog selectJobLogById(Long jobLogId); + + /** + * 新增任务日志 + * + * @param jobLog 调度日志信息 + */ + public void addJobLog(SysJobLog jobLog); + + /** + * 批量删除调度日志信息 + * + * @param logIds 需要删除的日志ID + * @return 结果 + */ + public int deleteJobLogByIds(Long[] logIds); + + /** + * 删除任务日志 + * + * @param jobId 调度日志ID + * @return 结果 + */ + public int deleteJobLogById(Long jobId); + + /** + * 清空任务日志 + */ + public void cleanJobLog(); +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/ISysJobService.java b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysJobService.java new file mode 100644 index 0000000..f7da1ac --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysJobService.java @@ -0,0 +1,102 @@ +package com.ruoyi.project.monitor.service; + +import java.util.List; +import org.quartz.SchedulerException; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.project.monitor.domain.SysJob; + +/** + * 定时任务调度信息信息 服务层 + * + * @author ruoyi + */ +public interface ISysJobService +{ + /** + * 获取quartz调度器的计划任务 + * + * @param job 调度信息 + * @return 调度任务集合 + */ + public List selectJobList(SysJob job); + + /** + * 通过调度任务ID查询调度信息 + * + * @param jobId 调度任务ID + * @return 调度任务对象信息 + */ + public SysJob selectJobById(Long jobId); + + /** + * 暂停任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int pauseJob(SysJob job) throws SchedulerException; + + /** + * 恢复任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int resumeJob(SysJob job) throws SchedulerException; + + /** + * 删除任务后,所对应的trigger也将被删除 + * + * @param job 调度信息 + * @return 结果 + */ + public int deleteJob(SysJob job) throws SchedulerException; + + /** + * 批量删除调度信息 + * + * @param jobIds 需要删除的任务ID + * @return 结果 + */ + public void deleteJobByIds(Long[] jobIds) throws SchedulerException; + + /** + * 任务调度状态修改 + * + * @param job 调度信息 + * @return 结果 + */ + public int changeStatus(SysJob job) throws SchedulerException; + + /** + * 立即运行任务 + * + * @param job 调度信息 + * @return 结果 + */ + public void run(SysJob job) throws SchedulerException; + + /** + * 新增任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int insertJob(SysJob job) throws SchedulerException, TaskException; + + /** + * 更新任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int updateJob(SysJob job) throws SchedulerException, TaskException; + + /** + * 校验cron表达式是否有效 + * + * @param cronExpression 表达式 + * @return 结果 + */ + public boolean checkCronExpressionIsValid(String cronExpression); +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/ISysLogininforService.java b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysLogininforService.java new file mode 100644 index 0000000..d3eede4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysLogininforService.java @@ -0,0 +1,40 @@ +package com.ruoyi.project.monitor.service; + +import java.util.List; +import com.ruoyi.project.monitor.domain.SysLogininfor; + +/** + * 系统访问日志情况信息 服务层 + * + * @author ruoyi + */ +public interface ISysLogininforService +{ + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + public void insertLogininfor(SysLogininfor logininfor); + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + public List selectLogininforList(SysLogininfor logininfor); + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return + */ + public int deleteLogininforByIds(Long[] infoIds); + + /** + * 清空系统登录日志 + */ + public void cleanLogininfor(); +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/ISysOperLogService.java b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysOperLogService.java new file mode 100644 index 0000000..0e63d8d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/ISysOperLogService.java @@ -0,0 +1,48 @@ +package com.ruoyi.project.monitor.service; + +import java.util.List; +import com.ruoyi.project.monitor.domain.SysOperLog; + +/** + * 操作日志 服务层 + * + * @author ruoyi + */ +public interface ISysOperLogService +{ + /** + * 新增操作日志 + * + * @param operLog 操作日志对象 + */ + public void insertOperlog(SysOperLog operLog); + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + public List selectOperLogList(SysOperLog operLog); + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + public int deleteOperLogByIds(Long[] operIds); + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + public SysOperLog selectOperLogById(Long operId); + + /** + * 清空操作日志 + */ + public void cleanOperLog(); +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysJobLogServiceImpl.java b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysJobLogServiceImpl.java new file mode 100644 index 0000000..991cf81 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysJobLogServiceImpl.java @@ -0,0 +1,87 @@ +package com.ruoyi.project.monitor.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.monitor.domain.SysJobLog; +import com.ruoyi.project.monitor.mapper.SysJobLogMapper; +import com.ruoyi.project.monitor.service.ISysJobLogService; + +/** + * 定时任务调度日志信息 服务层 + * + * @author ruoyi + */ +@Service +public class SysJobLogServiceImpl implements ISysJobLogService +{ + @Autowired + private SysJobLogMapper jobLogMapper; + + /** + * 获取quartz调度器日志的计划任务 + * + * @param jobLog 调度日志信息 + * @return 调度任务日志集合 + */ + @Override + public List selectJobLogList(SysJobLog jobLog) + { + return jobLogMapper.selectJobLogList(jobLog); + } + + /** + * 通过调度任务日志ID查询调度信息 + * + * @param jobLogId 调度任务日志ID + * @return 调度任务日志对象信息 + */ + @Override + public SysJobLog selectJobLogById(Long jobLogId) + { + return jobLogMapper.selectJobLogById(jobLogId); + } + + /** + * 新增任务日志 + * + * @param jobLog 调度日志信息 + */ + @Override + public void addJobLog(SysJobLog jobLog) + { + jobLogMapper.insertJobLog(jobLog); + } + + /** + * 批量删除调度日志信息 + * + * @param logIds 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteJobLogByIds(Long[] logIds) + { + return jobLogMapper.deleteJobLogByIds(logIds); + } + + /** + * 删除任务日志 + * + * @param jobId 调度日志ID + */ + @Override + public int deleteJobLogById(Long jobId) + { + return jobLogMapper.deleteJobLogById(jobId); + } + + /** + * 清空任务日志 + */ + @Override + public void cleanJobLog() + { + jobLogMapper.cleanJobLog(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysJobServiceImpl.java b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysJobServiceImpl.java new file mode 100644 index 0000000..c53cd3c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysJobServiceImpl.java @@ -0,0 +1,254 @@ +package com.ruoyi.project.monitor.service.impl; + +import java.util.List; +import javax.annotation.PostConstruct; +import org.quartz.JobDataMap; +import org.quartz.JobKey; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.common.utils.job.CronUtils; +import com.ruoyi.common.utils.job.ScheduleUtils; +import com.ruoyi.project.monitor.domain.SysJob; +import com.ruoyi.project.monitor.mapper.SysJobMapper; +import com.ruoyi.project.monitor.service.ISysJobService; + +/** + * 定时任务调度信息 服务层 + * + * @author ruoyi + */ +@Service +public class SysJobServiceImpl implements ISysJobService +{ + @Autowired + private Scheduler scheduler; + + @Autowired + private SysJobMapper jobMapper; + + /** + * 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据) + */ + @PostConstruct + public void init() throws SchedulerException, TaskException + { + scheduler.clear(); + List jobList = jobMapper.selectJobAll(); + for (SysJob job : jobList) + { + ScheduleUtils.createScheduleJob(scheduler, job); + } + } + + /** + * 获取quartz调度器的计划任务列表 + * + * @param job 调度信息 + * @return + */ + @Override + public List selectJobList(SysJob job) + { + return jobMapper.selectJobList(job); + } + + /** + * 通过调度任务ID查询调度信息 + * + * @param jobId 调度任务ID + * @return 调度任务对象信息 + */ + @Override + public SysJob selectJobById(Long jobId) + { + return jobMapper.selectJobById(jobId); + } + + /** + * 暂停任务 + * + * @param job 调度信息 + */ + @Override + @Transactional + public int pauseJob(SysJob job) throws SchedulerException + { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); + int rows = jobMapper.updateJob(job); + if (rows > 0) + { + scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 恢复任务 + * + * @param job 调度信息 + */ + @Override + @Transactional + public int resumeJob(SysJob job) throws SchedulerException + { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + job.setStatus(ScheduleConstants.Status.NORMAL.getValue()); + int rows = jobMapper.updateJob(job); + if (rows > 0) + { + scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 删除任务后,所对应的trigger也将被删除 + * + * @param job 调度信息 + */ + @Override + @Transactional + public int deleteJob(SysJob job) throws SchedulerException + { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + int rows = jobMapper.deleteJobById(jobId); + if (rows > 0) + { + scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 批量删除调度信息 + * + * @param jobIds 需要删除的任务ID + * @return 结果 + */ + @Override + @Transactional + public void deleteJobByIds(Long[] jobIds) throws SchedulerException + { + for (Long jobId : jobIds) + { + SysJob job = jobMapper.selectJobById(jobId); + deleteJob(job); + } + } + + /** + * 任务调度状态修改 + * + * @param job 调度信息 + */ + @Override + @Transactional + public int changeStatus(SysJob job) throws SchedulerException + { + int rows = 0; + String status = job.getStatus(); + if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) + { + rows = resumeJob(job); + } + else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) + { + rows = pauseJob(job); + } + return rows; + } + + /** + * 立即运行任务 + * + * @param job 调度信息 + */ + @Override + @Transactional + public void run(SysJob job) throws SchedulerException + { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + SysJob properties = selectJobById(job.getJobId()); + // 参数 + JobDataMap dataMap = new JobDataMap(); + dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties); + scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, jobGroup), dataMap); + } + + /** + * 新增任务 + * + * @param job 调度信息 调度信息 + */ + @Override + @Transactional + public int insertJob(SysJob job) throws SchedulerException, TaskException + { + job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); + int rows = jobMapper.insertJob(job); + if (rows > 0) + { + ScheduleUtils.createScheduleJob(scheduler, job); + } + return rows; + } + + /** + * 更新任务的时间表达式 + * + * @param job 调度信息 + */ + @Override + @Transactional + public int updateJob(SysJob job) throws SchedulerException, TaskException + { + SysJob properties = selectJobById(job.getJobId()); + int rows = jobMapper.updateJob(job); + if (rows > 0) + { + updateSchedulerJob(job, properties.getJobGroup()); + } + return rows; + } + + /** + * 更新任务 + * + * @param job 任务对象 + * @param jobGroup 任务组名 + */ + public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException + { + Long jobId = job.getJobId(); + // 判断是否存在 + JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup); + if (scheduler.checkExists(jobKey)) + { + // 防止创建时存在数据问题 先移除,然后在执行创建操作 + scheduler.deleteJob(jobKey); + } + ScheduleUtils.createScheduleJob(scheduler, job); + } + + /** + * 校验cron表达式是否有效 + * + * @param cronExpression 表达式 + * @return 结果 + */ + @Override + public boolean checkCronExpressionIsValid(String cronExpression) + { + return CronUtils.isValid(cronExpression); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysLogininforServiceImpl.java b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysLogininforServiceImpl.java new file mode 100644 index 0000000..d10bac6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysLogininforServiceImpl.java @@ -0,0 +1,65 @@ +package com.ruoyi.project.monitor.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.monitor.domain.SysLogininfor; +import com.ruoyi.project.monitor.mapper.SysLogininforMapper; +import com.ruoyi.project.monitor.service.ISysLogininforService; + +/** + * 系统访问日志情况信息 服务层处理 + * + * @author ruoyi + */ +@Service +public class SysLogininforServiceImpl implements ISysLogininforService +{ + + @Autowired + private SysLogininforMapper logininforMapper; + + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + @Override + public void insertLogininfor(SysLogininfor logininfor) + { + logininforMapper.insertLogininfor(logininfor); + } + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + @Override + public List selectLogininforList(SysLogininfor logininfor) + { + return logininforMapper.selectLogininforList(logininfor); + } + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return + */ + @Override + public int deleteLogininforByIds(Long[] infoIds) + { + return logininforMapper.deleteLogininforByIds(infoIds); + } + + /** + * 清空系统登录日志 + */ + @Override + public void cleanLogininfor() + { + logininforMapper.cleanLogininfor(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysOperLogServiceImpl.java b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysOperLogServiceImpl.java new file mode 100644 index 0000000..2f11469 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/monitor/service/impl/SysOperLogServiceImpl.java @@ -0,0 +1,75 @@ +package com.ruoyi.project.monitor.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.monitor.domain.SysOperLog; +import com.ruoyi.project.monitor.mapper.SysOperLogMapper; +import com.ruoyi.project.monitor.service.ISysOperLogService; + +/** + * 操作日志 服务层处理 + * + * @author ruoyi + */ +@Service +public class SysOperLogServiceImpl implements ISysOperLogService +{ + @Autowired + private SysOperLogMapper operLogMapper; + + /** + * 新增操作日志 + * + * @param operLog 操作日志对象 + */ + @Override + public void insertOperlog(SysOperLog operLog) + { + operLogMapper.insertOperlog(operLog); + } + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + @Override + public List selectOperLogList(SysOperLog operLog) + { + return operLogMapper.selectOperLogList(operLog); + } + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + public int deleteOperLogByIds(Long[] operIds) + { + return operLogMapper.deleteOperLogByIds(operIds); + } + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + @Override + public SysOperLog selectOperLogById(Long operId) + { + return operLogMapper.selectOperLogById(operId); + } + + /** + * 清空操作日志 + */ + @Override + public void cleanOperLog() + { + operLogMapper.cleanOperLog(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/controller/ProdHandlingMethodController.java b/evo/src/main/java/com/ruoyi/project/product/controller/ProdHandlingMethodController.java new file mode 100644 index 0000000..ec0c3c3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/controller/ProdHandlingMethodController.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.product.controller; + +import java.util.List; +import com.ruoyi.project.product.domain.ProdHandlingMethod; +import com.ruoyi.project.product.service.IProdHandlingMethodService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.page.TableDataInfo; +import javax.annotation.Resource; + +/** + * 处理方式Controller + * + * @author chenyongjiang + * @date 2024-11-13 + */ +@RestController +@RequestMapping("/product/method") +public class ProdHandlingMethodController extends BaseController +{ + @Resource + private IProdHandlingMethodService prodHandlingMethodService; + + /** + * 查询处理方式列表 + */ + @PreAuthorize("@ss.hasPermi('product:method:list')") + @GetMapping("/list") + public TableDataInfo list(ProdHandlingMethod prodHandlingMethod) + { + startPage(); + List list = prodHandlingMethodService.selectProdHandlingMethodList(prodHandlingMethod); + return getDataTable(list); + } + + /** + * 导出处理方式列表 + */ + @PreAuthorize("@ss.hasPermi('product:method:export')") + @Log(title = "处理方式", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ProdHandlingMethod prodHandlingMethod) + { + List list = prodHandlingMethodService.selectProdHandlingMethodList(prodHandlingMethod); + ExcelUtil util = new ExcelUtil(ProdHandlingMethod.class); + return util.exportExcel(list, "method"); + } + + /** + * 获取处理方式详细信息 + */ + @PreAuthorize("@ss.hasPermi('product:method:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(prodHandlingMethodService.selectProdHandlingMethodById(id)); + } + + /** + * 新增处理方式 + */ + @PreAuthorize("@ss.hasPermi('management:method:add')") + @Log(title = "处理方式", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProdHandlingMethod prodHandlingMethod) + { + return toAjax(prodHandlingMethodService.insertProdHandlingMethod(prodHandlingMethod)); + } + + /** + * 修改处理方式 + */ + @PreAuthorize("@ss.hasPermi('product:method:edit')") + @Log(title = "处理方式", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdHandlingMethod prodHandlingMethod) + { + return toAjax(prodHandlingMethodService.updateProdHandlingMethod(prodHandlingMethod)); + } + + /** + * 删除处理方式 + */ + @PreAuthorize("@ss.hasPermi('product:method:remove')") + @Log(title = "处理方式", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(prodHandlingMethodService.deleteProdHandlingMethodById(id)); + } + + /** + * 查询所有 + * @return + */ + @GetMapping("/queryMethodList") + public List queryMethodList() + { + List list = prodHandlingMethodService.selectProdHandlingMethodList(null); + return list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialCategoryController.java b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialCategoryController.java new file mode 100644 index 0000000..42eef78 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialCategoryController.java @@ -0,0 +1,123 @@ +package com.ruoyi.project.product.controller; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.product.domain.ProdMaterialCategory; +import com.ruoyi.project.product.service.IProdMaterialCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.util.List; + +/** + * 物料类别Controller + * + * @author evo + * @date 2024-11-09 + */ +@RestController +@RequestMapping("/product/category") +public class ProdMaterialCategoryController extends BaseController +{ + @Autowired + private IProdMaterialCategoryService prodMaterialCategoryService; + + /** + * 查询物料类别列表 + */ + @PreAuthorize("@ss.hasPermi('product:category:list')") + @GetMapping("/list") + public TableDataInfo list(ProdMaterialCategory prodMaterialCategory) + { + startPage(); + List list = prodMaterialCategoryService.selectProdMaterialCategoryList(prodMaterialCategory); + return getDataTable(list); + } + + /** + * 导出物料类别列表 + */ + @PreAuthorize("@ss.hasPermi('product:category:export')") + @Log(title = "物料类别", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ProdMaterialCategory prodMaterialCategory) + { + List list = prodMaterialCategoryService.selectProdMaterialCategoryList(prodMaterialCategory); + ExcelUtil util = new ExcelUtil(ProdMaterialCategory.class); + return util.exportExcel(list, "物料类别"); + } + + /** + * 获取物料类别详细信息 + */ + @PreAuthorize("@ss.hasPermi('product:category:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(prodMaterialCategoryService.selectProdMaterialCategoryById(id)); + } + + /** + * 新增物料类别 + */ + @PreAuthorize("@ss.hasPermi('product:category:add')") + @Log(title = "物料类别", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProdMaterialCategory prodMaterialCategory) + { + return prodMaterialCategoryService.insertProdMaterialCategory(prodMaterialCategory); + } + + /** + * 修改物料类别 + */ + @PreAuthorize("@ss.hasPermi('product:category:edit')") + @Log(title = "物料类别", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdMaterialCategory prodMaterialCategory) + { + return toAjax(prodMaterialCategoryService.updateProdMaterialCategory(prodMaterialCategory)); + } + + /** + * 删除物料类别 + */ + @PreAuthorize("@ss.hasPermi('product:category:remove')") + @Log(title = "物料类别", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(prodMaterialCategoryService.deleteProdMaterialCategoryById(id)); + } + + /** + * 查询所有的类别 + * @return + */ + @GetMapping("/listAll") + public List listAll() + { + List list = prodMaterialCategoryService.selectProdMaterialCategoryList(null); + return list; + } + + /** + * 数据导入 + * @param file + * @return + * @throws Exception + */ + @PreAuthorize("@ss.hasPermi('product:category:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file) throws Exception + { + ExcelUtil util = new ExcelUtil(ProdMaterialCategory.class); + List catList = util.importExcel(file.getInputStream()); + return prodMaterialCategoryService.importData(catList); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialController.java b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialController.java new file mode 100644 index 0000000..addfdfb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialController.java @@ -0,0 +1,105 @@ +package com.ruoyi.project.product.controller; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.product.domain.ProdMaterial; +import com.ruoyi.project.product.domain.vo.MaterialVo; +import com.ruoyi.project.product.service.IProdMaterialService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +/** + * 物料Controller + * + * @author evo + * @date 2024-11-09 + */ +@RestController +@RequestMapping("/product/material") +public class ProdMaterialController extends BaseController +{ + @Autowired + private IProdMaterialService prodMaterialService; + + /** + * 查询物料列表 + */ + @PreAuthorize("@ss.hasPermi('product:material:list')") + @GetMapping("/list") + public TableDataInfo list(ProdMaterial prodMaterial) + { + startPage(); + List list = prodMaterialService.selectProdMaterialList(prodMaterial); + return getDataTable(list); + } + + /** + * 导出物料列表 + */ + @PreAuthorize("@ss.hasPermi('product:material:export')") + @Log(title = "物料", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ProdMaterial prodMaterial) + { + List list = prodMaterialService.selectProdMaterialList(prodMaterial); + ExcelUtil util = new ExcelUtil(ProdMaterial.class); + return util.exportExcel(list, "material"); + } + + /** + * 获取物料详细信息 + */ + @PreAuthorize("@ss.hasPermi('product:material:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(prodMaterialService.selectProdMaterialById(id)); + } + + /** + * 新增物料 + */ + @PreAuthorize("@ss.hasPermi('product:material:add')") + @Log(title = "物料", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MaterialVo materialVo) + { + return prodMaterialService.insertProdMaterial(materialVo); + } + + /** + * 修改物料 + */ + @PreAuthorize("@ss.hasPermi('product:material:edit')") + @Log(title = "物料", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdMaterial prodMaterial) + { + return toAjax(prodMaterialService.updateProdMaterial(prodMaterial)); + } + + /** + * 删除物料 + */ + @PreAuthorize("@ss.hasPermi('product:material:remove')") + @Log(title = "物料", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(prodMaterialService.deleteProdMaterialById(id)); + } + + @PostMapping("/exportBom") + public void exportBom(ProdMaterial prodMaterial) + { + List list = prodMaterialService.selectProdMaterialList(prodMaterial); + ExcelUtil util = new ExcelUtil(ProdMaterial.class); + util.exportExcel(list, "物料数据"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialMaterialsController.java b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialMaterialsController.java new file mode 100644 index 0000000..622b4d1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialMaterialsController.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.product.controller; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.product.domain.ProdMaterialMaterials; +import com.ruoyi.project.product.service.IProdMaterialMaterialsService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; +import java.util.List; + +/** + * 物料材质Controller + * + * @author evo + * @date 2024-11-09 + */ +@RestController +@RequestMapping("/product/materials") +public class ProdMaterialMaterialsController extends BaseController +{ + @Resource + private IProdMaterialMaterialsService prodMaterialMaterialsService; + + /** + * 查询物料材质列表 + */ + @PreAuthorize("@ss.hasPermi('product:materials:list')") + @GetMapping("/list") + public TableDataInfo list(ProdMaterialMaterials prodMaterialMaterials) + { + startPage(); + List list = prodMaterialMaterialsService.selectProdMaterialMaterialsList(prodMaterialMaterials); + return getDataTable(list); + } + + /** + * 导出物料材质列表 + */ + @PreAuthorize("@ss.hasPermi('product:materials:export')") + @Log(title = "物料材质", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ProdMaterialMaterials prodMaterialMaterials) + { + List list = prodMaterialMaterialsService.selectProdMaterialMaterialsList(prodMaterialMaterials); + ExcelUtil util = new ExcelUtil(ProdMaterialMaterials.class); + return util.exportExcel(list, "物料材质"); + } + + /** + * 获取物料材质详细信息 + */ + @PreAuthorize("@ss.hasPermi('product:materials:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(prodMaterialMaterialsService.selectProdMaterialMaterialsById(id)); + } + + /** + * 新增物料材质 + */ + @PreAuthorize("@ss.hasPermi('product:materials:add')") + @Log(title = "物料材质", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProdMaterialMaterials prodMaterialMaterials) + { + return toAjax(prodMaterialMaterialsService.insertProdMaterialMaterials(prodMaterialMaterials)); + } + + /** + * 修改物料材质 + */ + @PreAuthorize("@ss.hasPermi('product:materials:edit')") + @Log(title = "物料材质", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdMaterialMaterials prodMaterialMaterials) + { + return toAjax(prodMaterialMaterialsService.updateProdMaterialMaterials(prodMaterialMaterials)); + } + + /** + * 删除物料材质 + */ + @PreAuthorize("@ss.hasPermi('product:materials:remove')") + @Log(title = "物料材质", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(prodMaterialMaterialsService.deleteProdMaterialMaterialsById(id)); + } + + /** + * 数据导入 + * @param file + * @return + * @throws Exception + */ + @PreAuthorize("@ss.hasPermi('product:category:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file) throws Exception + { + ExcelUtil util = new ExcelUtil(ProdMaterialMaterials.class); + List mList = util.importExcel(file.getInputStream()); + return prodMaterialMaterialsService.importData(mList); + } + + /** + * 查询物料材质列表 + */ + @GetMapping("/queryMaterials") + public List queryMaterials() + { + List list = prodMaterialMaterialsService.selectProdMaterialMaterialsList(null); + return list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialTypeController.java b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialTypeController.java new file mode 100644 index 0000000..d484d5d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/controller/ProdMaterialTypeController.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.product.controller; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.product.domain.ProdMaterialType; +import com.ruoyi.project.product.service.IProdMaterialTypeService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; +import java.util.List; + +/** + * 物料种类Controller + * + * @author evo + * @date 2024-11-09 + */ +@RestController +@RequestMapping("/product/productType") +public class ProdMaterialTypeController extends BaseController +{ + @Resource + private IProdMaterialTypeService prodMaterialTypeService; + + /** + * 查询物料种类列表 + */ + @PreAuthorize("@ss.hasPermi('product:productType:list')") + @GetMapping("/list") + public TableDataInfo list(ProdMaterialType prodMaterialType) + { + startPage(); + List list = prodMaterialTypeService.selectProdMaterialTypeList(prodMaterialType); + return getDataTable(list); + } + + /** + * 导出物料种类列表 + */ + @PreAuthorize("@ss.hasPermi('product:productType:export')") + @Log(title = "物料种类", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ProdMaterialType prodMaterialType) + { + List list = prodMaterialTypeService.selectProdMaterialTypeList(prodMaterialType); + ExcelUtil util = new ExcelUtil(ProdMaterialType.class); + return util.exportExcel(list, "物料种类"); + } + + /** + * 获取物料种类详细信息 + */ + @PreAuthorize("@ss.hasPermi('product:productType:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(prodMaterialTypeService.selectProdMaterialTypeById(id)); + } + + /** + * 新增物料种类 + */ + @PreAuthorize("@ss.hasPermi('product:productType:add')") + @Log(title = "物料种类", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProdMaterialType prodMaterialType) + { + return toAjax(prodMaterialTypeService.insertProdMaterialType(prodMaterialType)); + } + + /** + * 修改物料种类 + */ + @PreAuthorize("@ss.hasPermi('product:productType:edit')") + @Log(title = "物料种类", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdMaterialType prodMaterialType) + { + return toAjax(prodMaterialTypeService.updateProdMaterialType(prodMaterialType)); + } + + /** + * 删除物料种类 + */ + @PreAuthorize("@ss.hasPermi('product:productType:remove')") + @Log(title = "物料种类", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(prodMaterialTypeService.deleteProdMaterialTypeById(id)); + } + + /** + * 批量上传员工照片 + */ + @RequestMapping("/uploadBatchFile") + @ResponseBody + public AjaxResult uploadBatchFile(@RequestParam("file") MultipartFile filePath,@RequestParam("categoryId") String categoryId){ + + return prodMaterialTypeService.uploadBatchFile(filePath,categoryId); + } + + @GetMapping("/queryTypes") + public List queryTypes(ProdMaterialType prodMaterialType) + { + List list = prodMaterialTypeService.selectProdMaterialTypeList(prodMaterialType); + return list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/controller/ProdNumberController.java b/evo/src/main/java/com/ruoyi/project/product/controller/ProdNumberController.java new file mode 100644 index 0000000..3f17534 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/controller/ProdNumberController.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.product.controller; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.product.domain.ProdNumber; +import com.ruoyi.project.product.service.IProdNumberService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; +import java.util.List; + +/** + * 规格号维护Controller + * + * @author evo + * @date 2024-11-11 + */ +@RestController +@RequestMapping("/product/number") +public class ProdNumberController extends BaseController +{ + @Resource + private IProdNumberService prodNumberService; + + /** + * 查询规格号维护列表 + */ + @PreAuthorize("@ss.hasPermi('product:number:list')") + @GetMapping("/list") + public TableDataInfo list(ProdNumber prodNumber) + { + startPage(); + List list = prodNumberService.selectProdNumberList(prodNumber); + return getDataTable(list); + } + + /** + * 导出规格号维护列表 + */ + @PreAuthorize("@ss.hasPermi('product:number:export')") + @Log(title = "规格号维护", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(ProdNumber prodNumber) + { + List list = prodNumberService.selectProdNumberList(prodNumber); + ExcelUtil util = new ExcelUtil(ProdNumber.class); + return util.exportExcel(list, "规格号"); + } + + /** + * 获取规格号维护详细信息 + */ + @PreAuthorize("@ss.hasPermi('product:number:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(prodNumberService.selectProdNumberById(id)); + } + + /** + * 新增规格号维护 + */ + @PreAuthorize("@ss.hasPermi('product:number:add')") + @Log(title = "规格号维护", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProdNumber prodNumber) + { + return toAjax(prodNumberService.insertProdNumber(prodNumber)); + } + + /** + * 修改规格号维护 + */ + @PreAuthorize("@ss.hasPermi('product:number:edit')") + @Log(title = "规格号维护", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProdNumber prodNumber) + { + return toAjax(prodNumberService.updateProdNumber(prodNumber)); + } + + /** + * 删除规格号维护 + */ + @PreAuthorize("@ss.hasPermi('product:number:remove')") + @Log(title = "规格号维护", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(prodNumberService.deleteProdNumberById(id)); + } + + /** + * 数据导入 + * @param file + * @return + * @throws Exception + */ + @PreAuthorize("@ss.hasPermi('product:number:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file) throws Exception + { + ExcelUtil util = new ExcelUtil(ProdNumber.class); + List catList = util.importExcel(file.getInputStream()); + return prodNumberService.importData(catList); + } + + @GetMapping("/numberList") + public List numberList() + { + List list = prodNumberService.selectProdNumberList(null); + for (ProdNumber prodNumber : list) { + prodNumber.setLen(prodNumber.getLen() + " " + prodNumber.getWidth()); + } + return list; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/domain/ProdHandlingMethod.java b/evo/src/main/java/com/ruoyi/project/product/domain/ProdHandlingMethod.java new file mode 100644 index 0000000..102f366 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/domain/ProdHandlingMethod.java @@ -0,0 +1,83 @@ +package com.ruoyi.project.product.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 处理方式对象 prod_handling_method + * + * @author chenyongjiang + * @date 2024-11-13 + */ +public class ProdHandlingMethod extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 处理编码 */ + @Excel(name = "处理编码") + private String code; + + /** 处理名称 */ + @Excel(name = "处理名称") + private String name; + + /** 删除标记(0:未删除,1:已删除) */ + private String delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("name", getName()) + .append("remark", getRemark()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterial.java b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterial.java new file mode 100644 index 0000000..3854afc --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterial.java @@ -0,0 +1,175 @@ +package com.ruoyi.project.product.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 物料对象 prod_material + * + * @author evo + * @date 2024-11-09 + */ +public class ProdMaterial extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String code; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String name; + + /** 物料种类 */ + @Excel(name = "物料种类") + private String type; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String specifications; + + /** 物料品牌 */ + @Excel(name = "物料品牌") + private String brand; + + /** 材质 */ + @Excel(name = "材质") + private String materials; + /** 物料属性 */ + @Excel(name = "物料属性") + private String attribute; + + @Excel(name = "备注") + private String remark; + + private String flag; //电气标识 + + /** 删除标记(0:未删除,1:已删除) */ + private String delFlag; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + @Override + public String getRemark() { + return remark; + } + + @Override + public void setRemark(String remark) { + this.remark = remark; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setSpecifications(String specifications) + { + this.specifications = specifications; + } + + public String getSpecifications() + { + return specifications; + } + public void setBrand(String brand) + { + this.brand = brand; + } + + public String getBrand() + { + return brand; + } + public void setMaterials(String materials) + { + this.materials = materials; + } + + public String getMaterials() + { + return materials; + } + public void setAttribute(String attribute) + { + this.attribute = attribute; + } + + public String getAttribute() + { + return attribute; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("name", getName()) + .append("type", getType()) + .append("specifications", getSpecifications()) + .append("brand", getBrand()) + .append("materials", getMaterials()) + .append("attribute", getAttribute()) + .append("remark", getRemark()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialCategory.java b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialCategory.java new file mode 100644 index 0000000..ec28c06 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialCategory.java @@ -0,0 +1,83 @@ +package com.ruoyi.project.product.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 物料类别对象 prod_material_category + * + * @author evo + * @date 2024-11-09 + */ +public class ProdMaterialCategory extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 类别编码 */ + @Excel(name = "类别号编码") + private String code; + + /** 类别名称 */ + @Excel(name = "类别号名称") + private String name; + + /** 删除标记(0:未删除,1:已删除) */ + private String delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("name", getName()) + .append("remark", getRemark()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialMaterials.java b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialMaterials.java new file mode 100644 index 0000000..406520e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialMaterials.java @@ -0,0 +1,83 @@ +package com.ruoyi.project.product.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 物料材质对象 prod_material_materials + * + * @author evo + * @date 2024-11-09 + */ +public class ProdMaterialMaterials extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 材质编码 */ + @Excel(name = "材质编码") + private String code; + + /** 材质名称 */ + @Excel(name = "材质名称") + private String name; + + /** 删除标记(0:未删除,1:已删除) */ + private String delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("name", getName()) + .append("remark", getRemark()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialType.java b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialType.java new file mode 100644 index 0000000..31908a5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/domain/ProdMaterialType.java @@ -0,0 +1,102 @@ +package com.ruoyi.project.product.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 物料种类对象 prod_material_type + * + * @author evo + * @date 2024-11-09 + */ +public class ProdMaterialType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + private String categoryId; //类别号 + private String categoryName; //类别号名称 + + /** 种类编码 */ + @Excel(name = "登记号编码") + private String code; + + /** 种类名称 */ + @Excel(name = "登记号名称") + private String name; + + /** 删除标记(0:未删除,1:已删除) */ + private String delFlag; + + public String getCategoryName() { + return categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("name", getName()) + .append("remark", getRemark()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/domain/ProdNumber.java b/evo/src/main/java/com/ruoyi/project/product/domain/ProdNumber.java new file mode 100644 index 0000000..91326aa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/domain/ProdNumber.java @@ -0,0 +1,97 @@ +package com.ruoyi.project.product.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 规格号维护对象 prod_number + * + * @author evo + * @date 2024-11-11 + */ +public class ProdNumber extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 规格号编码 */ + @Excel(name = "规格号编码") + private String code; + + /** 长 */ + @Excel(name = "长") + private String len; + + /** 宽 */ + @Excel(name = "宽") + private String width; + + /** 删除标记(0:未删除,1:已删除) */ + private String delFlag; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setLen(String len) + { + this.len = len; + } + + public String getLen() + { + return len; + } + public void setWidth(String width) + { + this.width = width; + } + + public String getWidth() + { + return width; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("len", getLen()) + .append("width", getWidth()) + .append("remark", getRemark()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/domain/vo/MaterialVo.java b/evo/src/main/java/com/ruoyi/project/product/domain/vo/MaterialVo.java new file mode 100644 index 0000000..00c0f99 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/domain/vo/MaterialVo.java @@ -0,0 +1,171 @@ +package com.ruoyi.project.product.domain.vo; + + +import com.ruoyi.project.product.domain.ProdMaterial; + +public class MaterialVo extends ProdMaterial { + + + private String categoryId; //类别号 + private String registerNumber; //登记号 + private String reFlag; //维修标识 + private String reNum; //维修次数 + private String num; //规格号 + private String len; //长 + private String width; //宽 + private String height; //高 + private String thick; //厚 + private String out; //外径 + private String in; //内径 + private String model; //型号 + private String handle; //表面处理 + private String lianNum; //链号 + private String one; //单排代号 + private String spdh; //双排代号 + private String ljs; //链节数 + private String angle; //角度 + + public String getAngle() { + return angle; + } + + public void setAngle(String angle) { + this.angle = angle; + } + + public String getIn() { + return in; + } + + public void setIn(String in) { + this.in = in; + } + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public String getLianNum() { + return lianNum; + } + + public void setLianNum(String lianNum) { + this.lianNum = lianNum; + } + + public String getOne() { + return one; + } + + public void setOne(String one) { + this.one = one; + } + + public String getSpdh() { + return spdh; + } + + public void setSpdh(String spdh) { + this.spdh = spdh; + } + + public String getLjs() { + return ljs; + } + + public void setLjs(String ljs) { + this.ljs = ljs; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public String getReNum() { + return reNum; + } + + public void setReNum(String reNum) { + this.reNum = reNum; + } + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getRegisterNumber() { + return registerNumber; + } + + public void setRegisterNumber(String registerNumber) { + this.registerNumber = registerNumber; + } + + public String getReFlag() { + return reFlag; + } + + public void setReFlag(String reFlag) { + this.reFlag = reFlag; + } + + public String getLen() { + return len; + } + + public void setLen(String len) { + this.len = len; + } + + public String getWidth() { + return width; + } + + public void setWidth(String width) { + this.width = width; + } + + public String getHeight() { + return height; + } + + public void setHeight(String height) { + this.height = height; + } + + public String getThick() { + return thick; + } + + public void setThick(String thick) { + this.thick = thick; + } + + public String getOut() { + return out; + } + + public void setOut(String out) { + this.out = out; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/mapper/ProdHandlingMethodMapper.java b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdHandlingMethodMapper.java new file mode 100644 index 0000000..ea660e6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdHandlingMethodMapper.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.product.mapper; + +import com.ruoyi.project.product.domain.ProdHandlingMethod; +import java.util.List; + +/** + * 处理方式Mapper接口 + * + * @author chenyongjiang + * @date 2024-11-13 + */ +public interface ProdHandlingMethodMapper +{ + /** + * 查询处理方式 + * + * @param id 处理方式ID + * @return 处理方式 + */ + public ProdHandlingMethod selectProdHandlingMethodById(Long id); + + /** + * 查询处理方式列表 + * + * @param prodHandlingMethod 处理方式 + * @return 处理方式集合 + */ + public List selectProdHandlingMethodList(ProdHandlingMethod prodHandlingMethod); + + /** + * 新增处理方式 + * + * @param prodHandlingMethod 处理方式 + * @return 结果 + */ + public int insertProdHandlingMethod(ProdHandlingMethod prodHandlingMethod); + + /** + * 修改处理方式 + * + * @param prodHandlingMethod 处理方式 + * @return 结果 + */ + public int updateProdHandlingMethod(ProdHandlingMethod prodHandlingMethod); + +} diff --git a/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialCategoryMapper.java b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialCategoryMapper.java new file mode 100644 index 0000000..3382103 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialCategoryMapper.java @@ -0,0 +1,60 @@ +package com.ruoyi.project.product.mapper; + +import com.ruoyi.project.product.domain.ProdMaterialCategory; +import java.util.List; + +/** + * 物料类别Mapper接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface ProdMaterialCategoryMapper +{ + /** + * 查询物料类别 + * + * @param id 物料类别主键 + * @return 物料类别 + */ + public ProdMaterialCategory selectProdMaterialCategoryById(Long id); + + /** + * 查询物料类别列表 + * + * @param prodMaterialCategory 物料类别 + * @return 物料类别集合 + */ + public List selectProdMaterialCategoryList(ProdMaterialCategory prodMaterialCategory); + + /** + * 新增物料类别 + * + * @param prodMaterialCategory 物料类别 + * @return 结果 + */ + public int insertProdMaterialCategory(ProdMaterialCategory prodMaterialCategory); + + /** + * 修改物料类别 + * + * @param prodMaterialCategory 物料类别 + * @return 结果 + */ + public int updateProdMaterialCategory(ProdMaterialCategory prodMaterialCategory); + + /** + * 批量插入数据 + * @param list + * @return + */ + public int insertBatchMaterialCategorys(List list); + /** + * 查询物料类别 + * + * @param code 物料类别号 + * @return 物料类别 + */ + public ProdMaterialCategory selectProdMaterialCategoryByCode(String code); + +} diff --git a/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialMapper.java b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialMapper.java new file mode 100644 index 0000000..c5a1f2e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialMapper.java @@ -0,0 +1,83 @@ +package com.ruoyi.project.product.mapper; + +import com.ruoyi.project.product.domain.ProdMaterial; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 物料Mapper接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface ProdMaterialMapper +{ + /** + * 查询物料 + * + * @param id 物料主键 + * @return 物料 + */ + public ProdMaterial selectProdMaterialById(Long id); + + /** + * 查询物料列表 + * + * @param prodMaterial 物料 + * @return 物料集合 + */ + public List selectProdMaterialList(ProdMaterial prodMaterial); + + /** + * 新增物料 + * + * @param prodMaterial 物料 + * @return 结果 + */ + public int insertProdMaterial(ProdMaterial prodMaterial); + + /** + * 修改物料 + * + * @param prodMaterial 物料 + * @return 结果 + */ + public int updateProdMaterial(ProdMaterial prodMaterial); + + /** + * 根据编码模糊查询最大编码 + * @param code + * @return + */ + public ProdMaterial queryCodeByCategoryIdAndType(String code); + + /** + * 刀具的查询最大编码 + * @param code + * @param name + * @param specifications + * @return + */ + public ProdMaterial queryCodeByNameAndSpecifications(@Param("code") String code,@Param("name") String name,@Param("specifications") String specifications); + /** + * 电气物料查询 + * @param brand + * @param name + * @param specifications + * @return + */ + public ProdMaterial queryMaterialByNameAndBrand(@Param("name") String name,@Param("brand") String brand,@Param("specifications") String specifications); + + /** + * 电气物料最大编码查询 + * @return + */ + public ProdMaterial queryMaxMaterial(); + /** + * 批量插入数据 + * @param list + * @return + */ + public int insertBatch(List list); + +} diff --git a/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialMaterialsMapper.java b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialMaterialsMapper.java new file mode 100644 index 0000000..cda12ea --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialMaterialsMapper.java @@ -0,0 +1,60 @@ +package com.ruoyi.project.product.mapper; + +import com.ruoyi.project.product.domain.ProdMaterialMaterials; +import java.util.List; + +/** + * 物料材质Mapper接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface ProdMaterialMaterialsMapper +{ + /** + * 查询物料材质 + * + * @param id 物料材质主键 + * @return 物料材质 + */ + public ProdMaterialMaterials selectProdMaterialMaterialsById(Long id); + + /** + * 查询物料材质列表 + * + * @param prodMaterialMaterials 物料材质 + * @return 物料材质集合 + */ + public List selectProdMaterialMaterialsList(ProdMaterialMaterials prodMaterialMaterials); + + /** + * 新增物料材质 + * + * @param prodMaterialMaterials 物料材质 + * @return 结果 + */ + public int insertProdMaterialMaterials(ProdMaterialMaterials prodMaterialMaterials); + + /** + * 修改物料材质 + * + * @param prodMaterialMaterials 物料材质 + * @return 结果 + */ + public int updateProdMaterialMaterials(ProdMaterialMaterials prodMaterialMaterials); + + /** + * 批量插入数据 + * @param list + * @return + */ + public int insertBatch(List list); + /** + * 查询物料材质 + * + * @param code 物料材质 + * @return 物料材质 + */ + public ProdMaterialMaterials selectProdMaterialMaterialsByCode(String code); + +} diff --git a/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialTypeMapper.java b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialTypeMapper.java new file mode 100644 index 0000000..43b5080 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdMaterialTypeMapper.java @@ -0,0 +1,53 @@ +package com.ruoyi.project.product.mapper; + +import com.ruoyi.project.product.domain.ProdMaterialType; +import java.util.List; + +/** + * 物料种类Mapper接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface ProdMaterialTypeMapper +{ + /** + * 查询物料种类 + * + * @param id 物料种类主键 + * @return 物料种类 + */ + public ProdMaterialType selectProdMaterialTypeById(Long id); + + /** + * 查询物料种类列表 + * + * @param prodMaterialType 物料种类 + * @return 物料种类集合 + */ + public List selectProdMaterialTypeList(ProdMaterialType prodMaterialType); + + /** + * 新增物料种类 + * + * @param prodMaterialType 物料种类 + * @return 结果 + */ + public int insertProdMaterialType(ProdMaterialType prodMaterialType); + + /** + * 修改物料种类 + * + * @param prodMaterialType 物料种类 + * @return 结果 + */ + public int updateProdMaterialType(ProdMaterialType prodMaterialType); + + /** + * 批量插入数据 + * @param list + * @return + */ + public int insertBatch(List list); + +} diff --git a/evo/src/main/java/com/ruoyi/project/product/mapper/ProdNumberMapper.java b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdNumberMapper.java new file mode 100644 index 0000000..991b146 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/mapper/ProdNumberMapper.java @@ -0,0 +1,53 @@ +package com.ruoyi.project.product.mapper; + +import com.ruoyi.project.product.domain.ProdNumber; +import java.util.List; + +/** + * 规格号维护Mapper接口 + * + * @author evo + * @date 2024-11-11 + */ +public interface ProdNumberMapper +{ + /** + * 查询规格号维护 + * + * @param id 规格号维护主键 + * @return 规格号维护 + */ + public ProdNumber selectProdNumberById(Long id); + + /** + * 查询规格号维护列表 + * + * @param prodNumber 规格号维护 + * @return 规格号维护集合 + */ + public List selectProdNumberList(ProdNumber prodNumber); + + /** + * 新增规格号维护 + * + * @param prodNumber 规格号维护 + * @return 结果 + */ + public int insertProdNumber(ProdNumber prodNumber); + + /** + * 修改规格号维护 + * + * @param prodNumber 规格号维护 + * @return 结果 + */ + public int updateProdNumber(ProdNumber prodNumber); + + /** + * 批量插入数据 + * @param list + * @return + */ + public int insertBatch(List list); + +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/IProdHandlingMethodService.java b/evo/src/main/java/com/ruoyi/project/product/service/IProdHandlingMethodService.java new file mode 100644 index 0000000..8532a42 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/IProdHandlingMethodService.java @@ -0,0 +1,54 @@ +package com.ruoyi.project.product.service; + +import com.ruoyi.project.product.domain.ProdHandlingMethod; + +import java.util.List; + +/** + * 处理方式Service接口 + * + * @author chenyongjiang + * @date 2024-11-13 + */ +public interface IProdHandlingMethodService +{ + /** + * 查询处理方式 + * + * @param id 处理方式ID + * @return 处理方式 + */ + public ProdHandlingMethod selectProdHandlingMethodById(Long id); + + /** + * 查询处理方式列表 + * + * @param prodHandlingMethod 处理方式 + * @return 处理方式集合 + */ + public List selectProdHandlingMethodList(ProdHandlingMethod prodHandlingMethod); + + /** + * 新增处理方式 + * + * @param prodHandlingMethod 处理方式 + * @return 结果 + */ + public int insertProdHandlingMethod(ProdHandlingMethod prodHandlingMethod); + + /** + * 修改处理方式 + * + * @param prodHandlingMethod 处理方式 + * @return 结果 + */ + public int updateProdHandlingMethod(ProdHandlingMethod prodHandlingMethod); + + /** + * 删除处理方式信息 + * + * @param id 处理方式ID + * @return 结果 + */ + public int deleteProdHandlingMethodById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialCategoryService.java b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialCategoryService.java new file mode 100644 index 0000000..2ce9236 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialCategoryService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.product.service; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdMaterialCategory; +import java.util.List; + +/** + * 物料类别Service接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface IProdMaterialCategoryService +{ + /** + * 查询物料类别 + * + * @param id 物料类别主键 + * @return 物料类别 + */ + public ProdMaterialCategory selectProdMaterialCategoryById(Long id); + + /** + * 查询物料类别列表 + * + * @param prodMaterialCategory 物料类别 + * @return 物料类别集合 + */ + public List selectProdMaterialCategoryList(ProdMaterialCategory prodMaterialCategory); + + /** + * 新增物料类别 + * + * @param prodMaterialCategory 物料类别 + * @return 结果 + */ + public AjaxResult insertProdMaterialCategory(ProdMaterialCategory prodMaterialCategory); + + /** + * 修改物料类别 + * + * @param prodMaterialCategory 物料类别 + * @return 结果 + */ + public int updateProdMaterialCategory(ProdMaterialCategory prodMaterialCategory); + + /** + * 删除物料类别信息 + * + * @param id 物料类别主键 + * @return 结果 + */ + public int deleteProdMaterialCategoryById(Long id); + + /** + * 导入数据 + * @param cat_list + * @return + */ + public AjaxResult importData(List cat_list); +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialMaterialsService.java b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialMaterialsService.java new file mode 100644 index 0000000..dba8be7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialMaterialsService.java @@ -0,0 +1,62 @@ +package com.ruoyi.project.product.service; + + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdMaterialMaterials; +import java.util.List; + +/** + * 物料材质Service接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface IProdMaterialMaterialsService +{ + /** + * 查询物料材质 + * + * @param id 物料材质主键 + * @return 物料材质 + */ + public ProdMaterialMaterials selectProdMaterialMaterialsById(Long id); + + /** + * 查询物料材质列表 + * + * @param prodMaterialMaterials 物料材质 + * @return 物料材质集合 + */ + public List selectProdMaterialMaterialsList(ProdMaterialMaterials prodMaterialMaterials); + + /** + * 新增物料材质 + * + * @param prodMaterialMaterials 物料材质 + * @return 结果 + */ + public int insertProdMaterialMaterials(ProdMaterialMaterials prodMaterialMaterials); + + /** + * 修改物料材质 + * + * @param prodMaterialMaterials 物料材质 + * @return 结果 + */ + public int updateProdMaterialMaterials(ProdMaterialMaterials prodMaterialMaterials); + + /** + * 删除物料材质信息 + * + * @param id 物料材质主键 + * @return 结果 + */ + public int deleteProdMaterialMaterialsById(Long id); + + /** + * 导入数据 + * @param cat_list + * @return + */ + public AjaxResult importData(List cat_list); +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialService.java b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialService.java new file mode 100644 index 0000000..8b8155f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialService.java @@ -0,0 +1,56 @@ +package com.ruoyi.project.product.service; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdMaterial; +import com.ruoyi.project.product.domain.vo.MaterialVo; + +import java.util.List; + +/** + * 物料Service接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface IProdMaterialService +{ + /** + * 查询物料 + * + * @param id 物料主键 + * @return 物料 + */ + public ProdMaterial selectProdMaterialById(Long id); + + /** + * 查询物料列表 + * + * @param prodMaterial 物料 + * @return 物料集合 + */ + public List selectProdMaterialList(ProdMaterial prodMaterial); + + /** + * 新增物料 + * + * @param materialVo 物料 + * @return 结果 + */ + public AjaxResult insertProdMaterial(MaterialVo materialVo); + + /** + * 修改物料 + * + * @param prodMaterial 物料 + * @return 结果 + */ + public int updateProdMaterial(ProdMaterial prodMaterial); + + /** + * 删除物料信息 + * + * @param id 物料主键 + * @return 结果 + */ + public int deleteProdMaterialById(Long id); +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialTypeService.java b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialTypeService.java new file mode 100644 index 0000000..1c33439 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/IProdMaterialTypeService.java @@ -0,0 +1,62 @@ +package com.ruoyi.project.product.service; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdMaterialType; +import org.springframework.web.multipart.MultipartFile; +import java.util.List; + +/** + * 物料种类Service接口 + * + * @author evo + * @date 2024-11-09 + */ +public interface IProdMaterialTypeService +{ + /** + * 查询物料种类 + * + * @param id 物料种类主键 + * @return 物料种类 + */ + public ProdMaterialType selectProdMaterialTypeById(Long id); + + /** + * 查询物料种类列表 + * + * @param prodMaterialType 物料种类 + * @return 物料种类集合 + */ + public List selectProdMaterialTypeList(ProdMaterialType prodMaterialType); + + /** + * 新增物料种类 + * + * @param prodMaterialType 物料种类 + * @return 结果 + */ + public int insertProdMaterialType(ProdMaterialType prodMaterialType); + + /** + * 修改物料种类 + * + * @param prodMaterialType 物料种类 + * @return 结果 + */ + public int updateProdMaterialType(ProdMaterialType prodMaterialType); + + /** + * 删除物料种类信息 + * + * @param id 物料种类主键 + * @return 结果 + */ + public int deleteProdMaterialTypeById(Long id); + + /** + * 批量上传 + * @param filePath + * @return + */ + public AjaxResult uploadBatchFile(MultipartFile filePath, String categoryId); +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/IProdNumberService.java b/evo/src/main/java/com/ruoyi/project/product/service/IProdNumberService.java new file mode 100644 index 0000000..4da93fb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/IProdNumberService.java @@ -0,0 +1,60 @@ +package com.ruoyi.project.product.service; + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdNumber; +import java.util.List; + +/** + * 规格号维护Service接口 + * + * @author evo + * @date 2024-11-11 + */ +public interface IProdNumberService +{ + /** + * 查询规格号维护 + * + * @param id 规格号维护主键 + * @return 规格号维护 + */ + public ProdNumber selectProdNumberById(Long id); + + /** + * 查询规格号维护列表 + * + * @param prodNumber 规格号维护 + * @return 规格号维护集合 + */ + public List selectProdNumberList(ProdNumber prodNumber); + + /** + * 新增规格号维护 + * + * @param prodNumber 规格号维护 + * @return 结果 + */ + public int insertProdNumber(ProdNumber prodNumber); + + /** + * 修改规格号维护 + * + * @param prodNumber 规格号维护 + * @return 结果 + */ + public int updateProdNumber(ProdNumber prodNumber); + + /** + * 删除规格号维护信息 + * + * @param id 规格号维护主键 + * @return 结果 + */ + public int deleteProdNumberById(Long id); + /** + * 导入数据 + * @param cat_list + * @return + */ + public AjaxResult importData(List cat_list); +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdHandlingMethodServiceImpl.java b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdHandlingMethodServiceImpl.java new file mode 100644 index 0000000..910fcc6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdHandlingMethodServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.project.product.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.project.product.domain.ProdHandlingMethod; +import com.ruoyi.project.product.mapper.ProdHandlingMethodMapper; +import com.ruoyi.project.product.service.IProdHandlingMethodService; +import com.ruoyi.project.management.constant.Constants; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; + +/** + * 处理方式Service业务层处理 + * + * @author chenyongjiang + * @date 2024-11-13 + */ +@Service +public class ProdHandlingMethodServiceImpl implements IProdHandlingMethodService +{ + @Resource + private ProdHandlingMethodMapper prodHandlingMethodMapper; + + /** + * 查询处理方式 + * + * @param id 处理方式主键 + * @return 处理方式 + */ + @Override + public ProdHandlingMethod selectProdHandlingMethodById(Long id) + { + return prodHandlingMethodMapper.selectProdHandlingMethodById(id); + } + + /** + * 查询处理方式列表 + * + * @param prodHandlingMethod 处理方式 + * @return 处理方式 + */ + @Override + public List selectProdHandlingMethodList(ProdHandlingMethod prodHandlingMethod) + { + return prodHandlingMethodMapper.selectProdHandlingMethodList(prodHandlingMethod); + } + + /** + * 新增处理方式 + * + * @param prodHandlingMethod 处理方式 + * @return 结果 + */ + @Override + public int insertProdHandlingMethod(ProdHandlingMethod prodHandlingMethod) + { + prodHandlingMethod.setCreateTime(DateUtils.getNowDate()); + prodHandlingMethod.setCreateBy(SecurityUtils.getUsername()); + prodHandlingMethod.setDelFlag(Constants.DELETE_FLAG_0); + return prodHandlingMethodMapper.insertProdHandlingMethod(prodHandlingMethod); + } + + /** + * 修改处理方式 + * + * @param prodHandlingMethod 处理方式 + * @return 结果 + */ + @Override + public int updateProdHandlingMethod(ProdHandlingMethod prodHandlingMethod) + { + prodHandlingMethod.setUpdateTime(DateUtils.getNowDate()); + prodHandlingMethod.setUpdateBy(SecurityUtils.getUsername()); + return prodHandlingMethodMapper.updateProdHandlingMethod(prodHandlingMethod); + } + + /** + * 删除处理方式信息 + * + * @param id 处理方式主键 + * @return 结果 + */ + @Override + public int deleteProdHandlingMethodById(Long id) + { + ProdHandlingMethod prodHandlingMethod = prodHandlingMethodMapper.selectProdHandlingMethodById(id); + prodHandlingMethod.setUpdateTime(DateUtils.getNowDate()); + prodHandlingMethod.setUpdateBy(SecurityUtils.getUsername()); + prodHandlingMethod.setDelFlag(Constants.DELETE_FLAG_1); + return prodHandlingMethodMapper.updateProdHandlingMethod(prodHandlingMethod); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialCategoryServiceImpl.java b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialCategoryServiceImpl.java new file mode 100644 index 0000000..c1fd253 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialCategoryServiceImpl.java @@ -0,0 +1,126 @@ +package com.ruoyi.project.product.service.impl; + + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdMaterialCategory; +import com.ruoyi.project.product.mapper.ProdMaterialCategoryMapper; +import com.ruoyi.project.product.service.IProdMaterialCategoryService; +import com.ruoyi.project.management.constant.Constants; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + +/** + * 物料类别Service业务层处理 + * + * @author evo + * @date 2024-11-09 + */ +@Service +public class ProdMaterialCategoryServiceImpl implements IProdMaterialCategoryService +{ + @Resource + private ProdMaterialCategoryMapper prodMaterialCategoryMapper; + + /** + * 查询物料类别 + * + * @param id 物料类别主键 + * @return 物料类别 + */ + @Override + public ProdMaterialCategory selectProdMaterialCategoryById(Long id) + { + return prodMaterialCategoryMapper.selectProdMaterialCategoryById(id); + } + + /** + * 查询物料类别列表 + * + * @param prodMaterialCategory 物料类别 + * @return 物料类别 + */ + @Override + public List selectProdMaterialCategoryList(ProdMaterialCategory prodMaterialCategory) + { + return prodMaterialCategoryMapper.selectProdMaterialCategoryList(prodMaterialCategory); + } + + /** + * 新增物料类别 + * + * @param prodMaterialCategory 物料类别 + * @return 结果 + */ + @Override + public AjaxResult insertProdMaterialCategory(ProdMaterialCategory prodMaterialCategory) + { + //查询数据库编号 + ProdMaterialCategory category = prodMaterialCategoryMapper.selectProdMaterialCategoryByCode(prodMaterialCategory.getCode()); + if(category != null){ + return AjaxResult.error("数据重复!"); + } + prodMaterialCategory.setCreateTime(DateUtils.getNowDate()); + prodMaterialCategory.setCreateBy(SecurityUtils.getUsername()); + prodMaterialCategory.setDelFlag(Constants.DELETE_FLAG_0); + int i = prodMaterialCategoryMapper.insertProdMaterialCategory(prodMaterialCategory); + if(i < 1){ + return AjaxResult.error(); + } + return AjaxResult.success(); + } + + /** + * 修改物料类别 + * + * @param prodMaterialCategory 物料类别 + * @return 结果 + */ + @Override + public int updateProdMaterialCategory(ProdMaterialCategory prodMaterialCategory) + { + prodMaterialCategory.setUpdateBy(SecurityUtils.getUsername()); + prodMaterialCategory.setUpdateTime(DateUtils.getNowDate()); + return prodMaterialCategoryMapper.updateProdMaterialCategory(prodMaterialCategory); + } + + /** + * 删除物料类别信息 + * + * @param id 物料类别主键 + * @return 结果 + */ + @Override + public int deleteProdMaterialCategoryById(Long id) + { + ProdMaterialCategory prodMaterialCategory = prodMaterialCategoryMapper.selectProdMaterialCategoryById(id); + prodMaterialCategory.setUpdateTime(DateUtils.getNowDate()); + prodMaterialCategory.setUpdateBy(SecurityUtils.getUsername()); + prodMaterialCategory.setDelFlag(Constants.DELETE_FLAG_1); + return prodMaterialCategoryMapper.updateProdMaterialCategory(prodMaterialCategory); + } + + /** + * 导入数据 + * @param cat_list + * @return + */ + @Override + public AjaxResult importData(List cat_list){ + //判断集合是否为空 + if(cat_list == null || cat_list.size() == 0){ + return AjaxResult.error(Constants.RETURN_MESSEGES_EMPTY); + } + //添加删除标识 + for (ProdMaterialCategory prodMaterialCategory : cat_list) { + prodMaterialCategory.setDelFlag(Constants.DELETE_FLAG_0); + } + int i = prodMaterialCategoryMapper.insertBatchMaterialCategorys(cat_list); + if(i < 1){ + return AjaxResult.error(Constants.RETURN_MESSEGES_ERROR); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialMaterialsServiceImpl.java b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialMaterialsServiceImpl.java new file mode 100644 index 0000000..9a265b4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialMaterialsServiceImpl.java @@ -0,0 +1,117 @@ +package com.ruoyi.project.product.service.impl; + + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdMaterialMaterials; +import com.ruoyi.project.product.mapper.ProdMaterialMaterialsMapper; +import com.ruoyi.project.product.service.IProdMaterialMaterialsService; +import com.ruoyi.project.management.constant.Constants; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + +/** + * 物料材质Service业务层处理 + * + * @author evo + * @date 2024-11-09 + */ +@Service +public class ProdMaterialMaterialsServiceImpl implements IProdMaterialMaterialsService +{ + @Resource + private ProdMaterialMaterialsMapper prodMaterialMaterialsMapper; + + /** + * 查询物料材质 + * + * @param id 物料材质主键 + * @return 物料材质 + */ + @Override + public ProdMaterialMaterials selectProdMaterialMaterialsById(Long id) + { + return prodMaterialMaterialsMapper.selectProdMaterialMaterialsById(id); + } + + /** + * 查询物料材质列表 + * + * @param prodMaterialMaterials 物料材质 + * @return 物料材质 + */ + @Override + public List selectProdMaterialMaterialsList(ProdMaterialMaterials prodMaterialMaterials) + { + return prodMaterialMaterialsMapper.selectProdMaterialMaterialsList(prodMaterialMaterials); + } + + /** + * 新增物料材质 + * + * @param prodMaterialMaterials 物料材质 + * @return 结果 + */ + @Override + public int insertProdMaterialMaterials(ProdMaterialMaterials prodMaterialMaterials) + { + prodMaterialMaterials.setCreateBy(SecurityUtils.getUsername()); + prodMaterialMaterials.setCreateTime(DateUtils.getNowDate()); + prodMaterialMaterials.setDelFlag(Constants.DELETE_FLAG_0 ); + return prodMaterialMaterialsMapper.insertProdMaterialMaterials(prodMaterialMaterials); + } + + /** + * 修改物料材质 + * + * @param prodMaterialMaterials 物料材质 + * @return 结果 + */ + @Override + public int updateProdMaterialMaterials(ProdMaterialMaterials prodMaterialMaterials) + { + prodMaterialMaterials.setUpdateBy(SecurityUtils.getUsername()); + prodMaterialMaterials.setUpdateTime(DateUtils.getNowDate()); + return prodMaterialMaterialsMapper.updateProdMaterialMaterials(prodMaterialMaterials); + } + + /** + * 删除物料材质信息 + * + * @param id 物料材质主键 + * @return 结果 + */ + @Override + public int deleteProdMaterialMaterialsById(Long id) + { + ProdMaterialMaterials prodMaterialMaterials = prodMaterialMaterialsMapper.selectProdMaterialMaterialsById(id); + prodMaterialMaterials.setUpdateBy(SecurityUtils.getUsername()); + prodMaterialMaterials.setUpdateTime(DateUtils.getNowDate()); + prodMaterialMaterials.setDelFlag(Constants.DELETE_FLAG_1 ); + return prodMaterialMaterialsMapper.updateProdMaterialMaterials(prodMaterialMaterials); + } + + /** + * 导入数据 + * @param m_list + * @return + */ + @Override + public AjaxResult importData(List m_list){ + //判断集合是否为空 + if(m_list == null || m_list.size() == 0){ + return AjaxResult.error(Constants.RETURN_MESSEGES_EMPTY); + } + //添加删除标识 + for (ProdMaterialMaterials prodMaterialMaterials : m_list) { + prodMaterialMaterials.setDelFlag(Constants.DELETE_FLAG_0); + } + int i = prodMaterialMaterialsMapper.insertBatch(m_list); + if(i < 1){ + return AjaxResult.error(Constants.RETURN_MESSEGES_ERROR); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialServiceImpl.java b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialServiceImpl.java new file mode 100644 index 0000000..c9cb4f0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdMaterialServiceImpl.java @@ -0,0 +1,375 @@ +package com.ruoyi.project.product.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.constant.Constants; +import com.ruoyi.project.product.domain.ProdMaterial; +import com.ruoyi.project.product.domain.ProdMaterialCategory; +import com.ruoyi.project.product.domain.ProdMaterialMaterials; +import com.ruoyi.project.product.domain.vo.MaterialVo; +import com.ruoyi.project.product.mapper.ProdMaterialCategoryMapper; +import com.ruoyi.project.product.mapper.ProdMaterialMapper; +import com.ruoyi.project.product.mapper.ProdMaterialMaterialsMapper; +import com.ruoyi.project.product.service.IProdMaterialService; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * 物料Service业务层处理 + * + * @author evo + * @date 2024-11-09 + */ +@Service +public class ProdMaterialServiceImpl implements IProdMaterialService +{ + @Resource + private ProdMaterialMapper prodMaterialMapper; + @Resource + private ProdMaterialCategoryMapper prodMaterialCategoryMapper; //类别号 + @Resource + private ProdMaterialMaterialsMapper prodMaterialMaterialsMapper; //材质 + + /** + * 查询物料 + * + * @param id 物料主键 + * @return 物料 + */ + @Override + public ProdMaterial selectProdMaterialById(Long id) + { + return prodMaterialMapper.selectProdMaterialById(id); + } + + /** + * 查询物料列表 + * + * @param prodMaterial 物料 + * @return 物料 + */ + @Override + public List selectProdMaterialList(ProdMaterial prodMaterial) + { + //读取金蝶信息 + //getMaterialsFromJieDie(); + List res_list = prodMaterialMapper.selectProdMaterialList(prodMaterial); + for (ProdMaterial material : res_list) { + ProdMaterialCategory prodMaterialCategory = prodMaterialCategoryMapper.selectProdMaterialCategoryByCode(material.getType()); + if(prodMaterialCategory != null){ + material.setType(prodMaterialCategory.getName()); + } + ProdMaterialMaterials prodMaterialMaterials = prodMaterialMaterialsMapper.selectProdMaterialMaterialsByCode(material.getMaterials()); + if(prodMaterialMaterials != null){ + material.setMaterials(prodMaterialMaterials.getName()); + } + } + return res_list; + } + + /** + * 实时获取金蝶的数据信息 TODO + */ + private void getMaterialsFromJieDie(){ + //获取金蝶结果字符串 + String jsonStr = ""; + JSONArray jsonArray = JSONArray.parseArray(jsonStr); + //保存最终结果 + List res_list = new ArrayList(); + //查询本地数据库数据 + List bd_list = prodMaterialMapper.selectProdMaterialList(null); + ProdMaterial prodMaterial = null; + //循环集合 + for (int i=0;i selectProdMaterialTypeList(ProdMaterialType prodMaterialType) + { + List res_list = prodMaterialTypeMapper.selectProdMaterialTypeList(prodMaterialType); + for (ProdMaterialType materialType : res_list) { + ProdMaterialCategory prodMaterialCategory = prodMaterialCategoryMapper.selectProdMaterialCategoryByCode(materialType.getCategoryId()); + materialType.setCategoryName(prodMaterialCategory.getName()); + } + return res_list; + } + + /** + * 新增物料种类 + * + * @param prodMaterialType 物料种类 + * @return 结果 + */ + @Override + public int insertProdMaterialType(ProdMaterialType prodMaterialType) + { + prodMaterialType.setCreateTime(DateUtils.getNowDate()); + prodMaterialType.setCreateBy(SecurityUtils.getUsername()); + prodMaterialType.setDelFlag(Constants.DELETE_FLAG_0); + return prodMaterialTypeMapper.insertProdMaterialType(prodMaterialType); + } + + /** + * 修改物料种类 + * + * @param prodMaterialType 物料种类 + * @return 结果 + */ + @Override + public int updateProdMaterialType(ProdMaterialType prodMaterialType) + { + prodMaterialType.setUpdateTime(DateUtils.getNowDate()); + prodMaterialType.setUpdateBy(SecurityUtils.getUsername()); + return prodMaterialTypeMapper.updateProdMaterialType(prodMaterialType); + } + + /** + * 删除物料种类信息 + * + * @param id 物料种类主键 + * @return 结果 + */ + @Override + public int deleteProdMaterialTypeById(Long id) + { + ProdMaterialType prodMaterialType = prodMaterialTypeMapper.selectProdMaterialTypeById(id); + prodMaterialType.setUpdateTime(DateUtils.getNowDate()); + prodMaterialType.setUpdateBy(SecurityUtils.getUsername()); + prodMaterialType.setDelFlag(Constants.DELETE_FLAG_1); + return prodMaterialTypeMapper.updateProdMaterialType(prodMaterialType); + } + + /** + * 批量上传 + * @param filePath + * @return + */ + public AjaxResult uploadBatchFile(MultipartFile filePath, String categoryId){ + //获取文件名称 + String originalFilename = filePath.getOriginalFilename(); + //校验文件后缀 + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1); // 输出 "txt" + //判断是否是图片文件 + if(!"xls".equals(suffix) || !"xlsx".equals(suffix)){ + return AjaxResult.error(Constants.RETURN_MESSEGES_0); + } + try{ + ExcelUtil util = new ExcelUtil(ProdMaterialType.class); + List typeList = util.importExcel(filePath.getInputStream()); + for (ProdMaterialType prodMaterialType : typeList) { + prodMaterialType.setDelFlag(Constants.DELETE_FLAG_0); + prodMaterialType.setCategoryId(categoryId); + } + int i = prodMaterialTypeMapper.insertBatch(typeList); + if(i < 1){ + return AjaxResult.error(); + } + }catch (Exception e){ + e.printStackTrace(); + return AjaxResult.error(); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdNumberServiceImpl.java b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdNumberServiceImpl.java new file mode 100644 index 0000000..9aa7886 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/product/service/impl/ProdNumberServiceImpl.java @@ -0,0 +1,114 @@ +package com.ruoyi.project.product.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.product.domain.ProdNumber; +import com.ruoyi.project.product.mapper.ProdNumberMapper; +import com.ruoyi.project.product.service.IProdNumberService; +import com.ruoyi.project.management.constant.Constants; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + +/** + * 规格号维护Service业务层处理 + * + * @author evo + * @date 2024-11-11 + */ +@Service +public class ProdNumberServiceImpl implements IProdNumberService +{ + @Resource + private ProdNumberMapper prodNumberMapper; + + /** + * 查询规格号维护 + * + * @param id 规格号维护主键 + * @return 规格号维护 + */ + @Override + public ProdNumber selectProdNumberById(Long id) + { + return prodNumberMapper.selectProdNumberById(id); + } + + /** + * 查询规格号维护列表 + * + * @param prodNumber 规格号维护 + * @return 规格号维护 + */ + @Override + public List selectProdNumberList(ProdNumber prodNumber) + { + return prodNumberMapper.selectProdNumberList(prodNumber); + } + + /** + * 新增规格号维护 + * + * @param prodNumber 规格号维护 + * @return 结果 + */ + @Override + public int insertProdNumber(ProdNumber prodNumber) + { + prodNumber.setCreateTime(DateUtils.getNowDate()); + prodNumber.setCreateBy(SecurityUtils.getUsername()); + prodNumber.setDelFlag(Constants.DELETE_FLAG_0); + return prodNumberMapper.insertProdNumber(prodNumber); + } + + /** + * 修改规格号维护 + * + * @param prodNumber 规格号维护 + * @return 结果 + */ + @Override + public int updateProdNumber(ProdNumber prodNumber) + { + prodNumber.setUpdateTime(DateUtils.getNowDate()); + prodNumber.setUpdateBy(SecurityUtils.getUsername()); + return prodNumberMapper.updateProdNumber(prodNumber); + } + + /** + * 删除规格号维护信息 + * + * @param id 规格号维护主键 + * @return 结果 + */ + @Override + public int deleteProdNumberById(Long id) + { + ProdNumber prodNumber = prodNumberMapper.selectProdNumberById(id); + prodNumber.setUpdateTime(DateUtils.getNowDate()); + prodNumber.setUpdateBy(SecurityUtils.getUsername()); + prodNumber.setDelFlag(Constants.DELETE_FLAG_1); + return prodNumberMapper.updateProdNumber(prodNumber); + } + + /** + * 导入数据 + * @param cat_list + * @return + */ + @Override + public AjaxResult importData(List cat_list){ + if(cat_list == null || cat_list.size() == 0){ + return AjaxResult.error(Constants.RETURN_MESSEGES_EMPTY); + } + for (ProdNumber prodNumber : cat_list) { + prodNumber.setDelFlag(Constants.DELETE_FLAG_0); + } + int i = prodNumberMapper.insertBatch(cat_list); + if(i < 1){ + return AjaxResult.error(); + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java new file mode 100644 index 0000000..0f32e76 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java @@ -0,0 +1,133 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysConfig; +import com.ruoyi.project.system.service.ISysConfigService; + +/** + * 参数配置 信息操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/config") +public class SysConfigController extends BaseController +{ + @Autowired + private ISysConfigService configService; + + /** + * 获取参数配置列表 + */ + @PreAuthorize("@ss.hasPermi('system:config:list')") + @GetMapping("/list") + public TableDataInfo list(SysConfig config) + { + startPage(); + List list = configService.selectConfigList(config); + return getDataTable(list); + } + + @Log(title = "参数管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:config:export')") + @GetMapping("/export") + public AjaxResult export(SysConfig config) + { + List list = configService.selectConfigList(config); + ExcelUtil util = new ExcelUtil(SysConfig.class); + return util.exportExcel(list, "参数数据"); + } + + /** + * 根据参数编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:config:query')") + @GetMapping(value = "/{configId}") + public AjaxResult getInfo(@PathVariable Long configId) + { + return AjaxResult.success(configService.selectConfigById(configId)); + } + + /** + * 根据参数键名查询参数值 + */ + @GetMapping(value = "/configKey/{configKey}") + public AjaxResult getConfigKey(@PathVariable String configKey) + { + return AjaxResult.success(configService.selectConfigByKey(configKey)); + } + + /** + * 新增参数配置 + */ + @PreAuthorize("@ss.hasPermi('system:config:add')") + @Log(title = "参数管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysConfig config) + { + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + { + return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + config.setCreateBy(SecurityUtils.getUsername()); + return toAjax(configService.insertConfig(config)); + } + + /** + * 修改参数配置 + */ + @PreAuthorize("@ss.hasPermi('system:config:edit')") + @Log(title = "参数管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysConfig config) + { + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + { + return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + config.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(configService.updateConfig(config)); + } + + /** + * 删除参数配置 + */ + @PreAuthorize("@ss.hasPermi('system:config:remove')") + @Log(title = "参数管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{configIds}") + public AjaxResult remove(@PathVariable Long[] configIds) + { + return toAjax(configService.deleteConfigByIds(configIds)); + } + + /** + * 清空缓存 + */ + @PreAuthorize("@ss.hasPermi('system:config:remove')") + @Log(title = "参数管理", businessType = BusinessType.CLEAN) + @DeleteMapping("/clearCache") + public AjaxResult clearCache() + { + configService.clearCache(); + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java new file mode 100644 index 0000000..0a99e11 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java @@ -0,0 +1,193 @@ +package com.ruoyi.project.system.controller; + +import java.util.Iterator; +import java.util.List; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.service.ISysDeptService; + +/** + * 部门信息 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/dept") +public class SysDeptController extends BaseController +{ + @Autowired + private ISysDeptService deptService; + + /** + * 获取部门列表 + */ + @PreAuthorize("@ss.hasPermi('system:dept:list')") + @GetMapping("/list") + public AjaxResult list(SysDept dept) + { + List depts = deptService.selectDeptList(dept); + return AjaxResult.success(depts); + } + + /** + * 查询部门列表(排除节点) + */ + @PreAuthorize("@ss.hasPermi('system:dept:list')") + @GetMapping("/list/exclude/{deptId}") + public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) + { + List depts = deptService.selectDeptList(new SysDept()); + Iterator it = depts.iterator(); + while (it.hasNext()) + { + SysDept d = (SysDept) it.next(); + if (d.getDeptId().intValue() == deptId + || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) + { + it.remove(); + } + } + return AjaxResult.success(depts); + } + + /** + * 根据部门编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:dept:query')") + @GetMapping(value = "/{deptId}") + public AjaxResult getInfo(@PathVariable Long deptId) + { + return AjaxResult.success(deptService.selectDeptById(deptId)); + } + + /** + * 获取部门下拉树列表 + */ + @GetMapping("/treeselect") + public AjaxResult treeselect(SysDept dept) + { + List depts = deptService.selectDeptList(dept); + return AjaxResult.success(deptService.buildDeptTreeSelect(depts)); + } + + /** + * 加载对应角色部门列表树 + */ + @GetMapping(value = "/roleDeptTreeselect/{roleId}") + public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) + { + List depts = deptService.selectDeptList(new SysDept()); + AjaxResult ajax = AjaxResult.success(); + ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); + ajax.put("depts", deptService.buildDeptTreeSelect(depts)); + return ajax; + } + + /** + * 新增部门 + */ + @PreAuthorize("@ss.hasPermi('system:dept:add')") + @Log(title = "部门管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysDept dept) + { + if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + { + return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } + dept.setCreateBy(SecurityUtils.getUsername()); + return toAjax(deptService.insertDept(dept)); + } + + /** + * 修改部门 + */ + @PreAuthorize("@ss.hasPermi('system:dept:edit')") + @Log(title = "部门管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysDept dept) + { + if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + { + return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } + else if (dept.getParentId().equals(dept.getDeptId())) + { + return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); + } + else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) + && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) + { + return AjaxResult.error("该部门包含未停用的子部门!"); + } + dept.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(deptService.updateDept(dept)); + } + + /** + * 删除部门 + */ + @PreAuthorize("@ss.hasPermi('system:dept:remove')") + @Log(title = "部门管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{deptId}") + public AjaxResult remove(@PathVariable Long deptId) + { + if (deptService.hasChildByDeptId(deptId)) + { + return AjaxResult.error("存在下级部门,不允许删除"); + } + if (deptService.checkDeptExistUser(deptId)) + { + return AjaxResult.error("部门存在用户,不允许删除"); + } + return toAjax(deptService.deleteDeptById(deptId)); + } + + /** + * 获取部门列表 + */ + @PreAuthorize("@ss.hasPermi('system:dept:list')") + @GetMapping("/lists") + public AjaxResult lists(SysDept dept) + { + List depts = deptService.selectDeptLists(dept); + return AjaxResult.success(depts); + } + + /** + * 获取部门列表 + */ + @RequestMapping("/deptList") + public AjaxResult deptList(){ + SysDept dept = new SysDept(); + List depts = deptService.selectDeptLists(dept); + return AjaxResult.success(depts); + } + + /** + * 获取部门列表 + */ + @RequestMapping("/listAllDept") + public List listAllDept(){ + List depts = deptService.selectAllDept(); + return depts; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java new file mode 100644 index 0000000..9648785 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java @@ -0,0 +1,113 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysDictData; +import com.ruoyi.project.system.service.ISysDictDataService; +import com.ruoyi.project.system.service.ISysDictTypeService; + +/** + * 数据字典信息 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/dict/data") +public class SysDictDataController extends BaseController +{ + @Autowired + private ISysDictDataService dictDataService; + + @Autowired + private ISysDictTypeService dictTypeService; + + @PreAuthorize("@ss.hasPermi('system:dict:list')") + @GetMapping("/list") + public TableDataInfo list(SysDictData dictData) + { + startPage(); + List list = dictDataService.selectDictDataList(dictData); + return getDataTable(list); + } + + @Log(title = "字典数据", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:dict:export')") + @GetMapping("/export") + public AjaxResult export(SysDictData dictData) + { + List list = dictDataService.selectDictDataList(dictData); + ExcelUtil util = new ExcelUtil(SysDictData.class); + return util.exportExcel(list, "字典数据"); + } + + /** + * 查询字典数据详细 + */ + @PreAuthorize("@ss.hasPermi('system:dict:query')") + @GetMapping(value = "/{dictCode}") + public AjaxResult getInfo(@PathVariable Long dictCode) + { + return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); + } + + /** + * 根据字典类型查询字典数据信息 + */ + @GetMapping(value = "/type/{dictType}") + public AjaxResult dictType(@PathVariable String dictType) + { + return AjaxResult.success(dictTypeService.selectDictDataByType(dictType)); + } + + /** + * 新增字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:add')") + @Log(title = "字典数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysDictData dict) + { + dict.setCreateBy(SecurityUtils.getUsername()); + return toAjax(dictDataService.insertDictData(dict)); + } + + /** + * 修改保存字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:edit')") + @Log(title = "字典数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysDictData dict) + { + dict.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(dictDataService.updateDictData(dict)); + } + + /** + * 删除字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictCodes}") + public AjaxResult remove(@PathVariable Long[] dictCodes) + { + return toAjax(dictDataService.deleteDictDataByIds(dictCodes)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java new file mode 100644 index 0000000..bda8748 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java @@ -0,0 +1,131 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysDictType; +import com.ruoyi.project.system.service.ISysDictTypeService; + +/** + * 数据字典信息 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/dict/type") +public class SysDictTypeController extends BaseController +{ + @Autowired + private ISysDictTypeService dictTypeService; + + @PreAuthorize("@ss.hasPermi('system:dict:list')") + @GetMapping("/list") + public TableDataInfo list(SysDictType dictType) + { + startPage(); + List list = dictTypeService.selectDictTypeList(dictType); + return getDataTable(list); + } + + @Log(title = "字典类型", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:dict:export')") + @GetMapping("/export") + public AjaxResult export(SysDictType dictType) + { + List list = dictTypeService.selectDictTypeList(dictType); + ExcelUtil util = new ExcelUtil(SysDictType.class); + return util.exportExcel(list, "字典类型"); + } + + /** + * 查询字典类型详细 + */ + @PreAuthorize("@ss.hasPermi('system:dict:query')") + @GetMapping(value = "/{dictId}") + public AjaxResult getInfo(@PathVariable Long dictId) + { + return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); + } + + /** + * 新增字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:add')") + @Log(title = "字典类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysDictType dict) + { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + { + return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dict.setCreateBy(SecurityUtils.getUsername()); + return toAjax(dictTypeService.insertDictType(dict)); + } + + /** + * 修改字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:edit')") + @Log(title = "字典类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysDictType dict) + { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + { + return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dict.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(dictTypeService.updateDictType(dict)); + } + + /** + * 删除字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictIds}") + public AjaxResult remove(@PathVariable Long[] dictIds) + { + return toAjax(dictTypeService.deleteDictTypeByIds(dictIds)); + } + + /** + * 清空缓存 + */ + @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @Log(title = "字典类型", businessType = BusinessType.CLEAN) + @DeleteMapping("/clearCache") + public AjaxResult clearCache() + { + dictTypeService.clearCache(); + return AjaxResult.success(); + } + + /** + * 获取字典选择框列表 + */ + @GetMapping("/optionselect") + public AjaxResult optionselect() + { + List dictTypes = dictTypeService.selectDictTypeAll(); + return AjaxResult.success(dictTypes); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java new file mode 100644 index 0000000..35d374d --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java @@ -0,0 +1,97 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.security.LoginBody; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.SysLoginService; +import com.ruoyi.framework.security.service.SysPermissionService; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.system.domain.SysMenu; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysMenuService; + +/** + * 登录验证 + * + * @author ruoyi + */ +@RestController +public class SysLoginController +{ + @Autowired + private SysLoginService loginService; + + @Autowired + private ISysMenuService menuService; + + @Autowired + private SysPermissionService permissionService; + + @Autowired + private TokenService tokenService; + + /** + * 登录方法 + * + * @param username 用户名 + * @param password 密码 + * @param captcha 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + @PostMapping("/login") + public AjaxResult login(@RequestBody LoginBody loginBody) + { + AjaxResult ajax = AjaxResult.success(); + // 生成令牌 + String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), + loginBody.getUuid()); + ajax.put(Constants.TOKEN, token); + return ajax; + } + + /** + * 获取用户信息 + * + * @return 用户信息 + */ + @GetMapping("getInfo") + public AjaxResult getInfo() + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + // 角色集合 + Set roles = permissionService.getRolePermission(user); + // 权限集合 + Set permissions = permissionService.getMenuPermission(user); + AjaxResult ajax = AjaxResult.success(); + ajax.put("user", user); + ajax.put("roles", roles); + ajax.put("permissions", permissions); + return ajax; + } + + /** + * 获取路由信息 + * + * @return 路由信息 + */ + @GetMapping("getRouters") + public AjaxResult getRouters() + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 用户信息 + SysUser user = loginUser.getUser(); + List menus = menuService.selectMenuTreeByUserId(user.getUserId()); + return AjaxResult.success(menuService.buildMenus(menus)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java new file mode 100644 index 0000000..d56b13e --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java @@ -0,0 +1,153 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.system.domain.SysMenu; +import com.ruoyi.project.system.service.ISysMenuService; + +/** + * 菜单信息 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/menu") +public class SysMenuController extends BaseController +{ + @Autowired + private ISysMenuService menuService; + + @Autowired + private TokenService tokenService; + + /** + * 获取菜单列表 + */ + @PreAuthorize("@ss.hasPermi('system:menu:list')") + @GetMapping("/list") + public AjaxResult list(SysMenu menu) + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + Long userId = loginUser.getUser().getUserId(); + List menus = menuService.selectMenuList(menu, userId); + return AjaxResult.success(menus); + } + + /** + * 根据菜单编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:menu:query')") + @GetMapping(value = "/{menuId}") + public AjaxResult getInfo(@PathVariable Long menuId) + { + return AjaxResult.success(menuService.selectMenuById(menuId)); + } + + /** + * 获取菜单下拉树列表 + */ + @GetMapping("/treeselect") + public AjaxResult treeselect(SysMenu menu) + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + Long userId = loginUser.getUser().getUserId(); + List menus = menuService.selectMenuList(menu, userId); + return AjaxResult.success(menuService.buildMenuTreeSelect(menus)); + } + + /** + * 加载对应角色菜单列表树 + */ + @GetMapping(value = "/roleMenuTreeselect/{roleId}") + public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + List menus = menuService.selectMenuList(loginUser.getUser().getUserId()); + AjaxResult ajax = AjaxResult.success(); + ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); + ajax.put("menus", menuService.buildMenuTreeSelect(menus)); + return ajax; + } + + /** + * 新增菜单 + */ + @PreAuthorize("@ss.hasPermi('system:menu:add')") + @Log(title = "菜单管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysMenu menu) + { + if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + { + return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } + else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) + && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) + { + return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } + menu.setCreateBy(SecurityUtils.getUsername()); + return toAjax(menuService.insertMenu(menu)); + } + + /** + * 修改菜单 + */ + @PreAuthorize("@ss.hasPermi('system:menu:edit')") + @Log(title = "菜单管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysMenu menu) + { + if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + { + return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } + else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) + && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) + { + return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } + menu.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(menuService.updateMenu(menu)); + } + + /** + * 删除菜单 + */ + @PreAuthorize("@ss.hasPermi('system:menu:remove')") + @Log(title = "菜单管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{menuId}") + public AjaxResult remove(@PathVariable("menuId") Long menuId) + { + if (menuService.hasChildByMenuId(menuId)) + { + return AjaxResult.error("存在子菜单,不允许删除"); + } + if (menuService.checkMenuExistRole(menuId)) + { + return AjaxResult.error("菜单已分配,不允许删除"); + } + return toAjax(menuService.deleteMenuById(menuId)); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java new file mode 100644 index 0000000..efdd1f9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java @@ -0,0 +1,94 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.framework.websocket.WebSocketUsers; +import com.ruoyi.project.system.domain.SysNotice; +import com.ruoyi.project.system.service.ISysNoticeService; + +/** + * 公告 信息操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/notice") +public class SysNoticeController extends BaseController +{ + @Autowired + private ISysNoticeService noticeService; + + /** + * 获取通知公告列表 + */ + @PreAuthorize("@ss.hasPermi('system:notice:list')") + @GetMapping("/list") + public TableDataInfo list(SysNotice notice) + { + startPage(); + List list = noticeService.selectNoticeList(notice); + return getDataTable(list); + } + + /** + * 根据通知公告编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:notice:query')") + @GetMapping(value = "/{noticeId}") + public AjaxResult getInfo(@PathVariable Long noticeId) + { + return AjaxResult.success(noticeService.selectNoticeById(noticeId)); + } + + /** + * 新增通知公告 + */ + @PreAuthorize("@ss.hasPermi('system:notice:add')") + @Log(title = "通知公告", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysNotice notice){ + + notice.setCreateBy(SecurityUtils.getUsername()); + WebSocketUsers.sendMessageToUsersByText("有一条新的通知"); + return toAjax(noticeService.insertNotice(notice)); + } + + /** + * 修改通知公告 + */ + @PreAuthorize("@ss.hasPermi('system:notice:edit')") + @Log(title = "通知公告", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysNotice notice) + { + notice.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(noticeService.updateNotice(notice)); + } + + /** + * 删除通知公告 + */ + @PreAuthorize("@ss.hasPermi('system:notice:remove')") + @Log(title = "通知公告", businessType = BusinessType.DELETE) + @DeleteMapping("/{noticeIds}") + public AjaxResult remove(@PathVariable Long[] noticeIds) + { + return toAjax(noticeService.deleteNoticeByIds(noticeIds)); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysPostController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysPostController.java new file mode 100644 index 0000000..a2fc1de --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysPostController.java @@ -0,0 +1,131 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysPost; +import com.ruoyi.project.system.service.ISysPostService; + +/** + * 岗位信息操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/post") +public class SysPostController extends BaseController +{ + @Autowired + private ISysPostService postService; + + /** + * 获取岗位列表 + */ + @PreAuthorize("@ss.hasPermi('system:post:list')") + @GetMapping("/list") + public TableDataInfo list(SysPost post) + { + startPage(); + List list = postService.selectPostList(post); + return getDataTable(list); + } + + @Log(title = "岗位管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:post:export')") + @GetMapping("/export") + public AjaxResult export(SysPost post) + { + List list = postService.selectPostList(post); + ExcelUtil util = new ExcelUtil(SysPost.class); + return util.exportExcel(list, "岗位数据"); + } + + /** + * 根据岗位编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:post:query')") + @GetMapping(value = "/{postId}") + public AjaxResult getInfo(@PathVariable Long postId) + { + return AjaxResult.success(postService.selectPostById(postId)); + } + + /** + * 新增岗位 + */ + @PreAuthorize("@ss.hasPermi('system:post:add')") + @Log(title = "岗位管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysPost post) + { + if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + { + return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + { + return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } + post.setCreateBy(SecurityUtils.getUsername()); + return toAjax(postService.insertPost(post)); + } + + /** + * 修改岗位 + */ + @PreAuthorize("@ss.hasPermi('system:post:edit')") + @Log(title = "岗位管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysPost post) + { + if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + { + return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + { + return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } + post.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(postService.updatePost(post)); + } + + /** + * 删除岗位 + */ + @PreAuthorize("@ss.hasPermi('system:post:remove')") + @Log(title = "岗位管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{postIds}") + public AjaxResult remove(@PathVariable Long[] postIds) + { + return toAjax(postService.deletePostByIds(postIds)); + } + + /** + * 获取岗位选择框列表 + */ + @GetMapping("/optionselect") + public AjaxResult optionselect() + { + List posts = postService.selectPostAll(); + return AjaxResult.success(posts); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java new file mode 100644 index 0000000..ae4922f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java @@ -0,0 +1,128 @@ +package com.ruoyi.project.system.controller; + +import java.io.IOException; + +import com.ruoyi.project.system.service.ISysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +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.multipart.MultipartFile; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.config.RuoYiConfig; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 个人信息 业务处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/user/profile") +public class SysProfileController extends BaseController +{ + @Autowired + private ISysUserService userService; + + @Autowired + private TokenService tokenService; + + /** + * 个人信息 + */ + @GetMapping + public AjaxResult profile() + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + AjaxResult ajax = AjaxResult.success(user); + ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); + ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); + return ajax; + } + + /** + * 修改用户 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult updateProfile(@RequestBody SysUser user) + { + if (userService.updateUserProfile(user) > 0) + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + // 更新缓存用户信息 + loginUser.getUser().setNickName(user.getNickName()); + loginUser.getUser().setPhonenumber(user.getPhonenumber()); + loginUser.getUser().setEmail(user.getEmail()); + loginUser.getUser().setSex(user.getSex()); + tokenService.setLoginUser(loginUser); + return AjaxResult.success(); + } + return AjaxResult.error("修改个人信息异常,请联系管理员"); + } + + /** + * 重置密码 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping("/updatePwd") + public AjaxResult updatePwd(String oldPassword, String newPassword) + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + String userName = loginUser.getUsername(); + String password = loginUser.getPassword(); + if (!SecurityUtils.matchesPassword(oldPassword, password)) + { + return AjaxResult.error("修改密码失败,旧密码错误"); + } + if (SecurityUtils.matchesPassword(newPassword, password)) + { + return AjaxResult.error("新密码不能与旧密码相同"); + } + if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) + { + // 更新缓存用户密码 + loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); + tokenService.setLoginUser(loginUser); + return AjaxResult.success(); + } + return AjaxResult.error("修改密码异常,请联系管理员"); + } + + /** + * 头像上传 + */ + @Log(title = "用户头像", businessType = BusinessType.UPDATE) + @PostMapping("/avatar") + public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException + { + if (!file.isEmpty()) + { + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file); + if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) + { + AjaxResult ajax = AjaxResult.success(); + ajax.put("imgUrl", avatar); + // 更新缓存用户头像 + loginUser.getUser().setAvatar(avatar); + tokenService.setLoginUser(loginUser); + return ajax; + } + } + return AjaxResult.error("上传图片异常,请联系管理员"); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java new file mode 100644 index 0000000..2343ed9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java @@ -0,0 +1,154 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysRole; +import com.ruoyi.project.system.service.ISysRoleService; + +/** + * 角色信息 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/role") +public class SysRoleController extends BaseController +{ + @Autowired + private ISysRoleService roleService; + + @PreAuthorize("@ss.hasPermi('system:role:list')") + @GetMapping("/list") + public TableDataInfo list(SysRole role) + { + startPage(); + List list = roleService.selectRoleList(role); + return getDataTable(list); + } + + @Log(title = "角色管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:role:export')") + @GetMapping("/export") + public AjaxResult export(SysRole role) + { + List list = roleService.selectRoleList(role); + ExcelUtil util = new ExcelUtil(SysRole.class); + return util.exportExcel(list, "角色数据"); + } + + /** + * 根据角色编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:role:query')") + @GetMapping(value = "/{roleId}") + public AjaxResult getInfo(@PathVariable Long roleId) + { + return AjaxResult.success(roleService.selectRoleById(roleId)); + } + + /** + * 新增角色 + */ + @PreAuthorize("@ss.hasPermi('system:role:add')") + @Log(title = "角色管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysRole role) + { + if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + { + return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + { + return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + role.setCreateBy(SecurityUtils.getUsername()); + return toAjax(roleService.insertRole(role)); + + } + + /** + * 修改保存角色 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysRole role) + { + roleService.checkRoleAllowed(role); + if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + { + return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + { + return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + role.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(roleService.updateRole(role)); + } + + /** + * 修改保存数据权限 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/dataScope") + public AjaxResult dataScope(@RequestBody SysRole role) + { + roleService.checkRoleAllowed(role); + return toAjax(roleService.authDataScope(role)); + } + + /** + * 状态修改 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody SysRole role) + { + roleService.checkRoleAllowed(role); + role.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(roleService.updateRoleStatus(role)); + } + + /** + * 删除角色 + */ + @PreAuthorize("@ss.hasPermi('system:role:remove')") + @Log(title = "角色管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{roleIds}") + public AjaxResult remove(@PathVariable Long[] roleIds) + { + return toAjax(roleService.deleteRoleByIds(roleIds)); + } + + /** + * 获取角色选择框列表 + */ + @PreAuthorize("@ss.hasPermi('system:role:query')") + @GetMapping("/optionselect") + public AjaxResult optionselect() + { + return AjaxResult.success(roleService.selectRoleAll()); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/system/controller/SysUserController.java b/evo/src/main/java/com/ruoyi/project/system/controller/SysUserController.java new file mode 100644 index 0000000..b45e436 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/controller/SysUserController.java @@ -0,0 +1,206 @@ +package com.ruoyi.project.system.controller; + +import java.util.List; + +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.project.system.service.ISysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.security.service.TokenService; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.ISysPostService; +import com.ruoyi.project.system.service.ISysRoleService; + +/** + * 用户信息 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/user") +public class SysUserController extends BaseController +{ + @Autowired + private ISysUserService userService; + + @Autowired + private ISysRoleService roleService; + + @Autowired + private ISysPostService postService; + + @Autowired + private TokenService tokenService; + + /** + * 获取用户列表 + */ + @PreAuthorize("@ss.hasPermi('system:user:list')") + @GetMapping("/list") + public TableDataInfo list(SysUser user) + { + startPage(); + List list = userService.selectUserList(user); + return getDataTable(list); + } + + @Log(title = "用户管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:user:export')") + @GetMapping("/export") + public AjaxResult export(SysUser user) + { + List list = userService.selectUserList(user); + ExcelUtil util = new ExcelUtil(SysUser.class); + return util.exportExcel(list, "用户数据"); + } + + @Log(title = "用户管理", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('system:user:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil(SysUser.class); + List userList = util.importExcel(file.getInputStream()); + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + String operName = loginUser.getUsername(); + String message = userService.importUser(userList, updateSupport, operName); + return AjaxResult.success(message); + } + + @GetMapping("/importTemplate") + public AjaxResult importTemplate() + { + ExcelUtil util = new ExcelUtil(SysUser.class); + return util.importTemplateExcel("用户数据"); + } + + /** + * 根据用户编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:user:query')") + @GetMapping(value = { "/", "/{userId}" }) + public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) + { + AjaxResult ajax = AjaxResult.success(); + ajax.put("roles", roleService.selectRoleAll()); + ajax.put("posts", postService.selectPostAll()); + if (StringUtils.isNotNull(userId)) + { + ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId)); + ajax.put("postIds", postService.selectPostListByUserId(userId)); + ajax.put("roleIds", roleService.selectRoleListByUserId(userId)); + } + return ajax; + } + + /** + * 新增用户 + */ + @PreAuthorize("@ss.hasPermi('system:user:add')") + @Log(title = "用户管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysUser user) + { + if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) + { + return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + { + return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + { + return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setCreateBy(SecurityUtils.getUsername()); + user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); + return toAjax(userService.insertUser(user)); + } + + /** + * 修改用户 + */ + @PreAuthorize("@ss.hasPermi('system:user:edit')") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysUser user) + { + userService.checkUserAllowed(user); + if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + { + return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + { + return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(userService.updateUser(user)); + } + + /** + * 删除用户 + */ + @PreAuthorize("@ss.hasPermi('system:user:remove')") + @Log(title = "用户管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{userIds}") + public AjaxResult remove(@PathVariable Long[] userIds) + { + return toAjax(userService.deleteUserByIds(userIds)); + } + + /** + * 重置密码 + */ + @PreAuthorize("@ss.hasPermi('system:user:edit')") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/resetPwd") + public AjaxResult resetPwd(@RequestBody SysUser user) + { + userService.checkUserAllowed(user); + user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); + user.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(userService.resetPwd(user)); + } + + /** + * 状态修改 + */ + @PreAuthorize("@ss.hasPermi('system:user:edit')") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody SysUser user) + { + userService.checkUserAllowed(user); + user.setUpdateBy(SecurityUtils.getUsername()); + return toAjax(userService.updateUserStatus(user)); + } + + @GetMapping("/queryUser") + public TableDataInfo queryUser() + { + List list = userService.queryUsersList(); + return getDataTable(list); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysConfig.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysConfig.java new file mode 100644 index 0000000..f9b290b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysConfig.java @@ -0,0 +1,111 @@ +package com.ruoyi.project.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 参数配置表 sys_config + * + * @author ruoyi + */ +public class SysConfig extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 参数主键 */ + @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) + private Long configId; + + /** 参数名称 */ + @Excel(name = "参数名称") + private String configName; + + /** 参数键名 */ + @Excel(name = "参数键名") + private String configKey; + + /** 参数键值 */ + @Excel(name = "参数键值") + private String configValue; + + /** 系统内置(Y是 N否) */ + @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") + private String configType; + + public Long getConfigId() + { + return configId; + } + + public void setConfigId(Long configId) + { + this.configId = configId; + } + + @NotBlank(message = "参数名称不能为空") + @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") + public String getConfigName() + { + return configName; + } + + public void setConfigName(String configName) + { + this.configName = configName; + } + + @NotBlank(message = "参数键名长度不能为空") + @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") + public String getConfigKey() + { + return configKey; + } + + public void setConfigKey(String configKey) + { + this.configKey = configKey; + } + + @NotBlank(message = "参数键值不能为空") + @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") + public String getConfigValue() + { + return configValue; + } + + public void setConfigValue(String configValue) + { + this.configValue = configValue; + } + + public String getConfigType() + { + return configType; + } + + public void setConfigType(String configType) + { + this.configType = configType; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("configId", getConfigId()) + .append("configName", getConfigName()) + .append("configKey", getConfigKey()) + .append("configValue", getConfigValue()) + .append("configType", getConfigType()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysDept.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysDept.java new file mode 100644 index 0000000..271c5aa --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysDept.java @@ -0,0 +1,211 @@ +package com.ruoyi.project.system.domain; + +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 部门表 sys_dept + * + * @author ruoyi + */ +public class SysDept extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 部门ID */ + private Long deptId; + + /** 父部门ID */ + private Long parentId; + + /** 祖级列表 */ + private String ancestors; + + /** 部门名称 */ + private String deptName; + + /** 显示顺序 */ + private String orderNum; + + /** 负责人 */ + private String leader; + + /** 联系电话 */ + private String phone; + + /** 邮箱 */ + private String email; + + /** 部门状态:0正常,1停用 */ + private String status; + + /** 生产部门标识 */ + private String tag; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 父部门名称 */ + private String parentName; + //部门属性 + private String depAttributes; + + public String getDepAttributes() { + return depAttributes; + } + + public void setDepAttributes(String depAttributes) { + this.depAttributes = depAttributes; + } + + /** 子部门 */ + private List children = new ArrayList(); + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public String getAncestors() + { + return ancestors; + } + + public void setAncestors(String ancestors) + { + this.ancestors = ancestors; + } + + @NotBlank(message = "部门名称不能为空") + @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + @NotBlank(message = "显示顺序不能为空") + public String getOrderNum() + { + return orderNum; + } + + public void setOrderNum(String orderNum) + { + this.orderNum = orderNum; + } + + public String getLeader() + { + return leader; + } + + public void setLeader(String leader) + { + this.leader = leader; + } + + @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") + public String getPhone() + { + return phone; + } + + public void setPhone(String phone) + { + this.phone = phone; + } + + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } + + @Override + public String toString() { + return "SysDept [deptId=" + deptId + ", parentId=" + parentId + ", ancestors=" + ancestors + ", deptName=" + + deptName + ", orderNum=" + orderNum + ", leader=" + leader + ", phone=" + phone + ", email=" + email + + ", status=" + status + ", tag=" + tag + ", delFlag=" + delFlag + ", parentName=" + parentName + + ", children=" + children + ", parentName=" + depAttributes + "]"; + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysDictData.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysDictData.java new file mode 100644 index 0000000..d149653 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysDictData.java @@ -0,0 +1,176 @@ +package com.ruoyi.project.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 字典数据表 sys_dict_data + * + * @author ruoyi + */ +public class SysDictData extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 字典编码 */ + @Excel(name = "字典编码", cellType = ColumnType.NUMERIC) + private Long dictCode; + + /** 字典排序 */ + @Excel(name = "字典排序", cellType = ColumnType.NUMERIC) + private Long dictSort; + + /** 字典标签 */ + @Excel(name = "字典标签") + private String dictLabel; + + /** 字典键值 */ + @Excel(name = "字典键值") + private String dictValue; + + /** 字典类型 */ + @Excel(name = "字典类型") + private String dictType; + + /** 样式属性(其他样式扩展) */ + private String cssClass; + + /** 表格字典样式 */ + private String listClass; + + /** 是否默认(Y是 N否) */ + @Excel(name = "是否默认", readConverterExp = "Y=是,N=否") + private String isDefault; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + public Long getDictCode() + { + return dictCode; + } + + public void setDictCode(Long dictCode) + { + this.dictCode = dictCode; + } + + public Long getDictSort() + { + return dictSort; + } + + public void setDictSort(Long dictSort) + { + this.dictSort = dictSort; + } + + @NotBlank(message = "字典标签不能为空") + @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") + public String getDictLabel() + { + return dictLabel; + } + + public void setDictLabel(String dictLabel) + { + this.dictLabel = dictLabel; + } + + @NotBlank(message = "字典键值不能为空") + @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") + public String getDictValue() + { + return dictValue; + } + + public void setDictValue(String dictValue) + { + this.dictValue = dictValue; + } + + @NotBlank(message = "字典类型不能为空") + @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") + public String getDictType() + { + return dictType; + } + + public void setDictType(String dictType) + { + this.dictType = dictType; + } + + @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") + public String getCssClass() + { + return cssClass; + } + + public void setCssClass(String cssClass) + { + this.cssClass = cssClass; + } + + public String getListClass() + { + return listClass; + } + + public void setListClass(String listClass) + { + this.listClass = listClass; + } + + public boolean getDefault() + { + return UserConstants.YES.equals(this.isDefault) ? true : false; + } + + public String getIsDefault() + { + return isDefault; + } + + public void setIsDefault(String isDefault) + { + this.isDefault = isDefault; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("dictCode", getDictCode()) + .append("dictSort", getDictSort()) + .append("dictLabel", getDictLabel()) + .append("dictValue", getDictValue()) + .append("dictType", getDictType()) + .append("cssClass", getCssClass()) + .append("listClass", getListClass()) + .append("isDefault", getIsDefault()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysDictType.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysDictType.java new file mode 100644 index 0000000..7887e66 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysDictType.java @@ -0,0 +1,94 @@ +package com.ruoyi.project.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 字典类型表 sys_dict_type + * + * @author ruoyi + */ +public class SysDictType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 字典主键 */ + @Excel(name = "字典主键", cellType = ColumnType.NUMERIC) + private Long dictId; + + /** 字典名称 */ + @Excel(name = "字典名称") + private String dictName; + + /** 字典类型 */ + @Excel(name = "字典类型") + private String dictType; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + public Long getDictId() + { + return dictId; + } + + public void setDictId(Long dictId) + { + this.dictId = dictId; + } + + @NotBlank(message = "字典名称不能为空") + @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") + public String getDictName() + { + return dictName; + } + + public void setDictName(String dictName) + { + this.dictName = dictName; + } + + @NotBlank(message = "字典类型不能为空") + @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") + public String getDictType() + { + return dictType; + } + + public void setDictType(String dictType) + { + this.dictType = dictType; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("dictId", getDictId()) + .append("dictName", getDictName()) + .append("dictType", getDictType()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysMenu.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysMenu.java new file mode 100644 index 0000000..511128a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysMenu.java @@ -0,0 +1,231 @@ +package com.ruoyi.project.system.domain; + +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 菜单权限表 sys_menu + * + * @author ruoyi + */ +public class SysMenu extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 菜单ID */ + private Long menuId; + + /** 菜单名称 */ + private String menuName; + + /** 父菜单名称 */ + private String parentName; + + /** 父菜单ID */ + private Long parentId; + + /** 显示顺序 */ + private String orderNum; + + /** 路由地址 */ + private String path; + + /** 组件路径 */ + private String component; + + /** 是否为外链(0是 1否) */ + private String isFrame; + + /** 类型(M目录 C菜单 F按钮) */ + private String menuType; + + /** 显示状态(0显示 1隐藏) */ + private String visible; + + /** 菜单状态(0显示 1隐藏) */ + private String status; + + /** 权限字符串 */ + private String perms; + + /** 菜单图标 */ + private String icon; + + /** 子菜单 */ + private List children = new ArrayList(); + + public Long getMenuId() + { + return menuId; + } + + public void setMenuId(Long menuId) + { + this.menuId = menuId; + } + + @NotBlank(message = "菜单名称不能为空") + @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") + public String getMenuName() + { + return menuName; + } + + public void setMenuName(String menuName) + { + this.menuName = menuName; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + @NotBlank(message = "显示顺序不能为空") + public String getOrderNum() + { + return orderNum; + } + + public void setOrderNum(String orderNum) + { + this.orderNum = orderNum; + } + + @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public String getIsFrame() + { + return isFrame; + } + + public void setIsFrame(String isFrame) + { + this.isFrame = isFrame; + } + + @NotBlank(message = "菜单类型不能为空") + public String getMenuType() + { + return menuType; + } + + public void setMenuType(String menuType) + { + this.menuType = menuType; + } + + public String getVisible() + { + return visible; + } + + public void setVisible(String visible) + { + this.visible = visible; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") + public String getPerms() + { + return perms; + } + + public void setPerms(String perms) + { + this.perms = perms; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("menuId", getMenuId()) + .append("menuName", getMenuName()) + .append("parentId", getParentId()) + .append("orderNum", getOrderNum()) + .append("path", getPath()) + .append("component", getComponent()) + .append("isFrame", getIsFrame()) + .append("menuType", getMenuType()) + .append("visible", getVisible()) + .append("status ", getStatus()) + .append("perms", getPerms()) + .append("icon", getIcon()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysNotice.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysNotice.java new file mode 100644 index 0000000..0215f4a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysNotice.java @@ -0,0 +1,100 @@ +package com.ruoyi.project.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 通知公告表 sys_notice + * + * @author ruoyi + */ +public class SysNotice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 公告ID */ + private Long noticeId; + + /** 公告标题 */ + private String noticeTitle; + + /** 公告类型(1通知 2公告) */ + private String noticeType; + + /** 公告内容 */ + private String noticeContent; + + /** 公告状态(0正常 1关闭) */ + private String status; + + public Long getNoticeId() + { + return noticeId; + } + + public void setNoticeId(Long noticeId) + { + this.noticeId = noticeId; + } + + public void setNoticeTitle(String noticeTitle) + { + this.noticeTitle = noticeTitle; + } + + @NotBlank(message = "公告标题不能为空") + @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") + public String getNoticeTitle() + { + return noticeTitle; + } + + public void setNoticeType(String noticeType) + { + this.noticeType = noticeType; + } + + public String getNoticeType() + { + return noticeType; + } + + public void setNoticeContent(String noticeContent) + { + this.noticeContent = noticeContent; + } + + public String getNoticeContent() + { + return noticeContent; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("noticeId", getNoticeId()) + .append("noticeTitle", getNoticeTitle()) + .append("noticeType", getNoticeType()) + .append("noticeContent", getNoticeContent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysPost.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysPost.java new file mode 100644 index 0000000..150f3ba --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysPost.java @@ -0,0 +1,135 @@ +package com.ruoyi.project.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 岗位表 sys_post + * + * @author ruoyi + */ +public class SysPost extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 岗位序号 */ + @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC) + private Long postId; + + /** 部门id */ + @Excel(name = "部门id") + private Long deptId; + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + /** 岗位编码 */ + @Excel(name = "岗位编码") + private String postCode; + + /** 岗位名称 */ + @Excel(name = "岗位名称") + private String postName; + + /** 岗位排序 */ + @Excel(name = "岗位排序") + private String postSort; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 用户是否存在此岗位标识 默认不存在 */ + private boolean flag = false; + + public Long getPostId() + { + return postId; + } + + public void setPostId(Long postId) + { + this.postId = postId; + } + + @NotBlank(message = "岗位编码不能为空") + @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符") + public String getPostCode() + { + return postCode; + } + + public void setPostCode(String postCode) + { + this.postCode = postCode; + } + + @NotBlank(message = "岗位名称不能为空") + @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符") + public String getPostName() + { + return postName; + } + + public void setPostName(String postName) + { + this.postName = postName; + } + + @NotBlank(message = "显示顺序不能为空") + public String getPostSort() + { + return postSort; + } + + public void setPostSort(String postSort) + { + this.postSort = postSort; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public boolean isFlag() + { + return flag; + } + + public void setFlag(boolean flag) + { + this.flag = flag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("postId", getPostId()) + .append("postCode", getPostCode()) + .append("postName", getPostName()) + .append("postSort", getPostSort()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysRole.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysRole.java new file mode 100644 index 0000000..d9acb73 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysRole.java @@ -0,0 +1,197 @@ +package com.ruoyi.project.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 角色表 sys_role + * + * @author ruoyi + */ +public class SysRole extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 角色ID */ + @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) + private Long roleId; + + /** 角色名称 */ + @Excel(name = "角色名称") + private String roleName; + + /** 角色权限 */ + @Excel(name = "角色权限") + private String roleKey; + + /** 角色排序 */ + @Excel(name = "角色排序") + private String roleSort; + + /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */ + @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限") + private String dataScope; + + /** 角色状态(0正常 1停用) */ + @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 用户是否存在此角色标识 默认不存在 */ + private boolean flag = false; + + /** 菜单组 */ + private Long[] menuIds; + + /** 部门组(数据权限) */ + private Long[] deptIds; + + public SysRole() + { + + } + + public SysRole(Long roleId) + { + this.roleId = roleId; + } + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public boolean isAdmin() + { + return isAdmin(this.roleId); + } + + public static boolean isAdmin(Long roleId) + { + return roleId != null && 1L == roleId; + } + + @NotBlank(message = "角色名称不能为空") + @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") + public String getRoleName() + { + return roleName; + } + + public void setRoleName(String roleName) + { + this.roleName = roleName; + } + + @NotBlank(message = "权限字符不能为空") + @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") + public String getRoleKey() + { + return roleKey; + } + + public void setRoleKey(String roleKey) + { + this.roleKey = roleKey; + } + + @NotBlank(message = "显示顺序不能为空") + public String getRoleSort() + { + return roleSort; + } + + public void setRoleSort(String roleSort) + { + this.roleSort = roleSort; + } + + public String getDataScope() + { + return dataScope; + } + + public void setDataScope(String dataScope) + { + this.dataScope = dataScope; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public boolean isFlag() + { + return flag; + } + + public void setFlag(boolean flag) + { + this.flag = flag; + } + + public Long[] getMenuIds() + { + return menuIds; + } + + public void setMenuIds(Long[] menuIds) + { + this.menuIds = menuIds; + } + + public Long[] getDeptIds() + { + return deptIds; + } + + public void setDeptIds(Long[] deptIds) + { + this.deptIds = deptIds; + } + + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("roleName", getRoleName()) + .append("roleKey", getRoleKey()) + .append("roleSort", getRoleSort()) + .append("dataScope", getDataScope()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysRoleDept.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysRoleDept.java new file mode 100644 index 0000000..5cbeed4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysRoleDept.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 角色和部门关联 sys_role_dept + * + * @author ruoyi + */ +public class SysRoleDept +{ + /** 角色ID */ + private Long roleId; + + /** 部门ID */ + private Long deptId; + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("deptId", getDeptId()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysRoleMenu.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysRoleMenu.java new file mode 100644 index 0000000..2772cbb --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysRoleMenu.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 角色和菜单关联 sys_role_menu + * + * @author ruoyi + */ +public class SysRoleMenu +{ + /** 角色ID */ + private Long roleId; + + /** 菜单ID */ + private Long menuId; + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public Long getMenuId() + { + return menuId; + } + + public void setMenuId(Long menuId) + { + this.menuId = menuId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("menuId", getMenuId()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysUser.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysUser.java new file mode 100644 index 0000000..f745b17 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysUser.java @@ -0,0 +1,355 @@ +package com.ruoyi.project.system.domain; + +import java.util.Date; +import java.util.List; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; +import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; +import com.ruoyi.framework.aspectj.lang.annotation.Excels; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 用户对象 sys_user + * + * @author ruoyi + */ +public class SysUser extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户ID */ + @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") + private Long userId; + + /** 部门ID */ + @Excel(name = "部门编号", type = Type.IMPORT) + private Long deptId; + + /** 用户账号 */ + @Excel(name = "登录名称") + private String userName; + + /** 用户昵称 */ + @Excel(name = "用户名称") + private String nickName; + + /** 用户邮箱 */ + @Excel(name = "用户邮箱") + private String email; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phonenumber; + + /** 用户性别 */ + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + private String sex; + + /** 用户头像 */ + private String avatar; + + /** 密码 */ + private String password; + + /** 用户vip等级 */ + private double vipLevel; + + /** 盐加密 */ + private String salt; + + /** 帐号状态(0正常 1停用) */ + @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 最后登陆IP */ + @Excel(name = "最后登陆IP", type = Type.EXPORT) + private String loginIp; + + /** 最后登陆时间 */ + @Excel(name = "最后登陆时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) + private Date loginDate; + + /** 部门对象 */ + @Excels({ + @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), + @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) + }) + private SysDept dept; + + /** 角色对象 */ + private List roles; + /** 操作员类型 */ + private String operatorType; + + public String getOperatorType() { + return operatorType; + } + + public void setOperatorType(String operatorType) { + this.operatorType = operatorType; + } + + /** 角色组 */ + private Long[] roleIds; + + /** 岗位组 */ + private Long[] postIds; + + public String postId; + + public String getPostId() { + return postId; + } + + public void setPostId(String postId) { + this.postId = postId; + } + + public SysUser(){} + + public SysUser(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public boolean isAdmin() + { + return isAdmin(this.userId); + } + + public static boolean isAdmin(Long userId) + { + return userId != null && 1L == userId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") + public String getNickName() + { + return nickName; + } + + public void setNickName(String nickName) + { + this.nickName = nickName; + } + + @NotBlank(message = "用户账号不能为空") + @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") + public String getPhonenumber() + { + return phonenumber; + } + + public void setPhonenumber(String phonenumber) + { + this.phonenumber = phonenumber; + } + + public String getSex() + { + return sex; + } + + public void setSex(String sex) + { + this.sex = sex; + } + + public String getAvatar() + { + return avatar; + } + + public void setAvatar(String avatar) + { + this.avatar = avatar; + } + + @JsonProperty + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public double getVipLevel() { + return vipLevel; + } + + public void setVipLevel(double vipLevel) { + this.vipLevel = vipLevel; + } + + public String getSalt() + { + return salt; + } + + public void setSalt(String salt) + { + this.salt = salt; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getLoginIp() + { + return loginIp; + } + + public void setLoginIp(String loginIp) + { + this.loginIp = loginIp; + } + + public Date getLoginDate() + { + return loginDate; + } + + public void setLoginDate(Date loginDate) + { + this.loginDate = loginDate; + } + + public SysDept getDept() + { + return dept; + } + + public void setDept(SysDept dept) + { + this.dept = dept; + } + + public List getRoles() + { + return roles; + } + + public void setRoles(List roles) + { + this.roles = roles; + } + + public Long[] getRoleIds() + { + return roleIds; + } + + public void setRoleIds(Long[] roleIds) + { + this.roleIds = roleIds; + } + + public Long[] getPostIds() + { + return postIds; + } + + public void setPostIds(Long[] postIds) + { + this.postIds = postIds; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("deptId", getDeptId()) + .append("userName", getUserName()) + .append("nickName", getNickName()) + .append("email", getEmail()) + .append("phonenumber", getPhonenumber()) + .append("sex", getSex()) + .append("avatar", getAvatar()) + .append("password", getPassword()) + .append("vipLevel", getVipLevel()) + .append("salt", getSalt()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("loginIp", getLoginIp()) + .append("loginDate", getLoginDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("dept", getDept()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysUserPost.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysUserPost.java new file mode 100644 index 0000000..2633a2f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysUserPost.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 用户和岗位关联 sys_user_post + * + * @author ruoyi + */ +public class SysUserPost +{ + /** 用户ID */ + private Long userId; + + /** 岗位ID */ + private Long postId; + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getPostId() + { + return postId; + } + + public void setPostId(Long postId) + { + this.postId = postId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("postId", getPostId()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/SysUserRole.java b/evo/src/main/java/com/ruoyi/project/system/domain/SysUserRole.java new file mode 100644 index 0000000..3be4829 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/SysUserRole.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 用户和角色关联 sys_user_role + * + * @author ruoyi + */ +public class SysUserRole +{ + /** 用户ID */ + private Long userId; + + /** 角色ID */ + private Long roleId; + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("roleId", getRoleId()) + .toString(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/vo/MetaVo.java b/evo/src/main/java/com/ruoyi/project/system/domain/vo/MetaVo.java new file mode 100644 index 0000000..9a1ccb6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/vo/MetaVo.java @@ -0,0 +1,49 @@ +package com.ruoyi.project.system.domain.vo; + +/** + * 路由显示信息 + * + * @author ruoyi + */ +public class MetaVo +{ + /** + * 设置该路由在侧边栏和面包屑中展示的名字 + */ + private String title; + + /** + * 设置该路由的图标,对应路径src/icons/svg + */ + private String icon; + + public MetaVo() + { + } + + public MetaVo(String title, String icon) + { + this.title = title; + this.icon = icon; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/domain/vo/RouterVo.java b/evo/src/main/java/com/ruoyi/project/system/domain/vo/RouterVo.java new file mode 100644 index 0000000..342bc01 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/domain/vo/RouterVo.java @@ -0,0 +1,133 @@ +package com.ruoyi.project.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.List; + +/** + * 路由配置信息 + * + * @author ruoyi + */ +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class RouterVo +{ + /** + * 路由名字 + */ + private String name; + + /** + * 路由地址 + */ + private String path; + + /** + * 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 + */ + private boolean hidden; + + /** + * 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + */ + private String redirect; + + /** + * 组件地址 + */ + private String component; + + /** + * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + */ + private Boolean alwaysShow; + + /** + * 其他元素 + */ + private MetaVo meta; + + /** + * 子路由 + */ + private List children; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + public boolean getHidden() + { + return hidden; + } + + public void setHidden(boolean hidden) + { + this.hidden = hidden; + } + + public String getRedirect() + { + return redirect; + } + + public void setRedirect(String redirect) + { + this.redirect = redirect; + } + + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public Boolean getAlwaysShow() + { + return alwaysShow; + } + + public void setAlwaysShow(Boolean alwaysShow) + { + this.alwaysShow = alwaysShow; + } + + public MetaVo getMeta() + { + return meta; + } + + public void setMeta(MetaVo meta) + { + this.meta = meta; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysConfigMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysConfigMapper.java new file mode 100644 index 0000000..ea275d7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysConfigMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.SysConfig; + +/** + * 参数配置 数据层 + * + * @author ruoyi + */ +public interface SysConfigMapper +{ + /** + * 查询参数配置信息 + * + * @param config 参数配置信息 + * @return 参数配置信息 + */ + public SysConfig selectConfig(SysConfig config); + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + public List selectConfigList(SysConfig config); + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数键名 + * @return 参数配置信息 + */ + public SysConfig checkConfigKeyUnique(String configKey); + + /** + * 新增参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int insertConfig(SysConfig config); + + /** + * 修改参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int updateConfig(SysConfig config); + + /** + * 删除参数配置 + * + * @param configId 参数ID + * @return 结果 + */ + public int deleteConfigById(Long configId); + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + * @return 结果 + */ + public int deleteConfigByIds(Long[] configIds); +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysDeptMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysDeptMapper.java new file mode 100644 index 0000000..702c4f8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysDeptMapper.java @@ -0,0 +1,129 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.project.system.domain.SysDept; + +/** + * 部门管理 数据层 + * + * @author ruoyi + */ +public interface SysDeptMapper +{ + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + public List selectDeptList(SysDept dept); + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + public List selectDeptListByRoleId(Long roleId); + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + public SysDept selectDeptById(Long deptId); + + /** + * 根据ID查询所有子部门 + * + * @param deptId 部门ID + * @return 部门列表 + */ + public List selectChildrenDeptById(Long deptId); + + /** + * 根据ID查询所有子部门(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + public int selectNormalChildrenDeptById(Long deptId); + + /** + * 是否存在子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + public int hasChildByDeptId(Long deptId); + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 + */ + public int checkDeptExistUser(Long deptId); + + /** + * 校验部门名称是否唯一 + * + * @param deptName 部门名称 + * @param parentId 父部门ID + * @return 结果 + */ + public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); + + /** + * 新增部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int insertDept(SysDept dept); + + /** + * 修改部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int updateDept(SysDept dept); + + /** + * 修改所在部门的父级部门状态 + * + * @param dept 部门 + */ + public void updateDeptStatus(SysDept dept); + + /** + * 修改子元素关系 + * + * @param depts 子元素 + * @return 结果 + */ + public int updateDeptChildren(@Param("depts") List depts); + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + public int deleteDeptById(Long deptId); + + /** + * 获取各生产部门 + * @param dept + * @return + */ + public List selectDeptLists(SysDept dept); + /** + * 无权限查询所有数据 + * @return + */ + public List selectAllDept(); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysDictDataMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysDictDataMapper.java new file mode 100644 index 0000000..4977bb4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysDictDataMapper.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.project.system.domain.SysDictData; + +/** + * 字典表 数据层 + * + * @author ruoyi + */ +public interface SysDictDataMapper +{ + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + public List selectDictDataList(SysDictData dictData); + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + public List selectDictDataByType(String dictType); + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + public SysDictData selectDictDataById(Long dictCode); + + /** + * 查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据 + */ + public int countDictDataByType(String dictType); + + /** + * 通过字典ID删除字典数据信息 + * + * @param dictCode 字典数据ID + * @return 结果 + */ + public int deleteDictDataById(Long dictCode); + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + * @return 结果 + */ + public int deleteDictDataByIds(Long[] dictCodes); + + /** + * 新增字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int insertDictData(SysDictData dictData); + + /** + * 修改字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int updateDictData(SysDictData dictData); + + /** + * 同步修改字典类型 + * + * @param oldDictType 旧字典类型 + * @param newDictType 新旧字典类型 + * @return 结果 + */ + public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysDictTypeMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysDictTypeMapper.java new file mode 100644 index 0000000..a070955 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysDictTypeMapper.java @@ -0,0 +1,85 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Mapper; +import com.ruoyi.project.system.domain.SysDictType; + +/** + * 字典表 数据层 + * + * @author ruoyi + */ +@Mapper +public interface SysDictTypeMapper +{ + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + public List selectDictTypeList(SysDictType dictType); + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + public List selectDictTypeAll(); + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + public SysDictType selectDictTypeById(Long dictId); + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + public SysDictType selectDictTypeByType(String dictType); + + /** + * 通过字典ID删除字典信息 + * + * @param dictId 字典ID + * @return 结果 + */ + public int deleteDictTypeById(Long dictId); + + /** + * 批量删除字典类型信息 + * + * @param dictIds 需要删除的字典ID + * @return 结果 + */ + public int deleteDictTypeByIds(Long[] dictIds); + + /** + * 新增字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int insertDictType(SysDictType dictType); + + /** + * 修改字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int updateDictType(SysDictType dictType); + + /** + * 校验字典类型称是否唯一 + * + * @param dictType 字典类型 + * @return 结果 + */ + public SysDictType checkDictTypeUnique(String dictType); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysMenuMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysMenuMapper.java new file mode 100644 index 0000000..f4e0c32 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysMenuMapper.java @@ -0,0 +1,116 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.project.system.domain.SysMenu; + +/** + * 菜单表 数据层 + * + * @author ruoyi + */ +public interface SysMenuMapper +{ + /** + * 查询系统菜单列表 + * + * @param menu 菜单信息 + * @return 菜单列表 + */ + public List selectMenuList(SysMenu menu); + + /** + * 根据用户所有权限 + * + * @return 权限列表 + */ + public List selectMenuPerms(); + + /** + * 根据用户查询系统菜单列表 + * + * @param menu 菜单信息 + * @return 菜单列表 + */ + public List selectMenuListByUserId(SysMenu menu); + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + public List selectMenuPermsByUserId(Long userId); + + /** + * 根据用户ID查询菜单 + * + * @return 菜单列表 + */ + public List selectMenuTreeAll(); + + /** + * 根据用户ID查询菜单 + * + * @param username 用户ID + * @return 菜单列表 + */ + public List selectMenuTreeByUserId(Long userId); + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @return 选中菜单列表 + */ + public List selectMenuListByRoleId(Long roleId); + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + public SysMenu selectMenuById(Long menuId); + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int hasChildByMenuId(Long menuId); + + /** + * 新增菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int insertMenu(SysMenu menu); + + /** + * 修改菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int updateMenu(SysMenu menu); + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int deleteMenuById(Long menuId); + + /** + * 校验菜单名称是否唯一 + * + * @param menuName 菜单名称 + * @param parentId 父菜单ID + * @return 结果 + */ + public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysNoticeMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysNoticeMapper.java new file mode 100644 index 0000000..b80c50b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysNoticeMapper.java @@ -0,0 +1,60 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.SysNotice; + +/** + * 通知公告表 数据层 + * + * @author ruoyi + */ +public interface SysNoticeMapper +{ + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + public SysNotice selectNoticeById(Long noticeId); + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + public List selectNoticeList(SysNotice notice); + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int insertNotice(SysNotice notice); + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int updateNotice(SysNotice notice); + + /** + * 批量删除公告 + * + * @param noticeId 公告ID + * @return 结果 + */ + public int deleteNoticeById(Long noticeId); + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + public int deleteNoticeByIds(Long[] noticeIds); +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysPostMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysPostMapper.java new file mode 100644 index 0000000..43497a5 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysPostMapper.java @@ -0,0 +1,101 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.SysPost; + +/** + * 岗位信息 数据层 + * + * @author ruoyi + */ +public interface SysPostMapper +{ + /** + * 查询岗位数据集合 + * + * @param post 岗位信息 + * @return 岗位数据集合 + */ + public List selectPostList(SysPost post); + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + public List selectPostAll(); + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + public SysPost selectPostById(Long postId); + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + public List selectPostListByUserId(Long userId); + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + public List selectPostsByUserName(String userName); + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + public int deletePostById(Long postId); + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + */ + public int deletePostByIds(Long[] postIds); + + /** + * 修改岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int updatePost(SysPost post); + + /** + * 新增岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int insertPost(SysPost post); + + /** + * 校验岗位名称 + * + * @param postName 岗位名称 + * @return 结果 + */ + public SysPost checkPostNameUnique(String postName); + + /** + * 校验岗位编码 + * + * @param postCode 岗位编码 + * @return 结果 + */ + public SysPost checkPostCodeUnique(String postCode); + + public List queryPostListByUserId(Long userId); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleDeptMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleDeptMapper.java new file mode 100644 index 0000000..77ead08 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleDeptMapper.java @@ -0,0 +1,44 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.SysRoleDept; + +/** + * 角色与部门关联表 数据层 + * + * @author ruoyi + */ +public interface SysRoleDeptMapper +{ + /** + * 通过角色ID删除角色和部门关联 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleDeptByRoleId(Long roleId); + + /** + * 批量删除角色部门关联信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteRoleDept(Long[] ids); + + /** + * 查询部门使用数量 + * + * @param deptId 部门ID + * @return 结果 + */ + public int selectCountRoleDeptByDeptId(Long deptId); + + /** + * 批量新增角色部门信息 + * + * @param roleDeptList 角色部门列表 + * @return 结果 + */ + public int batchRoleDept(List roleDeptList); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleMapper.java new file mode 100644 index 0000000..fad471b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleMapper.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.SysRole; + +/** + * 角色表 数据层 + * + * @author ruoyi + */ +public interface SysRoleMapper +{ + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + public List selectRoleList(SysRole role); + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + public List selectRolePermissionByUserId(Long userId); + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + public List selectRoleAll(); + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + public List selectRoleListByUserId(Long userId); + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + public SysRole selectRoleById(Long roleId); + + /** + * 根据用户ID查询角色 + * + * @param userName 用户名 + * @return 角色列表 + */ + public List selectRolesByUserName(String userName); + + /** + * 校验角色名称是否唯一 + * + * @param roleName 角色名称 + * @return 角色信息 + */ + public SysRole checkRoleNameUnique(String roleName); + + /** + * 校验角色权限是否唯一 + * + * @param roleKey 角色权限 + * @return 角色信息 + */ + public SysRole checkRoleKeyUnique(String roleKey); + + /** + * 修改角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int updateRole(SysRole role); + + /** + * 新增角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int insertRole(SysRole role); + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleById(Long roleId); + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + public int deleteRoleByIds(Long[] roleIds); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleMenuMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleMenuMapper.java new file mode 100644 index 0000000..50666f4 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysRoleMenuMapper.java @@ -0,0 +1,36 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.SysRoleMenu; + +/** + * 角色与菜单关联表 数据层 + * + * @author ruoyi + */ +public interface SysRoleMenuMapper +{ + /** + * 查询菜单使用数量 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int checkMenuExistRole(Long menuId); + + /** + * 通过角色ID删除角色和菜单关联 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleMenuByRoleId(Long roleId); + + /** + * 批量新增角色菜单信息 + * + * @param roleMenuList 角色菜单列表 + * @return 结果 + */ + public int batchRoleMenu(List roleMenuList); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java new file mode 100644 index 0000000..c1038c3 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java @@ -0,0 +1,115 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.project.system.domain.SysUser; + +/** + * 用户表 数据层 + * + * @author ruoyi + */ +public interface SysUserMapper +{ + /** + * 根据条件分页查询用户列表 + * + * @param sysUser 用户信息 + * @return 用户信息集合信息 + */ + public List selectUserList(SysUser sysUser); + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + public SysUser selectUserByUserName(String userName); + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + public SysUser selectUserById(Long userId); + + /** + * 新增用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int insertUser(SysUser user); + + /** + * 修改用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUser(SysUser user); + + /** + * 修改用户头像 + * + * @param userName 用户名 + * @param avatar 头像地址 + * @return 结果 + */ + public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); + + /** + * 重置用户密码 + * + * @param userName 用户名 + * @param password 密码 + * @return 结果 + */ + public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserById(Long userId); + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + public int deleteUserByIds(Long[] userIds); + + /** + * 校验用户名称是否唯一 + * + * @param userName 用户名称 + * @return 结果 + */ + public int checkUserNameUnique(String userName); + + /** + * 校验手机号码是否唯一 + * + * @param phonenumber 手机号码 + * @return 结果 + */ + public SysUser checkPhoneUnique(String phonenumber); + + /** + * 校验email是否唯一 + * + * @param email 用户邮箱 + * @return 结果 + */ + public SysUser checkEmailUnique(String email); + + public List queryUsersList(); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserPostMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserPostMapper.java new file mode 100644 index 0000000..7c54fdf --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserPostMapper.java @@ -0,0 +1,44 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import com.ruoyi.project.system.domain.SysUserPost; + +/** + * 用户与岗位关联表 数据层 + * + * @author ruoyi + */ +public interface SysUserPostMapper +{ + /** + * 通过用户ID删除用户和岗位关联 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserPostByUserId(Long userId); + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + public int countUserPostById(Long postId); + + /** + * 批量删除用户和岗位关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteUserPost(Long[] ids); + + /** + * 批量新增用户岗位信息 + * + * @param userPostList 用户角色列表 + * @return 结果 + */ + public int batchUserPost(List userPostList); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserRoleMapper.java b/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserRoleMapper.java new file mode 100644 index 0000000..e535905 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/mapper/SysUserRoleMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.project.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.project.system.domain.SysUserRole; + +/** + * 用户与角色关联表 数据层 + * + * @author ruoyi + */ +public interface SysUserRoleMapper +{ + /** + * 通过用户ID删除用户和角色关联 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserRoleByUserId(Long userId); + + /** + * 批量删除用户和角色关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteUserRole(Long[] ids); + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + public int countUserRoleByRoleId(Long roleId); + + /** + * 批量新增用户角色信息 + * + * @param userRoleList 用户角色列表 + * @return 结果 + */ + public int batchUserRole(List userRoleList); + + /** + * 删除用户和角色关联信息 + * + * @param userRole 用户和角色关联信息 + * @return 结果 + */ + public int deleteUserRoleInfo(SysUserRole userRole); + + /** + * 批量取消授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要删除的用户数据ID + * @return 结果 + */ + public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysConfigService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysConfigService.java new file mode 100644 index 0000000..f5aa2f0 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysConfigService.java @@ -0,0 +1,73 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.project.system.domain.SysConfig; + +/** + * 参数配置 服务层 + * + * @author ruoyi + */ +public interface ISysConfigService +{ + /** + * 查询参数配置信息 + * + * @param configId 参数配置ID + * @return 参数配置信息 + */ + public SysConfig selectConfigById(Long configId); + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数键名 + * @return 参数键值 + */ + public String selectConfigByKey(String configKey); + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + public List selectConfigList(SysConfig config); + + /** + * 新增参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int insertConfig(SysConfig config); + + /** + * 修改参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int updateConfig(SysConfig config); + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + * @return 结果 + */ + public int deleteConfigByIds(Long[] configIds); + + /** + * 清空缓存数据 + */ + public void clearCache(); + + /** + * 校验参数键名是否唯一 + * + * @param config 参数信息 + * @return 结果 + */ + public String checkConfigKeyUnique(SysConfig config); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysDeptService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysDeptService.java new file mode 100644 index 0000000..19c00d9 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysDeptService.java @@ -0,0 +1,122 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.framework.web.domain.TreeSelect; +import com.ruoyi.project.system.domain.SysDept; + +/** + * 部门管理 服务层 + * + * @author ruoyi + */ +public interface ISysDeptService +{ + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + public List selectDeptList(SysDept dept); + + /** + * 构建前端所需要树结构 + * + * @param depts 部门列表 + * @return 树结构列表 + */ + public List buildDeptTree(List depts); + + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + public List buildDeptTreeSelect(List depts); + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + public List selectDeptListByRoleId(Long roleId); + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + public SysDept selectDeptById(Long deptId); + + /** + * 根据ID查询所有子部门(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + public int selectNormalChildrenDeptById(Long deptId); + + /** + * 是否存在部门子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + public boolean hasChildByDeptId(Long deptId); + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 true 存在 false 不存在 + */ + public boolean checkDeptExistUser(Long deptId); + + /** + * 校验部门名称是否唯一 + * + * @param dept 部门信息 + * @return 结果 + */ + public String checkDeptNameUnique(SysDept dept); + + /** + * 新增保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int insertDept(SysDept dept); + + /** + * 修改保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int updateDept(SysDept dept); + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + public int deleteDeptById(Long deptId); + + /** + * 获取各生产部门 + * @param dept + * @return + */ + public List selectDeptLists(SysDept dept); + + /** + * 无权限查询所有数据 + * @return + */ + public List selectAllDept(); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysDictDataService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysDictDataService.java new file mode 100644 index 0000000..f34bef1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysDictDataService.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.project.system.domain.SysDictData; + +/** + * 字典 业务层 + * + * @author ruoyi + */ +public interface ISysDictDataService +{ + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + public List selectDictDataList(SysDictData dictData); + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + public String selectDictLabel(String dictType, String dictValue); + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + public SysDictData selectDictDataById(Long dictCode); + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + * @return 结果 + */ + public int deleteDictDataByIds(Long[] dictCodes); + + /** + * 新增保存字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int insertDictData(SysDictData dictData); + + /** + * 修改保存字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int updateDictData(SysDictData dictData); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysDictTypeService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysDictTypeService.java new file mode 100644 index 0000000..2a1e80b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysDictTypeService.java @@ -0,0 +1,89 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.project.system.domain.SysDictData; +import com.ruoyi.project.system.domain.SysDictType; + +/** + * 字典 业务层 + * + * @author ruoyi + */ +public interface ISysDictTypeService +{ + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + public List selectDictTypeList(SysDictType dictType); + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + public List selectDictTypeAll(); + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + public List selectDictDataByType(String dictType); + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + public SysDictType selectDictTypeById(Long dictId); + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + public SysDictType selectDictTypeByType(String dictType); + + /** + * 批量删除字典信息 + * + * @param dictIds 需要删除的字典ID + * @return 结果 + */ + public int deleteDictTypeByIds(Long[] dictIds); + + /** + * 清空缓存数据 + */ + public void clearCache(); + + /** + * 新增保存字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int insertDictType(SysDictType dictType); + + /** + * 修改保存字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int updateDictType(SysDictType dictType); + + /** + * 校验字典类型称是否唯一 + * + * @param dictType 字典类型 + * @return 结果 + */ + public String checkDictTypeUnique(SysDictType dictType); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysMenuService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysMenuService.java new file mode 100644 index 0000000..dbd2cde --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysMenuService.java @@ -0,0 +1,136 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import java.util.Set; +import com.ruoyi.framework.web.domain.TreeSelect; +import com.ruoyi.project.system.domain.SysMenu; +import com.ruoyi.project.system.domain.vo.RouterVo; + +/** + * 菜单 业务层 + * + * @author ruoyi + */ +public interface ISysMenuService +{ + /** + * 根据用户查询系统菜单列表 + * + * @param userId 用户ID + * @return 菜单列表 + */ + public List selectMenuList(Long userId); + + /** + * 根据用户查询系统菜单列表 + * + * @param menu 菜单信息 + * @param userId 用户ID + * @return 菜单列表 + */ + public List selectMenuList(SysMenu menu, Long userId); + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + public Set selectMenuPermsByUserId(Long userId); + + /** + * 根据用户ID查询菜单树信息 + * + * @param userId 用户ID + * @return 菜单列表 + */ + public List selectMenuTreeByUserId(Long userId); + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @return 选中菜单列表 + */ + public List selectMenuListByRoleId(Long roleId); + + /** + * 构建前端路由所需要的菜单 + * + * @param menus 菜单列表 + * @return 路由列表 + */ + public List buildMenus(List menus); + + /** + * 构建前端所需要树结构 + * + * @param menus 菜单列表 + * @return 树结构列表 + */ + public List buildMenuTree(List menus); + + /** + * 构建前端所需要下拉树结构 + * + * @param menus 菜单列表 + * @return 下拉树结构列表 + */ + public List buildMenuTreeSelect(List menus); + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + public SysMenu selectMenuById(Long menuId); + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 true 存在 false 不存在 + */ + public boolean hasChildByMenuId(Long menuId); + + /** + * 查询菜单是否存在角色 + * + * @param menuId 菜单ID + * @return 结果 true 存在 false 不存在 + */ + public boolean checkMenuExistRole(Long menuId); + + /** + * 新增保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int insertMenu(SysMenu menu); + + /** + * 修改保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int updateMenu(SysMenu menu); + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int deleteMenuById(Long menuId); + + /** + * 校验菜单名称是否唯一 + * + * @param menu 菜单信息 + * @return 结果 + */ + public String checkMenuNameUnique(SysMenu menu); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java new file mode 100644 index 0000000..3f74551 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java @@ -0,0 +1,60 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.project.system.domain.SysNotice; + +/** + * 公告 服务层 + * + * @author ruoyi + */ +public interface ISysNoticeService +{ + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + public SysNotice selectNoticeById(Long noticeId); + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + public List selectNoticeList(SysNotice notice); + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int insertNotice(SysNotice notice); + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int updateNotice(SysNotice notice); + + /** + * 删除公告信息 + * + * @param noticeId 公告ID + * @return 结果 + */ + public int deleteNoticeById(Long noticeId); + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + public int deleteNoticeByIds(Long[] noticeIds); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysPostService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysPostService.java new file mode 100644 index 0000000..e4e8800 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysPostService.java @@ -0,0 +1,107 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.project.system.domain.SysPost; + +/** + * 岗位信息 服务层 + * + * @author ruoyi + */ +public interface ISysPostService +{ + /** + * 查询岗位信息集合 + * + * @param post 岗位信息 + * @return 岗位列表 + */ + public List selectPostList(SysPost post); + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + public List selectPostAll(); + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + public SysPost selectPostById(Long postId); + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + public List selectPostListByUserId(Long userId); + + /** + * 校验岗位名称 + * + * @param post 岗位信息 + * @return 结果 + */ + public String checkPostNameUnique(SysPost post); + + /** + * 校验岗位编码 + * + * @param post 岗位信息 + * @return 结果 + */ + public String checkPostCodeUnique(SysPost post); + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + public int countUserPostById(Long postId); + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + public int deletePostById(Long postId); + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + * @throws Exception 异常 + */ + public int deletePostByIds(Long[] postIds); + + /** + * 新增保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int insertPost(SysPost post); + + /** + * 修改保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int updatePost(SysPost post); + + /** + * 根据用户ID得到岗位编码 + * @param userId + * @return + */ + public List queryPostListByUserId(Long userId); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysRoleService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysRoleService.java new file mode 100644 index 0000000..93b013f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysRoleService.java @@ -0,0 +1,131 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import java.util.Set; +import com.ruoyi.project.system.domain.SysRole; + +/** + * 角色业务层 + * + * @author ruoyi + */ +public interface ISysRoleService +{ + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + public List selectRoleList(SysRole role); + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 权限列表 + */ + public Set selectRolePermissionByUserId(Long userId); + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + public List selectRoleAll(); + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + public List selectRoleListByUserId(Long userId); + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + public SysRole selectRoleById(Long roleId); + + /** + * 校验角色名称是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + public String checkRoleNameUnique(SysRole role); + + /** + * 校验角色权限是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + public String checkRoleKeyUnique(SysRole role); + + /** + * 校验角色是否允许操作 + * + * @param role 角色信息 + */ + public void checkRoleAllowed(SysRole role); + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + public int countUserRoleByRoleId(Long roleId); + + /** + * 新增保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int insertRole(SysRole role); + + /** + * 修改保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int updateRole(SysRole role); + + /** + * 修改角色状态 + * + * @param role 角色信息 + * @return 结果 + */ + public int updateRoleStatus(SysRole role); + + /** + * 修改数据权限信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int authDataScope(SysRole role); + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleById(Long roleId); + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + public int deleteRoleByIds(Long[] roleIds); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysUserOnlineService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysUserOnlineService.java new file mode 100644 index 0000000..7974ae7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysUserOnlineService.java @@ -0,0 +1,48 @@ +package com.ruoyi.project.system.service; + +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.project.monitor.domain.SysUserOnline; + +/** + * 在线用户 服务层 + * + * @author ruoyi + */ +public interface ISysUserOnlineService +{ + /** + * 通过登录地址查询信息 + * + * @param ipaddr 登录地址 + * @param user 用户信息 + * @return 在线用户信息 + */ + public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); + + /** + * 通过用户名称查询信息 + * + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); + + /** + * 通过登录地址/用户名称查询信息 + * + * @param ipaddr 登录地址 + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); + + /** + * 设置在线用户信息 + * + * @param user 用户信息 + * @return 在线用户 + */ + public SysUserOnline loginUserToUserOnline(LoginUser user); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/ISysUserService.java b/evo/src/main/java/com/ruoyi/project/system/service/ISysUserService.java new file mode 100644 index 0000000..68d6347 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/ISysUserService.java @@ -0,0 +1,169 @@ +package com.ruoyi.project.system.service; + +import java.util.List; +import com.ruoyi.project.system.domain.SysUser; + +/** + * 用户 业务层 + * + * @author ruoyi + */ +public interface ISysUserService +{ + /** + * 根据条件分页查询用户列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + public List selectUserList(SysUser user); + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + public SysUser selectUserByUserName(String userName); + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + public SysUser selectUserById(Long userId); + + /** + * 根据用户ID查询用户所属角色组 + * + * @param userName 用户名 + * @return 结果 + */ + public String selectUserRoleGroup(String userName); + + /** + * 根据用户ID查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + public String selectUserPostGroup(String userName); + + /** + * 校验用户名称是否唯一 + * + * @param userName 用户名称 + * @return 结果 + */ + public String checkUserNameUnique(String userName); + + /** + * 校验手机号码是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + public String checkPhoneUnique(SysUser user); + + /** + * 校验email是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + public String checkEmailUnique(SysUser user); + + /** + * 校验用户是否允许操作 + * + * @param user 用户信息 + */ + public void checkUserAllowed(SysUser user); + + /** + * 新增用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int insertUser(SysUser user); + + /** + * 修改用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUser(SysUser user); + + /** + * 修改用户状态 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUserStatus(SysUser user); + + /** + * 修改用户基本信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUserProfile(SysUser user); + + /** + * 修改用户头像 + * + * @param userName 用户名 + * @param avatar 头像地址 + * @return 结果 + */ + public boolean updateUserAvatar(String userName, String avatar); + + /** + * 重置用户密码 + * + * @param user 用户信息 + * @return 结果 + */ + public int resetPwd(SysUser user); + + /** + * 重置用户密码 + * + * @param userName 用户名 + * @param password 密码 + * @return 结果 + */ + public int resetUserPwd(String userName, String password); + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserById(Long userId); + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + public int deleteUserByIds(Long[] userIds); + + /** + * 导入用户数据 + * + * @param userList 用户数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + public String importUser(List userList, Boolean isUpdateSupport, String operName); + + public List queryUsersList(); +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java new file mode 100644 index 0000000..e98953a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java @@ -0,0 +1,184 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.Collection; +import java.util.List; +import javax.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.redis.RedisCache; +import com.ruoyi.project.system.domain.SysConfig; +import com.ruoyi.project.system.mapper.SysConfigMapper; +import com.ruoyi.project.system.service.ISysConfigService; + +/** + * 参数配置 服务层实现 + * + * @author ruoyi + */ +@Service +public class SysConfigServiceImpl implements ISysConfigService +{ + @Autowired + private SysConfigMapper configMapper; + + @Autowired + private RedisCache redisCache; + + /** + * 项目启动时,初始化参数到缓存 + */ + @PostConstruct + public void init() + { + List configsList = configMapper.selectConfigList(new SysConfig()); + for (SysConfig config : configsList) + { + redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); + } + } + + /** + * 查询参数配置信息 + * + * @param configId 参数配置ID + * @return 参数配置信息 + */ + @Override + public SysConfig selectConfigById(Long configId) + { + SysConfig config = new SysConfig(); + config.setConfigId(configId); + return configMapper.selectConfig(config); + } + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数key + * @return 参数键值 + */ + @Override + public String selectConfigByKey(String configKey) + { + String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); + if (StringUtils.isNotEmpty(configValue)) + { + return configValue; + } + SysConfig config = new SysConfig(); + config.setConfigKey(configKey); + SysConfig retConfig = configMapper.selectConfig(config); + if (StringUtils.isNotNull(retConfig)) + { + redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); + return retConfig.getConfigValue(); + } + return StringUtils.EMPTY; + } + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + @Override + public List selectConfigList(SysConfig config) + { + return configMapper.selectConfigList(config); + } + + /** + * 新增参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public int insertConfig(SysConfig config) + { + int row = configMapper.insertConfig(config); + if (row > 0) + { + redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); + } + return row; + } + + /** + * 修改参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public int updateConfig(SysConfig config) + { + int row = configMapper.updateConfig(config); + if (row > 0) + { + redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); + } + return row; + } + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + * @return 结果 + */ + @Override + public int deleteConfigByIds(Long[] configIds) + { + int count = configMapper.deleteConfigByIds(configIds); + if (count > 0) + { + Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); + redisCache.deleteObject(keys); + } + return count; + } + + /** + * 清空缓存数据 + */ + public void clearCache() + { + Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); + redisCache.deleteObject(keys); + } + + /** + * 校验参数键名是否唯一 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public String checkConfigKeyUnique(SysConfig config) + { + Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); + SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); + if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 设置cache key + * + * @param configKey 参数键 + * @return 缓存键key + */ + private String getCacheKey(String configKey) + { + return Constants.SYS_CONFIG_KEY + configKey; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..05c7876 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,321 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.DataScope; +import com.ruoyi.framework.web.domain.TreeSelect; +import com.ruoyi.project.system.domain.SysDept; +import com.ruoyi.project.system.mapper.SysDeptMapper; +import com.ruoyi.project.system.service.ISysDeptService; + +/** + * 部门管理 服务实现 + * + * @author ruoyi + */ +@Service +public class SysDeptServiceImpl implements ISysDeptService +{ + @Autowired + private SysDeptMapper deptMapper; + + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + @Override + @DataScope(deptAlias = "d") + public List selectDeptList(SysDept dept) + { + return deptMapper.selectDeptList(dept); + } + + /** + * 构建前端所需要树结构 + * + * @param depts 部门列表 + * @return 树结构列表 + */ + @Override + public List buildDeptTree(List depts) + { + List returnList = new ArrayList(); + List tempList = new ArrayList(); + for (SysDept dept : depts) + { + tempList.add(dept.getDeptId()); + } + for (Iterator iterator = depts.iterator(); iterator.hasNext();) + { + SysDept dept = (SysDept) iterator.next(); + // 如果是顶级节点, 遍历该父节点的所有子节点 + if (!tempList.contains(dept.getParentId())) + { + recursionFn(depts, dept); + returnList.add(dept); + } + } + if (returnList.isEmpty()) + { + returnList = depts; + } + return returnList; + } + + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + @Override + public List buildDeptTreeSelect(List depts) + { + List deptTrees = buildDeptTree(depts); + return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + @Override + public List selectDeptListByRoleId(Long roleId) + { + return deptMapper.selectDeptListByRoleId(roleId); + } + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + @Override + public SysDept selectDeptById(Long deptId) + { + return deptMapper.selectDeptById(deptId); + } + + /** + * 根据ID查询所有子部门(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + @Override + public int selectNormalChildrenDeptById(Long deptId) + { + return deptMapper.selectNormalChildrenDeptById(deptId); + } + + /** + * 是否存在子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + @Override + public boolean hasChildByDeptId(Long deptId) + { + int result = deptMapper.hasChildByDeptId(deptId); + return result > 0 ? true : false; + } + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 true 存在 false 不存在 + */ + @Override + public boolean checkDeptExistUser(Long deptId) + { + int result = deptMapper.checkDeptExistUser(deptId); + return result > 0 ? true : false; + } + + /** + * 校验部门名称是否唯一 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public String checkDeptNameUnique(SysDept dept) + { + Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); + SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); + if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 新增保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public int insertDept(SysDept dept) + { + SysDept info = deptMapper.selectDeptById(dept.getParentId()); + // 如果父节点不为正常状态,则不允许新增子节点 + if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) + { + throw new CustomException("部门停用,不允许新增"); + } + dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); + return deptMapper.insertDept(dept); + } + + + + /** + * 修改保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public int updateDept(SysDept dept) + { + SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); + SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); + if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) + { + String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); + String oldAncestors = oldDept.getAncestors(); + dept.setAncestors(newAncestors); + updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); + } + int result = deptMapper.updateDept(dept); + if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) + { + // 如果该部门是启用状态,则启用该部门的所有上级部门 + updateParentDeptStatus(dept); + } + return result; + } + + /** + * 修改该部门的父级部门状态 + * + * @param dept 当前部门 + */ + private void updateParentDeptStatus(SysDept dept) + { + String updateBy = dept.getUpdateBy(); + dept = deptMapper.selectDeptById(dept.getDeptId()); + dept.setUpdateBy(updateBy); + deptMapper.updateDeptStatus(dept); + } + + /** + * 修改子元素关系 + * + * @param deptId 被修改的部门ID + * @param newAncestors 新的父ID集合 + * @param oldAncestors 旧的父ID集合 + */ + public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) + { + List children = deptMapper.selectChildrenDeptById(deptId); + for (SysDept child : children) + { + child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors)); + } + if (children.size() > 0) + { + deptMapper.updateDeptChildren(children); + } + } + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + @Override + public int deleteDeptById(Long deptId) + { + return deptMapper.deleteDeptById(deptId); + } + + /** + * 递归列表 + */ + private void recursionFn(List list, SysDept t) + { + // 得到子节点列表 + List childList = getChildList(list, t); + t.setChildren(childList); + for (SysDept tChild : childList) + { + if (hasChild(list, tChild)) + { + // 判断是否有子节点 + Iterator it = childList.iterator(); + while (it.hasNext()) + { + SysDept n = (SysDept) it.next(); + recursionFn(list, n); + } + } + } + } + + /** + * 得到子节点列表 + */ + private List getChildList(List list, SysDept t) + { + List tlist = new ArrayList(); + Iterator it = list.iterator(); + while (it.hasNext()) + { + SysDept n = (SysDept) it.next(); + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) + { + tlist.add(n); + } + } + return tlist; + } + + /** + * 判断是否有子节点 + */ + private boolean hasChild(List list, SysDept t) + { + return getChildList(list, t).size() > 0 ? true : false; + } + + /** + * 获取各生产部门 + */ + @Override + public List selectDeptLists(SysDept dept) { + + return deptMapper.selectDeptLists(dept); + } + @Override + public List selectAllDept(){ + return deptMapper.selectAllDept(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDictDataServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDictDataServiceImpl.java new file mode 100644 index 0000000..0f531b7 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDictDataServiceImpl.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.utils.DictUtils; +import com.ruoyi.project.system.domain.SysDictData; +import com.ruoyi.project.system.mapper.SysDictDataMapper; +import com.ruoyi.project.system.service.ISysDictDataService; + +/** + * 字典 业务层处理 + * + * @author ruoyi + */ +@Service +public class SysDictDataServiceImpl implements ISysDictDataService +{ + @Autowired + private SysDictDataMapper dictDataMapper; + + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + @Override + public List selectDictDataList(SysDictData dictData) + { + return dictDataMapper.selectDictDataList(dictData); + } + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + @Override + public String selectDictLabel(String dictType, String dictValue) + { + return dictDataMapper.selectDictLabel(dictType, dictValue); + } + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + @Override + public SysDictData selectDictDataById(Long dictCode) + { + return dictDataMapper.selectDictDataById(dictCode); + } + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + * @return 结果 + */ + public int deleteDictDataByIds(Long[] dictCodes) + { + int row = dictDataMapper.deleteDictDataByIds(dictCodes); + if (row > 0) + { + DictUtils.clearDictCache(); + } + return row; + } + + /** + * 新增保存字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + @Override + public int insertDictData(SysDictData dictData) + { + int row = dictDataMapper.insertDictData(dictData); + if (row > 0) + { + DictUtils.clearDictCache(); + } + return row; + } + + /** + * 修改保存字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + @Override + public int updateDictData(SysDictData dictData) + { + int row = dictDataMapper.updateDictData(dictData); + if (row > 0) + { + DictUtils.clearDictCache(); + } + return row; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDictTypeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDictTypeServiceImpl.java new file mode 100644 index 0000000..5026c34 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysDictTypeServiceImpl.java @@ -0,0 +1,201 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.List; +import javax.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.DictUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.system.domain.SysDictData; +import com.ruoyi.project.system.domain.SysDictType; +import com.ruoyi.project.system.mapper.SysDictDataMapper; +import com.ruoyi.project.system.mapper.SysDictTypeMapper; +import com.ruoyi.project.system.service.ISysDictTypeService; + +/** + * 字典 业务层处理 + * + * @author ruoyi + */ +@Service +public class SysDictTypeServiceImpl implements ISysDictTypeService +{ + @Autowired + private SysDictTypeMapper dictTypeMapper; + + @Autowired + private SysDictDataMapper dictDataMapper; + + /** + * 项目启动时,初始化字典到缓存 + */ + @PostConstruct + public void init() + { + List dictTypeList = dictTypeMapper.selectDictTypeAll(); + for (SysDictType dictType : dictTypeList) + { + List dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); + DictUtils.setDictCache(dictType.getDictType(), dictDatas); + } + } + + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeList(SysDictType dictType) + { + return dictTypeMapper.selectDictTypeList(dictType); + } + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeAll() + { + return dictTypeMapper.selectDictTypeAll(); + } + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + @Override + public List selectDictDataByType(String dictType) + { + List dictDatas = DictUtils.getDictCache(dictType); + if (StringUtils.isNotNull(dictDatas)) + { + return dictDatas; + } + dictDatas = dictDataMapper.selectDictDataByType(dictType); + if (StringUtils.isNotNull(dictDatas)) + { + DictUtils.setDictCache(dictType, dictDatas); + return dictDatas; + } + return null; + } + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + @Override + public SysDictType selectDictTypeById(Long dictId) + { + return dictTypeMapper.selectDictTypeById(dictId); + } + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + public SysDictType selectDictTypeByType(String dictType) + { + return dictTypeMapper.selectDictTypeByType(dictType); + } + + /** + * 批量删除字典类型信息 + * + * @param dictIds 需要删除的字典ID + * @return 结果 + */ + public int deleteDictTypeByIds(Long[] dictIds) + { + for (Long dictId : dictIds) + { + SysDictType dictType = selectDictTypeById(dictId); + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) + { + throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); + } + } + int count = dictTypeMapper.deleteDictTypeByIds(dictIds); + if (count > 0) + { + DictUtils.clearDictCache(); + } + return count; + } + + /** + * 清空缓存数据 + */ + public void clearCache() + { + DictUtils.clearDictCache(); + } + + /** + * 新增保存字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + @Override + public int insertDictType(SysDictType dictType) + { + int row = dictTypeMapper.insertDictType(dictType); + if (row > 0) + { + DictUtils.clearDictCache(); + } + return row; + } + + /** + * 修改保存字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + @Override + @Transactional + public int updateDictType(SysDictType dictType) + { + SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId()); + dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType()); + int row = dictTypeMapper.updateDictType(dictType); + if (row > 0) + { + DictUtils.clearDictCache(); + } + return row; + } + + /** + * 校验字典类型称是否唯一 + * + * @param dict 字典类型 + * @return 结果 + */ + @Override + public String checkDictTypeUnique(SysDictType dict) + { + Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); + SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); + if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysMenuServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysMenuServiceImpl.java new file mode 100644 index 0000000..c3d25df --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,444 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.TreeSelect; +import com.ruoyi.project.system.domain.SysMenu; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.domain.vo.MetaVo; +import com.ruoyi.project.system.domain.vo.RouterVo; +import com.ruoyi.project.system.mapper.SysMenuMapper; +import com.ruoyi.project.system.mapper.SysRoleMenuMapper; +import com.ruoyi.project.system.service.ISysMenuService; + +/** + * 菜单 业务层处理 + * + * @author ruoyi + */ +@Service +public class SysMenuServiceImpl implements ISysMenuService +{ + public static final String PREMISSION_STRING = "perms[\"{0}\"]"; + + @Autowired + private SysMenuMapper menuMapper; + + @Autowired + private SysRoleMenuMapper roleMenuMapper; + + /** + * 根据用户查询系统菜单列表 + * + * @param userId 用户ID + * @return 菜单列表 + */ + @Override + public List selectMenuList(Long userId) + { + return selectMenuList(new SysMenu(), userId); + } + + /** + * 查询系统菜单列表 + * + * @param menu 菜单信息 + * @return 菜单列表 + */ + @Override + public List selectMenuList(SysMenu menu, Long userId) + { + List menuList = null; + // 管理员显示所有菜单信息 + if (SysUser.isAdmin(userId)) + { + menuList = menuMapper.selectMenuList(menu); + } + else + { + menu.getParams().put("userId", userId); + menuList = menuMapper.selectMenuListByUserId(menu); + } + return menuList; + } + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + @Override + public Set selectMenuPermsByUserId(Long userId) + { + List perms = menuMapper.selectMenuPermsByUserId(userId); + Set permsSet = new HashSet<>(); + for (String perm : perms) + { + if (StringUtils.isNotEmpty(perm)) + { + permsSet.addAll(Arrays.asList(perm.trim().split(","))); + } + } + return permsSet; + } + + /** + * 根据用户ID查询菜单 + * + * @param userId 用户名称 + * @return 菜单列表 + */ + @Override + public List selectMenuTreeByUserId(Long userId) + { + List menus = null; + if (SecurityUtils.isAdmin(userId)) + { + menus = menuMapper.selectMenuTreeAll(); + } + else + { + menus = menuMapper.selectMenuTreeByUserId(userId); + } + return getChildPerms(menus, 0); + } + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @return 选中菜单列表 + */ + public List selectMenuListByRoleId(Long roleId) + { + return menuMapper.selectMenuListByRoleId(roleId); + } + + /** + * 构建前端路由所需要的菜单 + * + * @param menus 菜单列表 + * @return 路由列表 + */ + @Override + public List buildMenus(List menus) + { + List routers = new LinkedList(); + for (SysMenu menu : menus) + { + RouterVo router = new RouterVo(); + router.setHidden("1".equals(menu.getVisible())); + router.setName(getRouteName(menu)); + router.setPath(getRouterPath(menu)); + router.setComponent(getComponent(menu)); + router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); + List cMenus = menu.getChildren(); + if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) + { + router.setAlwaysShow(true); + router.setRedirect("noRedirect"); + router.setChildren(buildMenus(cMenus)); + } + else if (isMeunFrame(menu)) + { + List childrenList = new ArrayList(); + RouterVo children = new RouterVo(); + children.setPath(menu.getPath()); + children.setComponent(menu.getComponent()); + children.setName(StringUtils.capitalize(menu.getPath())); + children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); + childrenList.add(children); + router.setChildren(childrenList); + } + routers.add(router); + } + return routers; + } + + /** + * 构建前端所需要树结构 + * + * @param menus 菜单列表 + * @return 树结构列表 + */ + @Override + public List buildMenuTree(List menus) + { + List returnList = new ArrayList(); + for (Iterator iterator = menus.iterator(); iterator.hasNext();) + { + SysMenu t = (SysMenu) iterator.next(); + // 根据传入的某个父节点ID,遍历该父节点的所有子节点 + if (t.getParentId() == 0) + { + recursionFn(menus, t); + returnList.add(t); + } + } + if (returnList.isEmpty()) + { + returnList = menus; + } + return returnList; + } + + /** + * 构建前端所需要下拉树结构 + * + * @param menus 菜单列表 + * @return 下拉树结构列表 + */ + @Override + public List buildMenuTreeSelect(List menus) + { + List menuTrees = buildMenuTree(menus); + return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + @Override + public SysMenu selectMenuById(Long menuId) + { + return menuMapper.selectMenuById(menuId); + } + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public boolean hasChildByMenuId(Long menuId) + { + int result = menuMapper.hasChildByMenuId(menuId); + return result > 0 ? true : false; + } + + /** + * 查询菜单使用数量 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public boolean checkMenuExistRole(Long menuId) + { + int result = roleMenuMapper.checkMenuExistRole(menuId); + return result > 0 ? true : false; + } + + /** + * 新增保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + @Override + public int insertMenu(SysMenu menu) + { + return menuMapper.insertMenu(menu); + } + + /** + * 修改保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + @Override + public int updateMenu(SysMenu menu) + { + return menuMapper.updateMenu(menu); + } + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public int deleteMenuById(Long menuId) + { + return menuMapper.deleteMenuById(menuId); + } + + /** + * 校验菜单名称是否唯一 + * + * @param menu 菜单信息 + * @return 结果 + */ + @Override + public String checkMenuNameUnique(SysMenu menu) + { + Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); + SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); + if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 获取路由名称 + * + * @param menu 菜单信息 + * @return 路由名称 + */ + public String getRouteName(SysMenu menu) + { + String routerName = StringUtils.capitalize(menu.getPath()); + // 非外链并且是一级目录(类型为目录) + if (isMeunFrame(menu)) + { + routerName = StringUtils.EMPTY; + } + return routerName; + } + + /** + * 获取路由地址 + * + * @param menu 菜单信息 + * @return 路由地址 + */ + public String getRouterPath(SysMenu menu) + { + String routerPath = menu.getPath(); + // 非外链并且是一级目录(类型为目录) + if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) + && UserConstants.NO_FRAME.equals(menu.getIsFrame())) + { + routerPath = "/" + menu.getPath(); + } + // 非外链并且是一级目录(类型为菜单) + else if (isMeunFrame(menu)) + { + routerPath = "/"; + } + return routerPath; + } + + /** + * 获取组件信息 + * + * @param menu 菜单信息 + * @return 组件信息 + */ + public String getComponent(SysMenu menu) + { + String component = UserConstants.LAYOUT; + if (StringUtils.isNotEmpty(menu.getComponent()) && !isMeunFrame(menu)) + { + component = menu.getComponent(); + } + return component; + } + + /** + * 是否为菜单内部跳转 + * + * @param menu 菜单信息 + * @return 结果 + */ + public boolean isMeunFrame(SysMenu menu) + { + return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) + && menu.getIsFrame().equals(UserConstants.NO_FRAME); + } + + /** + * 根据父节点的ID获取所有子节点 + * + * @param list 分类表 + * @param parentId 传入的父节点ID + * @return String + */ + public List getChildPerms(List list, int parentId) + { + List returnList = new ArrayList(); + for (Iterator iterator = list.iterator(); iterator.hasNext();) + { + SysMenu t = (SysMenu) iterator.next(); + // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 + if (t.getParentId() == parentId) + { + recursionFn(list, t); + returnList.add(t); + } + } + return returnList; + } + + /** + * 递归列表 + * + * @param list + * @param t + */ + private void recursionFn(List list, SysMenu t) + { + // 得到子节点列表 + List childList = getChildList(list, t); + t.setChildren(childList); + for (SysMenu tChild : childList) + { + if (hasChild(list, tChild)) + { + // 判断是否有子节点 + Iterator it = childList.iterator(); + while (it.hasNext()) + { + SysMenu n = (SysMenu) it.next(); + recursionFn(list, n); + } + } + } + } + + /** + * 得到子节点列表 + */ + private List getChildList(List list, SysMenu t) + { + List tlist = new ArrayList(); + Iterator it = list.iterator(); + while (it.hasNext()) + { + SysMenu n = (SysMenu) it.next(); + if (n.getParentId().longValue() == t.getMenuId().longValue()) + { + tlist.add(n); + } + } + return tlist; + } + + /** + * 判断是否有子节点 + */ + private boolean hasChild(List list, SysMenu t) + { + return getChildList(list, t).size() > 0 ? true : false; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java new file mode 100644 index 0000000..f607b4f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java @@ -0,0 +1,91 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.project.system.domain.SysNotice; +import com.ruoyi.project.system.mapper.SysNoticeMapper; +import com.ruoyi.project.system.service.ISysNoticeService; + +/** + * 公告 服务层实现 + * + * @author ruoyi + */ +@Service +public class SysNoticeServiceImpl implements ISysNoticeService +{ + @Autowired + private SysNoticeMapper noticeMapper; + + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + @Override + public SysNotice selectNoticeById(Long noticeId) + { + return noticeMapper.selectNoticeById(noticeId); + } + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + @Override + public List selectNoticeList(SysNotice notice) + { + return noticeMapper.selectNoticeList(notice); + } + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int insertNotice(SysNotice notice) + { + return noticeMapper.insertNotice(notice); + } + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int updateNotice(SysNotice notice) + { + return noticeMapper.updateNotice(notice); + } + + /** + * 删除公告对象 + * + * @param noticeId 公告ID + * @return 结果 + */ + @Override + public int deleteNoticeById(Long noticeId) + { + return noticeMapper.deleteNoticeById(noticeId); + } + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + public int deleteNoticeByIds(Long[] noticeIds) + { + return noticeMapper.deleteNoticeByIds(noticeIds); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysPostServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysPostServiceImpl.java new file mode 100644 index 0000000..d422502 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysPostServiceImpl.java @@ -0,0 +1,182 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.system.domain.SysPost; +import com.ruoyi.project.system.mapper.SysPostMapper; +import com.ruoyi.project.system.mapper.SysUserPostMapper; +import com.ruoyi.project.system.service.ISysPostService; + +/** + * 岗位信息 服务层处理 + * + * @author ruoyi + */ +@Service +public class SysPostServiceImpl implements ISysPostService +{ + @Autowired + private SysPostMapper postMapper; + + @Autowired + private SysUserPostMapper userPostMapper; + + /** + * 查询岗位信息集合 + * + * @param post 岗位信息 + * @return 岗位信息集合 + */ + @Override + public List selectPostList(SysPost post) + { + return postMapper.selectPostList(post); + } + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + @Override + public List selectPostAll() + { + return postMapper.selectPostAll(); + } + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + @Override + public SysPost selectPostById(Long postId) + { + return postMapper.selectPostById(postId); + } + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + public List selectPostListByUserId(Long userId) + { + return postMapper.selectPostListByUserId(userId); + } + + /** + * 校验岗位名称是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public String checkPostNameUnique(SysPost post) + { + Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); + SysPost info = postMapper.checkPostNameUnique(post.getPostName()); + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验岗位编码是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public String checkPostCodeUnique(SysPost post) + { + Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); + SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public int countUserPostById(Long postId) + { + return userPostMapper.countUserPostById(postId); + } + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public int deletePostById(Long postId) + { + return postMapper.deletePostById(postId); + } + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + * @throws Exception 异常 + */ + public int deletePostByIds(Long[] postIds) + { + for (Long postId : postIds) + { + SysPost post = selectPostById(postId); + if (countUserPostById(postId) > 0) + { + throw new CustomException(String.format("%1$s已分配,不能删除", post.getPostName())); + } + } + return postMapper.deletePostByIds(postIds); + } + + /** + * 新增保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public int insertPost(SysPost post) + { + return postMapper.insertPost(post); + } + + /** + * 修改保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public int updatePost(SysPost post) + { + return postMapper.updatePost(post); + } + @Override + public List queryPostListByUserId(Long userId) + { + return postMapper.queryPostListByUserId(userId); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysRoleServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..6501949 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,312 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.DataScope; +import com.ruoyi.project.system.domain.SysRole; +import com.ruoyi.project.system.domain.SysRoleDept; +import com.ruoyi.project.system.domain.SysRoleMenu; +import com.ruoyi.project.system.mapper.SysRoleDeptMapper; +import com.ruoyi.project.system.mapper.SysRoleMapper; +import com.ruoyi.project.system.mapper.SysRoleMenuMapper; +import com.ruoyi.project.system.mapper.SysUserRoleMapper; +import com.ruoyi.project.system.service.ISysRoleService; + +/** + * 角色 业务层处理 + * + * @author ruoyi + */ +@Service +public class SysRoleServiceImpl implements ISysRoleService +{ + @Autowired + private SysRoleMapper roleMapper; + + @Autowired + private SysRoleMenuMapper roleMenuMapper; + + @Autowired + private SysUserRoleMapper userRoleMapper; + + @Autowired + private SysRoleDeptMapper roleDeptMapper; + + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + @Override + @DataScope(deptAlias = "d") + public List selectRoleList(SysRole role) + { + return roleMapper.selectRoleList(role); + } + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + @Override + public Set selectRolePermissionByUserId(Long userId) + { + List perms = roleMapper.selectRolePermissionByUserId(userId); + Set permsSet = new HashSet<>(); + for (SysRole perm : perms) + { + if (StringUtils.isNotNull(perm)) + { + permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); + } + } + return permsSet; + } + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + public List selectRoleAll() + { + return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); + } + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + public List selectRoleListByUserId(Long userId) + { + return roleMapper.selectRoleListByUserId(userId); + } + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + public SysRole selectRoleById(Long roleId) + { + return roleMapper.selectRoleById(roleId); + } + + /** + * 校验角色名称是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public String checkRoleNameUnique(SysRole role) + { + Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); + SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); + if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验角色权限是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public String checkRoleKeyUnique(SysRole role) + { + Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); + SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); + if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验角色是否允许操作 + * + * @param role 角色信息 + */ + public void checkRoleAllowed(SysRole role) + { + if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) + { + throw new CustomException("不允许操作超级管理员角色"); + } + } + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + public int countUserRoleByRoleId(Long roleId) + { + return userRoleMapper.countUserRoleByRoleId(roleId); + } + + /** + * 新增保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional + public int insertRole(SysRole role) + { + // 新增角色信息 + roleMapper.insertRole(role); + return insertRoleMenu(role); + } + + /** + * 修改保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional + public int updateRole(SysRole role) + { + // 修改角色信息 + roleMapper.updateRole(role); + // 删除角色与菜单关联 + roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); + return insertRoleMenu(role); + } + + /** + * 修改角色状态 + * + * @param role 角色信息 + * @return 结果 + */ + public int updateRoleStatus(SysRole role) + { + return roleMapper.updateRole(role); + } + + /** + * 修改数据权限信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional + public int authDataScope(SysRole role) + { + // 修改角色信息 + roleMapper.updateRole(role); + // 删除角色与部门关联 + roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); + // 新增角色和部门信息(数据权限) + return insertRoleDept(role); + } + + /** + * 新增角色菜单信息 + * + * @param role 角色对象 + */ + public int insertRoleMenu(SysRole role) + { + int rows = 1; + // 新增用户与角色管理 + List list = new ArrayList(); + for (Long menuId : role.getMenuIds()) + { + SysRoleMenu rm = new SysRoleMenu(); + rm.setRoleId(role.getRoleId()); + rm.setMenuId(menuId); + list.add(rm); + } + if (list.size() > 0) + { + rows = roleMenuMapper.batchRoleMenu(list); + } + return rows; + } + + /** + * 新增角色部门信息(数据权限) + * + * @param role 角色对象 + */ + public int insertRoleDept(SysRole role) + { + int rows = 1; + // 新增角色与部门(数据权限)管理 + List list = new ArrayList(); + for (Long deptId : role.getDeptIds()) + { + SysRoleDept rd = new SysRoleDept(); + rd.setRoleId(role.getRoleId()); + rd.setDeptId(deptId); + list.add(rd); + } + if (list.size() > 0) + { + rows = roleDeptMapper.batchRoleDept(list); + } + return rows; + } + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + public int deleteRoleById(Long roleId) + { + return roleMapper.deleteRoleById(roleId); + } + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + public int deleteRoleByIds(Long[] roleIds) + { + for (Long roleId : roleIds) + { + checkRoleAllowed(new SysRole(roleId)); + SysRole role = selectRoleById(roleId); + if (countUserRoleByRoleId(roleId) > 0) + { + throw new CustomException(String.format("%1$s已分配,不能删除", role.getRoleName())); + } + } + return roleMapper.deleteRoleByIds(roleIds); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysUserOnlineServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysUserOnlineServiceImpl.java new file mode 100644 index 0000000..261e7f1 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysUserOnlineServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.project.system.service.impl; + +import org.springframework.stereotype.Service; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.project.monitor.domain.SysUserOnline; +import com.ruoyi.project.system.service.ISysUserOnlineService; + +/** + * 在线用户 服务层处理 + * + * @author ruoyi + */ +@Service +public class SysUserOnlineServiceImpl implements ISysUserOnlineService +{ + /** + * 通过登录地址查询信息 + * + * @param ipaddr 登录地址 + * @param user 用户信息 + * @return 在线用户信息 + */ + @Override + public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) + { + if (StringUtils.equals(ipaddr, user.getIpaddr())) + { + return loginUserToUserOnline(user); + } + return null; + } + + /** + * 通过用户名称查询信息 + * + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + @Override + public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) + { + if (StringUtils.equals(userName, user.getUsername())) + { + return loginUserToUserOnline(user); + } + return null; + } + + /** + * 通过登录地址/用户名称查询信息 + * + * @param ipaddr 登录地址 + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + @Override + public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) + { + if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) + { + return loginUserToUserOnline(user); + } + return null; + } + + /** + * 设置在线用户信息 + * + * @param user 用户信息 + * @return 在线用户 + */ + public SysUserOnline loginUserToUserOnline(LoginUser user) + { + if (StringUtils.isNull(user) && StringUtils.isNull(user.getUser())) + { + return null; + } + SysUserOnline sysUserOnline = new SysUserOnline(); + sysUserOnline.setTokenId(user.getToken()); + sysUserOnline.setUserName(user.getUsername()); + sysUserOnline.setIpaddr(user.getIpaddr()); + sysUserOnline.setLoginLocation(user.getLoginLocation()); + sysUserOnline.setBrowser(user.getBrowser()); + sysUserOnline.setOs(user.getOs()); + sysUserOnline.setLoginTime(user.getLoginTime()); + if (StringUtils.isNotNull(user.getUser().getDept())) + { + sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); + } + return sysUserOnline; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/system/service/impl/SysUserServiceImpl.java b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..8a67b97 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/system/service/impl/SysUserServiceImpl.java @@ -0,0 +1,461 @@ +package com.ruoyi.project.system.service.impl; + +import java.util.ArrayList; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.aspectj.lang.annotation.DataScope; +import com.ruoyi.project.system.domain.SysPost; +import com.ruoyi.project.system.domain.SysRole; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.domain.SysUserPost; +import com.ruoyi.project.system.domain.SysUserRole; +import com.ruoyi.project.system.mapper.SysPostMapper; +import com.ruoyi.project.system.mapper.SysRoleMapper; +import com.ruoyi.project.system.mapper.SysUserMapper; +import com.ruoyi.project.system.mapper.SysUserPostMapper; +import com.ruoyi.project.system.mapper.SysUserRoleMapper; +import com.ruoyi.project.system.service.ISysConfigService; +import com.ruoyi.project.system.service.ISysUserService; + +/** + * 用户 业务层处理 + * + * @author ruoyi + */ +@Service +public class SysUserServiceImpl implements ISysUserService +{ + private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); + + @Autowired + private SysUserMapper userMapper; + + @Autowired + private SysRoleMapper roleMapper; + + @Autowired + private SysPostMapper postMapper; + + @Autowired + private SysUserRoleMapper userRoleMapper; + + @Autowired + private SysUserPostMapper userPostMapper; + + @Autowired + private ISysConfigService configService; + + /** + * 根据条件分页查询用户列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + public List selectUserList(SysUser user) + { + return userMapper.selectUserList(user); + } + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + @Override + public SysUser selectUserByUserName(String userName) + { + return userMapper.selectUserByUserName(userName); + } + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + @Override + public SysUser selectUserById(Long userId) + { + return userMapper.selectUserById(userId); + } + + /** + * 查询用户所属角色组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserRoleGroup(String userName) + { + List list = roleMapper.selectRolesByUserName(userName); + StringBuffer idsStr = new StringBuffer(); + for (SysRole role : list) + { + idsStr.append(role.getRoleName()).append(","); + } + if (StringUtils.isNotEmpty(idsStr.toString())) + { + return idsStr.substring(0, idsStr.length() - 1); + } + return idsStr.toString(); + } + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserPostGroup(String userName) + { + List list = postMapper.selectPostsByUserName(userName); + StringBuffer idsStr = new StringBuffer(); + for (SysPost post : list) + { + idsStr.append(post.getPostName()).append(","); + } + if (StringUtils.isNotEmpty(idsStr.toString())) + { + return idsStr.substring(0, idsStr.length() - 1); + } + return idsStr.toString(); + } + + /** + * 校验用户名称是否唯一 + * + * @param userName 用户名称 + * @return 结果 + */ + @Override + public String checkUserNameUnique(String userName) + { + int count = userMapper.checkUserNameUnique(userName); + if (count > 0) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验用户名称是否唯一 + * + * @param user 用户信息 + * @return + */ + @Override + public String checkPhoneUnique(SysUser user) + { + Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); + SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验email是否唯一 + * + * @param user 用户信息 + * @return + */ + @Override + public String checkEmailUnique(SysUser user) + { + Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); + SysUser info = userMapper.checkEmailUnique(user.getEmail()); + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验用户是否允许操作 + * + * @param user 用户信息 + */ + public void checkUserAllowed(SysUser user) + { + if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) + { + throw new CustomException("不允许操作超级管理员用户"); + } + } + + /** + * 新增保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional + public int insertUser(SysUser user) + { + // 新增用户信息 + int rows = userMapper.insertUser(user); + // 新增用户岗位关联 + insertUserPost(user); + // 新增用户与角色管理 + insertUserRole(user); + return rows; + } + + /** + * 修改保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional + public int updateUser(SysUser user) + { + Long userId = user.getUserId(); + // 删除用户与角色关联 + userRoleMapper.deleteUserRoleByUserId(userId); + // 新增用户与角色管理 + insertUserRole(user); + // 删除用户与岗位关联 + userPostMapper.deleteUserPostByUserId(userId); + // 新增用户与岗位管理 + insertUserPost(user); + return userMapper.updateUser(user); + } + + /** + * 修改用户状态 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int updateUserStatus(SysUser user) + { + return userMapper.updateUser(user); + } + + /** + * 修改用户基本信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int updateUserProfile(SysUser user) + { + return userMapper.updateUser(user); + } + + /** + * 修改用户头像 + * + * @param userId 用户ID + * @param avatar 头像地址 + * @return 结果 + */ + public boolean updateUserAvatar(String userName, String avatar) + { + return userMapper.updateUserAvatar(userName, avatar) > 0; + } + + /** + * 重置用户密码 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int resetPwd(SysUser user) + { + return userMapper.updateUser(user); + } + + /** + * 重置用户密码 + * + * @param userName 用户名 + * @param password 密码 + * @return 结果 + */ + @Override + public int resetUserPwd(String userName, String password) + { + return userMapper.resetUserPwd(userName, password); + } + + /** + * 新增用户角色信息 + * + * @param user 用户对象 + */ + public void insertUserRole(SysUser user) + { + Long[] roles = user.getRoleIds(); + if (StringUtils.isNotNull(roles)) + { + // 新增用户与角色管理 + List list = new ArrayList(); + for (Long roleId : roles) + { + SysUserRole ur = new SysUserRole(); + ur.setUserId(user.getUserId()); + ur.setRoleId(roleId); + list.add(ur); + } + if (list.size() > 0) + { + userRoleMapper.batchUserRole(list); + } + } + } + + /** + * 新增用户岗位信息 + * + * @param user 用户对象 + */ + public void insertUserPost(SysUser user) + { + Long[] posts = user.getPostIds(); + if (StringUtils.isNotNull(posts)) + { + // 新增用户与岗位管理 + List list = new ArrayList(); + for (Long postId : posts) + { + SysUserPost up = new SysUserPost(); + up.setUserId(user.getUserId()); + up.setPostId(postId); + list.add(up); + } + if (list.size() > 0) + { + userPostMapper.batchUserPost(list); + } + } + } + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + @Override + public int deleteUserById(Long userId) + { + // 删除用户与角色关联 + userRoleMapper.deleteUserRoleByUserId(userId); + // 删除用户与岗位表 + userPostMapper.deleteUserPostByUserId(userId); + return userMapper.deleteUserById(userId); + } + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + public int deleteUserByIds(Long[] userIds) + { + for (Long userId : userIds) + { + checkUserAllowed(new SysUser(userId)); + } + return userMapper.deleteUserByIds(userIds); + } + + /** + * 导入用户数据 + * + * @param userList 用户数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + @Override + public String importUser(List userList, Boolean isUpdateSupport, String operName) + { + if (StringUtils.isNull(userList) || userList.size() == 0) + { + throw new CustomException("导入用户数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + String password = configService.selectConfigByKey("sys.user.initPassword"); + for (SysUser user : userList) + { + try + { + // 验证是否存在这个用户 + SysUser u = userMapper.selectUserByUserName(user.getUserName()); + if (StringUtils.isNull(u)) + { + user.setPassword(SecurityUtils.encryptPassword(password)); + user.setCreateBy(operName); + this.insertUser(user); + successNum++; + successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 导入成功"); + } + else if (isUpdateSupport) + { + user.setUpdateBy(operName); + this.updateUser(user); + successNum++; + successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 更新成功"); + } + else + { + failureNum++; + failureMsg.append("
" + failureNum + "、账号 " + user.getUserName() + " 已存在"); + } + } + catch (Exception e) + { + failureNum++; + String msg = "
" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; + failureMsg.append(msg + e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) + { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new CustomException(failureMsg.toString()); + } + else + { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + @Override + public List queryUsersList() + { + return userMapper.queryUsersList(); + } + +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java b/evo/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java new file mode 100644 index 0000000..10d7d65 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java @@ -0,0 +1,186 @@ +package com.ruoyi.project.tool.gen.controller; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.tool.gen.domain.GenTable; +import com.ruoyi.project.tool.gen.domain.GenTableColumn; +import com.ruoyi.project.tool.gen.service.IGenTableColumnService; +import com.ruoyi.project.tool.gen.service.IGenTableService; + +/** + * 代码生成 操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/tool/gen") +public class GenController extends BaseController +{ + @Autowired + private IGenTableService genTableService; + + @Autowired + private IGenTableColumnService genTableColumnService; + + /** + * 查询代码生成列表 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @GetMapping("/list") + public TableDataInfo genList(GenTable genTable) + { + startPage(); + List list = genTableService.selectGenTableList(genTable); + return getDataTable(list); + } + + /** + * 修改代码生成业务 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:query')") + @GetMapping(value = "/{talbleId}") + public AjaxResult getInfo(@PathVariable Long talbleId) + { + GenTable table = genTableService.selectGenTableById(talbleId); + List list = genTableColumnService.selectGenTableColumnListByTableId(talbleId); + Map map = new HashMap(); + map.put("info", table); + map.put("rows", list); + return AjaxResult.success(map); + } + + /** + * 查询数据库列表 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @GetMapping("/db/list") + public TableDataInfo dataList(GenTable genTable) + { + startPage(); + List list = genTableService.selectDbTableList(genTable); + return getDataTable(list); + } + + /** + * 查询数据表字段列表 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @GetMapping(value = "/column/{talbleId}") + public TableDataInfo columnList(Long tableId) + { + TableDataInfo dataInfo = new TableDataInfo(); + List list = genTableColumnService.selectGenTableColumnListByTableId(tableId); + dataInfo.setRows(list); + dataInfo.setTotal(list.size()); + return dataInfo; + } + + /** + * 导入表结构(保存) + */ + @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @Log(title = "代码生成", businessType = BusinessType.IMPORT) + @PostMapping("/importTable") + public AjaxResult importTableSave(String tables) + { + String[] tableNames = Convert.toStrArray(tables); + // 查询表信息 + List tableList = genTableService.selectDbTableListByNames(tableNames); + genTableService.importGenTable(tableList); + return AjaxResult.success(); + } + + /** + * 修改保存代码生成业务 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:edit')") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editSave(@Validated @RequestBody GenTable genTable) + { + genTableService.validateEdit(genTable); + genTableService.updateGenTable(genTable); + return AjaxResult.success(); + } + + /** + * 删除代码生成 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:remove')") + @Log(title = "代码生成", businessType = BusinessType.DELETE) + @DeleteMapping("/{tableIds}") + public AjaxResult remove(@PathVariable Long[] tableIds) + { + genTableService.deleteGenTableByIds(tableIds); + return AjaxResult.success(); + } + + /** + * 预览代码 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:preview')") + @GetMapping("/preview/{tableId}") + public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException + { + Map dataMap = genTableService.previewCode(tableId); + return AjaxResult.success(dataMap); + } + + /** + * 生成代码 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/genCode/{tableName}") + public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException + { + byte[] data = genTableService.generatorCode(tableName); + genCode(response, data); + } + + /** + * 批量生成代码 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/batchGenCode") + public void batchGenCode(HttpServletResponse response, String tables) throws IOException + { + String[] tableNames = Convert.toStrArray(tables); + byte[] data = genTableService.generatorCode(tableNames); + genCode(response, data); + } + + /** + * 生成zip文件 + */ + private void genCode(HttpServletResponse response, byte[] data) throws IOException + { + response.reset(); + response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\""); + response.addHeader("Content-Length", "" + data.length); + response.setContentType("application/octet-stream; charset=UTF-8"); + IOUtils.write(data, response.getOutputStream()); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/domain/GenTable.java b/evo/src/main/java/com/ruoyi/project/tool/gen/domain/GenTable.java new file mode 100644 index 0000000..d24014b --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/domain/GenTable.java @@ -0,0 +1,271 @@ +package com.ruoyi.project.tool.gen.domain; + +import java.util.List; +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import org.apache.commons.lang3.ArrayUtils; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 业务表 gen_table + * + * @author ruoyi + */ +public class GenTable extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long tableId; + + /** 表名称 */ + @NotBlank(message = "表名称不能为空") + private String tableName; + + /** 表描述 */ + @NotBlank(message = "表描述不能为空") + private String tableComment; + + /** 实体类名称(首字母大写) */ + @NotBlank(message = "实体类名称不能为空") + private String className; + + /** 使用的模板(crud单表操作 tree树表操作) */ + private String tplCategory; + + /** 生成包路径 */ + @NotBlank(message = "生成包路径不能为空") + private String packageName; + + /** 生成模块名 */ + @NotBlank(message = "生成模块名不能为空") + private String moduleName; + + /** 生成业务名 */ + @NotBlank(message = "生成业务名不能为空") + private String businessName; + + /** 生成功能名 */ + @NotBlank(message = "生成功能名不能为空") + private String functionName; + + /** 生成作者 */ + @NotBlank(message = "作者不能为空") + private String functionAuthor; + + /** 主键信息 */ + private GenTableColumn pkColumn; + + /** 表列信息 */ + @Valid + private List columns; + + /** 其它生成选项 */ + private String options; + + /** 树编码字段 */ + private String treeCode; + + /** 树父编码字段 */ + private String treeParentCode; + + /** 树名称字段 */ + private String treeName; + + public Long getTableId() + { + return tableId; + } + + public void setTableId(Long tableId) + { + this.tableId = tableId; + } + + public String getTableName() + { + return tableName; + } + + public void setTableName(String tableName) + { + this.tableName = tableName; + } + + public String getTableComment() + { + return tableComment; + } + + public void setTableComment(String tableComment) + { + this.tableComment = tableComment; + } + + public String getClassName() + { + return className; + } + + public void setClassName(String className) + { + this.className = className; + } + + public String getTplCategory() + { + return tplCategory; + } + + public void setTplCategory(String tplCategory) + { + this.tplCategory = tplCategory; + } + + public String getPackageName() + { + return packageName; + } + + public void setPackageName(String packageName) + { + this.packageName = packageName; + } + + public String getModuleName() + { + return moduleName; + } + + public void setModuleName(String moduleName) + { + this.moduleName = moduleName; + } + + public String getBusinessName() + { + return businessName; + } + + public void setBusinessName(String businessName) + { + this.businessName = businessName; + } + + public String getFunctionName() + { + return functionName; + } + + public void setFunctionName(String functionName) + { + this.functionName = functionName; + } + + public String getFunctionAuthor() + { + return functionAuthor; + } + + public void setFunctionAuthor(String functionAuthor) + { + this.functionAuthor = functionAuthor; + } + + public GenTableColumn getPkColumn() + { + return pkColumn; + } + + public void setPkColumn(GenTableColumn pkColumn) + { + this.pkColumn = pkColumn; + } + + public List getColumns() + { + return columns; + } + + public void setColumns(List columns) + { + this.columns = columns; + } + + public String getOptions() + { + return options; + } + + public void setOptions(String options) + { + this.options = options; + } + + public String getTreeCode() + { + return treeCode; + } + + public void setTreeCode(String treeCode) + { + this.treeCode = treeCode; + } + + public String getTreeParentCode() + { + return treeParentCode; + } + + public void setTreeParentCode(String treeParentCode) + { + this.treeParentCode = treeParentCode; + } + + public String getTreeName() + { + return treeName; + } + + public void setTreeName(String treeName) + { + this.treeName = treeName; + } + + public boolean isTree() + { + return isTree(this.tplCategory); + } + + public static boolean isTree(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory); + } + + public boolean isCrud() + { + return isCrud(this.tplCategory); + } + + public static boolean isCrud(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory); + } + + public boolean isSuperColumn(String javaField) + { + return isSuperColumn(this.tplCategory, javaField); + } + + public static boolean isSuperColumn(String tplCategory, String javaField) + { + if (isTree(tplCategory)) + { + return StringUtils.equalsAnyIgnoreCase(javaField, + ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY)); + } + return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/domain/GenTableColumn.java b/evo/src/main/java/com/ruoyi/project/tool/gen/domain/GenTableColumn.java new file mode 100644 index 0000000..b73f28c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/domain/GenTableColumn.java @@ -0,0 +1,368 @@ +package com.ruoyi.project.tool.gen.domain; + +import javax.validation.constraints.NotBlank; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.BaseEntity; + +/** + * 代码生成业务字段表 gen_table_column + * + * @author ruoyi + */ +public class GenTableColumn extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long columnId; + + /** 归属表编号 */ + private Long tableId; + + /** 列名称 */ + private String columnName; + + /** 列描述 */ + private String columnComment; + + /** 列类型 */ + private String columnType; + + /** JAVA类型 */ + private String javaType; + + /** JAVA字段名 */ + @NotBlank(message = "Java属性不能为空") + private String javaField; + + /** 是否主键(1是) */ + private String isPk; + + /** 是否自增(1是) */ + private String isIncrement; + + /** 是否必填(1是) */ + private String isRequired; + + /** 是否为插入字段(1是) */ + private String isInsert; + + /** 是否编辑字段(1是) */ + private String isEdit; + + /** 是否列表字段(1是) */ + private String isList; + + /** 是否查询字段(1是) */ + private String isQuery; + + /** 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) */ + private String queryType; + + /** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件) */ + private String htmlType; + + /** 字典类型 */ + private String dictType; + + /** 排序 */ + private Integer sort; + + public void setColumnId(Long columnId) + { + this.columnId = columnId; + } + + public Long getColumnId() + { + return columnId; + } + + public void setTableId(Long tableId) + { + this.tableId = tableId; + } + + public Long getTableId() + { + return tableId; + } + + public void setColumnName(String columnName) + { + this.columnName = columnName; + } + + public String getColumnName() + { + return columnName; + } + + public void setColumnComment(String columnComment) + { + this.columnComment = columnComment; + } + + public String getColumnComment() + { + return columnComment; + } + + public void setColumnType(String columnType) + { + this.columnType = columnType; + } + + public String getColumnType() + { + return columnType; + } + + public void setJavaType(String javaType) + { + this.javaType = javaType; + } + + public String getJavaType() + { + return javaType; + } + + public void setJavaField(String javaField) + { + this.javaField = javaField; + } + + public String getJavaField() + { + return javaField; + } + + public void setIsPk(String isPk) + { + this.isPk = isPk; + } + + public String getIsPk() + { + return isPk; + } + + public boolean isPk() + { + return isPk(this.isPk); + } + + public boolean isPk(String isPk) + { + return isPk != null && StringUtils.equals("1", isPk); + } + + public String getIsIncrement() + { + return isIncrement; + } + + public void setIsIncrement(String isIncrement) + { + this.isIncrement = isIncrement; + } + + public boolean isIncrement() + { + return isIncrement(this.isIncrement); + } + + public boolean isIncrement(String isIncrement) + { + return isIncrement != null && StringUtils.equals("1", isIncrement); + } + + public void setIsRequired(String isRequired) + { + this.isRequired = isRequired; + } + + public String getIsRequired() + { + return isRequired; + } + + public boolean isRequired() + { + return isRequired(this.isRequired); + } + + public boolean isRequired(String isRequired) + { + return isRequired != null && StringUtils.equals("1", isRequired); + } + + public void setIsInsert(String isInsert) + { + this.isInsert = isInsert; + } + + public String getIsInsert() + { + return isInsert; + } + + public boolean isInsert() + { + return isInsert(this.isInsert); + } + + public boolean isInsert(String isInsert) + { + return isInsert != null && StringUtils.equals("1", isInsert); + } + + public void setIsEdit(String isEdit) + { + this.isEdit = isEdit; + } + + public String getIsEdit() + { + return isEdit; + } + + public boolean isEdit() + { + return isInsert(this.isEdit); + } + + public boolean isEdit(String isEdit) + { + return isEdit != null && StringUtils.equals("1", isEdit); + } + + public void setIsList(String isList) + { + this.isList = isList; + } + + public String getIsList() + { + return isList; + } + + public boolean isList() + { + return isList(this.isList); + } + + public boolean isList(String isList) + { + return isList != null && StringUtils.equals("1", isList); + } + + public void setIsQuery(String isQuery) + { + this.isQuery = isQuery; + } + + public String getIsQuery() + { + return isQuery; + } + + public boolean isQuery() + { + return isQuery(this.isQuery); + } + + public boolean isQuery(String isQuery) + { + return isQuery != null && StringUtils.equals("1", isQuery); + } + + public void setQueryType(String queryType) + { + this.queryType = queryType; + } + + public String getQueryType() + { + return queryType; + } + + public String getHtmlType() + { + return htmlType; + } + + public void setHtmlType(String htmlType) + { + this.htmlType = htmlType; + } + + public void setDictType(String dictType) + { + this.dictType = dictType; + } + + public String getDictType() + { + return dictType; + } + + public void setSort(Integer sort) + { + this.sort = sort; + } + + public Integer getSort() + { + return sort; + } + + public boolean isSuperColumn() + { + return isSuperColumn(this.javaField); + } + + public static boolean isSuperColumn(String javaField) + { + return StringUtils.equalsAnyIgnoreCase(javaField, + // BaseEntity + "createBy", "createTime", "updateBy", "updateTime", "remark", + // TreeEntity + "parentName", "parentId", "orderNum", "ancestors"); + } + + public boolean isUsableColumn() + { + return isUsableColumn(javaField); + } + + public static boolean isUsableColumn(String javaField) + { + // isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单 + return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum"); + } + + public String readConverterExp() + { + String remarks = StringUtils.substringBetween(this.columnComment, "(", ")"); + StringBuffer sb = new StringBuffer(); + if (StringUtils.isNotEmpty(remarks)) + { + for (String value : remarks.split(" ")) + { + if (StringUtils.isNotEmpty(value)) + { + Object startStr = value.subSequence(0, 1); + String endStr = value.substring(1); + sb.append("").append(startStr).append("=").append(endStr).append(","); + } + } + return sb.deleteCharAt(sb.length() - 1).toString(); + } + else + { + return this.columnComment; + } + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableColumnMapper.java b/evo/src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableColumnMapper.java new file mode 100644 index 0000000..3aa09e8 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableColumnMapper.java @@ -0,0 +1,52 @@ +package com.ruoyi.project.tool.gen.mapper; + +import java.util.List; +import com.ruoyi.project.tool.gen.domain.GenTableColumn; + +/** + * 业务字段 数据层 + * + * @author ruoyi + */ +public interface GenTableColumnMapper +{ + /** + * 根据表名称查询列信息 + * + * @param tableName 表名称 + * @return 列信息 + */ + public List selectDbTableColumnsByName(String tableName); + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + public List selectGenTableColumnListByTableId(Long tableId); + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int insertGenTableColumn(GenTableColumn genTableColumn); + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int updateGenTableColumn(GenTableColumn genTableColumn); + + /** + * 批量删除业务字段 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableColumnByIds(Long[] ids); +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableMapper.java b/evo/src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableMapper.java new file mode 100644 index 0000000..a7bcf95 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/mapper/GenTableMapper.java @@ -0,0 +1,76 @@ +package com.ruoyi.project.tool.gen.mapper; + +import java.util.List; +import com.ruoyi.project.tool.gen.domain.GenTable; + +/** + * 业务 数据层 + * + * @author ruoyi + */ +public interface GenTableMapper +{ + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + public List selectGenTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + public List selectDbTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + public List selectDbTableListByNames(String[] tableNames); + + /** + * 查询表ID业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + public GenTable selectGenTableById(Long id); + + /** + * 查询表名称业务信息 + * + * @param tableName 表名称 + * @return 业务信息 + */ + public GenTable selectGenTableByName(String tableName); + + /** + * 新增业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public int insertGenTable(GenTable genTable); + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public int updateGenTable(GenTable genTable); + + /** + * 批量删除业务 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableByIds(Long[] ids); +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/service/GenTableColumnServiceImpl.java b/evo/src/main/java/com/ruoyi/project/tool/gen/service/GenTableColumnServiceImpl.java new file mode 100644 index 0000000..ee85a47 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/service/GenTableColumnServiceImpl.java @@ -0,0 +1,68 @@ +package com.ruoyi.project.tool.gen.service; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.project.tool.gen.domain.GenTableColumn; +import com.ruoyi.project.tool.gen.mapper.GenTableColumnMapper; + +/** + * 业务字段 服务层实现 + * + * @author ruoyi + */ +@Service +public class GenTableColumnServiceImpl implements IGenTableColumnService +{ + @Autowired + private GenTableColumnMapper genTableColumnMapper; + + /** + * 查询业务字段列表 + * + * @param genTableColumn 业务字段编号 + * @return 业务字段集合 + */ + @Override + public List selectGenTableColumnListByTableId(Long tableId) + { + return genTableColumnMapper.selectGenTableColumnListByTableId(tableId); + } + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + @Override + public int insertGenTableColumn(GenTableColumn genTableColumn) + { + return genTableColumnMapper.insertGenTableColumn(genTableColumn); + } + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + @Override + public int updateGenTableColumn(GenTableColumn genTableColumn) + { + return genTableColumnMapper.updateGenTableColumn(genTableColumn); + } + + /** + * 删除业务字段对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteGenTableColumnByIds(String ids) + { + return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java b/evo/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java new file mode 100644 index 0000000..85a3613 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java @@ -0,0 +1,341 @@ +package com.ruoyi.project.tool.gen.service; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.tool.gen.domain.GenTable; +import com.ruoyi.project.tool.gen.domain.GenTableColumn; +import com.ruoyi.project.tool.gen.mapper.GenTableColumnMapper; +import com.ruoyi.project.tool.gen.mapper.GenTableMapper; +import com.ruoyi.project.tool.gen.util.GenUtils; +import com.ruoyi.project.tool.gen.util.VelocityInitializer; +import com.ruoyi.project.tool.gen.util.VelocityUtils; + +/** + * 业务 服务层实现 + * + * @author ruoyi + */ +@Service +public class GenTableServiceImpl implements IGenTableService +{ + private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class); + + @Autowired + private GenTableMapper genTableMapper; + + @Autowired + private GenTableColumnMapper genTableColumnMapper; + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + @Override + public GenTable selectGenTableById(Long id) + { + GenTable genTable = genTableMapper.selectGenTableById(id); + setTableFromOptions(genTable); + return genTable; + } + + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + @Override + public List selectGenTableList(GenTable genTable) + { + return genTableMapper.selectGenTableList(genTable); + } + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + public List selectDbTableList(GenTable genTable) + { + return genTableMapper.selectDbTableList(genTable); + } + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + public List selectDbTableListByNames(String[] tableNames) + { + return genTableMapper.selectDbTableListByNames(tableNames); + } + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + @Override + @Transactional + public void updateGenTable(GenTable genTable) + { + String options = JSON.toJSONString(genTable.getParams()); + genTable.setOptions(options); + int row = genTableMapper.updateGenTable(genTable); + if (row > 0) + { + for (GenTableColumn cenTableColumn : genTable.getColumns()) + { + genTableColumnMapper.updateGenTableColumn(cenTableColumn); + } + } + } + + /** + * 删除业务对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + @Transactional + public void deleteGenTableByIds(Long[] tableIds) + { + genTableMapper.deleteGenTableByIds(tableIds); + genTableColumnMapper.deleteGenTableColumnByIds(tableIds); + } + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + @Override + @Transactional + public void importGenTable(List tableList) + { + String operName = SecurityUtils.getUsername(); + for (GenTable table : tableList) + { + try + { + String tableName = table.getTableName(); + GenUtils.initTable(table, operName); + int row = genTableMapper.insertGenTable(table); + if (row > 0) + { + // 保存列信息 + List genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + for (GenTableColumn column : genTableColumns) + { + GenUtils.initColumnField(column, table); + genTableColumnMapper.insertGenTableColumn(column); + } + } + } + catch (Exception e) + { + log.error("表名 " + table.getTableName() + " 导入失败:", e); + } + } + } + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + public Map previewCode(Long tableId) + { + Map dataMap = new LinkedHashMap<>(); + // 查询表信息 + GenTable table = genTableMapper.selectGenTableById(tableId); + // 查询列信息 + List columns = table.getColumns(); + setPkColumn(table, columns); + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) + { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + dataMap.put(template, sw.toString()); + } + return dataMap; + } + + /** + * 生成代码 + * + * @param tableName 表名称 + * @return 数据 + */ + @Override + public byte[] generatorCode(String tableName) + { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + generatorCode(tableName, zip); + IOUtils.closeQuietly(zip); + return outputStream.toByteArray(); + } + + /** + * 批量生成代码 + * + * @param tableNames 表数组 + * @return 数据 + */ + @Override + public byte[] generatorCode(String[] tableNames) + { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + for (String tableName : tableNames) + { + generatorCode(tableName, zip); + } + IOUtils.closeQuietly(zip); + return outputStream.toByteArray(); + } + + /** + * 查询表信息并生成代码 + */ + private void generatorCode(String tableName, ZipOutputStream zip) + { + // 查询表信息 + GenTable table = genTableMapper.selectGenTableByName(tableName); + // 查询列信息 + List columns = table.getColumns(); + setPkColumn(table, columns); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) + { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try + { + // 添加到zip + zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); + IOUtils.write(sw.toString(), zip, Constants.UTF8); + IOUtils.closeQuietly(sw); + zip.flush(); + zip.closeEntry(); + } + catch (IOException e) + { + log.error("渲染模板失败,表名:" + table.getTableName(), e); + } + } + } + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + public void validateEdit(GenTable genTable) + { + if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) + { + String options = JSON.toJSONString(genTable.getParams()); + JSONObject paramsObj = JSONObject.parseObject(options); + if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) + { + throw new CustomException("树编码字段不能为空"); + } + else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) + { + throw new CustomException("树父编码字段不能为空"); + } + else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) + { + throw new CustomException("树名称字段不能为空"); + } + } + } + + /** + * 设置主键列信息 + * + * @param genTable 业务表信息 + * @param columns 业务字段列表 + */ + public void setPkColumn(GenTable table, List columns) + { + for (GenTableColumn column : columns) + { + if (column.isPk()) + { + table.setPkColumn(column); + break; + } + } + if (StringUtils.isNull(table.getPkColumn())) + { + table.setPkColumn(columns.get(0)); + } + } + + /** + * 设置代码生成其他选项值 + * + * @param genTable 设置后的生成对象 + */ + public void setTableFromOptions(GenTable genTable) + { + JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions()); + if (StringUtils.isNotNull(paramsObj)) + { + String treeCode = paramsObj.getString(GenConstants.TREE_CODE); + String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE); + String treeName = paramsObj.getString(GenConstants.TREE_NAME); + genTable.setTreeCode(treeCode); + genTable.setTreeParentCode(treeParentCode); + genTable.setTreeName(treeName); + } + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/service/IGenTableColumnService.java b/evo/src/main/java/com/ruoyi/project/tool/gen/service/IGenTableColumnService.java new file mode 100644 index 0000000..c8c5c6f --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/service/IGenTableColumnService.java @@ -0,0 +1,44 @@ +package com.ruoyi.project.tool.gen.service; + +import java.util.List; +import com.ruoyi.project.tool.gen.domain.GenTableColumn; + +/** + * 业务字段 服务层 + * + * @author ruoyi + */ +public interface IGenTableColumnService +{ + /** + * 查询业务字段列表 + * + * @param genTableColumn 业务字段编号 + * @return 业务字段集合 + */ + public List selectGenTableColumnListByTableId(Long tableId); + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int insertGenTableColumn(GenTableColumn genTableColumn); + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int updateGenTableColumn(GenTableColumn genTableColumn); + + /** + * 删除业务字段信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableColumnByIds(String ids); +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/service/IGenTableService.java b/evo/src/main/java/com/ruoyi/project/tool/gen/service/IGenTableService.java new file mode 100644 index 0000000..2bf015c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/service/IGenTableService.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.tool.gen.service; + +import java.util.List; +import java.util.Map; +import com.ruoyi.project.tool.gen.domain.GenTable; + +/** + * 业务 服务层 + * + * @author ruoyi + */ +public interface IGenTableService +{ + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + public List selectGenTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + public List selectDbTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + public List selectDbTableListByNames(String[] tableNames); + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + public GenTable selectGenTableById(Long id); + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public void updateGenTable(GenTable genTable); + + /** + * 删除业务信息 + * + * @param tableIds 需要删除的表数据ID + * @return 结果 + */ + public void deleteGenTableByIds(Long[] tableIds); + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + public void importGenTable(List tableList); + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + public Map previewCode(Long tableId); + + /** + * 生成代码 + * + * @param tableName 表名称 + * @return 数据 + */ + public byte[] generatorCode(String tableName); + + /** + * 批量生成代码 + * + * @param tableNames 表数组 + * @return 数据 + */ + public byte[] generatorCode(String[] tableNames); + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + public void validateEdit(GenTable genTable); +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java b/evo/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java new file mode 100644 index 0000000..4068643 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java @@ -0,0 +1,242 @@ +package com.ruoyi.project.tool.gen.util; + +import java.util.Arrays; +import org.apache.commons.lang3.RegExUtils; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.config.GenConfig; +import com.ruoyi.project.tool.gen.domain.GenTable; +import com.ruoyi.project.tool.gen.domain.GenTableColumn; + +/** + * 代码生成器 工具类 + * + * @author ruoyi + */ +public class GenUtils +{ + /** + * 初始化表信息 + */ + public static void initTable(GenTable genTable, String operName) + { + genTable.setClassName(convertClassName(genTable.getTableName())); + genTable.setPackageName(GenConfig.getPackageName()); + genTable.setModuleName(getModuleName(GenConfig.getPackageName())); + genTable.setBusinessName(getBusinessName(genTable.getTableName())); + genTable.setFunctionName(replaceText(genTable.getTableComment())); + genTable.setFunctionAuthor(GenConfig.getAuthor()); + genTable.setCreateBy(operName); + } + + /** + * 初始化列属性字段 + */ + public static void initColumnField(GenTableColumn column, GenTable table) + { + String dataType = getDbType(column.getColumnType()); + String columnName = column.getColumnName(); + column.setTableId(table.getTableId()); + column.setCreateBy(table.getCreateBy()); + // 设置java字段名 + column.setJavaField(StringUtils.toCamelCase(columnName)); + + if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType)) + { + column.setJavaType(GenConstants.TYPE_STRING); + // 字符串长度超过500设置为文本域 + Integer columnLength = getColumnLength(column.getColumnType()); + String htmlType = columnLength >= 500 ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; + column.setHtmlType(htmlType); + } + else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) + { + column.setJavaType(GenConstants.TYPE_DATE); + column.setHtmlType(GenConstants.HTML_DATETIME); + } + else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) + { + column.setHtmlType(GenConstants.HTML_INPUT); + + // 如果是浮点型 + String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); + if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) + { + column.setJavaType(GenConstants.TYPE_DOUBLE); + } + // 如果是整形 + else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) + { + column.setJavaType(GenConstants.TYPE_INTEGER); + } + // 长整形 + else + { + column.setJavaType(GenConstants.TYPE_LONG); + } + } + + // 插入字段(默认所有字段都需要插入) + column.setIsInsert(GenConstants.REQUIRE); + + // 编辑字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) + { + column.setIsEdit(GenConstants.REQUIRE); + } + // 列表字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) + { + column.setIsList(GenConstants.REQUIRE); + } + // 查询字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) + { + column.setIsQuery(GenConstants.REQUIRE); + } + + // 查询字段类型 + if (StringUtils.endsWithIgnoreCase(columnName, "name")) + { + column.setQueryType(GenConstants.QUERY_LIKE); + } + // 状态字段设置单选框 + if (StringUtils.endsWithIgnoreCase(columnName, "status")) + { + column.setHtmlType(GenConstants.HTML_RADIO); + } + // 类型&性别字段设置下拉框 + else if (StringUtils.endsWithIgnoreCase(columnName, "type") + || StringUtils.endsWithIgnoreCase(columnName, "sex")) + { + column.setHtmlType(GenConstants.HTML_SELECT); + } + } + + /** + * 校验数组是否包含指定值 + * + * @param arr 数组 + * @param targetValue 值 + * @return 是否包含 + */ + public static boolean arraysContains(String[] arr, String targetValue) + { + return Arrays.asList(arr).contains(targetValue); + } + + /** + * 获取模块名 + * + * @param packageName 包名 + * @return 模块名 + */ + public static String getModuleName(String packageName) + { + int lastIndex = packageName.lastIndexOf("."); + int nameLength = packageName.length(); + String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength); + return moduleName; + } + + /** + * 获取业务名 + * + * @param tableName 表名 + * @return 业务名 + */ + public static String getBusinessName(String tableName) + { + int lastIndex = tableName.lastIndexOf("_"); + int nameLength = tableName.length(); + String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength); + return businessName; + } + + /** + * 表名转换成Java类名 + * + * @param tableName 表名称 + * @return 类名 + */ + public static String convertClassName(String tableName) + { + boolean autoRemovePre = GenConfig.getAutoRemovePre(); + String tablePrefix = GenConfig.getTablePrefix(); + if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) + { + String[] searchList = StringUtils.split(tablePrefix, ","); + tableName = replaceFirst(tableName, searchList); + } + return StringUtils.convertToCamelCase(tableName); + } + + /** + * 批量替换前缀 + * + * @param replacementm 替换值 + * @param searchList 替换列表 + * @return + */ + public static String replaceFirst(String replacementm, String[] searchList) + { + String text = replacementm; + for (String searchString : searchList) + { + if (replacementm.startsWith(searchString)) + { + text = replacementm.replaceFirst(searchString, ""); + break; + } + } + return text; + } + + /** + * 关键字替换 + * + * @param name 需要被替换的名字 + * @return 替换后的名字 + */ + public static String replaceText(String text) + { + return RegExUtils.replaceAll(text, "(?:表|若依)", ""); + } + + /** + * 获取数据库类型字段 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static String getDbType(String columnType) + { + if (StringUtils.indexOf(columnType, "(") > 0) + { + return StringUtils.substringBefore(columnType, "("); + } + else + { + return columnType; + } + } + + /** + * 获取字段长度 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static Integer getColumnLength(String columnType) + { + if (StringUtils.indexOf(columnType, "(") > 0) + { + String length = StringUtils.substringBetween(columnType, "(", ")"); + return Integer.valueOf(length); + } + else + { + return 0; + } + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/util/VelocityInitializer.java b/evo/src/main/java/com/ruoyi/project/tool/gen/util/VelocityInitializer.java new file mode 100644 index 0000000..28d7c30 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/util/VelocityInitializer.java @@ -0,0 +1,35 @@ +package com.ruoyi.project.tool.gen.util; + +import java.util.Properties; +import org.apache.velocity.app.Velocity; +import com.ruoyi.common.constant.Constants; + +/** + * VelocityEngine工厂 + * + * @author RuoYi + */ +public class VelocityInitializer +{ + /** + * 初始化vm方法 + */ + public static void initVelocity() + { + Properties p = new Properties(); + try + { + // 加载classpath目录下的vm文件 + p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + // 定义字符集 + p.setProperty(Velocity.ENCODING_DEFAULT, Constants.UTF8); + p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8); + // 初始化Velocity引擎,指定配置Properties + Velocity.init(p); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java b/evo/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java new file mode 100644 index 0000000..e464974 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/gen/util/VelocityUtils.java @@ -0,0 +1,293 @@ +package com.ruoyi.project.tool.gen.util; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import org.apache.velocity.VelocityContext; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.project.tool.gen.domain.GenTable; +import com.ruoyi.project.tool.gen.domain.GenTableColumn; + +public class VelocityUtils +{ + /** 项目空间路径 */ + private static final String PROJECT_PATH = "main/java"; + + /** mybatis空间路径 */ + private static final String MYBATIS_PATH = "main/resources/mybatis"; + + /** + * 设置模板变量信息 + * + * @return 模板列表 + */ + public static VelocityContext prepareContext(GenTable genTable) + { + String moduleName = genTable.getModuleName(); + String businessName = genTable.getBusinessName(); + String packageName = genTable.getPackageName(); + String tplCategory = genTable.getTplCategory(); + String functionName = genTable.getFunctionName(); + + VelocityContext velocityContext = new VelocityContext(); + velocityContext.put("tplCategory", genTable.getTplCategory()); + velocityContext.put("tableName", genTable.getTableName()); + velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); + velocityContext.put("ClassName", genTable.getClassName()); + velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); + velocityContext.put("moduleName", genTable.getModuleName()); + velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); + velocityContext.put("businessName", genTable.getBusinessName()); + velocityContext.put("basePackage", getPackagePrefix(packageName)); + velocityContext.put("packageName", packageName); + velocityContext.put("author", genTable.getFunctionAuthor()); + velocityContext.put("datetime", DateUtils.getDate()); + velocityContext.put("pkColumn", genTable.getPkColumn()); + velocityContext.put("importList", getImportList(genTable.getColumns())); + velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); + velocityContext.put("columns", genTable.getColumns()); + velocityContext.put("table", genTable); + if (GenConstants.TPL_TREE.equals(tplCategory)) + { + setTreeVelocityContext(velocityContext, genTable); + } + return velocityContext; + } + + public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) + { + String options = genTable.getOptions(); + JSONObject paramsObj = JSONObject.parseObject(options); + String treeCode = getTreecode(paramsObj); + String treeParentCode = getTreeParentCode(paramsObj); + String treeName = getTreeName(paramsObj); + + context.put("treeCode", treeCode); + context.put("treeParentCode", treeParentCode); + context.put("treeName", treeName); + context.put("expandColumn", getExpandColumn(genTable)); + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) + { + context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + } + if (paramsObj.containsKey(GenConstants.TREE_NAME)) + { + context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME)); + } + } + + /** + * 获取模板信息 + * + * @return 模板列表 + */ + public static List getTemplateList(String tplCategory) + { + List templates = new ArrayList(); + templates.add("vm/java/domain.java.vm"); + templates.add("vm/java/mapper.java.vm"); + templates.add("vm/java/service.java.vm"); + templates.add("vm/java/serviceImpl.java.vm"); + templates.add("vm/java/controller.java.vm"); + templates.add("vm/xml/mapper.xml.vm"); + templates.add("vm/sql/sql.vm"); + templates.add("vm/js/api.js.vm"); + if (GenConstants.TPL_CRUD.equals(tplCategory)) + { + templates.add("vm/vue/index.vue.vm"); + } + else if (GenConstants.TPL_TREE.equals(tplCategory)) + { + templates.add("vm/vue/index-tree.vue.vm"); + } + return templates; + } + + /** + * 获取文件名 + */ + public static String getFileName(String template, GenTable genTable) + { + // 文件名称 + String fileName = ""; + // 包路径 + String packageName = genTable.getPackageName(); + // 模块名 + String moduleName = genTable.getModuleName(); + // 大写类名 + String className = genTable.getClassName(); + // 业务名称 + String businessName = genTable.getBusinessName(); + + String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); + String mybatisPath = MYBATIS_PATH + "/" + moduleName; + String vuePath = "vue"; + + if (template.contains("domain.java.vm")) + { + fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); + } + else if (template.contains("mapper.java.vm")) + { + fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); + } + else if (template.contains("service.java.vm")) + { + fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); + } + else if (template.contains("serviceImpl.java.vm")) + { + fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); + } + else if (template.contains("controller.java.vm")) + { + fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); + } + else if (template.contains("mapper.xml.vm")) + { + fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); + } + else if (template.contains("sql.vm")) + { + fileName = businessName + "Menu.sql"; + } + else if (template.contains("api.js.vm")) + { + fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); + } + else if (template.contains("index.vue.vm")) + { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } + else if (template.contains("index-tree.vue.vm")) + { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } + return fileName; + } + + /** + * 获取包前缀 + * + * @param packageName 包名称 + * @return 包前缀名称 + */ + public static String getPackagePrefix(String packageName) + { + int lastIndex = packageName.lastIndexOf("."); + String basePackage = StringUtils.substring(packageName, 0, lastIndex); + return basePackage; + } + + /** + * 根据列类型获取导入包 + * + * @param column 列集合 + * @return 返回需要导入的包列表 + */ + public static HashSet getImportList(List columns) + { + HashSet importList = new HashSet(); + for (GenTableColumn column : columns) + { + if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) + { + importList.add("java.util.Date"); + importList.add("com.fasterxml.jackson.annotation.JsonFormat"); + } + else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) + { + importList.add("java.math.BigDecimal"); + } + } + return importList; + } + + /** + * 获取权限前缀 + * + * @param moduleName 模块名称 + * @param businessName 业务名称 + * @return 返回权限前缀 + */ + public static String getPermissionPrefix(String moduleName, String businessName) + { + return StringUtils.format("{}:{}", moduleName, businessName); + + } + + /** + * 获取树编码 + * + * @param options 生成其他选项 + * @return 树编码 + */ + public static String getTreecode(JSONObject paramsObj) + { + if (paramsObj.containsKey(GenConstants.TREE_CODE)) + { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE)); + } + return ""; + } + + /** + * 获取树父编码 + * + * @param options 生成其他选项 + * @return 树父编码 + */ + public static String getTreeParentCode(JSONObject paramsObj) + { + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) + { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + } + return ""; + } + + /** + * 获取树名称 + * + * @param options 生成其他选项 + * @return 树名称 + */ + public static String getTreeName(JSONObject paramsObj) + { + if (paramsObj.containsKey(GenConstants.TREE_NAME)) + { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME)); + } + return ""; + } + + /** + * 获取需要在哪一列上面显示展开按钮 + * + * @param genTable 业务表对象 + * @return 展开按钮列序号 + */ + public static int getExpandColumn(GenTable genTable) + { + String options = genTable.getOptions(); + JSONObject paramsObj = JSONObject.parseObject(options); + String treeName = paramsObj.getString(GenConstants.TREE_NAME); + int num = 0; + for (GenTableColumn column : genTable.getColumns()) + { + if (column.isList()) + { + num++; + String columnName = column.getColumnName(); + if (columnName.equals(treeName)) + { + break; + } + } + } + return num; + } +} \ No newline at end of file diff --git a/evo/src/main/java/com/ruoyi/project/tool/improt/controller/ImportController.java b/evo/src/main/java/com/ruoyi/project/tool/improt/controller/ImportController.java new file mode 100644 index 0000000..251a3e6 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/improt/controller/ImportController.java @@ -0,0 +1,46 @@ +package com.ruoyi.project.tool.improt.controller; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.management.domain.PwFuturesOrders; +import com.ruoyi.project.management.domain.PwFuturesOrdersDetail; +import com.ruoyi.project.management.service.IPwFuturesOrdersDetailService; +import com.ruoyi.project.management.service.IPwFuturesOrdersService; +import com.ruoyi.project.tool.improt.service.ImportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +@RestController +@RequestMapping("/system/import") +public class ImportController extends BaseController { + @Autowired + private ImportService importService; + @Autowired + private IPwFuturesOrdersService pwFuturesOrdersService; + @Autowired + private IPwFuturesOrdersDetailService pwFuturesOrdersDetailService; + + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil<>(PwFuturesOrdersDetail.class); + List userList = util.importExcel(file.getInputStream()); + List tabList = pwFuturesOrdersDetailService.selectPwFuturesOrdersDetailList(null); + for (PwFuturesOrdersDetail pwFuturesOrdersDetail : userList) { + for (PwFuturesOrdersDetail futuresOrders : tabList) { + if(pwFuturesOrdersDetail.getFigureNumber().equals(futuresOrders.getFigureNumber())){ + futuresOrders.setUnit(pwFuturesOrdersDetail.getUnit()); + futuresOrders.setMaterials(pwFuturesOrdersDetail.getMaterials()); + pwFuturesOrdersDetailService.updatePwFuturesOrdersDetail(futuresOrders); + } + } + } + return AjaxResult.success(); + } +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/improt/domain/ImportVo.java b/evo/src/main/java/com/ruoyi/project/tool/improt/domain/ImportVo.java new file mode 100644 index 0000000..d514b6c --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/improt/domain/ImportVo.java @@ -0,0 +1,47 @@ +package com.ruoyi.project.tool.improt.domain; + +import com.ruoyi.framework.aspectj.lang.annotation.Excel; + +public class ImportVo { + + @Excel(name = "员工姓名") + private String userName; + @Excel(name = "岗位") + private String post; + @Excel(name = "所属部门") + private String dept; + @Excel(name = "早餐补助") + private String number; + + public String getPost() { + return post; + } + + public void setPost(String post) { + this.post = post; + } + + public String getDept() { + return dept; + } + + public void setDept(String dept) { + this.dept = dept; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/improt/mapper/ImportMapper.java b/evo/src/main/java/com/ruoyi/project/tool/improt/mapper/ImportMapper.java new file mode 100644 index 0000000..420472a --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/improt/mapper/ImportMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.project.tool.improt.mapper; + +import com.ruoyi.project.tool.improt.domain.ImportVo; + +import java.util.List; + +public interface ImportMapper { + void insertImport(ImportVo importVo); + + List selectImportVos(); + + void updateImport(ImportVo importVo); +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/improt/service/ImportService.java b/evo/src/main/java/com/ruoyi/project/tool/improt/service/ImportService.java new file mode 100644 index 0000000..1476192 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/improt/service/ImportService.java @@ -0,0 +1,9 @@ +package com.ruoyi.project.tool.improt.service; + +import com.ruoyi.project.tool.improt.domain.ImportVo; + +import java.util.List; + +public interface ImportService { + void insert(List userList); +} diff --git a/evo/src/main/java/com/ruoyi/project/tool/improt/service/impl/ImportServiceImpl.java b/evo/src/main/java/com/ruoyi/project/tool/improt/service/impl/ImportServiceImpl.java new file mode 100644 index 0000000..fbb4e17 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/improt/service/impl/ImportServiceImpl.java @@ -0,0 +1,38 @@ +package com.ruoyi.project.tool.improt.service.impl; + +import com.ruoyi.project.management.domain.CwNewEmployeeInformation; +import com.ruoyi.project.management.domain.CyStatisticsInfo; +import com.ruoyi.project.management.mapper.CwNewEmployeeInformationMapper; +import com.ruoyi.project.tool.improt.domain.ImportVo; +import com.ruoyi.project.tool.improt.service.ImportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ImportServiceImpl implements ImportService { + @Autowired + private CwNewEmployeeInformationMapper cwNewEmployeeInformationMapper; + + @Override + public void insert(List userList) { + /* for (ImportVo vo : userList) { + importMapper.insertImport(vo); + }*/ + compare(userList); + } + + public void compare(List userList) { + List list = cwNewEmployeeInformationMapper.selectCwNewEmployeeInformationList(new CwNewEmployeeInformation()); + for (CwNewEmployeeInformation importVo : list) { + for (ImportVo vo : userList) { + if (importVo.getName().equals(vo.getUserName())) { + importVo.setBreakfastSubsidy(Double.parseDouble(vo.getNumber())); + cwNewEmployeeInformationMapper.updateCwNewEmployeeInformation(importVo); + } + } + } + } +} + diff --git a/evo/src/main/java/com/ruoyi/project/tool/swagger/TestController.java b/evo/src/main/java/com/ruoyi/project/tool/swagger/TestController.java new file mode 100644 index 0000000..841b531 --- /dev/null +++ b/evo/src/main/java/com/ruoyi/project/tool/swagger/TestController.java @@ -0,0 +1,175 @@ +package com.ruoyi.project.tool.swagger; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; + +/** + * swagger 用户测试方法 + * + * @author ruoyi + */ +@Api("用户信息管理") +@RestController +@RequestMapping("/test/user") +public class TestController extends BaseController +{ + private final static Map users = new LinkedHashMap(); + { + users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); + users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); + } + + @ApiOperation("获取用户列表") + @GetMapping("/list") + public AjaxResult userList() + { + List userList = new ArrayList(users.values()); + return AjaxResult.success(userList); + } + + @ApiOperation("获取用户详细") + @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") + @GetMapping("/{userId}") + public AjaxResult getUser(@PathVariable Integer userId) + { + if (!users.isEmpty() && users.containsKey(userId)) + { + return AjaxResult.success(users.get(userId)); + } + else + { + return AjaxResult.error("用户不存在"); + } + } + + @ApiOperation("新增用户") + @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") + @PostMapping("/save") + public AjaxResult save(UserEntity user) + { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) + { + return AjaxResult.error("用户ID不能为空"); + } + return AjaxResult.success(users.put(user.getUserId(), user)); + } + + @ApiOperation("更新用户") + @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") + @PutMapping("/update") + public AjaxResult update(UserEntity user) + { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) + { + return AjaxResult.error("用户ID不能为空"); + } + if (users.isEmpty() || !users.containsKey(user.getUserId())) + { + return AjaxResult.error("用户不存在"); + } + users.remove(user.getUserId()); + return AjaxResult.success(users.put(user.getUserId(), user)); + } + + @ApiOperation("删除用户信息") + @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") + @DeleteMapping("/{userId}") + public AjaxResult delete(@PathVariable Integer userId) + { + if (!users.isEmpty() && users.containsKey(userId)) + { + users.remove(userId); + return AjaxResult.success(); + } + else + { + return AjaxResult.error("用户不存在"); + } + } +} + +@ApiModel("用户实体") +class UserEntity +{ + @ApiModelProperty("用户ID") + private Integer userId; + + @ApiModelProperty("用户名称") + private String username; + + @ApiModelProperty("用户密码") + private String password; + + @ApiModelProperty("用户手机") + private String mobile; + + public UserEntity() + { + + } + + public UserEntity(Integer userId, String username, String password, String mobile) + { + this.userId = userId; + this.username = username; + this.password = password; + this.mobile = mobile; + } + + public Integer getUserId() + { + return userId; + } + + public void setUserId(Integer userId) + { + this.userId = userId; + } + + public String getUsername() + { + return username; + } + + public void setUsername(String username) + { + this.username = username; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getMobile() + { + return mobile; + } + + public void setMobile(String mobile) + { + this.mobile = mobile; + } +} diff --git a/evo/src/main/resources/application-druid.yml b/evo/src/main/resources/application-druid.yml new file mode 100644 index 0000000..97f118b --- /dev/null +++ b/evo/src/main/resources/application-druid.yml @@ -0,0 +1,60 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + #url: jdbc:mysql://192.168.4.178:3306/evo_new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true + url: jdbc:mysql://localhost:3306/evo_new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true + + username: root + #password: hbyt2025 + password: yj.chen@001 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: + login-password: + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true diff --git a/evo/src/main/resources/application.yml b/evo/src/main/resources/application.yml new file mode 100644 index 0000000..983fa09 --- /dev/null +++ b/evo/src/main/resources/application.yml @@ -0,0 +1,153 @@ +# 项目相关配置 +ruoyi: + # 名称 + name: RuoYi + # 版本 + version: 2.3.0 + # 版权年份 + copyrightYear: 2019 + # 实例演示开关 + demoEnabled: true + # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) + profile: D:/ruoyi/uploadPath/download + #产品图片存储路径 + uploadPath: D:/ruoyi/product/ + # uploadPath: D:/java/ruoyi/product/ + #母图存储路径 + dwgUploadPath: D:/evoEngine/evo_engine/dwg/ + # 获取ip地址开关 + addressEnabled: false + # 三方方案图接口路径 + schemeUrl: http://localhost:8900/scheme/scheme_design + # 三方生产总图接口路径 + productionUrl: http://localhost:8900/product/product_mesh_draw + # 根据图号获取图纸接口路径 + #: getDwgUrlByFigureNumber: http://192.168.5.10:8988/product/product_design_second + #PDF存放路径 + # pdfUrl: D:/ruoyi/products/ + pdfUrl: D:/evoEngine/static/pdf/ + # 预制件库存清单pdf图 + yzPdfUrl: D:/evoEngine/static/pdf/yzpdf/ + # yzPdfUrl: 192.168.5.10:8906/yzpdf + #生产图纸dwg导出后的pdf存放路径 + dwgAndPdf: D:/evoEngine/static/product/ + #金蝶接口地址 + jdInterFaceUrl: http://192.168.5.8/k3cloud/YT.ServicePlugIn.YTToKingDee.CreateMaterialList.SaveENG_BOM,YT.ServicePlugIn.common.kdsvc + #金蝶投放接口地址 + jdInterFaceToufUrl: http://192.168.5.8/k3cloud/YT.ServicePlugIn.YTToKingDee.PlannedOrderPlacement.Release_PlanOrder,YT.ServicePlugIn.common.kdsvc + #金蝶session接口地址 + jdSessionUrl: http://192.168.5.8/k3cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.LoginByAppSecret.common.kdsvc + jd_acctId: 67075d035463dc +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8080 + port: 8081 + servlet: + # 应用的访问路径 + context-path: /evo + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # tomcat最大线程数,默认为200 + max-threads: 800 + # Tomcat启动初始化的线程数,默认值25 + min-spare-threads: 30 + +# 日志配置 +logging: + level: + com.ruoyi: debug + org.springframework: warn + +# Spring配置 +spring: + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: druid + # 文件上传 + servlet: + multipart: + # 单个文件大小 + max-file-size: 50MB + # 设置总上传的文件大小 + max-request-size: 500MB + # 服务模块 + devtools: + restart: + # 热部署开关 + enabled: true + # redis 配置 + redis: + # 地址 + host: localhost + # 端口,默认为6379 + port: 6379 + # 密码 + password: + # 连接超时时间 + timeout: 80s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + +# token配置 +token: + # 令牌自定义标识 + header: Authorization + # 令牌秘钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 600 + +# MyBatis配置 +mybatis: + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.project.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mybatis/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml + +# PageHelper分页插件 +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql + +# Swagger配置 +swagger: + # 是否开启swagger + enabled: true + # 请求前缀 + pathMapping: /dev-api + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: /system/notice/* + # 匹配链接 + urlPatterns: /system/*,/monitor/*,/tool/* + +# 代码生成 +gen: + # 作者 + author: chenyongjiang + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: com.ruoyi.project.management + # 自动去除表前缀,默认是true + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ diff --git a/evo/src/main/resources/banner.txt b/evo/src/main/resources/banner.txt new file mode 100644 index 0000000..0b09702 --- /dev/null +++ b/evo/src/main/resources/banner.txt @@ -0,0 +1,24 @@ +Application Version: ${ruoyi.version} +Spring Boot Version: ${spring-boot.version} +//////////////////////////////////////////////////////////////////// +// _ooOoo_ // +// o8888888o // +// 88" . "88 // +// (| ^_^ |) // +// O\ = /O // +// ____/`---'\____ // +// .' \\| |// `. // +// / \\||| : |||// \ // +// / _||||| -:- |||||- \ // +// | | \\\ - /// | | // +// | \_| ''\---/'' | | // +// \ .-\__ `-` ___/-. / // +// ___`. .' /--.--\ `. . ___ // +// ."" '< `.___\_<|>_/___.' >'"". // +// | | : `- \`.;`\ _ /`;.`/ - ` : | | // +// \ \ `-. \_ __\ /__ _/ .-` / / // +// ========`-.____`-.___\_____/___.-`____.-'======== // +// `=---=' // +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// 佛祖保佑 永不宕机 永无BUG // +//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/evo/src/main/resources/i18n/messages.properties b/evo/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..d63aa1f --- /dev/null +++ b/evo/src/main/resources/i18n/messages.properties @@ -0,0 +1,36 @@ +#错误消息 +not.null=* 必须填写 +user.jcaptcha.error=验证码错误 +user.jcaptcha.expire=验证码已失效 +user.not.exists=用户不存在/密码错误 +user.password.not.match=用户不存在/密码错误 +user.password.retry.limit.count=密码输入错误{0}次 +user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟 +user.password.delete=对不起,您的账号已被删除 +user.blocked=用户已封禁,请联系管理员 +role.blocked=角色已封禁,请联系管理员 +user.logout.success=退出成功 + +length.not.valid=长度必须在{min}到{max}个字符之间 + +user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 +user.password.not.valid=* 5-50个字符 + +user.email.not.valid=邮箱格式错误 +user.mobile.phone.number.not.valid=手机号格式错误 +user.login.success=登录成功 +user.notfound=请重新登录 +user.forcelogout=管理员强制退出,请重新登录 +user.unknown.error=未知错误,请重新登录 + +##文件上传消息 +upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! +upload.filename.exceed.length=上传的文件名最长{0}个字符 + +##权限 +no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] +no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] +no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] +no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] +no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] +no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] diff --git a/evo/src/main/resources/ip2region.db b/evo/src/main/resources/ip2region.db new file mode 100644 index 0000000..d41b4a0 Binary files /dev/null and b/evo/src/main/resources/ip2region.db differ diff --git a/evo/src/main/resources/kdwebapi.properties b/evo/src/main/resources/kdwebapi.properties new file mode 100644 index 0000000..b53c874 --- /dev/null +++ b/evo/src/main/resources/kdwebapi.properties @@ -0,0 +1,18 @@ +# \u7B2C\u4E09\u65B9\u7CFB\u7EDF\u767B\u5F55\u6388\u6743\u7684\u8D26\u5957ID +X-KDApi-AcctID = 67075d035463dc +# \u7B2C\u4E09\u65B9\u7CFB\u7EDF\u767B\u5F55\u6388\u6743\u7684\u7528\u6237 +X-KDApi-UserName = Administrator +# \u7B2C\u4E09\u65B9\u7CFB\u7EDF\u767B\u5F55\u6388\u6743\u7684\u5E94\u7528ID +X-KDApi-AppID = 288012_Rc0C0zCG2lga0/Vs2Y4pzYSL6hQcWOko +# \u7B2C\u4E09\u65B9\u7CFB\u7EDF\u767B\u5F55\u6388\u6743\u7684\u5E94\u7528\u5BC6\u94A5 +X-KDApi-AppSec = 8a76cd746fa24636b2c65ef9f313c640 +# \u670D\u52A1Url\u5730\u5740(\u516C\u6709\u4E91\u7EDF\u4E00\u8D70\u7F51\u5173sdk\u5E95\u5C42\u5DF2\u5904\u7406\uFF0C\u65E0\u9700\u4F20X-KDApi-ServerUrl,\u4E0B\u9762\u8FD9\u884C\u9700\u8981\u6CE8\u91CA) +X-KDApi-ServerUrl =http://192.168.5.8/K3Cloud/ +# \u8D26\u5957\u8BED\u7CFB\uFF0C\u9ED8\u8BA42052 +X-KDApi-LCID = 2052 +# \u7EC4\u7EC7\u7F16\u7801\uFF0C\u542F\u7528\u591A\u7EC4\u7EC7\u65F6\u914D\u7F6E\u5BF9\u5E94\u7684\u7EC4\u7EC7\u7F16\u7801\u624D\u6709\u6548 +X-KDApi-OrgNum = 100 +# \u5141\u8BB8\u7684\u6700\u5927\u8FDE\u63A5\u5EF6\u65F6\uFF0C\u5355\u4F4D\u4E3A\u79D2 +X-KDApi-ConnectTimeout = 120 +# \u5141\u8BB8\u7684\u6700\u5927\u8BFB\u53D6\u5EF6\u65F6\uFF0C\u5355\u4F4D\u4E3A\u79D2 +X-KDApi-RequestTimeout = 120 diff --git a/evo/src/main/resources/logback.xml b/evo/src/main/resources/logback.xml new file mode 100644 index 0000000..a8a162b --- /dev/null +++ b/evo/src/main/resources/logback.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + ${log.path}/sys-user.log + + + ${log.path}/sys-user.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/AutoInventoryIssueMapper.xml b/evo/src/main/resources/mybatis/management/AutoInventoryIssueMapper.xml new file mode 100644 index 0000000..da04fa1 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/AutoInventoryIssueMapper.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, figure_number, material_name, specification_type, category, purchase_mark, material_classification, materials, piece_weight, unit, preferential_origin_name, quantity, univalence, unit_price, remark, create_time, create_by, update_time, update_by from auto_inventory_issue + + + + + + + + + + insert into auto_inventory_issue + + figure_number, + material_name, + specification_type, + category, + purchase_mark, + material_classification, + materials, + piece_weight, + unit, + preferential_origin_name, + quantity, + univalence, + unit_price, + remark, + flag, + create_time, + create_by, + update_time, + update_by, + + + #{figureNumber}, + #{materialName}, + #{specificationType}, + #{category}, + #{purchaseMark}, + #{materialClassification}, + #{materials}, + #{pieceWeight}, + #{unit}, + #{preferentialOriginName}, + #{quantity}, + #{univalence}, + #{unitPrice}, + #{remark}, + #{flag}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + + + + + update auto_inventory_issue + + figure_number = #{figureNumber}, + material_name = #{materialName}, + specification_type = #{specificationType}, + category = #{category}, + purchase_mark = #{purchaseMark}, + material_classification = #{materialClassification}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + unit = #{unit}, + preferential_origin_name = #{preferentialOriginName}, + quantity = #{quantity}, + univalence = #{univalence}, + unit_price = #{unitPrice}, + remark = #{remark}, + flag = #{flag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where id = #{id} + + + + delete from auto_inventory_issue where id = #{id} + + + + delete from auto_inventory_issue where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/CadMaterialInfoMapper.xml b/evo/src/main/resources/mybatis/management/CadMaterialInfoMapper.xml new file mode 100644 index 0000000..16a513d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CadMaterialInfoMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, materials, piece_weight, category, remarks, quantity, parent_level_name, parent_level_figure_number, spared_one, spared_two, spared_three, spared_four from cad_material_info + + + + + + + + insert into cad_material_info + + create_time, + name, + figure_number, + materials, + piece_weight, + category, + remarks, + quantity, + parent_level_name, + parent_level_figure_number, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{category}, + #{remarks}, + #{quantity}, + #{parentLevelName}, + #{parentLevelFigureNumber}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cad_material_info + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + category = #{category}, + remarks = #{remarks}, + quantity = #{quantity}, + parent_level_name = #{parentLevelName}, + parent_level_figure_number = #{parentLevelFigureNumber}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cad_material_info where id = #{id} + + + + delete from cad_material_info where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwAttendanceMapper.xml b/evo/src/main/resources/mybatis/management/CwAttendanceMapper.xml new file mode 100644 index 0000000..e9d26b1 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwAttendanceMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, on_record, down_record, should_be_attendance, real_attendance, belongs_to_date, spared_one, spared_two, sapred_three, sapred_four, del_flag from cw_attendance + + + + + + + + insert into cw_attendance + + create_time, + name, + on_record, + down_record, + should_be_attendance, + real_attendance, + belongs_to_date, + spared_one, + spared_two, + sapred_three, + sapred_four, + del_flag, + + + #{createTime}, + #{name}, + #{onRecord}, + #{downRecord}, + #{shouldBeAttendance}, + #{realAttendance}, + #{belongsToDate}, + #{sparedOne}, + #{sparedTwo}, + #{sapredThree}, + #{sapredFour}, + #{delFlag}, + + + + + update cw_attendance + + create_time = #{createTime}, + name = #{name}, + on_record = #{onRecord}, + down_record = #{downRecord}, + should_be_attendance = #{shouldBeAttendance}, + real_attendance = #{realAttendance}, + belongs_to_date = #{belongsToDate}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + sapred_three = #{sapredThree}, + sapred_four = #{sapredFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_attendance where id = #{id} + + + + delete from cw_attendance where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwAttendanceRecordDetailMapper.xml b/evo/src/main/resources/mybatis/management/CwAttendanceRecordDetailMapper.xml new file mode 100644 index 0000000..96fc75c --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwAttendanceRecordDetailMapper.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, equipment_code, type, code, name, date_time, button_type, spared_one, spared_two, spared_three, spared_four, spared_five, spared_six from cw_attendance_record_detail + + + + + + + + insert into cw_attendance_record_detail + + create_time, + equipment_code, + type, + code, + name, + date_time, + button_type, + spared_one, + spared_two, + spared_three, + spared_four, + spared_five, + spared_six, + + + #{createTime}, + #{equipmentCode}, + #{type}, + #{code}, + #{name}, + #{dateTime}, + #{buttonType}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{sparedSix}, + + + + + update cw_attendance_record_detail + + create_time = #{createTime}, + equipment_code = #{equipmentCode}, + type = #{type}, + code = #{code}, + name = #{name}, + date_time = #{dateTime}, + button_type = #{buttonType}, + button_type = null, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + spared_six = #{sparedSix}, + + where id = #{id} + + + + delete from cw_attendance_record_detail where id = #{id} + + + + delete from cw_attendance_record_detail where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwAttendanceUserMapper.xml b/evo/src/main/resources/mybatis/management/CwAttendanceUserMapper.xml new file mode 100644 index 0000000..bd54a62 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwAttendanceUserMapper.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, phone, tts_name,face_template, spared_one, spared_two, spared_three, spared_four, spared_five, spared_six from cw_attendance_user + + + + + + + + insert into cw_attendance_user + + create_time, + name, + phone, + tts_name, + face_template, + spared_one, + spared_two, + spared_three, + spared_four, + spared_five, + spared_six, + + + #{createTime}, + #{name}, + #{phone}, + #{ttsName}, + #{faceTemplate}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{sparedSix}, + + + + + update cw_attendance_user + + create_time = #{createTime}, + name = #{name}, + phone = #{phone}, + tts_name = #{ttsName}, + face_template = #{faceTemplate}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + spared_six = #{sparedSix}, + + where id = #{id} + + + + delete from cw_attendance_user where id = #{id} + + + + delete from cw_attendance_user where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwButtonMapper.xml b/evo/src/main/resources/mybatis/management/CwButtonMapper.xml new file mode 100644 index 0000000..e1de226 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwButtonMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + select id, create_time, num, name, image, spared_one, spared_two, spared_three, spared_four from cw_button + + + + + + + + insert into cw_button + + create_time, + num, + name, + image, + to, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{num}, + #{name}, + #{image}, + #{to}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_button + + create_time = #{createTime}, + num = #{num}, + name = #{name}, + image = #{image}, + to = #{to}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_button where id = #{id} + + + + delete from cw_button where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwCostAnalysisMapper.xml b/evo/src/main/resources/mybatis/management/CwCostAnalysisMapper.xml new file mode 100644 index 0000000..b1bec9d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwCostAnalysisMapper.xml @@ -0,0 +1,368 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id,uuid, create_time,cost_statistics_id, code, product_name, number, material_name, figure_number, piece_weight, type, one_number, sum_number, univalence, total_prices,share_expenses,proportion_of_allocation,man_hour,man_hour_unit_price,materials_name,materials_specification,measure,workblank,materials_unit_price,superior_id, spared_one, spared_two, spared_three, spared_four from cw_cost_analysis + + + + + + + + insert into cw_cost_analysis + + create_time, + uuid, + cost_statistics_id, + code, + product_name, + number, + material_name, + figure_number, + piece_weight, + type, + one_number, + sum_number, + univalence, + total_prices, + share_expenses, + proportion_of_allocation, + man_hour, + man_hour_unit_price, + materials_name, + materials_specification, + measure, + workblank, + materials_unit_price, + superior_id, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{uuid}, + #{costStatisticsId}, + #{code}, + #{productName}, + #{number}, + #{materialName}, + #{figureNumber}, + #{pieceWeight}, + #{type}, + #{oneNumber}, + #{sumNumber}, + #{univalence}, + #{totalPrices}, + #{shareExpenses}, + #{proportionOfAllocation}, + #{manHour}, + #{manHourUnitPrice}, + #{materialsName}, + #{materialsSpecification}, + #{measure}, + #{workblank}, + #{materialsUnitPrice}, + #{superiorId}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + + insert into cw_cost_analysis(uuid,cost_statistics_id, code, product_name, number, material_name, figure_number, piece_weight, type, one_number, sum_number, univalence, total_prices,share_expenses,proportion_of_allocation, man_hour,man_hour_unit_price,materials_name,materials_specification,measure,workblank,materials_unit_price, superior_id,spared_one, spared_two, spared_three, spared_four) + VALUES + + (#{item.uuid}, + #{item.costStatisticsId}, + #{item.code}, + #{item.productName}, + #{item.number}, + #{item.materialName}, + #{item.figureNumber}, + #{item.pieceWeight}, + #{item.type}, + #{item.oneNumber}, + #{item.sumNumber}, + #{item.univalence}, + #{item.totalPrices}, + #{item.shareExpenses}, + #{item.proportionOfAllocation}, + #{item.manHour}, + #{item.manHourUnitPrice}, + #{item.materialsName}, + #{item.materialsSpecification}, + #{item.measure}, + #{item.workblank}, + #{item.materialsUnitPrice}, + #{item.superiorId}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}) + + + + + update cw_cost_analysis + + uuid = #{uuid}, + create_time = #{createTime}, + code = #{code}, + product_name = #{productName}, + number = #{number}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + piece_weight = #{pieceWeight}, + type = #{type}, + one_number = #{oneNumber}, + sum_number = #{sumNumber}, + univalence = #{univalence}, + total_prices = #{totalPrices}, + share_expenses = #{shareExpenses}, + proportion_of_allocation = #{proportionOfAllocation}, + man_hour = #{manHour}, + man_hour_unit_price = #{manHourUnitPrice}, + materials_name = #{materialsName}, + materials_specification = #{materialsSpecification}, + measure = #{measure}, + workblank = #{workblank}, + materials_unit_price = #{materialsUnitPrice}, + superior_id = #{superiorId}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + + + + delete from cw_cost_analysis where id = #{id} + + + + + delete from cw_cost_analysis where spared_four = #{long1} + + + + delete from cw_cost_analysis where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwCostStatisticsMapper.xml b/evo/src/main/resources/mybatis/management/CwCostStatisticsMapper.xml new file mode 100644 index 0000000..5ebd14a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwCostStatisticsMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, date, factory_depreciation_costs, depreciation_cost, article_of_consumption, electric_charge, cost_of_labor, other_charges, remarks, spared_one, spared_two, spared_three, spared_four from cw_cost_statistics + + + + + + + + insert into cw_cost_statistics + + create_time, + date, + factory_depreciation_costs, + depreciation_cost, + article_of_consumption, + electric_charge, + cost_of_labor, + other_charges, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{date}, + #{factoryDepreciationCosts}, + #{depreciationCost}, + #{articleOfConsumption}, + #{electricCharge}, + #{costOfLabor}, + #{otherCharges}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_cost_statistics + + create_time = #{createTime}, + date = #{date}, + factory_depreciation_costs = #{factoryDepreciationCosts}, + depreciation_cost = #{depreciationCost}, + article_of_consumption = #{articleOfConsumption}, + electric_charge = #{electricCharge}, + cost_of_labor = #{costOfLabor}, + other_charges = #{otherCharges}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_cost_statistics where id = #{id} + + + + delete from cw_cost_statistics where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwDepartmentMapper.xml b/evo/src/main/resources/mybatis/management/CwDepartmentMapper.xml new file mode 100644 index 0000000..c31bb0f --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwDepartmentMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + select id, create_time, department_name, remarks, sapred_one, spared_two, spared_three, spared_four, del_flag from cw_department + + + + + + + + insert into cw_department + + create_time, + department_name, + remarks, + sapred_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{departmentName}, + #{remarks}, + #{sapredOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_department + + create_time = #{createTime}, + department_name = #{departmentName}, + remarks = #{remarks}, + sapred_one = #{sapredOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_department where id = #{id} + + + + delete from cw_department where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwDimissionMapper.xml b/evo/src/main/resources/mybatis/management/CwDimissionMapper.xml new file mode 100644 index 0000000..fad5099 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwDimissionMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, cause, cause_date, dept_audit, dept_audit_date, competent_dept_audit, competent_dept_audit_date, personnel_audit, personnel_audit_date, leadership_audit, leadership_audit_date, finance_audit, finance_audit_date, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from cw_dimission + + + + + + + + insert into cw_dimission + + create_time, + name, + cause, + cause_date, + dept_audit, + dept_audit_date, + competent_dept_audit, + competent_dept_audit_date, + personnel_audit, + personnel_audit_date, + leadership_audit, + leadership_audit_date, + finance_audit, + finance_audit_date, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{name}, + #{cause}, + #{causeDate}, + #{deptAudit}, + #{deptAuditDate}, + #{competentDeptAudit}, + #{competentDeptAuditDate}, + #{personnelAudit}, + #{personnelAuditDate}, + #{leadershipAudit}, + #{leadershipAuditDate}, + #{financeAudit}, + #{financeAuditDate}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_dimission + + create_time = #{createTime}, + name = #{name}, + cause = #{cause}, + cause_date = #{causeDate}, + dept_audit = #{deptAudit}, + dept_audit_date = #{deptAuditDate}, + competent_dept_audit = #{competentDeptAudit}, + competent_dept_audit_date = #{competentDeptAuditDate}, + personnel_audit = #{personnelAudit}, + personnel_audit_date = #{personnelAuditDate}, + leadership_audit = #{leadershipAudit}, + leadership_audit_date = #{leadershipAuditDate}, + finance_audit = #{financeAudit}, + finance_audit_date = #{financeAuditDate}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_dimission where id = #{id} + + + + delete from cw_dimission where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwEmployeeInformationMapper.xml b/evo/src/main/resources/mybatis/management/CwEmployeeInformationMapper.xml new file mode 100644 index 0000000..a4c52e9 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwEmployeeInformationMapper.xml @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, department, name, should_attendance_number, basic_monthly_salary, daily_wages, Subsidy_or_bonus, incentive_fee,traffic_allowance, communicate_allowance, housing_allowance, meal_allowance, accumulation_fund, pay_insurance, entry_date,probation_period, seniority, endowment_insurance, medical_insurance, employment_injury_insurance, maternity_insurance, unemployment_insurance, children_education, support_the_old, housing_loans, housing_rents, adult_education, treatment_for_serious_disease,special_deduction, total_wages, aggregate_personal_income_tax, remarks, spared_one, sapred_two, spread_three, spread_four, del_flag from cw_employee_information + + + + + + + + insert into cw_employee_information + + create_time, + department, + name, + should_attendance_number, + basic_monthly_salary, + daily_wages, + Subsidy_or_bonus, + incentive_fee, + traffic_allowance, + communicate_allowance, + housing_allowance, + meal_allowance, + accumulation_fund, + pay_insurance, + entry_date, + probation_period, + seniority, + endowment_insurance, + medical_insurance, + employment_injury_insurance, + maternity_insurance, + unemployment_insurance, + children_education, + support_the_old, + housing_loans, + housing_rents, + adult_education, + treatment_for_serious_disease, + special_deduction, + total_wages, + aggregate_personal_income_tax, + remarks, + spared_one, + sapred_two, + spread_three, + spread_four, + del_flag, + + + #{createTime}, + #{department}, + #{name}, + #{shouldAttendanceNumber}, + #{basicMonthlySalary}, + #{dailyWages}, + #{subsidyOrBonus}, + #{incentiveFee}, + #{trafficAllowance}, + #{communicateAllowance}, + #{housingAllowance}, + #{mealAllowance}, + #{accumulationFund}, + #{payInsurance}, + #{entryDate}, + #{probationPeriod}, + #{seniority}, + #{endowmentInsurance}, + #{medicalInsurance}, + #{employmentInjuryInsurance}, + #{maternityInsurance}, + #{unemploymentInsurance}, + #{childrenEducation}, + #{supportTheOld}, + #{housingLoans}, + #{housingRents}, + #{adultEducation}, + #{treatmentForSeriousDisease}, + #{specialDeduction}, + #{totalWages}, + #{aggregatePersonalIncomeTax}, + #{remarks}, + #{sparedOne}, + #{sapredTwo}, + #{spreadThree}, + #{spreadFour}, + #{delFlag}, + + + + + update cw_employee_information + + create_time = #{createTime}, + department = #{department}, + name = #{name}, + should_attendance_number = #{shouldAttendanceNumber}, + basic_monthly_salary = #{basicMonthlySalary}, + daily_wages = #{dailyWages}, + Subsidy_or_bonus = #{subsidyOrBonus}, + incentive_fee = #{incentiveFee}, + traffic_allowance = #{trafficAllowance}, + communicate_allowance = #{communicateAllowance}, + housing_allowance = #{housingAllowance}, + meal_allowance = #{mealAllowance}, + accumulation_fund = #{accumulationFund}, + pay_insurance = #{payInsurance}, + entry_date = #{entryDate}, + probation_period = #{probationPeriod}, + seniority = #{seniority}, + endowment_insurance = #{endowmentInsurance}, + medical_insurance = #{medicalInsurance}, + employment_injury_insurance = #{employmentInjuryInsurance}, + maternity_insurance = #{maternityInsurance}, + unemployment_insurance = #{unemploymentInsurance}, + children_education = #{childrenEducation}, + support_the_old = #{supportTheOld}, + housing_loans = #{housingLoans}, + housing_rents = #{housingRents}, + adult_education = #{adultEducation}, + treatment_for_serious_disease = #{treatmentForSeriousDisease}, + special_deduction = #{specialDeduction}, + total_wages = #{totalWages}, + aggregate_personal_income_tax = #{aggregatePersonalIncomeTax}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + sapred_two = #{sapredTwo}, + spread_three = #{spreadThree}, + spread_four = #{spreadFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_employee_information where id = #{id} + + + + delete from cw_employee_information where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwEvectionMapper.xml b/evo/src/main/resources/mybatis/management/CwEvectionMapper.xml new file mode 100644 index 0000000..e02c2da --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwEvectionMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, dept_name, name, evection_date, evection_number, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from cw_evection + + + + + + + + insert into cw_evection + + create_time, + dept_name, + name, + evection_date, + evection_number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{deptName}, + #{name}, + #{evectionDate}, + #{evectionNumber}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_evection + + create_time = #{createTime}, + dept_name = #{deptName}, + name = #{name}, + evection_date = #{evectionDate}, + evection_number = #{evectionNumber}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_evection where id = #{id} + + + + delete from cw_evection where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwExpenseReimbursementMapper.xml b/evo/src/main/resources/mybatis/management/CwExpenseReimbursementMapper.xml new file mode 100644 index 0000000..dacc7c4 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwExpenseReimbursementMapper.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, user_name, date_time, dept_name, money, product, cause, remarks, big_money,offsetting_deduction, borrow_money, retreat_repair_money, accountant_approve, approve_time, reviewer, reviewer_time, cashier, cashier_time, leadership, leadership_time, not_invoice_amount, invoice_amount, not_proceeds_amount, proceeds_amount, settlement_ratio, spared_one, spared_two, spared_three, spared_four from cw_expense_reimbursement + + + + + + + + insert into cw_expense_reimbursement + + create_time, + code, + user_name, + date_time, + dept_name, + money, + product, + cause, + remarks, + big_money, + offsetting_deduction, + borrow_money, + retreat_repair_money, + accountant_approve, + approve_time, + reviewer, + reviewer_time, + cashier, + cashier_time, + leadership, + leadership_time, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{userName}, + #{dateTime}, + #{deptName}, + #{money}, + #{product}, + #{cause}, + #{remarks}, + #{bigMoney}, + #{offsettingDeduction}, + #{borrowMoney}, + #{retreatRepairMoney}, + #{accountantApprove}, + #{approveTime}, + #{reviewer}, + #{reviewerTime}, + #{cashier}, + #{cashierTime}, + #{leadership}, + #{leadershipTime}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_expense_reimbursement + + create_time = #{createTime}, + code = #{code}, + user_name = #{userName}, + date_time = #{dateTime}, + dept_name = #{deptName}, + money = #{money}, + product = #{product}, + cause = #{cause}, + remarks = #{remarks}, + big_money = #{bigMoney}, + offsetting_deduction = #{offsettingDeduction}, + borrow_money = #{borrowMoney}, + retreat_repair_money = #{retreatRepairMoney}, + + accountant_approve = #{accountantApprove}, + accountant_approve = null, + approve_time = #{approveTime}, + approve_time = null, + reviewer = #{reviewer}, + reviewer = null, + reviewer_time = #{reviewerTime}, + reviewer_time = null, + cashier = #{cashier}, + cashier = null, + cashier_time = #{cashierTime}, + cashier_time = null, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{invoiceAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_expense_reimbursement where id = #{id} + + + + delete from cw_expense_reimbursement where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwJobsMapper.xml b/evo/src/main/resources/mybatis/management/CwJobsMapper.xml new file mode 100644 index 0000000..6dc5e4d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwJobsMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + select id, create_time, jobs_name, dept_name, work_hours, spared_one, spared_two, spared_three, spared_four, del_flag from cw_jobs + + + + + + + + insert into cw_jobs + + create_time, + jobs_name, + dept_name, + work_hours, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{jobsName}, + #{deptName}, + #{workHours}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_jobs + + create_time = #{createTime}, + jobs_name = #{jobsName}, + dept_name = #{deptName}, + work_hours = #{workHours}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_jobs where id = #{id} + + + + delete from cw_jobs where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwLeaveRecordMapper.xml b/evo/src/main/resources/mybatis/management/CwLeaveRecordMapper.xml new file mode 100644 index 0000000..ddc5b72 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwLeaveRecordMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, dept_name, name, leave_date, reason_for_leave, time_number, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from cw_leave_record + + + + + + + + insert into cw_leave_record + + create_time, + dept_name, + name, + leave_date, + reason_for_leave, + time_number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{deptName}, + #{name}, + #{leaveDate}, + #{reasonForLeave}, + #{timeNumber}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_leave_record + + create_time = #{createTime}, + dept_name = #{deptName}, + name = #{name}, + leave_date = #{leaveDate}, + reason_for_leave = #{reasonForLeave}, + time_number = #{timeNumber}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_leave_record where id = #{id} + + + + delete from cw_leave_record where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwLevelOfEducationMapper.xml b/evo/src/main/resources/mybatis/management/CwLevelOfEducationMapper.xml new file mode 100644 index 0000000..cc51635 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwLevelOfEducationMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + select id, create_time, subsidies_name, subsidies, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from cw_level_of_education + + + + + + + + insert into cw_level_of_education + + create_time, + subsidies_name, + subsidies, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{subsidiesName}, + #{subsidies}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_level_of_education + + create_time = #{createTime}, + subsidies_name = #{subsidiesName}, + subsidies = #{subsidies}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_level_of_education where id = #{id} + + + + delete from cw_level_of_education where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwLogisticsFeesInfoMapper.xml b/evo/src/main/resources/mybatis/management/CwLogisticsFeesInfoMapper.xml new file mode 100644 index 0000000..4b5c341 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwLogisticsFeesInfoMapper.xml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, relevance_code, relevance_type, user_name, dept_name, date, money, big_money, cause, remarks, approver, approver_time, pay_way, unit_name, account_number, opening_bank, not_invoice_amount, invoice_amount, not_proceeds_amount, proceeds_amount, settlement_ratio, spared_one, spared_two, spared_three, spared_four from cw_logistics_fees_info + + + + + + + + insert into cw_logistics_fees_info + + create_time, + code, + relevance_code, + relevance_type, + user_name, + dept_name, + date, + money, + big_money, + cause, + remarks, + approver, + approver_time, + pay_way, + unit_name, + account_number, + opening_bank, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{relevanceCode}, + #{relevanceType}, + #{userName}, + #{deptName}, + #{date}, + #{money}, + #{bigMoney}, + #{cause}, + #{remarks}, + #{approver}, + #{approverTime}, + #{payWay}, + #{unitName}, + #{accountNumber}, + #{openingBank}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_logistics_fees_info + + create_time = #{createTime}, + code = #{code}, + relevance_code = #{relevanceCode}, + relevance_type = #{relevanceType}, + user_name = #{userName}, + dept_name = #{deptName}, + date = #{date}, + money = #{money}, + big_money = #{bigMoney}, + cause = #{cause}, + remarks = #{remarks}, + approver = #{approver}, + approver = null, + approver_time = #{approverTime}, + approver_time = null, + pay_way = #{payWay}, + unit_name = #{unitName}, + account_number = #{accountNumber}, + opening_bank = #{openingBank}, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{invoiceAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_logistics_fees_info where id = #{id} + + + + delete from cw_logistics_fees_info where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwLogsotocsFeesMaterialMapper.xml b/evo/src/main/resources/mybatis/management/CwLogsotocsFeesMaterialMapper.xml new file mode 100644 index 0000000..6d61b68 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwLogsotocsFeesMaterialMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, logistics_fees_info_id, product_receipt_material_id, name, figure_number, unit_price, quantity, cost_proportion, spared_one, spared_two, spared_three, spared_four, spared_five, sapred_six from cw_logsotocs_fees_material + + + + + + + + insert into cw_logsotocs_fees_material + + create_time, + logistics_fees_info_id, + product_receipt_material_id, + name, + figure_number, + unit_price, + quantity, + cost_proportion, + spared_one, + spared_two, + spared_three, + spared_four, + spared_five, + sapred_six, + + + #{createTime}, + #{logisticsFeesInfoId}, + #{productReceiptMaterialId}, + #{name}, + #{figureNumber}, + #{unitPrice}, + #{quantity}, + #{costProportion}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{sapredSix}, + + + + + update cw_logsotocs_fees_material + + create_time = #{createTime}, + logistics_fees_info_id = #{logisticsFeesInfoId}, + product_receipt_material_id = #{productReceiptMaterialId}, + name = #{name}, + figure_number = #{figureNumber}, + unit_price = #{unitPrice}, + quantity = #{quantity}, + cost_proportion = #{costProportion}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + sapred_six = #{sapredSix}, + + where id = #{id} + + + + delete from cw_logsotocs_fees_material where id = #{id} + + + + delete from cw_logsotocs_fees_material where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwNewAttendanceMapper.xml b/evo/src/main/resources/mybatis/management/CwNewAttendanceMapper.xml new file mode 100644 index 0000000..3433902 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwNewAttendanceMapper.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time,statistical_id, name, code, dept_name, attendance_date, rules, work_start_time, work_end_time, work_sum, late_number, leave_early_number, absenteeism_number, leave_days,night_number,middle_shift_number, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from cw_new_attendance + + + + + + + + insert into cw_new_attendance + + create_time, + statistical_id, + name, + code, + dept_name, + attendance_date, + rules, + work_start_time, + work_end_time, + work_sum, + late_number, + leave_early_number, + absenteeism_number, + leave_days, + night_number, + middle_shift_number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{statisticalId}, + #{name}, + #{code}, + #{deptName}, + #{attendanceDate}, + #{rules}, + #{workStartTime}, + #{workEndTime}, + #{workSum}, + #{lateNumber}, + #{leaveEarlyNumber}, + #{absenteeismNumber}, + #{leaveDays}, + #{nightNumber}, + #{middleShiftNumber}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_new_attendance + + create_time = #{createTime}, + statistical_id = #{statisticalId}, + name = #{name}, + code = #{code}, + dept_name = #{deptName}, + attendance_date = #{attendanceDate}, + rules = #{rules}, + work_start_time = #{workStartTime}, + work_end_time = #{workEndTime}, + work_sum = #{workSum}, + late_number = #{lateNumber}, + leave_early_number = #{leaveEarlyNumber}, + absenteeism_number = #{absenteeismNumber}, + leave_days = #{leaveDays}, + night_number = #{nightNumber}, + middle_shift_number = #{middleShiftNumber}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_new_attendance where id = #{id} + + + + delete from cw_new_attendance where id in + + #{id} + + + + + + + insert into cw_new_attendance + + create_time, + statistical_id, + name, + code, + dept_name, + attendance_date, + rules, + work_start_time, + work_end_time, + work_sum, + late_number, + leave_early_number, + absenteeism_number, + leave_days, + night_number, + middle_shift_number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{item.createTime}, + #{item.statisticalId}, + #{item.name}, + #{item.code}, + #{item.deptName}, + #{item.attendanceDate}, + #{item.rules}, + #{item.workStartTime}, + #{item.workEndTime}, + #{item.workSum}, + #{item.lateNumber}, + #{item.leaveEarlyNumber}, + #{item.absenteeismNumber}, + #{item.leaveDays}, + #{item.nightNumber}, + #{item.middleShiftNumber}, + #{item.remarks}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.delFlag}, + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwNewAttendanceStatisticalMapper.xml b/evo/src/main/resources/mybatis/management/CwNewAttendanceStatisticalMapper.xml new file mode 100644 index 0000000..444f3e5 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwNewAttendanceStatisticalMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, date, name, dept_name,should_attendance_number, real_attendance,essential_attendance,work_overtime_number,absenteeism, late_number, leave_early, less_number,night_number,middle_shift_number, del_flag, spared_one, spared_two, sapred_three, spared_four from cw_new_attendance_statistical + + + + + + + + insert into cw_new_attendance_statistical + + create_time, + date, + name, + dept_name, + should_attendance_number, + real_attendance, + essential_attendance, + work_overtime_number, + absenteeism, + late_number, + leave_early, + less_number, + night_number, + middle_shift_number, + del_flag, + spared_one, + spared_two, + sapred_three, + spared_four, + + + #{createTime}, + #{date}, + #{name}, + #{deptName}, + #{shouldAttendanceNumber}, + #{realAttendance}, + #{essential_attendance}, + #{workOvertimeNumber}, + #{absenteeism}, + #{lateNumber}, + #{leaveEarly}, + #{lessNumber}, + #{nightNumber}, + #{middleShiftNumber}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sapredThree}, + #{sparedFour}, + + + + + update cw_new_attendance_statistical + + create_time = #{createTime}, + date = #{date}, + name = #{name}, + dept_name = #{deptName}, + should_attendance_number = #{shouldAttendanceNumber}, + real_attendance = #{realAttendance}, + essential_attendance = #{essentialAttendance}, + work_overtime_number = #{workOvertimeNumber}, + absenteeism = #{absenteeism}, + late_number = #{lateNumber}, + leave_early = #{leaveEarly}, + less_number = #{lessNumber}, + night_number = #{nightNumber}, + middle_shift_number = #{middleShiftNumber}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_new_attendance_statistical where id = #{id} + + + + delete from cw_new_attendance_statistical where id in + + #{id} + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwNewEmployeeInformationMapper.xml b/evo/src/main/resources/mybatis/management/CwNewEmployeeInformationMapper.xml new file mode 100644 index 0000000..77419c9 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwNewEmployeeInformationMapper.xml @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name,e_mail, jobs, dept_name, basic_salary, jobs_salary,daily_wage, hours_salary, shift_the_length, level_of_education, contract_year, social_security_status, entry_date, seniority, probation_period, level_of_education_subsidies, contract_subsidies, seniority_subsidies, social_security_subsidies, full_frequently_subsidies, night_shift_subsidies, dinner_subsidies,fixed_allowance, other_subsidies,is_overtime_pay,deductions, virtual_workstation, endowment_insurance, medical_insurance, employment_injury_insurance, maternity_insurance, unemployment_insurance, children_education, support_the_old, housing_loans, housing_rents, adult_education, treatment_for_serious_disease, special_deduction, total_wages, aggregate_personal_income_tax, remarks,dimission,dimission_date,subsidy_deduct_money,breakfast_subsidy,lunch_subsidy,supper_subsidy,account_number, opening_bank, spared_one, spared_two, spared_three, spared_four, spared_five, spared_six, del_flag from cw_new_employee_information + + + + select id, create_time, name from cw_new_employee_information + + + + + + + + + + + insert into cw_new_employee_information + + create_time, + name, + e_mail, + jobs, + dept_name, + basic_salary, + jobs_salary, + daily_wage, + hours_salary, + shift_the_length, + level_of_education, + contract_year, + social_security_status, + entry_date, + seniority, + probation_period, + level_of_education_subsidies, + contract_subsidies, + seniority_subsidies, + social_security_subsidies, + full_frequently_subsidies, + night_shift_subsidies, + dinner_subsidies, + fixed_allowance, + other_subsidies, + is_overtime_pay, + deductions, + virtual_workstation, + endowment_insurance, + medical_insurance, + employment_injury_insurance, + maternity_insurance, + unemployment_insurance, + children_education, + support_the_old, + housing_loans, + housing_rents, + adult_education, + treatment_for_serious_disease, + special_deduction, + total_wages, + aggregate_personal_income_tax, + remarks, + dimission, + dimission_date, + subsidy_deduct_money, + breakfast_subsidy, + lunch_subsidy, + supper_subsidy, + account_number, + opening_bank, + spared_one, + spared_two, + spared_three, + spared_four, + spared_five, + spared_six, + del_flag, + + + #{createTime}, + #{name}, + #{email}, + #{jobs}, + #{deptName}, + #{basicSalary}, + #{jobsSalary}, + #{dailyWage}, + #{hoursSalary}, + #{shiftTheLength}, + #{levelOfEducation}, + #{contractYear}, + #{socialSecurityStatus}, + #{entryDate}, + #{seniority}, + #{probationPeriod}, + #{levelOfEducationSubsidies}, + #{contractSubsidies}, + #{senioritySubsidies}, + #{socialSecuritySubsidies}, + #{fullFrequentlySubsidies}, + #{nightShiftSubsidies}, + #{dinnerSubsidies}, + #{fixedAllowance}, + #{otherSubsidies}, + #{isOvertimePay}, + #{deductions}, + #{virtualWorkstation}, + #{endowmentInsurance}, + #{medicalInsurance}, + #{employmentInjuryInsurance}, + #{maternityInsurance}, + #{unemploymentInsurance}, + #{childrenEducation}, + #{supportTheOld}, + #{housingLoans}, + #{housingRents}, + #{adultEducation}, + #{treatmentForSeriousDisease}, + #{specialDeduction}, + #{totalWages}, + #{aggregatePersonalIncomeTax}, + #{remarks}, + #{dimission}, + #{dimissionDate}, + #{subsidyDeductMoney}, + #{breakfastSubsidy}, + #{lunchSubsidy}, + #{supperSubsidy}, + #{accountNumber}, + #{openingBank}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{sparedSix}, + #{delFlag}, + + + + + update cw_new_employee_information + + create_time = #{createTime}, + name = #{name}, + e_mail = #{email}, + jobs = #{jobs}, + dept_name = #{deptName}, + basic_salary = #{basicSalary}, + jobs_salary = #{jobsSalary}, + daily_wage = #{dailyWage}, + hours_salary = #{hoursSalary}, + shift_the_length = #{shiftTheLength}, + level_of_education = #{levelOfEducation}, + contract_year = #{contractYear}, + social_security_status = #{socialSecurityStatus}, + entry_date = #{entryDate}, + seniority = #{seniority}, + probation_period = #{probationPeriod}, + level_of_education_subsidies = #{levelOfEducationSubsidies}, + contract_subsidies = #{contractSubsidies}, + seniority_subsidies = #{senioritySubsidies}, + social_security_subsidies = #{socialSecuritySubsidies}, + full_frequently_subsidies = #{fullFrequentlySubsidies}, + night_shift_subsidies = #{nightShiftSubsidies}, + dinner_subsidies = #{dinnerSubsidies}, + fixed_allowance = #{fixedAllowance}, + other_subsidies = #{otherSubsidies}, + is_overtime_pay = #{isOvertimePay}, + deductions = #{deductions}, + virtual_workstation = #{virtualWorkstation}, + endowment_insurance = #{endowmentInsurance}, + medical_insurance = #{medicalInsurance}, + employment_injury_insurance = #{employmentInjuryInsurance}, + maternity_insurance = #{maternityInsurance}, + unemployment_insurance = #{unemploymentInsurance}, + children_education = #{childrenEducation}, + support_the_old = #{supportTheOld}, + housing_loans = #{housingLoans}, + housing_rents = #{housingRents}, + adult_education = #{adultEducation}, + treatment_for_serious_disease = #{treatmentForSeriousDisease}, + special_deduction = #{specialDeduction}, + total_wages = #{totalWages}, + aggregate_personal_income_tax = #{aggregatePersonalIncomeTax}, + remarks = #{remarks}, + dimission = #{dimission}, + dimission_date = #{dimissionDate}, + subsidy_deduct_money = #{subsidyDeductMoney}, + breakfast_subsidy = #{breakfastSubsidy}, + lunch_subsidy = #{lunchSubsidy}, + supper_subsidy = #{supperSubsidy}, + account_number = #{accountNumber}, + opening_bank = #{openingBank}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + spared_six = #{sparedSix}, + del_flag = #{delFlag}, + + where id = #{id} + + + + + update cw_new_employee_information set other_subsidies = 0 , deductions = 0 + + + + delete from cw_new_employee_information where id = #{id} + + + + delete from cw_new_employee_information where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwNewPayrollMapper.xml b/evo/src/main/resources/mybatis/management/CwNewPayrollMapper.xml new file mode 100644 index 0000000..5bc7536 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwNewPayrollMapper.xml @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, affiliation_month, department_name, name, basic_salary, jobs_salary,daily_wage, hours_salary, basic_monthly_salary, should_attendance_number, real_attendance_number, absenteeism_salary, absenteeism_subsidies, level_of_education_subsidies, contract_subsidies,seniority_salary,social_security_subsidies,full_frequently_subsidies, overtime_salary, night_shift_subsidies, dinner_subsidies, subsidy_or_bonus,deductions,meal_fee, salary, pay_insurance, endowment_insurance, medical_insurance, employment_injury_insurance, maternity_insurance, unemployment_insurance,salary_before_tax, total_wages, annual_exemption_amount, special_deduction, taxable_income, tax_rate, slow_down_the_deduction, aggregate_personal_income_tax, tax_payable, net_payroll, remarks, spared_one, spared_two, sapred_three, spared_four, del_flag from cw_new_payroll + + + + + + + + + + insert into cw_new_payroll + + create_time, + affiliation_month, + department_name, + name, + basic_salary, + jobs_salary, + daily_wage, + hours_salary, + basic_monthly_salary, + should_attendance_number, + real_attendance_number, + absenteeism_salary, + absenteeism_subsidies, + level_of_education_subsidies, + contract_subsidies, + seniority_salary, + social_security_subsidies, + full_frequently_subsidies, + overtime_salary, + night_shift_subsidies, + dinner_subsidies, + subsidy_or_bonus, + deductions, + meal_fee, + salary, + pay_insurance, + endowment_insurance, + medical_insurance, + employment_injury_insurance, + maternity_insurance, + unemployment_insurance, + salary_before_tax, + total_wages, + annual_exemption_amount, + special_deduction, + taxable_income, + tax_rate, + slow_down_the_deduction, + aggregate_personal_income_tax, + tax_payable, + net_payroll, + remarks, + spared_one, + spared_two, + sapred_three, + spared_four, + del_flag, + + + #{createTime}, + #{affiliationMonth}, + #{departmentName}, + #{name}, + #{basicSalary}, + #{jobsSalary}, + #{dailyWage}, + #{hoursSalary}, + #{basicMonthlySalary}, + #{shouldAttendanceNumber}, + #{realAttendanceNumber}, + #{absenteeismSalary}, + #{absenteeismSubsidies}, + #{levelOfEducationSubsidies}, + #{contractSubsidies}, + #{senioritySalary}, + #{socialSecuritySubsidies}, + #{fullFrequentlySubsidies}, + #{overtimeSalary}, + #{nightShiftSubsidies}, + #{dinnerSubsidies}, + #{subsidyOrBonus}, + #{deductions}, + #{mealFee}, + #{salary}, + #{payInsurance}, + #{endowmentInsurance}, + #{medicalInsurance}, + #{employmentInjuryInsurance}, + #{maternityInsurance}, + #{unemploymentInsurance}, + #{salaryBeforeTax}, + #{totalWages}, + #{annualExemptionAmount}, + #{specialDeduction}, + #{taxableIncome}, + #{taxRate}, + #{slowDownTheDeduction}, + #{aggregatePersonalIncomeTax}, + #{taxPayable}, + #{netPayroll}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sapredThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_new_payroll + + create_time = #{createTime}, + affiliation_month = #{affiliationMonth}, + department_name = #{departmentName}, + name = #{name}, + basic_salary = #{basicSalary}, + jobs_salary = #{jobsSalary}, + daily_wage = #{dailyWage}, + hours_salary = #{hoursSalary}, + basic_monthly_salary = #{basicMonthlySalary}, + should_attendance_number = #{shouldAttendanceNumber}, + real_attendance_number = #{realAttendanceNumber}, + absenteeism_salary = #{absenteeismSalary}, + absenteeism_subsidies = #{absenteeismSubsidies}, + level_of_education_subsidies = #{levelOfEducationSubsidies}, + contract_subsidies = #{contractSubsidies}, + seniority_salary = #{senioritySalary}, + social_security_subsidies = #{socialSecuritySubsidies}, + full_frequently_subsidies = #{fullFrequentlySubsidies}, + overtime_salary = #{overtimeSalary}, + night_shift_subsidies = #{nightShiftSubsidies}, + dinner_subsidies = #{dinnerSubsidies}, + subsidy_or_bonus = #{subsidyOrBonus}, + deductions = #{deductions}, + meal_fee = #{mealFee}, + salary = #{salary}, + pay_insurance = #{payInsurance}, + endowment_insurance = #{endowmentInsurance}, + medical_insurance = #{medicalInsurance}, + employment_injury_insurance = #{employmentInjuryInsurance}, + maternity_insurance = #{maternityInsurance}, + unemployment_insurance = #{unemploymentInsurance}, + salary_before_tax = #{salaryBeforeTax}, + total_wages = #{totalWages}, + annual_exemption_amount = #{annualExemptionAmount}, + special_deduction = #{specialDeduction}, + taxable_income = #{taxableIncome}, + tax_rate = #{taxRate}, + slow_down_the_deduction = #{slowDownTheDeduction}, + aggregate_personal_income_tax = #{aggregatePersonalIncomeTax}, + tax_payable = #{taxPayable}, + net_payroll = #{netPayroll}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_new_payroll where id = #{id} + + + + delete from cw_new_payroll where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwNonbusinessIncomeMapper.xml b/evo/src/main/resources/mybatis/management/CwNonbusinessIncomeMapper.xml new file mode 100644 index 0000000..b5ae488 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwNonbusinessIncomeMapper.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code,user_name, dept_name, pay_way, type, money, big_money, date, source, unit_name, remarks, not_invoice_amount, invoice_amount, not_proceeds_amount, proceeds_amount, settlement_ratio, leadership, leadership_time, spared_one, spared_two, spared_three, spared_four from cw_nonbusiness_income + + + + + + + + insert into cw_nonbusiness_income + + create_time, + code, + user_name, + dept_name, + pay_way, + type, + money, + big_money, + date, + source, + unit_name, + remarks, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + leadership, + leadership_time, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{userName}, + #{deptName}, + #{payWay}, + #{type}, + #{money}, + #{bigMoney}, + #{date}, + #{source}, + #{unitName}, + #{remarks}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{leadership}, + #{leadershipTime}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_nonbusiness_income + + create_time = #{createTime}, + code = #{code}, + user_name = #{userName}, + dept_name = #{deptName}, + pay_way = #{payWay}, + type = #{type}, + money = #{money}, + big_money = #{bigMoney}, + date = #{date}, + source = #{source}, + unit_name = #{unitName}, + remarks = #{remarks}, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{invoiceAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_nonbusiness_income where id = #{id} + + + + delete from cw_nonbusiness_income where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwOtherPaymentInfoMapper.xml b/evo/src/main/resources/mybatis/management/CwOtherPaymentInfoMapper.xml new file mode 100644 index 0000000..3063e9e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwOtherPaymentInfoMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, other_payment_id, other_payment_code, code, contract_money, proportion, payment_amount, spared_one, spared_two, spared_three, spared_four from cw_other_payment_info + + + + + + + + insert into cw_other_payment_info + + create_time, + other_payment_id, + other_payment_code, + code, + contract_money, + proportion, + payment_amount, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{otherPaymentId}, + #{otherPaymentCode}, + #{code}, + #{contractMoney}, + #{proportion}, + #{paymentAmount}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_other_payment_info + + create_time = #{createTime}, + other_payment_id = #{otherPaymentId}, + other_payment_code = #{otherPaymentCode}, + code = #{code}, + contract_money = #{contractMoney}, + proportion = #{proportion}, + payment_amount = #{paymentAmount}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_other_payment_info where id = #{id} + + + + delete from cw_other_payment_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwOtherPaymentMapper.xml b/evo/src/main/resources/mybatis/management/CwOtherPaymentMapper.xml new file mode 100644 index 0000000..b194e09 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwOtherPaymentMapper.xml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, user_name, dept_name, date_time, pay_way, money, big_money, cause, unit_name, account_number, opening_bank, remarks, leadership, leadership_time, reviewer, reviewer_time, not_invoice_amount, invoice_amount, not_proceeds_amount, proceeds_amount, settlement_ratio, spared_one, spared_two, spaerd_three, spared_four from cw_other_payment + + + + + + + + insert into cw_other_payment + + create_time, + code, + user_name, + dept_name, + date_time, + pay_way, + money, + big_money, + cause, + unit_name, + account_number, + opening_bank, + remarks, + leadership, + leadership_time, + reviewer, + reviewer_time, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + spared_one, + spared_two, + spaerd_three, + spared_four, + + + #{createTime}, + #{code}, + #{userName}, + #{deptName}, + #{dateTime}, + #{payWay}, + #{money}, + #{bigMoney}, + #{cause}, + #{unitName}, + #{accountNumber}, + #{openingBank}, + #{remarks}, + #{leadership}, + #{leadershipTime}, + #{reviewer}, + #{reviewerTime}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{sparedOne}, + #{sparedTwo}, + #{spaerdThree}, + #{sparedFour}, + + + + + update cw_other_payment + + create_time = #{createTime}, + code = #{code}, + user_name = #{userName}, + dept_name = #{deptName}, + date_time = #{dateTime}, + pay_way = #{payWay}, + money = #{money}, + big_money = #{bigMoney}, + cause = #{cause}, + unit_name = #{unitName}, + account_number = #{accountNumber}, + opening_bank = #{openingBank}, + remarks = #{remarks}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + reviewer = #{reviewer}, + reviewer = null, + reviewer_time = #{reviewerTime}, + reviewer_time = null, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{invoiceAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spaerd_three = #{spaerdThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_other_payment where id = #{id} + + + + delete from cw_other_payment where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwPayrollMapper.xml b/evo/src/main/resources/mybatis/management/CwPayrollMapper.xml new file mode 100644 index 0000000..2330464 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwPayrollMapper.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, affiliation_month, department_name, name, basic_monthly_salary, daily_wages, should_attendance_number, real_attendance_number, late_deductions,subsidy_or_bonus, incentive_fee,seniority_salary, traffic_allowance, communicate_allowance, housing_allowance, meal_allowance, salary, pay_insurance, salary_before_tax, total_wages, annual_exemption_amount, special_deduction,taxable_income, tax_rate, slow_down_the_deduction, aggregate_personal_income_tax, tax_payable, net_payroll, remarks, spared_one, spared_two, sapred_three, spared_four, del_flag from cw_payroll + + + + + + + + insert into cw_payroll + + create_time, + affiliation_month, + department_name, + name, + basic_monthly_salary, + daily_wages, + should_attendance_number, + real_attendance_number, + late_deductions, + subsidy_or_bonus, + incentive_fee, + seniority_salary, + traffic_allowance, + communicate_allowance, + housing_allowance, + meal_allowance, + salary, + pay_insurance, + salary_before_tax, + total_wages, + annual_exemption_amount, + special_deduction, + taxable_income, + tax_rate, + slow_down_the_deduction, + aggregate_personal_income_tax, + tax_payable, + net_payroll, + remarks, + spared_one, + spared_two, + sapred_three, + spared_four, + del_flag, + + + #{createTime}, + #{affiliationMonth}, + #{departmentName}, + #{name}, + #{basicMonthlySalary}, + #{dailyWages}, + #{shouldAttendanceNumber}, + #{realAttendanceNumber}, + #{lateDeductions}, + #{subsidyOrBonus}, + #{incentiveFee}, + #{senioritySalary}, + #{trafficAllowance}, + #{communicateAllowance}, + #{housingAllowance}, + #{mealAllowance}, + #{salary}, + #{payInsurance}, + #{salaryBeforeTax}, + #{totalWages}, + #{annualExemptionAmount}, + #{specialDeduction}, + #{taxableIncome}, + #{taxRate}, + #{slowDownTheDeduction}, + #{aggregatePersonalIncomeTax}, + #{taxPayable}, + #{netPayroll}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sapredThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_payroll + + create_time = #{createTime}, + affiliation_month = #{affiliationMonth}, + department_name = #{departmentName}, + name = #{name}, + basic_monthly_salary = #{basicMonthlySalary}, + daily_wages = #{dailyWages}, + should_attendance_number = #{shouldAttendanceNumber}, + real_attendance_number = #{realAttendanceNumber}, + late_deductions = #{lateDeductions}, + subsidy_or_bonus = #{subsidyOrBonus}, + incentive_fee = #{incentiveFee}, + seniority_salary = #{senioritySalary}, + traffic_allowance = #{trafficAllowance}, + communicate_allowance = #{communicateAllowance}, + housing_allowance = #{housingAllowance}, + meal_allowance = #{mealAllowance}, + salary = #{salary}, + pay_insurance = #{payInsurance}, + salary_before_tax = #{salaryBeforeTax}, + total_wages = #{totalWages}, + annual_exemption_amount = #{annualExemptionAmount}, + special_deduction = #{specialDeduction}, + taxable_income = #{taxableIncome}, + tax_rate = #{taxRate}, + slow_down_the_deduction = #{slowDownTheDeduction}, + aggregate_personal_income_tax = #{aggregatePersonalIncomeTax}, + tax_payable = #{taxPayable}, + net_payroll = #{netPayroll}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_payroll where id = #{id} + + + + delete from cw_payroll where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwRulesMapper.xml b/evo/src/main/resources/mybatis/management/CwRulesMapper.xml new file mode 100644 index 0000000..bee76f2 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwRulesMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, working_days, sequence, name, rules, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from cw_rules + + + + + + + + insert into cw_rules + + create_time, + working_days, + sequence, + name, + rules, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{workingDays}, + #{sequence}, + #{name}, + #{rules}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_rules + + create_time = #{createTime}, + working_days = #{workingDays}, + sequence = #{sequence}, + name = #{name}, + rules = #{rules}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_rules where id = #{id} + + + + update cw_rules set del_flag = 1 where id in + + #{id} + + + + + + insert into cw_rules(working_days, sequence, name, rules, remarks, spared_one, spared_two, spared_three, spared_four, del_flag) + VALUES + + (#{item.workingDays}, + #{item.sequence}, + #{item.name}, + #{item.rules}, + #{item.remarks}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.delFlag}) + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwSnDetailMapper.xml b/evo/src/main/resources/mybatis/management/CwSnDetailMapper.xml new file mode 100644 index 0000000..18b18de --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwSnDetailMapper.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, sn, version_code, version_name, token, ip, sn_time, type, spared_one, spared_two, spared_three, spared_four from cw_sn_detail + + + + + + + + insert into cw_sn_detail + + create_time, + sn, + version_code, + version_name, + token, + ip, + sn_time, + type, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{sn}, + #{versionCode}, + #{versionName}, + #{token}, + #{ip}, + #{snTime}, + #{type}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_sn_detail + + create_time = #{createTime}, + sn = #{sn}, + version_code = #{versionCode}, + version_name = #{versionName}, + token = #{token}, + ip = #{ip}, + sn_time = #{snTime}, + type = #{type}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_sn_detail where id = #{id} + + + + delete from cw_sn_detail where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwTaxRateInfoMapper.xml b/evo/src/main/resources/mybatis/management/CwTaxRateInfoMapper.xml new file mode 100644 index 0000000..0723025 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwTaxRateInfoMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + select id, create_time, name, tax_rate, make_out_an_invoice, remarks, spared_one, spared_two, spared_three, spared_four from cw_tax_rate_info + + + + + + + + insert into cw_tax_rate_info + + create_time, + name, + tax_rate, + make_out_an_invoice, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{name}, + #{taxRate}, + #{makeOutAnInvoice}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_tax_rate_info + + create_time = #{createTime}, + name = #{name}, + tax_rate = #{taxRate}, + make_out_an_invoice = #{makeOutAnInvoice}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_tax_rate_info where id = #{id} + + + + delete from cw_tax_rate_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwTypeTimeMapper.xml b/evo/src/main/resources/mybatis/management/CwTypeTimeMapper.xml new file mode 100644 index 0000000..f5c7dca --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwTypeTimeMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + select id, create_time, type, time, spared_one, spared_two, spared_three, spared_four from cw_type_time + + + + + + + + insert into cw_type_time + + create_time, + type, + time, + to, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{type}, + #{time}, + #{to}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_type_time + + create_time = #{createTime}, + type = #{type}, + time = #{time}, + to = #{to}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_type_time where id = #{id} + + + + delete from cw_type_time where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwWageSummaryMapper.xml b/evo/src/main/resources/mybatis/management/CwWageSummaryMapper.xml new file mode 100644 index 0000000..5ca03f1 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwWageSummaryMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, affiliation_month, review_one, review_two, review_three, review_four, remarks, sapred_one, spared_two, spared_three, spared_four, del_flag from cw_wage_summary + + + + + + + + insert into cw_wage_summary + + create_time, + affiliation_month, + review_one, + review_two, + review_three, + review_four, + remarks, + sapred_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{affiliationMonth}, + #{reviewOne}, + #{reviewTwo}, + #{reviewThree}, + #{reviewFour}, + #{remarks}, + #{sapredOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_wage_summary + + create_time = #{createTime}, + affiliation_month = #{affiliationMonth}, + review_one = #{reviewOne}, + review_two = #{reviewTwo}, + review_three = #{reviewThree}, + review_four = #{reviewFour}, + remarks = #{remarks}, + sapred_one = #{sapredOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_wage_summary where id = #{id} + + + + delete from cw_wage_summary where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwWorkOvertimeRecordMapper.xml b/evo/src/main/resources/mybatis/management/CwWorkOvertimeRecordMapper.xml new file mode 100644 index 0000000..2cdc5bd --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwWorkOvertimeRecordMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, dept_name, name, work_overtime_date, work_overtime_number, remarks, spread_one, spared_two, spared_three, spared_four, del_flag from cw_work_overtime_record + + + + + + + + insert into cw_work_overtime_record + + create_time, + dept_name, + name, + work_overtime_date, + work_overtime_number, + remarks, + spread_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{deptName}, + #{name}, + #{workOvertimeDate}, + #{workOvertimeNumber}, + #{remarks}, + #{spreadOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update cw_work_overtime_record + + create_time = #{createTime}, + dept_name = #{deptName}, + name = #{name}, + work_overtime_date = #{workOvertimeDate}, + work_overtime_number = #{workOvertimeNumber}, + remarks = #{remarks}, + spread_one = #{spreadOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from cw_work_overtime_record where id = #{id} + + + + delete from cw_work_overtime_record where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CwWorkingDaysConfigurationMapper.xml b/evo/src/main/resources/mybatis/management/CwWorkingDaysConfigurationMapper.xml new file mode 100644 index 0000000..1378e05 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CwWorkingDaysConfigurationMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, date, working_days,working_days_houqin,working_days_zhuangpei,working_days_jijia,working_days_zhijian,post_wage, shift_days,remarks, spared_one, spared_two, spared_three, spared_four from cw_working_days_configuration + + + + + + + + insert into cw_working_days_configuration + + create_time, + date, + working_days, + working_days_houqin, + working_days_zhuangpei, + working_days_jijia, + working_days_zhijian, + post_wage, + shift_days, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{date}, + #{workingDays}, + #{workingDaysHouqin}, + #{workingDaysZhuangpei}, + #{workingDaysJijia}, + #{workingDaysZhijian}, + #{postWage}, + #{shiftDays}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cw_working_days_configuration + + create_time = #{createTime}, + date = #{date}, + working_days = #{workingDays}, + working_days_houqin = #{workingDaysHouqin}, + working_days_zhuangpei = #{workingDaysZhuangpei}, + working_days_jijia = #{workingDaysJijia}, + working_days_zhijian = #{workingDaysZhijian}, + post_wage = #{postWage}, + shift_days = #{shiftDays}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cw_working_days_configuration where id = #{id} + + + + delete from cw_working_days_configuration where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CyConsumptionInfoMapper.xml b/evo/src/main/resources/mybatis/management/CyConsumptionInfoMapper.xml new file mode 100644 index 0000000..4313d2e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CyConsumptionInfoMapper.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id,statistics_id, create_time, date_time, name, shang_ban, xia_ban, duration, breakfast_number, breakfast_subsidy, breakfast_personal_consumption, breakfast_sum_consumption, lunch_number, lunch_subsidy, lunch_presonal_consumption, lunch_sum_consumption, supper_number, supper_subsidy, supper_personal_consumption, supper_sum_consumption, sum_subsidy, personal_sum_consumption, sum_consumption, spared_one, spared_two, spared_three, spared_four from cy_consumption_info + + + + + + + + insert into cy_consumption_info + + create_time, + statistics_id, + date_time, + name, + shang_ban, + xia_ban, + duration, + breakfast_number, + breakfast_subsidy, + breakfast_personal_consumption, + breakfast_sum_consumption, + lunch_number, + lunch_subsidy, + lunch_presonal_consumption, + lunch_sum_consumption, + supper_number, + supper_subsidy, + supper_personal_consumption, + supper_sum_consumption, + sum_subsidy, + personal_sum_consumption, + sum_consumption, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{statisticsId}, + #{dateTime}, + #{name}, + #{shangBan}, + #{xiaBan}, + #{duration}, + #{breakfastNumber}, + #{breakfastSubsidy}, + #{breakfastPersonalConsumption}, + #{breakfastSumConsumption}, + #{lunchNumber}, + #{lunchSubsidy}, + #{lunchPresonalConsumption}, + #{lunchSumConsumption}, + #{supperNumber}, + #{supperSubsidy}, + #{supperPersonalConsumption}, + #{supperSumConsumption}, + #{sumSubsidy}, + #{personalSumConsumption}, + #{sumConsumption}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cy_consumption_info + + create_time = #{createTime}, + statistics_id = #{statisticsId}, + date_time = #{dateTime}, + name = #{name}, + shang_ban = #{shangBan}, + xia_ban = #{xiaBan}, + duration = #{duration}, + breakfast_number = #{breakfastNumber}, + breakfast_subsidy = #{breakfastSubsidy}, + breakfast_personal_consumption = #{breakfastPersonalConsumption}, + breakfast_sum_consumption = #{breakfastSumConsumption}, + lunch_number = #{lunchNumber}, + lunch_subsidy = #{lunchSubsidy}, + lunch_presonal_consumption = #{lunchPresonalConsumption}, + lunch_sum_consumption = #{lunchSumConsumption}, + supper_number = #{supperNumber}, + supper_subsidy = #{supperSubsidy}, + supper_personal_consumption = #{supperPersonalConsumption}, + supper_sum_consumption = #{supperSumConsumption}, + sum_subsidy = #{sumSubsidy}, + personal_sum_consumption = #{personalSumConsumption}, + sum_consumption = #{sumConsumption}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cy_consumption_info where id = #{id} + + + + delete from cy_consumption_info where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CyFaceInfoMapper.xml b/evo/src/main/resources/mybatis/management/CyFaceInfoMapper.xml new file mode 100644 index 0000000..f567c90 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CyFaceInfoMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + select id, create_time, date, name, time,sign from cy_face_info + + + + + + + + insert into cy_face_info + + create_time, + date, + name, + time, + sign, + + + #{createTime}, + #{date}, + #{name}, + #{time}, + #{sign}, + + + + + update cy_face_info + + create_time = #{createTime}, + date = #{date}, + name = #{name}, + time = #{time}, + sign = #{sign}, + + where id = #{id} + + + + delete from cy_face_info where id = #{id} + + + + delete from cy_face_info where id in + + #{id} + + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/CyStatisticsInfoMapper.xml b/evo/src/main/resources/mybatis/management/CyStatisticsInfoMapper.xml new file mode 100644 index 0000000..ec63577 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/CyStatisticsInfoMapper.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, date, name, breakfast_number, breakfast_subsidy, breakfast_personal_consumption, breakfast_sum_consumption, lunch_number, lunch_subsidy, lunch_presonal_consumption, lunch_sum_consumption, supper_number, supper_subsidy, supper_personal_consumption, supper_sum_consumption, sum_subsidy, personal_sum_consumption, sum_consumption, remarks, spared_one, spared_two, spared_three, spared_four from cy_statistics_info + + + + + + + + insert into cy_statistics_info + + create_time, + date, + name, + breakfast_number, + breakfast_subsidy, + breakfast_personal_consumption, + breakfast_sum_consumption, + lunch_number, + lunch_subsidy, + lunch_presonal_consumption, + lunch_sum_consumption, + supper_number, + supper_subsidy, + supper_personal_consumption, + supper_sum_consumption, + sum_subsidy, + personal_sum_consumption, + sum_consumption, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{date}, + #{name}, + #{breakfastNumber}, + #{breakfastSubsidy}, + #{breakfastPersonalConsumption}, + #{breakfastSumConsumption}, + #{lunchNumber}, + #{lunchSubsidy}, + #{lunchPresonalConsumption}, + #{lunchSumConsumption}, + #{supperNumber}, + #{supperSubsidy}, + #{supperPersonalConsumption}, + #{supperSumConsumption}, + #{sumSubsidy}, + #{personalSumConsumption}, + #{sumConsumption}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update cy_statistics_info + + create_time = #{createTime}, + date = #{date}, + name = #{name}, + breakfast_number = #{breakfastNumber}, + breakfast_subsidy = #{breakfastSubsidy}, + breakfast_personal_consumption = #{breakfastPersonalConsumption}, + breakfast_sum_consumption = #{breakfastSumConsumption}, + lunch_number = #{lunchNumber}, + lunch_subsidy = #{lunchSubsidy}, + lunch_presonal_consumption = #{lunchPresonalConsumption}, + lunch_sum_consumption = #{lunchSumConsumption}, + supper_number = #{supperNumber}, + supper_subsidy = #{supperSubsidy}, + supper_personal_consumption = #{supperPersonalConsumption}, + supper_sum_consumption = #{supperSumConsumption}, + sum_subsidy = #{sumSubsidy}, + personal_sum_consumption = #{personalSumConsumption}, + sum_consumption = #{sumConsumption}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from cy_statistics_info where id = #{id} + + + + delete from cy_statistics_info where id in + + #{id} + + + + + + + + + update cy_statistics_info + + create_time = #{createTime}, + breakfast_number = #{breakfastNumber}, + breakfast_subsidy = #{breakfastSubsidy}, + breakfast_personal_consumption = #{breakfastPersonalConsumption}, + breakfast_sum_consumption = #{breakfastSumConsumption}, + lunch_number = #{lunchNumber}, + lunch_subsidy = #{lunchSubsidy}, + lunch_presonal_consumption = #{lunchPresonalConsumption}, + lunch_sum_consumption = #{lunchSumConsumption}, + supper_number = #{supperNumber}, + supper_subsidy = #{supperSubsidy}, + supper_personal_consumption = #{supperPersonalConsumption}, + supper_sum_consumption = #{supperSumConsumption}, + sum_subsidy = #{sumSubsidy}, + personal_sum_consumption = #{personalSumConsumption}, + sum_consumption = #{sumConsumption}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where date = #{date} and name = #{name}; + + + diff --git a/evo/src/main/resources/mybatis/management/EvoInOutStorageManagementMapper.xml b/evo/src/main/resources/mybatis/management/EvoInOutStorageManagementMapper.xml new file mode 100644 index 0000000..1cea956 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/EvoInOutStorageManagementMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, material_name, figure_number, materials, use_to,product_id, quantity,qualified_number, unit,flag, applicant, appliy_time, in_out_flag, status, approve_by, approve_time, operate_by, operate_time from evo_in_out_storage_management + + + + + + + + insert into evo_in_out_storage_management + + material_name, + figure_number, + materials, + use_to, + quantity, + unit, + applicant, + appliy_time, + in_out_flag, + status, + approve_by, + approve_time, + operate_by, + operate_time, + qualified_number, + product_id, + flag, + + + #{materialName}, + #{figureNumber}, + #{materials}, + #{useTo}, + #{quantity}, + #{unit}, + #{applicant}, + #{appliyTime}, + #{inOutFlag}, + #{status}, + #{approveBy}, + #{approveTime}, + #{operateBy}, + #{operateTime}, + #{qualifiedNumber}, + #{productId}, + #{flag}, + + + + + update evo_in_out_storage_management + + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + use_to = #{useTo}, + quantity = #{quantity}, + unit = #{unit}, + applicant = #{applicant}, + appliy_time = #{appliyTime}, + in_out_flag = #{inOutFlag}, + status = #{status}, + approve_by = #{approveBy}, + approve_time = #{approveTime}, + operate_by = #{operateBy}, + operate_time = #{operateTime}, + qualified_number = #{qualifiedNumber}, + product_id = #{productId}, + + where id = #{id} + + + + delete from evo_in_out_storage_management where id = #{id} + + + diff --git a/evo/src/main/resources/mybatis/management/EvoInvalidLibraryMapper.xml b/evo/src/main/resources/mybatis/management/EvoInvalidLibraryMapper.xml new file mode 100644 index 0000000..afe73bb --- /dev/null +++ b/evo/src/main/resources/mybatis/management/EvoInvalidLibraryMapper.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, product_bill_code, item_name, process, material_name, figure_number, materials, invalid_number, repair_number, unit, operator, operator_time, remark, quality_inspector, quality_time from evo_invalid_library + + + + + + + + insert into evo_invalid_library + + product_bill_code, + item_name, + process, + material_name, + figure_number, + materials, + invalid_number, + repair_number, + unit, + operator, + operator_time, + remark, + quality_inspector, + quality_time, + + + #{productBillCode}, + #{itemName}, + #{process}, + #{materialName}, + #{figureNumber}, + #{materials}, + #{invalidNumber}, + #{repairNumber}, + #{unit}, + #{operator}, + #{operatorTime}, + #{remark}, + #{qualityInspector}, + #{qualityTime}, + + + + + update evo_invalid_library + + product_bill_code = #{productBillCode}, + item_name = #{itemName}, + process = #{process}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + invalid_number = #{invalidNumber}, + repair_number = #{repairNumber}, + unit = #{unit}, + operator = #{operator}, + operator_time = #{operatorTime}, + remark = #{remark}, + quality_inspector = #{qualityInspector}, + quality_time = #{qualityTime}, + + where id = #{id} + + + + delete from evo_invalid_library where id = #{id} + + + + delete from evo_invalid_library where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/EvoOperatorTypeJdMapper.xml b/evo/src/main/resources/mybatis/management/EvoOperatorTypeJdMapper.xml new file mode 100644 index 0000000..a1b5540 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/EvoOperatorTypeJdMapper.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + select id, operator_code, material_code from evo_operator_type_jd + + + + + + + + insert into evo_operator_type_jd + + operator_code, + material_code, + + + #{operatorCode}, + #{materialCode}, + + + + + update evo_operator_type_jd + + operator_code = #{operatorCode}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from evo_operator_type_jd where id = #{id} + + + + delete from evo_operator_type_jd where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/EvoStagnantStorageMapper.xml b/evo/src/main/resources/mybatis/management/EvoStagnantStorageMapper.xml new file mode 100644 index 0000000..a63f7b3 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/EvoStagnantStorageMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, name, type_name, figure_number, type, materials, piece_weight, category, unit, univalence, unit_price, quantity, lock_number, available_number, remarks from evo_stagnant_storage + + + + + + + + + + insert into evo_stagnant_storage + + name, + type_name, + figure_number, + type, + materials, + piece_weight, + category, + unit, + univalence, + unit_price, + quantity, + lock_number, + available_number, + remarks, + + + #{name}, + #{typeName}, + #{figureNumber}, + #{type}, + #{materials}, + #{pieceWeight}, + #{category}, + #{unit}, + #{univalence}, + #{unitPrice}, + #{quantity}, + #{lockNumber}, + #{availableNumber}, + #{remarks}, + + + + + update evo_stagnant_storage + + name = #{name}, + type_name = #{typeName}, + figure_number = #{figureNumber}, + type = #{type}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + category = #{category}, + unit = #{unit}, + univalence = #{univalence}, + unit_price = #{unitPrice}, + quantity = #{quantity}, + lock_number = #{lockNumber}, + available_number = #{availableNumber}, + remarks = #{remarks}, + + where id = #{id} + + + + delete from evo_stagnant_storage where id = #{id} + + + + delete from evo_stagnant_storage where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/ImCustomerMapper.xml b/evo/src/main/resources/mybatis/management/ImCustomerMapper.xml new file mode 100644 index 0000000..9d11a7a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImCustomerMapper.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, customer_name, customer_to_as,customer_group,customer_group_name,bank_address, customer_address,interbank_number,swift_code, customer_level, customer_head, phone, email, bank, bank_number, duty_paragraph, customer_type, contract_code, remark, create_by, create_time, update_by, update_time from im_customer + + + + + + + + + + insert into im_customer + + customer_name, + customer_to_as, + customer_address, + customer_group, + customer_group_name, + customer_level, + customer_head, + phone, + email, + bank, + bank_address, + bank_number, + duty_paragraph, + customer_type, + contract_code, + remark, + create_by, + create_time, + update_by, + update_time, + interbank_number, + swift_code, + + + #{customerName}, + #{customerToAs}, + #{customerAddress}, + #{customerGroup}, + #{customerGroupName}, + #{customerLevel}, + #{customerHead}, + #{phone}, + #{email}, + #{bank}, + #{bankAddress}, + #{bankNumber}, + #{dutyParagraph}, + #{customerType}, + #{contractCode}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{interbankNumber}, + #{swiftCode}, + + + + + update im_customer + + customer_name = #{customerName}, + customer_to_as = #{customerToAs}, + customer_address = #{customerAddress}, + customer_group = #{customerGroup}, + customer_group_name = #{customerGroupName}, + customer_level = #{customerLevel}, + customer_head = #{customerHead}, + phone = #{phone}, + email = #{email}, + bank = #{bank}, + bank_address = #{bankAddress}, + bank_number = #{bankNumber}, + duty_paragraph = #{dutyParagraph}, + customer_type = #{customerType}, + contract_code = #{contractCode}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + interbank_number = #{interbankNumber}, + swift_code = #{swiftCode}, + + where id = #{id} + + + + delete from im_customer where id = #{id} + + + + delete from im_customer where id in + + #{id} + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/ImCustomerTypeMapper.xml b/evo/src/main/resources/mybatis/management/ImCustomerTypeMapper.xml new file mode 100644 index 0000000..64d530e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImCustomerTypeMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + select id, customer_group_name, create_time, create_by from im_customer_group + + + + + + + + insert into im_customer_group + + customer_group_name, + create_time, + create_by, + + + #{customerGroupName}, + #{createTime}, + #{createBy}, + + + + + update im_customer_group + + customer_group_name = #{customerGroupName}, + create_time = #{createTime}, + create_by = #{createBy}, + + where id = #{id} + + + + delete from im_customer_group where id = #{id} + + + + delete from im_customer_group where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/ImDeliveryUnitMapper.xml b/evo/src/main/resources/mybatis/management/ImDeliveryUnitMapper.xml new file mode 100644 index 0000000..cddbfb8 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImDeliveryUnitMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, unit_name, department_id, department_name, unit_principal, unit_phone, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_delivery_unit + + + + + + + + insert into im_delivery_unit + + create_time, + unit_name, + department_id, + department_name, + unit_principal, + unit_phone, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{unitName}, + #{departmentId}, + #{departmentName}, + #{unitPrincipal}, + #{unitPhone}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_delivery_unit + + create_time = #{createTime}, + unit_name = #{unitName}, + department_id = #{departmentId}, + department_name = #{departmentName}, + unit_principal = #{unitPrincipal}, + unit_phone = #{unitPhone}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_delivery_unit where id = #{id} + + + + update im_delivery_unit set del_flag = 1 where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImLogisticsMapper.xml b/evo/src/main/resources/mybatis/management/ImLogisticsMapper.xml new file mode 100644 index 0000000..c47a7de --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImLogisticsMapper.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + select id, create_time, logistics_name, logistics_principal, logistics_phone, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_logistics + + + + + + + + insert into im_logistics + + create_time, + logistics_name, + logistics_principal, + logistics_phone, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{logisticsName}, + #{logisticsPrincipal}, + #{logisticsPhone}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_logistics + + create_time = #{createTime}, + logistics_name = #{logisticsName}, + logistics_principal = #{logisticsPrincipal}, + logistics_phone = #{logisticsPhone}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_logistics where id = #{id} + + + + delete from im_logistics where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImMaterialGroupMapper.xml b/evo/src/main/resources/mybatis/management/ImMaterialGroupMapper.xml new file mode 100644 index 0000000..9ce1516 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImMaterialGroupMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + select id, group_name from im_material_group + + + + + + + + insert into im_material_group + + group_name, + + + #{groupName}, + + + + + update im_material_group + + group_name = #{groupName}, + + where id = #{id} + + + + delete from im_material_group where id = #{id} + + + + delete from im_material_group where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImMaterialMapper.xml b/evo/src/main/resources/mybatis/management/ImMaterialMapper.xml new file mode 100644 index 0000000..957f7a6 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImMaterialMapper.xml @@ -0,0 +1,517 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time,material_code, material_name, specification_type,material_group, figure_number,len,wid,wid_two,altitude,thickness,thickness_two,outer_diameter,internal_diameter,colour,category,purchase_mark, material_type_id, material_type_name,materials,piece_weight, unit_of_measurement_id, unit_of_measurement_name, warehouse_id, warehouse_name, preferential_supplier_id, preferential_origin_name,preferential_origin_name_two,preferential_origin_name_three, common, minimum, highest,highest_number, picture, univalence,unit_price, tailor,tailor_measure,surplus_measure,proportion,stock_requisition_unit,remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_material + + + + select m.id, m.create_time,m.material_code, m.material_name, m.specification_type, m.figure_number,m.len,m.wid,m.wid_two,m.altitude, + m.thickness,m.thickness_two,m.outer_diameter,m.internal_diameter,m.colour,m.category,m.purchase_mark, m.material_type_id, + m.material_type_name,m.materials,m.piece_weight, m.unit_of_measurement_id, m.unit_of_measurement_name, m.warehouse_id, + m.warehouse_name, m.preferential_supplier_id, m.preferential_origin_name,m.preferential_origin_name_two, + m.preferential_origin_name_three, m.common, m.minimum, m.highest,m.highest_number, m.picture, m.univalence,m.unit_price, + m.tailor,tailor_measure,m.surplus_measure,m.proportion,m.stock_requisition_unit,m.remark, m.spared_one, + m.spared_two, m.spared_three, m.spared_four, m.del_flag ,i.quantity from im_material m inner join pw_inventory_detail i + + + + + + + + + + + + + + + + + + + + + + insert into im_material + + create_time, + material_code, + material_name, + specification_type, + figure_number, + len, + wid, + wid_two, + altitude, + thickness, + thickness_two + outer_diameter, + internal_diameter, + colour, + category, + purchase_mark, + material_type_id, + material_type_name, + materials, + piece_weight, + unit_of_measurement_id, + unit_of_measurement_name, + warehouse_id, + warehouse_name, + preferential_supplier_id, + preferential_origin_name, + preferential_origin_name_two, + preferential_origin_name_three, + common, + minimum, + highest, + highest_number, + picture, + univalence, + unit_price, + tailor, + tailor_measure, + surplus_measure, + proportion, + stock_requisition_unit, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + material_group, + + + #{createTime}, + #{materialCode}, + #{materialName}, + #{specificationType}, + #{figureNumber}, + #{len}, + #{wid}, + #{widTwo}, + #{altitude}, + #{thickness}, + #{thicknessTwo}, + #{outerDiameter}, + #{internalDiameter}, + #{colour}, + #{category}, + #{purchaseMark}, + #{materialTypeId}, + #{materialTypeName}, + #{materials}, + #{pieceWeight}, + #{unitOfMeasurementId}, + #{unitOfMeasurementName}, + #{warehouseId}, + #{warehouseName}, + #{preferentialSupplierId}, + #{preferentialOriginName}, + #{preferentialOriginNameTwo}, + #{preferentialOriginNameThree}, + #{common}, + #{minimum}, + #{highest}, + #{highestNumber}, + #{picture}, + #{univalence}, + #{unitPrice}, + #{tailor}, + #{tailorMeasure}, + #{surplusMeasure}, + #{proportion}, + #{stockRequisitionUnit}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{materialGroup}, + + + + + update im_material + + create_time = #{createTime}, + material_code = #{materialCode}, + material_name = #{materialName}, + specification_type = #{specificationType}, + figure_number = #{figureNumber}, + len = #{len}, + wid = #{wid}, + wid_two = #{widTwo}, + altitude = #{altitude}, + thickness = #{thickness}, + thickness_two = #{thicknessTwo}, + outer_diameter = #{outerDiameter}, + internal_diameter = #{internalDiameter}, + colour = #{colour}, + category = #{category}, + category = null, + purchase_mark = #{purchaseMark}, + material_type_id = #{materialTypeId}, + material_type_name = #{materialTypeName}, + materials =#{materials}, + piece_weight = #{pieceWeight}, + unit_of_measurement_id = #{unitOfMeasurementId}, + unit_of_measurement_name = #{unitOfMeasurementName}, + warehouse_id = #{warehouseId}, + warehouse_name = #{warehouseName}, + preferential_supplier_id = #{preferentialSupplierId}, + preferential_origin_name = #{preferentialOriginName}, + preferential_origin_name_two = #{preferentialOriginNameTwo}, + preferential_origin_name_three = #{preferentialOriginNameThree}, + common = #{common}, + minimum = #{minimum}, + highest = #{highest}, + highest_number = #{highestNumber}, + picture = #{picture}, + univalence = #{univalence}, + unit_price = #{unitPrice}, + tailor = #{tailor}, + tailor_measure = #{tailorMeasure}, + surplus_measure = #{surplusMeasure}, + proportion = #{proportion}, + stock_requisition_unit = #{stockRequisitionUnit}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_material where id = #{id} + + + + delete from im_material where id in + + #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + delete from im_material + + diff --git a/evo/src/main/resources/mybatis/management/ImMaterialTypeMapper.xml b/evo/src/main/resources/mybatis/management/ImMaterialTypeMapper.xml new file mode 100644 index 0000000..0c1e8d8 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImMaterialTypeMapper.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + select id, create_time, parent_id, material_type_name, spared_one, spared_two, spared_three, spared_four, del_flag from im_material_type + + + + + + + + + + insert into im_material_type + + create_time, + parent_id, + material_type_name, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{parentId}, + #{materialTypeName}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_material_type + + create_time = #{createTime}, + parent_id = #{parentId}, + material_type_name = #{materialTypeName}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_material_type where id = #{id} + + + + delete from im_material_type where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/ImMeteringUnitMapper.xml b/evo/src/main/resources/mybatis/management/ImMeteringUnitMapper.xml new file mode 100644 index 0000000..36685e1 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImMeteringUnitMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + select id, create_time, unit_name, remark, spread_one, spared_two, spared_three, spared_four, del_flag from im_metering_unit + + + + + + + + insert into im_metering_unit + + create_time, + unit_name, + remark, + spread_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{unitName}, + #{remark}, + #{spreadOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_metering_unit + + create_time = #{createTime}, + unit_name = #{unitName}, + remark = #{remark}, + spread_one = #{spreadOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_metering_unit where id = #{id} + + + + update im_metering_unit set del_flag = 1 where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/ImProductReceiptMapper.xml b/evo/src/main/resources/mybatis/management/ImProductReceiptMapper.xml new file mode 100644 index 0000000..bd10a49 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImProductReceiptMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time,make_documents_code,project_name,proposer,recipient,inventory_status, delivery_unit_id, delivery_unit, code, worksheet_id, worksheet_code,productive_task_id,productive_task_code, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_product_receipt + + + + + + + + insert into im_product_receipt + + create_time, + make_documents_code, + project_name, + proposer, + recipient, + inventory_status, + delivery_unit_id, + delivery_unit, + code, + worksheet_id, + worksheet_code, + productive_task_id, + productive_task_code, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{makeDocumentsCode}, + #{projectName}, + #{proposer}, + #{recipient}, + #{inventoryStatus}, + #{deliveryUnitId}, + #{deliveryUnit}, + #{code}, + #{worksheetId}, + #{worksheetCode}, + #{productiveTaskId}, + #{productiveTaskCode}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_product_receipt + + create_time = #{createTime}, + make_documents_code = #{makeDocumentsCode}, + project_name = #{projectName}, + proposer = #{proposer}, + recipient = #{recipient}, + inventory_status = #{inventoryStatus}, + delivery_unit_id = #{deliveryUnitId}, + delivery_unit = #{deliveryUnit}, + code = #{code}, + worksheet_id = #{worksheetId}, + worksheet_code = #{worksheetCode}, + productive_task_id = #{productiveTaskId}, + productive_task_code = #{productiveTaskCode}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_product_receipt where id = #{id} + + + + delete from im_product_receipt where id in + + #{id} + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImProductReceiptMaterialMapper.xml b/evo/src/main/resources/mybatis/management/ImProductReceiptMaterialMapper.xml new file mode 100644 index 0000000..0e0b1af --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImProductReceiptMaterialMapper.xml @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, product_receipt_id, code,material_id, material_name, specification,material_type,material_code, warehouse_id, warehouse_name,preferential_origin_name, batch_number, unit, receivable_quantity,checkout_time,received, actual_quantity,practical_number,univalence,unit_price,total_prices,proposer,quality_inspector,recipient,inventory_status,storage_date, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_product_receipt_material + + + + + + + + + + + + insert into im_product_receipt_material + + create_time, + product_receipt_id, + code, + material_id, + material_name, + specification, + material_type, + warehouse_id, + warehouse_name, + preferential_origin_name, + batch_number, + unit, + receivable_quantity, + received, + actual_quantity, + practical_number, + univalence, + unit_price, + total_prices, + proposer, + quality_inspector, + checkout_time + recipient, + inventory_status, + storage_date, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + material_code, + + + #{createTime}, + #{productReceiptId}, + #{code}, + #{materialId}, + #{materialName}, + #{specification}, + #{materialType}, + #{warehouseId}, + #{warehouseName}, + #{preferentialOriginName}, + #{batchNumber}, + #{unit}, + #{receivableQuantity}, + #{received}, + #{actualQuantity}, + #{practicalNumber}, + #{univalence}, + #{unitPrice}, + #{totalPrices}, + #{proposer}, + #{qualityInspector}, + #{checkoutTime}, + #{recipient}, + #{inventoryStatus}, + #{storageDate}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{materialCode}, + + + + + update im_product_receipt_material + + create_time = #{createTime}, + product_receipt_id = #{productReceiptId}, + code = #{code}, + material_id = #{materialId}, + material_name = #{materialName}, + specification = #{specification}, + material_type = #{materialType}, + warehouse_id = #{warehouseId}, + warehouse_name = #{warehouseName}, + preferential_origin_name = #{preferentialOriginName}, + batch_number = #{batchNumber}, + unit = #{unit}, + receivable_quantity = #{receivableQuantity}, + received = #{received}, + actual_quantity = #{actualQuantity}, + practical_number = #{practicalNumber}, + univalence = #{univalence}, + unit_price = #{unitPrice}, + total_prices = #{totalPrices}, + proposer = #{proposer}, + quality_inspector = #{qualityInspector}, + quality_inspector = null, + checkout_time = #{checkoutTime}, + recipient = #{recipient}, + inventory_status = #{inventoryStatus}, + storage_date = #{storageDate}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from im_product_receipt_material where id = #{id} + + + + delete from im_product_receipt_material where id in + + #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/ImProductStockRequistionMapper.xml b/evo/src/main/resources/mybatis/management/ImProductStockRequistionMapper.xml new file mode 100644 index 0000000..07f2c6e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImProductStockRequistionMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, customer_id, customer_name, code, contract_id, contract_code, logistics_id, logistics_name, tracking_number, shipping_address, warehouse_keeper, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_product_stock_requistion + + + + + + + + insert into im_product_stock_requistion + + create_time, + customer_id, + customer_name, + code, + contract_id, + contract_code, + logistics_id, + logistics_name, + tracking_number, + shipping_address, + warehouse_keeper, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{customerId}, + #{customerName}, + #{code}, + #{contractId}, + #{contractCode}, + #{logisticsId}, + #{logisticsName}, + #{trackingNumber}, + #{shippingAddress}, + #{warehouseKeeper}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_product_stock_requistion + + create_time = #{createTime}, + customer_id = #{customerId}, + customer_name = #{customerName}, + code = #{code}, + contract_id = #{contractId}, + contract_code = #{contractCode}, + logistics_id = #{logisticsId}, + logistics_name = #{logisticsName}, + tracking_number = #{trackingNumber}, + shipping_address = #{shippingAddress}, + warehouse_keeper = #{warehouseKeeper}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_product_stock_requistion where id = #{id} + + + + delete from im_product_stock_requistion where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImProductStockRequistionProductMapper.xml b/evo/src/main/resources/mybatis/management/ImProductStockRequistionProductMapper.xml new file mode 100644 index 0000000..7a096a1 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImProductStockRequistionProductMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, product_id, product_name, product_stock_requistion_id, product_type, delivery_warehouse_id, delivery_warehouse_name, unit, actual_quantity_issued, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_product_stock_requistion_product + + + + + + + + insert into im_product_stock_requistion_product + + create_time, + product_id, + product_name, + product_stock_requistion_id, + product_type, + delivery_warehouse_id, + delivery_warehouse_name, + unit, + actual_quantity_issued, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productId}, + #{productName}, + #{productStockRequistionId}, + #{productType}, + #{deliveryWarehouseId}, + #{deliveryWarehouseName}, + #{unit}, + #{actualQuantityIssued}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_product_stock_requistion_product + + create_time = #{createTime}, + product_id = #{productId}, + product_name = #{productName}, + product_stock_requistion_id = #{productStockRequistionId}, + product_type = #{productType}, + delivery_warehouse_id = #{deliveryWarehouseId}, + delivery_warehouse_name = #{deliveryWarehouseName}, + unit = #{unit}, + actual_quantity_issued = #{actualQuantityIssued}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_product_stock_requistion_product where id = #{id} + + + + delete from im_product_stock_requistion_product where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImPurchaseReceiptMapper.xml b/evo/src/main/resources/mybatis/management/ImPurchaseReceiptMapper.xml new file mode 100644 index 0000000..2fabfe7 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImPurchaseReceiptMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, supplier_id, supplier_name, code, contract_id, contract_code,buying_requisition_code, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_purchase_receipt + + + + + + + + insert into im_purchase_receipt + + create_time, + supplier_id, + supplier_name, + code, + contract_id, + contract_code, + buying_requisition_code, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{supplierId}, + #{supplierName}, + #{code}, + #{contractId}, + #{contractCode}, + #{buying_requisition_code}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_purchase_receipt + + create_time = #{createTime}, + supplier_id = #{supplierId}, + supplier_name = #{supplierName}, + code = #{code}, + contract_id = #{contractId}, + contract_code = #{contractCode}, + buying_requisition_code = #{buyingRequisitionCode}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_purchase_receipt where id = #{id} + + + + delete from im_purchase_receipt where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImPurchaseReceiptMaterialMapper.xml b/evo/src/main/resources/mybatis/management/ImPurchaseReceiptMaterialMapper.xml new file mode 100644 index 0000000..ae900cb --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImPurchaseReceiptMaterialMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, purchase_receipt_id, material_id, material_name, specification,figure_number, warehouse_id, warehouse_name, unit, receivable_quantity, actual_quantity,inventory_status, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_purchase_receipt_material + + + + + + + + insert into im_purchase_receipt_material + + create_time, + purchase_receipt_id, + material_id, + material_name, + specification, + figure_number, + warehouse_id, + warehouse_name, + unit, + receivable_quantity, + actual_quantity, + inventory_status, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{purchaseReceiptId}, + #{materialId}, + #{materialName}, + #{specification}, + #{figureNumber}, + #{warehouseId}, + #{warehouseName}, + #{unit}, + #{receivableQuantity}, + #{actualQuantity}, + #{inventoryStatus}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_purchase_receipt_material + + create_time = #{createTime}, + purchase_receipt_id = #{purchaseReceiptId}, + material_id = #{materialId}, + material_name = #{materialName}, + specification = #{specification}, + figure_number = #{figureNumber}, + warehouse_id = #{warehouseId}, + warehouse_name = #{warehouseName}, + unit = #{unit}, + receivable_quantity = #{receivableQuantity}, + actual_quantity = #{actualQuantity}, + inventory_status = #{inventoryStatus}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_purchase_receipt_material where id = #{id} + + + + delete from im_purchase_receipt_material where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImStockRequisitionMapper.xml b/evo/src/main/resources/mybatis/management/ImStockRequisitionMapper.xml new file mode 100644 index 0000000..7df36f4 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImStockRequisitionMapper.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, unit_id, unit_name, code,project_name,type_name,get_status, purpose, material_handler_id, material_handler_name, sending_people_id, sending_people_name, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_stock_requisition + + + + + + + + insert into im_stock_requisition + + create_time, + unit_id, + unit_name, + code, + project_name, + type_name, + get_status, + purpose, + material_handler_id, + material_handler_name, + sending_people_id, + sending_people_name, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{unitId}, + #{unitName}, + #{code}, + #{projectName}, + #{typeName}, + #{getStatus}, + #{purpose}, + #{materialHandlerId}, + #{materialHandlerName}, + #{sendingPeopleId}, + #{sendingPeopleName}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_stock_requisition + + create_time = #{createTime}, + unit_id = #{unitId}, + unit_name = #{unitName}, + code = #{code}, + project_name = #{projectName}, + type_name = #{typeName}, + get_status = #{getStatus}, + purpose = #{purpose}, + material_handler_id = #{materialHandlerId}, + material_handler_name = #{materialHandlerName}, + sending_people_id = #{sendingPeopleId}, + sending_people_name = #{sendingPeopleName}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_stock_requisition where id = #{id} + + + + delete from im_stock_requisition where id in + + #{id} + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImStockRequisitionMaterialMapper.xml b/evo/src/main/resources/mybatis/management/ImStockRequisitionMaterialMapper.xml new file mode 100644 index 0000000..8c5a0cd --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImStockRequisitionMaterialMapper.xml @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select srm.id, srm.create_time, srm.stock_requisition_id, srm.material_id,srm.code, srm.material_name, srm.specification,srm.figure_number,srm.materials,srm.piece_weight, srm.material_issuing_warehouse_id, + srm.material_issuing_warehouse_name, srm.unit,srm.material_handler_name, srm.sending_people_name, srm.salary_quantity,srm.apply_for_quantity,srm.already_quantity,srm.univalence,srm.total_prices, + srm.actual_quantity_issued, srm.get_status,srm.outbound_date,srm.inventory_quantity,srm.remark, srm.spared_one, srm.spared_two, srm.spared_three, srm.spared_four, srm.del_flag,i.quantity + from im_stock_requisition_material srm LEFT JOIN pw_inventory_detail i on srm.material_name = i.name and srm.figure_number = i.figure_number + + + + + + + + + + + insert into im_stock_requisition_material + + create_time, + stock_requisition_id, + material_id, + code, + material_name, + specification, + figure_number, + materials, + piece_weight, + material_issuing_warehouse_id, + material_issuing_warehouse_name, + unit, + material_handler_name, + sending_people_name, + salary_quantity, + apply_for_quantity, + already_quantity, + univalence, + total_prices, + actual_quantity_issued, + get_status, + outbound_date, + inventory_quantity, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{stockRequisitionId}, + #{materialId}, + #{code}, + #{materialName}, + #{specification}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{materialIssuingWarehouseId}, + #{materialIssuingWarehouseName}, + #{unit}, + #{materialHandlerName}, + #{sendingPeopleName}, + #{salaryQuantity}, + #{applyForQuantity}, + #{alreadyQuantity}, + #{univalence}, + #{totalPrices}, + #{actualQuantityIssued}, + #{getStatus}, + #{outboundDate}, + #{inventoryQuantity}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_stock_requisition_material + + create_time = #{createTime}, + stock_requisition_id = #{stockRequisitionId}, + material_id = #{materialId}, + code = #{code}, + material_name = #{materialName}, + specification = #{specification}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + material_issuing_warehouse_id = #{materialIssuingWarehouseId}, + material_issuing_warehouse_name = #{materialIssuingWarehouseName}, + unit = #{unit}, + material_handler_name = #{materialHandlerName}, + sending_people_name = #{sendingPeopleName}, + salary_quantity = #{salaryQuantity}, + apply_for_quantity = #{applyForQuantity}, + already_quantity = #{alreadyQuantity}, + univalence = #{univalence}, + total_prices = #{totalPrices}, + actual_quantity_issued = #{actualQuantityIssued}, + get_status = #{getStatus}, + outbound_date = #{outboundDate}, + inventory_quantity = #{inventoryQuantity}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_stock_requisition_material where id = #{id} + + + + delete from im_stock_requisition_material where id in + + #{id} + + + + + + insert into im_stock_requisition_material(stock_requisition_id,code, material_id, material_name, specification,figure_number,materials,piece_weight, material_issuing_warehouse_id, material_issuing_warehouse_name, unit,material_handler_name,sending_people_name, salary_quantity,apply_for_quantity,already_quantity,univalence,total_prices, actual_quantity_issued,get_status, outbound_date,inventory_quantity,remark, spared_one, spared_two, spared_three, spared_four, del_flag) + VALUES + + (#{item.stockRequisitionId}, + #{item.code}, + #{item.materialId}, + #{item.materialName}, + #{item.specification}, + #{item.figureNumber}, + #{item.materials}, + #{item.pieceWeight}, + #{item.materialIssuingWarehouseId}, + #{item.materialIssuingWarehouseName}, + #{item.unit}, + #{item.materialHandlerName}, + #{item.sendingPeopleName}, + #{item.salaryQuantity}, + #{item.applyForQuantity}, + #{item.alreadyQuantity}, + #{item.univalence}, + #{item.totalPrices}, + #{item.actualQuantityIssued}, + #{item.getStatus}, + #{item.outboundDate}, + #{item.inventoryQuantity}, + #{item.remark}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.delFlag}) + + + + + + + + + + + + delete from im_stock_requisition_material where code = #{code} + + + + + + + + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/ImSupplierMapper.xml b/evo/src/main/resources/mybatis/management/ImSupplierMapper.xml new file mode 100644 index 0000000..843997c --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImSupplierMapper.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, supplier_name,supplier_type_id,supplier_type_name, supplier_phone, supplier_address,bank_address,interbank_number,swift_code, contacts, fax, zip_code, email_address, account_number, duty_paragraph, opening_bank, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_supplier + + + + + + + + insert into im_supplier + + create_time, + supplier_name, + supplier_type_id, + supplier_type_name, + supplier_phone, + supplier_address, + contacts, + fax, + zip_code, + email_address, + account_number, + duty_paragraph, + opening_bank, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + interbank_number, + swift_code, + bank_address, + + + #{createTime}, + #{supplierName}, + #{supplierTypeId}, + #{supplierTypeName}, + #{supplierPhone}, + #{supplierAddress}, + #{contacts}, + #{fax}, + #{zipCode}, + #{emailAddress}, + #{accountNumber}, + #{dutyParagraph}, + #{openingBank}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{interbankNumber}, + #{swiftCode}, + #{bankAddress}, + + + + + update im_supplier + + create_time = #{createTime}, + supplier_name = #{supplierName}, + supplier_type_id = #{supplierTypeId}, + supplier_type_name = #{supplierTypeName}, + supplier_phone = #{supplierPhone}, + supplier_address = #{supplierAddress}, + contacts = #{contacts}, + fax = #{fax}, + zip_code = #{zipCode}, + email_address = #{emailAddress}, + account_number = #{accountNumber}, + duty_paragraph = #{dutyParagraph}, + opening_bank = #{openingBank}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + interbank_number = #{interbankNumber}, + swift_code = #{swiftCode}, + bank_address = #{bankAddress}, + + where id = #{id} + + + + delete from im_supplier where id = #{id} + + + + delete from im_supplier where id in + + #{id} + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/ImSupplierTypeMapper.xml b/evo/src/main/resources/mybatis/management/ImSupplierTypeMapper.xml new file mode 100644 index 0000000..b4d8fe7 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImSupplierTypeMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + select id, create_time, parent_id, supplier_type_name, spared_one, spared_two, spared_three, spared_four, del_flag from im_supplier_type + + + + + + + + insert into im_supplier_type + + create_time, + parent_id, + supplier_type_name, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{parentId}, + #{supplierTypeName}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_supplier_type + + create_time = #{createTime}, + parent_id = #{parentId}, + supplier_type_name = #{supplierTypeName}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_supplier_type where id = #{id} + + + + delete from im_supplier_type where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/ImWarehouseMapper.xml b/evo/src/main/resources/mybatis/management/ImWarehouseMapper.xml new file mode 100644 index 0000000..2eddbc6 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/ImWarehouseMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time,code, warehouse_name, warehouse_admin, warehouse_address, warehouse_phone, remark, spared_one, spared_two, spared_three, spared_four, del_flag from im_warehouse + + + + + + + + + + insert into im_warehouse + + create_time, + code, + warehouse_name, + warehouse_admin, + warehouse_address, + warehouse_phone, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{warehouseName}, + #{warehouseAdmin}, + #{warehouseAddress}, + #{warehousePhone}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update im_warehouse + + create_time = #{createTime}, + code = #{code}, + warehouse_name = #{warehouseName}, + warehouse_admin = #{warehouseAdmin}, + warehouse_address = #{warehouseAddress}, + warehouse_phone = #{warehousePhone}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from im_warehouse where id = #{id} + + + + delete from im_warehouse where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/JdBomMateriallsMapper.xml b/evo/src/main/resources/mybatis/management/JdBomMateriallsMapper.xml new file mode 100644 index 0000000..a604738 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdBomMateriallsMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + select id, product_code, figure_number, name, number, store_number, completionDate, parent_figure_number, parent_name, remarks, del_flag, create_time from jd_bom_materialls + + + + + + insert into jd_bom_materialls + + product_code, + figure_number, + name, + number, + store_number, + completionDate, + parent_figure_number, + parent_name, + remarks, + del_flag, + create_time, + + + #{productCode}, + #{figureNumber}, + #{name}, + #{number}, + #{storeNumber}, + #{completiondate}, + #{parentFigureNumber}, + #{parentName}, + #{remarks}, + #{delFlag}, + #{createTime}, + + + + + update jd_bom_materialls + + number = #{number}, + store_number = #{storeNumber}, + completionDate = #{completiondate}, + parent_figure_number = #{parentFigureNumber}, + parent_name = #{parentName}, + remarks = #{remarks}, + del_flag = #{delFlag}, + + where id = #{id} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/JdBomNumberMapper.xml b/evo/src/main/resources/mybatis/management/JdBomNumberMapper.xml new file mode 100644 index 0000000..2073f16 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdBomNumberMapper.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code, type_name, num, figure_number, name, one_number, type, piece_weight, unit, workshop_section, xu_time from jd_bom_number + + + + + + + + insert into jd_bom_number + + create_time, + production_code, + type_name, + num, + figure_number, + name, + one_number, + type, + piece_weight, + unit, + workshop_section, + xu_time, + + + #{createTime}, + #{productionCode}, + #{typeName}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{unit}, + #{workshopSection}, + #{xuTime}, + + + + + + insert into jd_bom_number + (create_time,production_code,type_name,type,num,figure_number,name,one_number,piece_weight,unit,workshop_section,xu_time) values + + (#{item.createTime},#{item.productionCode},#{item.typeName},#{item.type},#{item.num},#{item.figureNumber},#{item.name},#{item.oneNumber},#{item.pieceWeight},#{item.unit},#{item.workshopSection},#{item.xuTime}) + + + diff --git a/evo/src/main/resources/mybatis/management/JdBomRecordMapper.xml b/evo/src/main/resources/mybatis/management/JdBomRecordMapper.xml new file mode 100644 index 0000000..f4e944d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdBomRecordMapper.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + select id, jd_code, product_code, figure_number, product_name,number,status, remarks,del_flag, create_time,quantity,complete_date from jd_bom_record + + + + + + + + insert into jd_bom_record + + jd_code, + product_code, + figure_number, + product_name, + number, + status, + remarks, + del_flag, + create_time, + quantity, + complete_date, + + + #{jdCode}, + #{productCode}, + #{figureNumber}, + #{productName}, + #{number}, + #{status}, + #{remarks}, + #{delFlag}, + #{createTime}, + #{quantity}, + #{completeDate}, + + + + + update jd_bom_record + + jd_code = #{jdCode}, + figure_number = #{figureNumber}, + product_name = #{productName}, + number = #{number}, + status = #{status}, + remarks = #{remarks}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from jd_bom_record where id = #{id} + + + + + + update jd_bom_record set del_flag = '1' where id = #{id} + + + diff --git a/evo/src/main/resources/mybatis/management/JdCurrencyMapper.xml b/evo/src/main/resources/mybatis/management/JdCurrencyMapper.xml new file mode 100644 index 0000000..4f1a27c --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdCurrencyMapper.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + select id, + code, + currency_name, + currency_code, + unit_price_precision, + amount_precision, + created_date, + updated_date + from jd_currency + + + + + + + + insert into jd_currency + + code, + currency_name, + currency_code, + unit_price_precision, + amount_precision, + created_date, + updated_date, + + + #{code}, + #{currencyName}, + #{currencyCode}, + #{unitPricePrecision}, + #{amountPrecision}, + #{createdDate}, + #{updatedDate}, + + + + + update jd_currency + + code = #{code}, + currency_name = #{currencyName}, + currency_code = #{currencyCode}, + unit_price_precision = #{unitPricePrecision}, + amount_precision = #{amountPrecision}, + created_date = #{createdDate}, + updated_date = #{updatedDate}, + + where id = #{id} + + + + delete + from jd_currency + where id = #{id} + + + + delete from jd_currency where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/JdErrorMessageMapper.xml b/evo/src/main/resources/mybatis/management/JdErrorMessageMapper.xml new file mode 100644 index 0000000..5ac8506 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdErrorMessageMapper.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + select message_id, message_type, message_opt, message_content, status, remark, create_by, create_time, update_by, update_time from jd_error_message + + + + + + + + insert into jd_error_message + + message_id, + message_type, + message_opt, + message_content, + status, + remark, + create_by, + create_time, + + + #{messageId}, + #{messageType}, + #{messageOpt}, + #{messageContent}, + #{status}, + #{remark}, + #{createBy}, + #{createTime}, + + + + + update jd_error_message + + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + diff --git a/evo/src/main/resources/mybatis/management/JdExpenseItemsMapper.xml b/evo/src/main/resources/mybatis/management/JdExpenseItemsMapper.xml new file mode 100644 index 0000000..2779647 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdExpenseItemsMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + select id, name, description, create_time + from jd_expense_items + + + + + + + + insert into jd_expense_items + + name, + description, + create_time, + + + #{name}, + #{description}, + #{createTime}, + + + + + update jd_expense_items + + name = #{name}, + create_time = #{createTime}, + + where id = #{id} + + + + delete + from jd_expense_items + where id = #{id} + + + + delete from jd_expense_items where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/JdProcessBomMapper.xml b/evo/src/main/resources/mybatis/management/JdProcessBomMapper.xml new file mode 100644 index 0000000..6c62e01 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdProcessBomMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, product_code, figure_number, product_name, materials, weight, parent_figure_number, parent_product_name,xu_time,parent_id, status,purchase_mark, remarks,push_status, create_time,flag from jd_process_bom + + + + + + + + + + insert into jd_process_bom + + product_code, + figure_number, + product_name, + materials, + weight, + parent_figure_number, + parent_product_name, + status, + push_status, + purchase_mark, + remarks, + create_time, + xu_time, + parent_id, + flag, + + + #{productCode}, + #{figureNumber}, + #{productName}, + #{materials}, + #{weight}, + #{parentFigureNumber}, + #{parentProductName}, + #{status}, + #{pushStatus}, + #{purchaseMark}, + #{remarks}, + #{createTime}, + #{xuTime}, + #{parentId}, + #{flag}, + + + + + update jd_process_bom + + product_code = #{productCode}, + figure_number = #{figureNumber}, + product_name = #{productName}, + materials = #{materials}, + weight = #{weight}, + parent_figure_number = #{parentFigureNumber}, + parent_product_name = #{parentProductName}, + status = #{status}, + push_status = #{pushStatus}, + purchase_mark = #{purchaseMark}, + remarks = #{remarks}, + create_time = #{createTime}, + xu_time = #{xuTime}, + parent_id = #{parentId}, + flag = #{flag}, + + where id = #{id} + + + + update jd_process_bom set status = '已审核' where id = #{id} + + + + + + + + + delete from jd_process_bom where id = #{id} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/JdProcessBomRecordMapper.xml b/evo/src/main/resources/mybatis/management/JdProcessBomRecordMapper.xml new file mode 100644 index 0000000..38624e1 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdProcessBomRecordMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + select id, record_id, process_id from jd_bom_record_process + + + + + + insert into jd_bom_record_process(record_id,process_id) values (#{recordId},#{processId}) + + + + + diff --git a/evo/src/main/resources/mybatis/management/JdReceiptsDataInfoMapper.xml b/evo/src/main/resources/mybatis/management/JdReceiptsDataInfoMapper.xml new file mode 100644 index 0000000..b50af02 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/JdReceiptsDataInfoMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, contract_code, type, sign,business_sign, money, spared_one, spared_two, spared_three, spared_four, spared_five, spared_six from jd_receipts_data_info + + + + + + + + insert into jd_receipts_data_info + + create_time, + code, + contract_code, + type, + sign, + business_sign, + money, + spared_one, + spared_two, + spared_three, + spared_four, + spared_five, + spared_six, + + + #{createTime}, + #{code}, + #{contractCode}, + #{type}, + #{sign}, + #{businessSign}, + #{money}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{sparedSix}, + + + + + update jd_receipts_data_info + + create_time = #{createTime}, + code = #{code}, + contract_code = #{contractCode}, + type = #{type}, + sign = #{sign}, + business_sign = #{businessSign}, + money = #{money}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + spared_six = #{sparedSix}, + + where id = #{id} + + + + delete from jd_receipts_data_info where id = #{id} + + + + delete from jd_receipts_data_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/MaterialSecureMapper.xml b/evo/src/main/resources/mybatis/management/MaterialSecureMapper.xml new file mode 100644 index 0000000..f8fce41 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/MaterialSecureMapper.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, figure_number, material_name, specification_type, category, purchase_mark, material_classification, materials, piece_weight, unit, preferential_origin_name, minimum, highest, univalence, unit_price, remark, create_time, create_by, update_time, update_by from jd_material_secure + + + + + + + + insert into jd_material_secure + + figure_number, + material_name, + specification_type, + category, + purchase_mark, + material_classification, + materials, + piece_weight, + unit, + preferential_origin_name, + minimum, + highest, + univalence, + unit_price, + remark, + create_time, + create_by, + update_time, + update_by, + + + #{figureNumber}, + #{materialName}, + #{specificationType}, + #{category}, + #{purchaseMark}, + #{materialClassification}, + #{materials}, + #{pieceWeight}, + #{unit}, + #{preferentialOriginName}, + #{minimum}, + #{highest}, + #{univalence}, + #{unitPrice}, + #{remark}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + + + + + update jd_material_secure + + figure_number = #{figureNumber}, + material_name = #{materialName}, + specification_type = #{specificationType}, + category = #{category}, + purchase_mark = #{purchaseMark}, + material_classification = #{materialClassification}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + unit = #{unit}, + preferential_origin_name = #{preferentialOriginName}, + minimum = #{minimum}, + highest = #{highest}, + univalence = #{univalence}, + unit_price = #{unitPrice}, + remark = #{remark}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where id = #{id} + + + + delete from jd_material_secure where id = #{id} + + + + delete from jd_material_secure where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/PcCurtainMachineMapper.xml b/evo/src/main/resources/mybatis/management/PcCurtainMachineMapper.xml new file mode 100644 index 0000000..44953fe --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcCurtainMachineMapper.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, unilateral_stroke, overlap_length, drive_the_load, divide_speed, chassis_total_lenght, entablature_measure, suspension_centre_number, suspension_centre_interval, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_curtain_machine + + + + + + + + insert into pc_curtain_machine + + create_time, + type_name, + product_id, + product_name, + unilateral_stroke, + overlap_length, + drive_the_load, + divide_speed, + chassis_total_lenght, + entablature_measure, + suspension_centre_number, + suspension_centre_interval, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{unilateralStroke}, + #{overlapLength}, + #{driveTheLoad}, + #{divideSpeed}, + #{chassisTotalLenght}, + #{entablatureMeasure}, + #{suspensionCentreNumber}, + #{suspensionCentreInterval}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_curtain_machine + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + unilateral_stroke = #{unilateralStroke}, + overlap_length = #{overlapLength}, + drive_the_load = #{driveTheLoad}, + divide_speed = #{divideSpeed}, + chassis_total_lenght = #{chassisTotalLenght}, + entablature_measure = #{entablatureMeasure}, + suspension_centre_number = #{suspensionCentreNumber}, + suspension_centre_interval = #{suspensionCentreInterval}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_curtain_machine where id = #{id} + + + + update pc_curtain_machine set del_flag = 1 where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcDetentMapper.xml b/evo/src/main/resources/mybatis/management/PcDetentMapper.xml new file mode 100644 index 0000000..f07e8c4 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcDetentMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, rated_braking_moment, brake_wheel_diameter, weight, center_height_h_one, overall_height_h, thickness_b, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_detent + + + + + + + + insert into pc_detent + + create_time, + type_name, + product_id, + product_name, + rated_braking_moment, + brake_wheel_diameter, + weight, + center_height_h_one, + overall_height_h, + thickness_b, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{ratedBrakingMoment}, + #{brakeWheelDiameter}, + #{weight}, + #{centerHeightHOne}, + #{overallHeightH}, + #{thicknessB}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_detent + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + rated_braking_moment = #{ratedBrakingMoment}, + brake_wheel_diameter = #{brakeWheelDiameter}, + weight = #{weight}, + center_height_h_one = #{centerHeightHOne}, + overall_height_h = #{overallHeightH}, + thickness_b = #{thicknessB}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_detent where id = #{id} + + + + update pc_detent set del_flag = 1 where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcElectricalMachineryAcMapper.xml b/evo/src/main/resources/mybatis/management/PcElectricalMachineryAcMapper.xml new file mode 100644 index 0000000..8c82fbc --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcElectricalMachineryAcMapper.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, power, diameter_ac, one_braking_length, two_braking_tailshaft, rated_speed, rated_torque, retarding_torque, weight, supply_voltage, brake_voltage, frequency, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_electrical_machinery_ac + + + + + + + + insert into pc_electrical_machinery_ac + + create_time, + type_name, + product_id, + product_name, + power, + diameter_ac, + one_braking_length, + two_braking_tailshaft, + rated_speed, + rated_torque, + retarding_torque, + weight, + supply_voltage, + brake_voltage, + frequency, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{power}, + #{diameterAc}, + #{oneBrakingLength}, + #{twoBrakingTailshaft}, + #{ratedSpeed}, + #{ratedTorque}, + #{retardingTorque}, + #{weight}, + #{supplyVoltage}, + #{brakeVoltage}, + #{frequency}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_electrical_machinery_ac + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + power = #{power}, + diameter_ac = #{diameterAc}, + one_braking_length = #{oneBrakingLength}, + two_braking_tailshaft = #{twoBrakingTailshaft}, + rated_speed = #{ratedSpeed}, + rated_torque = #{ratedTorque}, + retarding_torque = #{retardingTorque}, + weight = #{weight}, + supply_voltage = #{supplyVoltage}, + brake_voltage = #{brakeVoltage}, + frequency = #{frequency}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_electrical_machinery_ac where id = #{id} + + + + update pc_electrical_machinery_ac set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcFTypeReducerMapper.xml b/evo/src/main/resources/mybatis/management/PcFTypeReducerMapper.xml new file mode 100644 index 0000000..80a5a44 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcFTypeReducerMapper.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, power, speed_ratio, output_speed, output_torque, motor_braking_torque, supply_voltage, brake_voltage, shaft_size, univalence, picture, manufacturers, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_f_type_reducer + + + + + + + + insert into pc_f_type_reducer + + create_time, + type_name, + product_id, + product_name, + power, + speed_ratio, + output_speed, + output_torque, + motor_braking_torque, + supply_voltage, + brake_voltage, + shaft_size, + univalence, + picture, + manufacturers, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{power}, + #{speedRatio}, + #{outputSpeed}, + #{outputTorque}, + #{motorBrakingTorque}, + #{supplyVoltage}, + #{brakeVoltage}, + #{shaftSize}, + #{univalence}, + #{picture}, + #{manufacturers}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_f_type_reducer + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + power = #{power}, + speed_ratio = #{speedRatio}, + output_speed = #{outputSpeed}, + output_torque = #{outputTorque}, + motor_braking_torque = #{motorBrakingTorque}, + supply_voltage = #{supplyVoltage}, + brake_voltage = #{brakeVoltage}, + shaft_size = #{shaftSize}, + univalence = #{univalence}, + picture = #{picture}, + manufacturers = #{manufacturers}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_f_type_reducer where id = #{id} + + + + update pc_f_type_reducer set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcFireCurtainDampingDriveMapper.xml b/evo/src/main/resources/mybatis/management/PcFireCurtainDampingDriveMapper.xml new file mode 100644 index 0000000..c8560f7 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcFireCurtainDampingDriveMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, unilateral_stroke, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_fire_curtain_damping_drive + + + + + + + + insert into pc_fire_curtain_damping_drive + + create_time, + type_name, + product_id, + product_name, + unilateral_stroke, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{unilateralStroke}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_fire_curtain_damping_drive + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + unilateral_stroke = #{unilateralStroke}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_fire_curtain_damping_drive where id = #{id} + + + + update pc_fire_curtain_damping_drive set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcHooksCouplingMapper.xml b/evo/src/main/resources/mybatis/management/PcHooksCouplingMapper.xml new file mode 100644 index 0000000..139d70d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcHooksCouplingMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, nominal_torque, fatigue_torque, length, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_hooks_coupling + + + + + + + + insert into pc_hooks_coupling + + create_time, + type_name, + product_id, + product_name, + nominal_torque, + fatigue_torque, + length, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{nominalTorque}, + #{fatigueTorque}, + #{length}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_hooks_coupling + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + nominal_torque = #{nominalTorque}, + fatigue_torque = #{fatigueTorque}, + length = #{length}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_hooks_coupling where id = #{id} + + + + update pc_hooks_coupling set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcRigidChainMapper.xml b/evo/src/main/resources/mybatis/management/PcRigidChainMapper.xml new file mode 100644 index 0000000..46b97fb --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcRigidChainMapper.xml @@ -0,0 +1,656 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type, type_name, product_id, + product_name,material_code, + axial_direction, box, journey, lable_number, l_one, l_two, l_three, + sum_weight, + chain_weight, dynamic_load, dead_load, + rise_in_height_per_revolution, + speed, efficiency, chain_pitch, + pitch_radius, minimum_altitude, + single_meter_chain_weight, + driving_box_weight, chain_box_weight, + univalence, picture, part_id, + remark, spared_one, spared_two, + spared_three, spared_four, del_flag, + v_one, v_two, v_three, v_four, + v_five, v_six, v_seven, v_eight, v_nine, + v_ten, v_eleven, v_twelve, + v_thirteen, v_fourteen, v_fifteen, + v_sixteen, v_seveteen, v_eighteen, + v_nineteen, v_twenty, v_twenty_one, + v_twenty_two, v_twenty_three, + v_twenty_four, v_twenty_five, + v_twenty_six, v_twenty_seven, + v_twenty_eight, v_twenty_nine, v_thirty, + v_thirty_one, v_thirty_two, + v_thirty_three, v_thirty_four, + v_thirty_five, v_thirty_six, + v_thirty_seven, v_thirty_eight, + v_thirty_nine, v_forty, v_forty_one, + v_forty_two, v_forty_three, + v_forty_four, v_forty_five, v_forty_six, + v_forty_seven, v_forty_eight, + v_forty_nine, v_fifty, v_fifty_one, + v_fifty_two,v_fifty_three, + g_one, g_two, g_three, g_four, + g_five, g_six, g_seven, g_eight, + g_nine, g_ten, g_eleven, g_twelve, + g_thirteen, g_fourteen, g_fifteen, + g_sixteen, g_seveteen, g_eighteen, + g_nineteen, g_twenty from + pc_rigid_chain + + + + + + + + insert into pc_rigid_chain + + create_time, + type, + type_name, + product_id, + product_name, + axial_direction, + box, + journey, + lable_number, + l_one, + l_two, + l_three, + sum_weight, + chain_weight, + dynamic_load, + dead_load, + rise_in_height_per_revolution, + speed, + efficiency, + chain_pitch, + pitch_radius, + minimum_altitude, + single_meter_chain_weight, + driving_box_weight, + chain_box_weight, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + v_one, + v_two, + v_three, + v_four, + v_five, + v_six, + v_seven, + v_eight, + v_nine, + v_ten, + v_eleven, + v_twelve, + v_thirteen, + v_fourteen, + v_fifteen, + v_sixteen, + v_seveteen, + v_eighteen, + v_nineteen, + v_twenty, + v_twenty_one, + v_twenty_two, + v_twenty_three, + v_twenty_four, + v_twenty_five, + v_twenty_six, + v_twenty_seven, + v_twenty_eight, + v_twenty_nine, + v_thirty, + v_thirty_one, + v_thirty_two, + v_thirty_three, + v_thirty_four, + v_thirty_five, + v_thirty_six, + v_thirty_seven, + v_thirty_eight, + v_thirty_nine, + v_forty, + v_forty_one, + v_forty_two, + v_forty_three, + v_forty_four, + v_forty_five, + v_forty_six, + v_forty_seven, + v_forty_eight, + v_forty_nine, + v_fifty, + v_fifty_one, + v_fifty_two, + v_fifty_three, + g_one, + g_two, + g_three, + g_four, + g_five, + g_six, + g_seven, + g_eight, + g_nine, + g_ten, + g_eleven, + g_twelve, + g_thirteen, + g_fourteen, + g_fifteen, + g_sixteen, + g_seveteen, + g_eighteen, + g_nineteen, + g_twenty, + material_code, + + + #{createTime}, + #{type}, + #{typeName}, + #{productId}, + #{productName}, + #{axialDirection}, + #{box}, + #{journey}, + #{lableNumber}, + #{lOne}, + #{lTwo}, + #{lThree}, + #{sumWeight}, + #{chainWeight}, + #{dynamicLoad}, + #{deadLoad}, + #{riseInHeightPerRevolution}, + #{speed}, + #{efficiency}, + #{chainPitch}, + #{pitchRadius}, + #{minimumAltitude}, + #{singleMeterChainWeight}, + #{drivingBoxWeight}, + #{chainBoxWeight}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{vOne}, + #{vTwo}, + #{vThree}, + #{vFour}, + #{vFive}, + #{vSix}, + #{vSeven}, + #{vEight}, + #{vNine}, + #{vTen}, + #{vEleven}, + #{vTwelve}, + #{vThirteen}, + #{vFourteen}, + #{vFifteen}, + #{vSixteen}, + #{vSeveteen}, + #{vEighteen}, + #{vNineteen}, + #{vTwenty}, + #{vTwentyOne}, + #{vTwentyTwo}, + #{vTwentyThree}, + #{vTwentyFour}, + #{vTwentyFive}, + #{vTwentySix}, + #{vTwentySeven}, + #{vTwentyEight}, + #{vTwentyNine}, + #{vThirty}, + #{vThirtyOne}, + #{vThirtyTwo}, + #{vThirtyThree}, + #{vThirtyFour}, + #{vThirtyFive}, + #{vThirtySix}, + #{vThirtySeven}, + #{vThirtyEight}, + #{vThirtyNine}, + #{vForty}, + #{vFortyOne}, + #{vFortyTwo}, + #{vFortyThree}, + #{vFortyFour}, + #{vFortyFive}, + #{vFortySix}, + #{vFortySeven}, + #{vFortyEight}, + #{vFortyNine}, + #{vFifty}, + #{vFiftyOne}, + #{vFiftyTwo}, + #{vFiftyThree}, + #{gOne}, + #{gTwo}, + #{gThree}, + #{gFour}, + #{gFive}, + #{gSix}, + #{gSeven}, + #{gEight}, + #{gNine}, + #{gTen}, + #{gEleven}, + #{gTwelve}, + #{gThirteen}, + #{gFourteen}, + #{gFifteen}, + #{gSixteen}, + #{gSeveteen}, + #{gEighteen}, + #{gNineteen}, + #{gTwenty}, + #{materialCode}, + + + + + update pc_rigid_chain + + create_time = #{createTime}, + type = #{type}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + axial_direction = #{axialDirection}, + box = #{box}, + journey = #{journey}, + lable_number = #{lableNumber}, + l_one = #{lOne}, + l_two = #{lTwo}, + l_three = #{lThree}, + sum_weight = #{sumWeight}, + chain_weight = #{chainWeight}, + dynamic_load = #{dynamicLoad}, + dead_load = #{deadLoad}, + rise_in_height_per_revolution = + #{riseInHeightPerRevolution}, + + speed = #{speed}, + efficiency = #{efficiency}, + chain_pitch = #{chainPitch}, + pitch_radius = #{pitchRadius}, + minimum_altitude = #{minimumAltitude}, + single_meter_chain_weight = #{singleMeterChainWeight}, + + driving_box_weight = #{drivingBoxWeight}, + chain_box_weight = #{chainBoxWeight}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + v_one = #{vOne}, + v_two = #{vTwo}, + v_three = #{vThree}, + v_four = #{vFour}, + v_five = #{vFive}, + v_six = #{vSix}, + v_seven = #{vSeven}, + v_eight = #{vEight}, + v_nine = #{vNine}, + v_ten = #{vTen}, + v_eleven = #{vEleven}, + v_twelve = #{vTwelve}, + v_thirteen = #{vThirteen}, + v_fourteen = #{vFourteen}, + v_fifteen = #{vFifteen}, + v_sixteen = #{vSixteen}, + v_seveteen = #{vSeveteen}, + v_eighteen = #{vEighteen}, + v_nineteen = #{vNineteen}, + v_twenty = #{vTwenty}, + v_twenty_one = #{vTwentyOne}, + v_twenty_two = #{vTwentyTwo}, + v_twenty_three = #{vTwentyThree}, + v_twenty_four = #{vTwentyFour}, + v_twenty_five = #{vTwentyFive}, + v_twenty_six = #{vTwentySix}, + v_twenty_seven = #{vTwentySeven}, + v_twenty_eight = #{vTwentyEight}, + v_twenty_nine = #{vTwentyNine}, + v_thirty = #{vThirty}, + v_thirty_one = #{vThirtyOne}, + v_thirty_two = #{vThirtyTwo}, + v_thirty_three = #{vThirtyThree}, + v_thirty_four = #{vThirtyFour}, + v_thirty_five = #{vThirtyFive}, + v_thirty_six = #{vThirtySix}, + v_thirty_seven = #{vThirtySeven}, + v_thirty_eight = #{vThirtyEight}, + v_thirty_nine = #{vThirtyNine}, + v_forty = #{vForty}, + v_forty_one = #{vFortyOne}, + v_forty_two = #{vFortyTwo}, + v_forty_three = #{vFortyThree}, + v_forty_four = #{vFortyFour}, + v_forty_five = #{vFortyFive}, + v_forty_six = #{vFortySix}, + v_forty_seven = #{vFortySeven}, + v_forty_eight = #{vFortyEight}, + v_forty_nine = #{vFortyNine}, + v_fifty = #{vFifty}, + v_fifty_one = #{vFiftyOne}, + v_fifty_two = #{vFiftyTwo}, + v_fifty_three = #{vFiftyThree}, + g_one = #{gOne}, + g_two = #{gTwo}, + g_three = #{gThree}, + g_four = #{gFour}, + g_five = #{gFive}, + g_six = #{gSix}, + g_seven = #{gSeven}, + g_eight = #{gEight}, + g_nine = #{gNine}, + g_ten = #{gTen}, + g_eleven = #{gEleven}, + g_twelve = #{gTwelve}, + g_thirteen = #{gThirteen}, + g_fourteen = #{gFourteen}, + g_fifteen = #{gFifteen}, + g_sixteen = #{gSixteen}, + g_seveteen = #{gSeveteen}, + g_eighteen = #{gEighteen}, + g_nineteen = #{gNineteen}, + g_twenty = #{gTwenty}, + material_code = #{materialCode}, + + where id = #{id} + + + delete from + pc_rigid_chain where id = #{id} + + + update pc_rigid_chain set del_flag = 1 where id in + #{id} + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PcStrokeMeasurementMapper.xml b/evo/src/main/resources/mybatis/management/PcStrokeMeasurementMapper.xml new file mode 100644 index 0000000..76d8d56 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcStrokeMeasurementMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, speed_ratio, contact_number,material_code, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_stroke_measurement + + + + + + + + insert into pc_stroke_measurement + + create_time, + type_name, + product_id, + product_name, + speed_ratio, + contact_number, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + material_code, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{speedRatio}, + #{contactNumber}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{materialCode}, + + + + + update pc_stroke_measurement + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + speed_ratio = #{speedRatio}, + contact_number = #{contactNumber}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from pc_stroke_measurement where id = #{id} + + + + update pc_stroke_measurement set del_flag = 1 where id in + + #{id} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PcToothedCouplingMapper.xml b/evo/src/main/resources/mybatis/management/PcToothedCouplingMapper.xml new file mode 100644 index 0000000..56c619c --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcToothedCouplingMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, torque, bore_diameter, y_long_shaft_hole, j_one_short_shaft_hole, length_gap, flange_face_minimum_distance, Minimum_total_length_coupling, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_toothed_coupling + + + + + + + + insert into pc_toothed_coupling + + create_time, + type_name, + product_id, + product_name, + torque, + bore_diameter, + y_long_shaft_hole, + j_one_short_shaft_hole, + length_gap, + flange_face_minimum_distance, + Minimum_total_length_coupling, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{torque}, + #{boreDiameter}, + #{yLongShaftHole}, + #{jOneShortShaftHole}, + #{lengthGap}, + #{flangeFaceMinimumDistance}, + #{minimumTotalLengthCoupling}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_toothed_coupling + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + torque = #{torque}, + bore_diameter = #{boreDiameter}, + y_long_shaft_hole = #{yLongShaftHole}, + j_one_short_shaft_hole = #{jOneShortShaftHole}, + length_gap = #{lengthGap}, + flange_face_minimum_distance = #{flangeFaceMinimumDistance}, + Minimum_total_length_coupling = #{minimumTotalLengthCoupling}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_toothed_coupling where id = #{id} + + + + update pc_toothed_coupling set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcTravelSwitchMapper.xml b/evo/src/main/resources/mybatis/management/PcTravelSwitchMapper.xml new file mode 100644 index 0000000..377d6db --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcTravelSwitchMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, illustrate, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_travel_switch + + + + + + + + insert into pc_travel_switch + + create_time, + type_name, + product_id, + product_name, + illustrate, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{illustrate}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_travel_switch + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + illustrate = #{illustrate}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_travel_switch where id = #{id} + + + + update pc_travel_switch set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcTwoStageReductionGearMapper.xml b/evo/src/main/resources/mybatis/management/PcTwoStageReductionGearMapper.xml new file mode 100644 index 0000000..1651570 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcTwoStageReductionGearMapper.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, velocity_ratio, torque, input_shaft_diameter_d_one, input_shaft_length_e_one, input_shaft_distance_g_one, output_shaft_diameter_d, output_shaft_length_e, output_shaft_distance_g_two, in_out_height_of_center_h, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_two_stage_reduction_gear + + + + + + + + insert into pc_two_stage_reduction_gear + + create_time, + type_name, + product_id, + product_name, + velocity_ratio, + torque, + input_shaft_diameter_d_one, + input_shaft_length_e_one, + input_shaft_distance_g_one, + output_shaft_diameter_d, + output_shaft_length_e, + output_shaft_distance_g_two, + in_out_height_of_center_h, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{velocityRatio}, + #{torque}, + #{inputShaftDiameterDOne}, + #{inputShaftLengthEOne}, + #{inputShaftDistanceGOne}, + #{outputShaftDiameterD}, + #{outputShaftLengthE}, + #{outputShaftDistanceGTwo}, + #{inOutHeightOfCenterH}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_two_stage_reduction_gear + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + velocity_ratio = #{velocityRatio}, + torque = #{torque}, + input_shaft_diameter_d_one = #{inputShaftDiameterDOne}, + input_shaft_length_e_one = #{inputShaftLengthEOne}, + input_shaft_distance_g_one = #{inputShaftDistanceGOne}, + output_shaft_diameter_d = #{outputShaftDiameterD}, + output_shaft_length_e = #{outputShaftLengthE}, + output_shaft_distance_g_two = #{outputShaftDistanceGTwo}, + in_out_height_of_center_h = #{inOutHeightOfCenterH}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_two_stage_reduction_gear where id = #{id} + + + + update pc_two_stage_reduction_gear set del_flag = 1 where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PcWindlassMapper.xml b/evo/src/main/resources/mybatis/management/PcWindlassMapper.xml new file mode 100644 index 0000000..d7ee0f7 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PcWindlassMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, product_id, product_name, texture, diameter, journey, load_capacity, speed, diameter_of_wire_rope, suspension_centre_number, univalence, picture, part_id, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pc_windlass + + + + + + + + insert into pc_windlass + + create_time, + type_name, + product_id, + product_name, + texture, + diameter, + journey, + load_capacity, + speed, + diameter_of_wire_rope, + suspension_centre_number, + univalence, + picture, + part_id, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{typeName}, + #{productId}, + #{productName}, + #{texture}, + #{diameter}, + #{journey}, + #{loadCapacity}, + #{speed}, + #{diameterOfWireRope}, + #{suspensionCentreNumber}, + #{univalence}, + #{picture}, + #{partId}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pc_windlass + + create_time = #{createTime}, + type_name = #{typeName}, + product_id = #{productId}, + product_name = #{productName}, + texture = #{texture}, + diameter = #{diameter}, + journey = #{journey}, + load_capacity = #{loadCapacity}, + speed = #{speed}, + diameter_of_wire_rope = #{diameterOfWireRope}, + suspension_centre_number = #{suspensionCentreNumber}, + univalence = #{univalence}, + picture = #{picture}, + part_id = #{partId}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pc_windlass where id = #{id} + + + + update pc_windlass set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwAlterationDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwAlterationDetailMapper.xml new file mode 100644 index 0000000..5e63500 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwAlterationDetailMapper.xml @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, alteration_id, code, project_name,old_id, old_name, old_figure_number, old_one_number, old_type, old_piece_weight, old_sum_number, new_name, new_figure_number, new_one_number, new_type, new_piece_weight, new_sum_number, new_parent_level_name,new_parent_level_figure_number,remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_alteration_detail + + + + + + + + insert into pw_alteration_detail + + create_time, + alteration_id, + code, + project_name, + old_id, + old_name, + old_figure_number, + old_one_number, + old_type, + old_piece_weight, + old_sum_number, + new_name, + new_figure_number, + new_one_number, + new_type, + new_piece_weight, + new_sum_number, + new_parent_level_name, + new_parent_level_figure_number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{alterationId}, + #{code}, + #{projectName}, + #{oldId}, + #{oldName}, + #{oldFigureNumber}, + #{oldOneNumber}, + #{oldType}, + #{oldPieceWeight}, + #{oldSumNumber}, + #{newName}, + #{newFigureNumber}, + #{newOneNumber}, + #{newType}, + #{newPieceWeight}, + #{newSumNumber}, + #{newParentLevelName}, + #{newParentLevelFigureNumber}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_alteration_detail + + create_time = #{createTime}, + alteration_id = #{alterationId}, + code = #{code}, + project_name = #{projectName}, + old_id = #{oldId}, + old_name = #{oldName}, + old_figure_number = #{oldFigureNumber}, + old_one_number = #{oldOneNumber}, + old_type = #{oldType}, + old_piece_weight = #{oldPieceWeight}, + old_sum_number = #{oldSumNumber}, + new_name = #{newName}, + new_figure_number = #{newFigureNumber}, + new_one_number = #{newOneNumber}, + new_type = #{newType}, + new_piece_weight = #{newPieceWeight}, + new_sum_number = #{newSumNumber}, + new_parent_level_name = #{newParentLevelName}, + new_parent_level_figure_number = #{newParentLevelFigureNumber}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_alteration_detail where id = #{id} + + + + delete from pw_alteration_detail where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwAlterationMapper.xml b/evo/src/main/resources/mybatis/management/PwAlterationMapper.xml new file mode 100644 index 0000000..242d627 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwAlterationMapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, name, cause, cause_date, designer, handling_method, audit, remarks, spared_one, sapred_two, sapred_three, spared_four, del_flag from pw_alteration + + + + + + + + insert into pw_alteration + + create_time, + code, + name, + cause, + cause_date, + designer, + handling_method, + audit, + remarks, + spared_one, + sapred_two, + sapred_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{name}, + #{cause}, + #{causeDate}, + #{designer}, + #{handlingMethod}, + #{audit}, + #{remarks}, + #{sparedOne}, + #{sapredTwo}, + #{sapredThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_alteration + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + cause = #{cause}, + cause_date = #{causeDate}, + designer = #{designer}, + handling_method = #{handlingMethod}, + audit = #{audit}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + sapred_two = #{sapredTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_alteration where id = #{id} + + + + delete from pw_alteration where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBacklogMapper.xml b/evo/src/main/resources/mybatis/management/PwBacklogMapper.xml new file mode 100644 index 0000000..faae0ec --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBacklogMapper.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, matter_name, code,material_name,figure_number, push_name, push_time, recipient_name, recipient_time, process_mode, schedule, module_name, address, status, remarks, spared_one, spared_two, spared_three, spared_four from pw_backlog + + + + + + + + insert into pw_backlog + + create_time, + matter_name, + code, + material_name, + figure_number, + push_name, + push_time, + recipient_name, + recipient_time, + process_mode, + schedule, + module_name, + address, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{matterName}, + #{code}, + #{materialName}, + #{figureNumber}, + #{pushName}, + #{pushTime}, + #{recipientName}, + #{recipientTime}, + #{processMode}, + #{schedule}, + #{moduleName}, + #{address}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_backlog + + create_time = #{createTime}, + matter_name = #{matterName}, + code = #{code}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + push_name = #{pushName}, + push_time = #{pushTime}, + recipient_name = #{recipientName}, + recipient_time = #{recipientTime}, + recipient_time = null, + process_mode = #{processMode}, + schedule = #{schedule}, + module_name = #{moduleName}, + address = #{address}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_backlog where id = #{id} + + + + delete from pw_backlog where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBomMapper.xml b/evo/src/main/resources/mybatis/management/PwBomMapper.xml new file mode 100644 index 0000000..0d8c930 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBomMapper.xml @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, single_quantity, type, + piece_weight, total_quantity, parent_level_figure_number, + parent_level_name,type_name,code, remark, spared_one, spared_two, spared_three, + spared_four, del_flag from pw_bom + + + + + + + + insert into pw_bom + + create_time, + name, + figure_number, + single_quantity, + type, + piece_weight, + total_quantity, + parent_level_figure_number, + parent_level_name, + type_name, + code, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{singleQuantity}, + #{type}, + #{pieceWeight}, + #{totalQuantity}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{type_name}, + #{code}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_bom + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + single_quantity = #{singleQuantity}, + type = #{type}, + piece_weight = #{pieceWeight}, + total_quantity = #{totalQuantity}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + type_name = #{typeName}, + code = #{code}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_bom where id = #{id} + + + + delete from pw_bom where id in + + #{id} + + + + + + insert into pw_bom(name, figure_number, + single_quantity, type, piece_weight, total_quantity, + parent_level_figure_number, parent_level_name,type_name,code, remark, spared_one, + spared_two, spared_three, spared_four, del_flag) + VALUES + + (#{item.name}, + #{item.figureNumber}, + #{item.singleQuantity}, + #{item.type}, + #{item.pieceWeight}, + #{item.totalQuantity}, + #{item.parentLevelFigureNumber}, + #{item.parentLevelName}, + #{item.typeName}, + #{item.code}, + #{item.remark}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.delFlag}) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBomNumberMapper.xml b/evo/src/main/resources/mybatis/management/PwBomNumberMapper.xml new file mode 100644 index 0000000..9030be1 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBomNumberMapper.xml @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code,type_name,num, figure_number, name, one_number,type,piece_weight, parent_level_figure_number, parent_level_name, sum_number,remarks, spared_one, spared_two, spared_three, spared_four,purchase_mark from pw_bom_number + + + + + + + + insert into pw_bom_number + + create_time, + production_code, + type_name, + num, + figure_number, + name, + one_number, + type, + piece_weight, + parent_level_figure_number, + parent_level_name, + sum_number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + purchase_mark, + + + #{createTime}, + #{productionCode}, + #{typeName}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{sumNumber}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{purchaseMark}, + + + + + update pw_bom_number + + create_time = #{createTime}, + production_code = #{productionCode}, + type_name = #{typeName}, + num = #{num}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + sum_number = #{sumNumber}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + purchase_mark = #{purchaseMark}, + + where id = #{id} + + + + delete from pw_bom_number where production_code = #{code} and figure_number = #{figureNumber} + + + + + + + + + + + + + + + + + + insert into pw_bom_number(production_code,type_name,num, figure_number, name, one_number,type,piece_weight, parent_level_figure_number, parent_level_name, sum_number,remarks, spared_one, spared_two, spared_three, spared_four,purchase_mark) + VALUES + + (#{item.productionCode}, + #{item.typeName}, + #{item.num}, + #{item.figureNumber}, + #{item.name}, + #{item.oneNumber}, + #{item.type}, + #{item.pieceWeight}, + #{item.parentLevelFigureNumber}, + #{item.parentLevelName}, + #{item.sumNumber}, + #{item.remarks}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.purchaseMark}) + + + + + delete from pw_bom_number where production_code = #{code} + + + + + + + + + + + + + + + + + + + + + update pw_bom_number set purchase_mark = #{purchaseMark} + where production_code = #{productCode} and figure_number = #{figureNumber} + + + diff --git a/evo/src/main/resources/mybatis/management/PwBomNumberTwoFuMapper.xml b/evo/src/main/resources/mybatis/management/PwBomNumberTwoFuMapper.xml new file mode 100644 index 0000000..74dd915 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBomNumberTwoFuMapper.xml @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code, num, figure_number, name, one_number, type, piece_weight, parent_level_figure_number, parent_level_name, sum_number, spared_one, spared_two, process_name, godown_entry, inventory_status, superior_id, picture, remarks, completion_date, department_name, material_id, materials_name, materials_specification, measure, len, wid, specification, workblank, finished, receive_number, xu_describe, material_id_two, materials_name_two, materials_specification_two, measure_two, len_two, wid_two, specification_two, workblank_two, finished_two, theoretical, outsource_contrat_detail_id, spared_three, spared_four, del_flag from pw_bom_number_two_fu + + + + + + + + insert into pw_bom_number_two_fu + + create_time, + production_code, + num, + figure_number, + name, + one_number, + type, + piece_weight, + parent_level_figure_number, + parent_level_name, + sum_number, + spared_one, + spared_two, + process_name, + godown_entry, + inventory_status, + superior_id, + picture, + remarks, + completion_date, + department_name, + material_id, + materials_name, + materials_specification, + measure, + len, + wid, + specification, + workblank, + finished, + receive_number, + xu_describe, + material_id_two, + materials_name_two, + materials_specification_two, + measure_two, + len_two, + wid_two, + specification_two, + workblank_two, + finished_two, + theoretical, + outsource_contrat_detail_id, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productionCode}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{sumNumber}, + #{sparedOne}, + #{sparedTwo}, + #{processName}, + #{godownEntry}, + #{inventoryStatus}, + #{superiorId}, + #{picture}, + #{remarks}, + #{completionDate}, + #{departmentName}, + #{materialId}, + #{materialsName}, + #{materialsSpecification}, + #{measure}, + #{len}, + #{wid}, + #{specification}, + #{workblank}, + #{finished}, + #{receiveNumber}, + #{xuDescribe}, + #{materialIdTwo}, + #{materialsNameTwo}, + #{materialsSpecificationTwo}, + #{measureTwo}, + #{lenTwo}, + #{widTwo}, + #{specificationTwo}, + #{workblankTwo}, + #{finishedTwo}, + #{theoretical}, + #{outsourceContratDetailId}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_bom_number_two_fu + + create_time = #{createTime}, + production_code = #{productionCode}, + num = #{num}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + sum_number = #{sumNumber}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + process_name = #{processName}, + godown_entry = #{godownEntry}, + inventory_status = #{inventoryStatus}, + inventory_status = null, + superior_id = #{superiorId}, + picture = #{picture}, + remarks = #{remarks}, + completion_date = #{completionDate}, + department_name = #{departmentName}, + material_id = #{materialId}, + materials_name = #{materialsName}, + materials_specification = #{materialsSpecification}, + measure = #{measure}, + len = #{len}, + wid = #{wid}, + specification = #{specification}, + workblank = #{workblank}, + finished = #{finished}, + receive_number = #{receiveNumber}, + xu_describe = #{xuDescribe}, + material_id_two = #{materialIdTwo}, + materials_name_two = #{materialsNameTwo}, + materials_specification_two = #{materialsSpecificationTwo}, + measure_two = #{measureTwo}, + len_two = #{lenTwo}, + wid_two = #{widTwo}, + specification_two = #{specificationTwo}, + workblank_two = #{workblankTwo}, + finished_two = #{finishedTwo}, + theoretical = #{theoretical}, + outsource_contrat_detail_id = #{outsourceContratDetailId}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_bom_number_two_fu where id = #{id} + + + + delete from pw_bom_number_two_fu where id in + + #{id} + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBomNumberTwoGongxuMapper.xml b/evo/src/main/resources/mybatis/management/PwBomNumberTwoGongxuMapper.xml new file mode 100644 index 0000000..68bb8bd --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBomNumberTwoGongxuMapper.xml @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code, num, figure_number, name, one_number, type, piece_weight, parent_level_figure_number, parent_level_name, sum_number, spared_one, spared_two, process_name, godown_entry, inventory_status, superior_id, picture, remarks, completion_date, department_name, material_id, materials_name, materials_specification, measure, len, wid, specification, workblank, finished, receive_number, materials_date, xu_describe, date_describe, xu_time, material_id_two, materials_name_two, materials_specification_two, measure_two, len_two, wid_two, specification_two, workblank_two, finished_two, theoretical, outsource_contrat_detail_id, spared_three, spared_four, spared_five, del_flag from pw_bom_number_two_gongxu + + + + + + + + insert into pw_bom_number_two_gongxu + + create_time, + production_code, + num, + figure_number, + name, + one_number, + type, + piece_weight, + parent_level_figure_number, + parent_level_name, + sum_number, + spared_one, + spared_two, + process_name, + godown_entry, + inventory_status, + superior_id, + picture, + remarks, + completion_date, + department_name, + material_id, + materials_name, + materials_specification, + measure, + len, + wid, + specification, + workblank, + finished, + receive_number, + materials_date, + xu_describe, + date_describe, + xu_time, + material_id_two, + materials_name_two, + materials_specification_two, + measure_two, + len_two, + wid_two, + specification_two, + workblank_two, + finished_two, + theoretical, + outsource_contrat_detail_id, + spared_three, + spared_four, + spared_five, + del_flag, + + + #{createTime}, + #{productionCode}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{sumNumber}, + #{sparedOne}, + #{sparedTwo}, + #{processName}, + #{godownEntry}, + #{inventoryStatus}, + #{superiorId}, + #{picture}, + #{remarks}, + #{completionDate}, + #{departmentName}, + #{materialId}, + #{materialsName}, + #{materialsSpecification}, + #{measure}, + #{len}, + #{wid}, + #{specification}, + #{workblank}, + #{finished}, + #{receiveNumber}, + #{materialsDate}, + #{xuDescribe}, + #{dateDescribe}, + #{xuTime}, + #{materialIdTwo}, + #{materialsNameTwo}, + #{materialsSpecificationTwo}, + #{measureTwo}, + #{lenTwo}, + #{widTwo}, + #{specificationTwo}, + #{workblankTwo}, + #{finishedTwo}, + #{theoretical}, + #{outsourceContratDetailId}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{delFlag}, + + + + + update pw_bom_number_two_gongxu + + create_time = #{createTime}, + production_code = #{productionCode}, + num = #{num}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + sum_number = #{sumNumber}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + process_name = #{processName}, + godown_entry = #{godownEntry}, + inventory_status = #{inventoryStatus}, + superior_id = #{superiorId}, + picture = #{picture}, + remarks = #{remarks}, + completion_date = #{completionDate}, + department_name = #{departmentName}, + material_id = #{materialId}, + materials_name = #{materialsName}, + materials_specification = #{materialsSpecification}, + measure = #{measure}, + len = #{len}, + wid = #{wid}, + specification = #{specification}, + workblank = #{workblank}, + finished = #{finished}, + receive_number = #{receiveNumber}, + materials_date = #{materialsDate}, + xu_describe = #{xuDescribe}, + date_describe = #{dateDescribe}, + xu_time = #{xuTime}, + material_id_two = #{materialIdTwo}, + materials_name_two = #{materialsNameTwo}, + materials_specification_two = #{materialsSpecificationTwo}, + measure_two = #{measureTwo}, + len_two = #{lenTwo}, + wid_two = #{widTwo}, + specification_two = #{specificationTwo}, + workblank_two = #{workblankTwo}, + finished_two = #{finishedTwo}, + theoretical = #{theoretical}, + outsource_contrat_detail_id = #{outsourceContratDetailId}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_bom_number_two_gongxu where id = #{id} + + + + delete from pw_bom_number_two_gongxu where id in + + #{id} + + + + + + insert into pw_bom_number_two_gongxu(production_code, num, figure_number, name, one_number, type, piece_weight, parent_level_figure_number, parent_level_name, sum_number, spared_one, spared_two, process_name, godown_entry, inventory_status, superior_id, picture, remarks, completion_date, department_name, material_id, materials_name, materials_specification, measure, len, wid, specification, workblank, finished, receive_number, materials_date, xu_describe, date_describe, xu_time, material_id_two, materials_name_two, materials_specification_two, measure_two, len_two, wid_two, specification_two, workblank_two, finished_two, theoretical, outsource_contrat_detail_id, spared_three, spared_four, spared_five, del_flag) + VALUES + + (#{item.productionCode}, + #{item.num}, + #{item.figureNumber}, + #{item.name}, + #{item.oneNumber}, + #{item.type}, + #{item.pieceWeight}, + #{item.parentLevelFigureNumber}, + #{item.parentLevelName}, + #{item.sumNumber}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.processName}, + #{item.godownEntry}, + #{item.inventoryStatus}, + #{item.superiorId}, + #{item.picture}, + #{item.remarks}, + #{item.completionDate}, + #{item.departmentName}, + #{item.materialId}, + #{item.materialsName}, + #{item.materialsSpecification}, + #{item.measure}, + #{item.len}, + #{item.wid}, + #{item.specification}, + #{item.workblank}, + #{item.finished}, + #{item.receiveNumber}, + #{item.materialsDate}, + #{item.xuDescribe}, + #{item.dateDescribe}, + #{item.xuTime}, + #{item.materialIdTwo}, + #{item.materialsNameTwo}, + #{item.materialsSpecificationTwo}, + #{item.measureTwo}, + #{item.lenTwo}, + #{item.widTwo}, + #{item.specificationTwo}, + #{item.workblankTwo}, + #{item.finishedTwo}, + #{item.theoretical}, + #{item.outsourceContratDetailId}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.sparedFive}, + #{item.delFlag}) + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBomNumberTwoLingliaoMapper.xml b/evo/src/main/resources/mybatis/management/PwBomNumberTwoLingliaoMapper.xml new file mode 100644 index 0000000..3d60a2d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBomNumberTwoLingliaoMapper.xml @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code, num, figure_number, name, one_number, type, piece_weight, parent_level_figure_number, parent_level_name, sum_number, spared_one, spared_two, process_name, inventory_status, superior_id, picture, remarks, completion_date, department_name, materials_name, materials_specification, measure, workblank, finished,theoretical, spared_three, spared_four, del_flag from pw_bom_number_two_lingliao + + + + + + + + insert into pw_bom_number_two_lingliao + + create_time, + production_code, + num, + figure_number, + name, + one_number, + type, + piece_weight, + parent_level_figure_number, + parent_level_name, + sum_number, + spared_one, + spared_two, + process_name, + inventory_status, + superior_id, + picture, + remarks, + completion_date, + department_name, + materials_name, + materials_specification, + measure, + workblank, + finished, + theoretical, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productionCode}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{sumNumber}, + #{sparedOne}, + #{sparedTwo}, + #{processName}, + #{inventoryStatus}, + #{superiorId}, + #{picture}, + #{remarks}, + #{completionDate}, + #{departmentName}, + #{materialsName}, + #{materialsSpecification}, + #{measure}, + #{workblank}, + #{finished}, + #{theoretical}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_bom_number_two_lingliao + + create_time = #{createTime}, + production_code = #{productionCode}, + num = #{num}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + sum_number = #{sumNumber}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + process_name = #{processName}, + inventory_status = #{inventoryStatus}, + superior_id = #{superiorId}, + picture = #{picture}, + remarks = #{remarks}, + completion_date = #{completionDate}, + department_name = #{departmentName}, + materials_name = #{materialsName}, + materials_specification = #{materialsSpecification}, + measure = #{measure}, + workblank = #{workblank}, + finished = #{finished}, + theoretical = #{theoretical}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_bom_number_two_lingliao where id = #{id} + + + + delete from pw_bom_number_two_lingliao where id in + + #{id} + + + + + + + + + + + + + + + delete from pw_bom_number_two_lingliao where production_code = #{code} + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwBomNumberTwoMapper.xml b/evo/src/main/resources/mybatis/management/PwBomNumberTwoMapper.xml new file mode 100644 index 0000000..0d87a68 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBomNumberTwoMapper.xml @@ -0,0 +1,908 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code,num ,figure_number,jd_flag, name, one_number,type,piece_weight, parent_level_figure_number, parent_level_name, sum_number, spared_one, spared_two,process_name,godown_entry,inventory_status,superior_id,picture,remarks,completion_date,department_name,material_id,materials_name,materials_specification,measure,len,wid,specification,workblank,finished,receive_number,materials_date,xu_describe,date_describe,xu_time,theoretical,outsource_contrat_detail_id,spared_three, spared_four,spared_five,del_flag from pw_bom_number_two + + + + + + + + + + + + + + + + + insert into pw_bom_number_two + + create_time, + production_code, + num, + figure_number, + name, + one_number, + type, + piece_weight, + parent_level_figure_number, + parent_level_name, + sum_number, + spared_one, + spared_two, + process_name, + godown_entry, + inventory_status, + superior_id, + picture, + remarks, + completion_date, + department_name, + material_id, + materials_name, + materials_specification, + measure, + len, + wid, + specification, + workblank, + finished, + receive_number, + materials_date, + xu_describe, + date_describe, + xu_time, + theoretical, + outsource_contrat_detail_id, + spared_three, + spared_four, + spared_five, + del_flag, + + + #{createTime}, + #{productionCode}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{sumNumber}, + #{sparedOne}, + #{sparedTwo}, + #{processName}, + #{godownEntry}, + #{inventoryStatus}, + #{superiorId}, + #{picture}, + #{remarks}, + #{completionDate}, + #{departmentName}, + #{materialId}, + #{materialsName}, + #{materialsSpecification}, + #{measure}, + #{len}, + #{wid}, + #{specification}, + #{workblank}, + #{finished}, + #{receiveNumber}, + #{materialsDate}, + #{xuDescribe}, + #{dateDescribe}, + #{xuTime}, + #{theoretical}, + #{outsourceContratDetailId}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{delFlag}, + + + + + update pw_bom_number_two + + create_time = #{createTime}, + production_code = #{productionCode}, + num = #{num}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + sum_number = #{sumNumber}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + process_name = #{processName}, + godown_entry = #{godownEntry}, + inventory_status = #{inventoryStatus}, + inventory_status = null, + superior_id = #{superiorId}, + picture = #{picture}, + remarks = #{remarks}, + completion_date = #{completionDate}, + department_name = #{departmentName}, + material_id = #{materialId}, + material_id = null, + + materials_name = #{materialsName}, + materials_name = null, + + materials_specification = #{materialsSpecification}, + materials_specification = null, + + measure = #{measure}, + measure = null, + + len = #{len}, + len = null, + + wid = #{wid}, + wid = null, + + specification = #{specification}, + specification = null, + + workblank = #{workblank}, + workblank = null, + + finished = #{finished}, + finished = null, + + receive_number = #{receiveNumber}, + receive_number = null, + + materials_date = #{materialsDate}, + xu_describe = #{xuDescribe}, + date_describe = #{dateDescribe}, + xu_time = #{xuTime}, + theoretical = #{theoretical}, + outsource_contrat_detail_id = #{outsourceContratDetailId}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + del_flag = #{delFlag}, + department_name = null, + spared_two = null, + jd_flag = #{jdFlag}, + + where id = #{id} + + + + delete from pw_bom_number_two where id = #{id} + + + + delete from pw_bom_number_two where id in + + #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from pw_bom_number_two where production_code = #{code} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into pw_bom_number_two + (create_time,production_code,num,figure_number,name,one_number,type,piece_weight,parent_level_figure_number,parent_level_name,sum_number,spared_one,spared_two,process_name,godown_entry,inventory_status,superior_id, + picture,remarks,completion_date,department_name,material_id,materials_name,materials_specification,measure,len,wid,specification,workblank,finished,receive_number,materials_date,xu_describe, + date_describe,xu_time,theoretical,outsource_contrat_detail_id,spared_three,spared_four,spared_five,del_flag) values + + (#{item.createTime},#{item.productionCode},#{item.num},#{item.figureNumber},#{item.name},#{item.oneNumber},#{item.type},#{item.pieceWeight},#{item.parentLevelFigureNumber},#{item.parentLevelName},#{item.sumNumber},#{item.sparedOne}, + #{item.sparedTwo},#{item.processName},#{item.godownEntry},#{item.inventoryStatus}, #{item.superiorId},#{item.picture},#{item.remarks},#{item.completionDate},#{item.departmentName},#{item.materialId},#{item.materialsName},#{item.materialsSpecification}, + #{item.measure},#{item.len},#{item.wid},#{item.specification},#{item.workblank},#{item.finished},#{item.receiveNumber},#{item.materialsDate}, + #{item.xuDescribe},#{item.dateDescribe},#{item.xuTime},#{item.theoretical},#{item.outsourceContratDetailId},#{item.sparedThree},#{item.sparedFour},#{item.sparedFive},#{item.delFlag}) + + + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwBuyingRequisitionJjMapper.xml b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionJjMapper.xml new file mode 100644 index 0000000..18c003e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionJjMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, name, purpose, total_prices, demand_date, proposer, auditor, status, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_buying_requisition_jj + + + + + + + + + + insert into pw_buying_requisition_jj + + create_time, + code, + name, + purpose, + total_prices, + demand_date, + proposer, + auditor, + status, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{name}, + #{purpose}, + #{totalPrices}, + #{demandDate}, + #{proposer}, + #{auditor}, + #{status}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_buying_requisition_jj + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + purpose = #{purpose}, + total_prices = #{totalPrices}, + demand_date = #{demandDate}, + proposer = #{proposer}, + auditor = #{auditor}, + status = #{status}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_buying_requisition_jj where id = #{id} + + + + delete from pw_buying_requisition_jj where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMapper.xml b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMapper.xml new file mode 100644 index 0000000..ae7f3cc --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMapper.xml @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + create_time, + code, + name, + purpose, + total_prices, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + seller_name, + appoint_time, + big_total_prices, + agreement, + tax_rate, + delivery_type, + payer, + mode_of_payment, + withhold, + billing_information, + demand_date, + proposer, + auditor, + status, + overtime, + remark, + leadership, + leadership_time, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + contract_path + from pw_buying_requisition + + + + + + + + insert into pw_buying_requisition + + create_time, + code, + name, + purpose, + total_prices, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + seller_name, + appoint_time, + big_total_prices, + agreement, + tax_rate, + delivery_type, + payer, + mode_of_payment, + withhold, + billing_information, + demand_date, + proposer, + auditor, + status, + overtime, + remark, + leadership, + leadership_time, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + contract_path, + + + #{createTime}, + #{code}, + #{name}, + #{purpose}, + #{totalPrices}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{sellerName}, + #{appointTime}, + #{bigTotalPrices}, + #{agreement}, + #{taxRate}, + #{deliveryType}, + #{payer}, + #{modeOfPayment}, + #{withhold}, + #{billingInformation}, + #{demandDate}, + #{proposer}, + #{auditor}, + #{status}, + #{overtime}, + #{remark}, + #{leadership}, + #{leadershipTime}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{contractPath}, + + + + + update pw_buying_requisition + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + purpose = #{purpose}, + total_prices = #{totalPrices}, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{proceedsAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + seller_name = #{sellerName}, + appoint_time = #{appointTime}, + big_total_prices = #{bigTotalPrices}, + agreement = #{agreement}, + tax_rate = #{taxRate}, + delivery_type = #{deliveryType}, + payer = #{payer}, + mode_of_payment = #{modeOfPayment}, + withhold = #{withhold}, + billing_information = #{billingInformation}, + demand_date = #{demandDate}, + proposer = #{proposer}, + auditor = #{auditor}, + status = #{status}, + overtime = #{overtime}, + remark = #{remark}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + contract_path = #{contractPath}, + + where id = #{id} + + + + delete from pw_buying_requisition where id = #{id} + + + + delete from pw_buying_requisition where id in + + #{id} + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialJjMapper.xml b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialJjMapper.xml new file mode 100644 index 0000000..e002080 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialJjMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, buying_requisition_id, material_name, figure_number, materials, piece_weight, unit_of_measurement_name, number, univalence, totalprice, reference_number, practical_number, preferential_origin_name, inventory_status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_buying_requisition_material_jj + + + + + + + + + + + insert into pw_buying_requisition_material_jj + + create_time, + buying_requisition_id, + material_name, + figure_number, + materials, + piece_weight, + unit_of_measurement_name, + number, + univalence, + totalprice, + reference_number, + practical_number, + preferential_origin_name, + inventory_status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{buyingRequisitionId}, + #{materialName}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{unitOfMeasurementName}, + #{number}, + #{univalence}, + #{totalprice}, + #{referenceNumber}, + #{practicalNumber}, + #{preferentialOriginName}, + #{inventoryStatus}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_buying_requisition_material_jj + + create_time = #{createTime}, + buying_requisition_id = #{buyingRequisitionId}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + unit_of_measurement_name = #{unitOfMeasurementName}, + number = #{number}, + univalence = #{univalence}, + totalprice = #{totalprice}, + reference_number = #{referenceNumber}, + practical_number = #{practicalNumber}, + preferential_origin_name = #{preferentialOriginName}, + inventory_status = #{inventoryStatus}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_buying_requisition_material_jj where id = #{id} + + + + delete from pw_buying_requisition_material_jj where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialMapper.xml b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialMapper.xml new file mode 100644 index 0000000..b172d27 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialMapper.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, buying_requisition_id,material_id, material_name,material_code, figure_number, materials, piece_weight, unit_of_measurement_name, number,sum_number, univalence, totalprice,reference_number,practical_number,preferential_origin_name, inventory_status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_buying_requisition_material + + + + + + + + + insert into pw_buying_requisition_material + + create_time, + buying_requisition_id, + material_id, + material_name, + figure_number, + materials, + piece_weight, + unit_of_measurement_name, + number, + sum_number, + univalence, + totalprice, + reference_number, + practical_number, + preferential_origin_name, + inventory_status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + material_code, + + + #{createTime}, + #{buyingRequisitionId}, + #{materialId}, + #{materialName}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{unitOfMeasurementName}, + #{number}, + #{sumNumber}, + #{univalence}, + #{totalprice}, + #{referenceNumber}, + #{practicalNumber}, + #{preferentialOriginName}, + #{inventoryStatus}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{materialCode}, + + + + + update pw_buying_requisition_material + + create_time = #{createTime}, + buying_requisition_id = #{buyingRequisitionId}, + material_id = #{materialId}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + unit_of_measurement_name = #{unitOfMeasurementName}, + number = #{number}, + sum_number = #{sumNumber}, + univalence = #{univalence}, + totalprice = #{totalprice}, + reference_number = #{referenceNumber}, + practical_number = #{practicalNumber}, + preferential_origin_name = #{preferentialOriginName}, + inventory_status = #{inventoryStatus}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from pw_buying_requisition_material where id = #{id} + + + + delete from pw_buying_requisition_material where id in + + #{id} + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialTwoMapper.xml b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialTwoMapper.xml new file mode 100644 index 0000000..31a4c98 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionMaterialTwoMapper.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, buying_requisition_id, material_id, material_name, figure_number, materials, piece_weight,material_code, unit_of_measurement_name, number, univalence, totalprice, reference_number, practical_number, preferential_origin_name, inventory_status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_buying_requisition_material_two + + + + + + + + insert into pw_buying_requisition_material_two + + create_time, + buying_requisition_id, + material_id, + material_name, + figure_number, + materials, + piece_weight, + unit_of_measurement_name, + number, + univalence, + totalprice, + reference_number, + practical_number, + preferential_origin_name, + inventory_status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + material_code, + + + #{createTime}, + #{buyingRequisitionId}, + #{materialId}, + #{materialName}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{unitOfMeasurementName}, + #{number}, + #{univalence}, + #{totalprice}, + #{referenceNumber}, + #{practicalNumber}, + #{preferentialOriginName}, + #{inventoryStatus}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{materialCode}, + + + + + update pw_buying_requisition_material_two + + create_time = #{createTime}, + buying_requisition_id = #{buyingRequisitionId}, + material_id = #{materialId}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + unit_of_measurement_name = #{unitOfMeasurementName}, + number = #{number}, + univalence = #{univalence}, + totalprice = #{totalprice}, + reference_number = #{referenceNumber}, + practical_number = #{practicalNumber}, + preferential_origin_name = #{preferentialOriginName}, + inventory_status = #{inventoryStatus}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from pw_buying_requisition_material_two where id = #{id} + + + + delete from pw_buying_requisition_material_two where id in + + #{id} + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwBuyingRequisitionTwoMapper.xml b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionTwoMapper.xml new file mode 100644 index 0000000..b6bd0a4 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwBuyingRequisitionTwoMapper.xml @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + create_time, + code, + name, + purpose, + total_prices, + demand_date, + proposer, + auditor, + status, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + seller_name, + appoint_time, + big_total_prices, + agreement, + contract_status, + tax_rate, + delivery_type, + payer, + mode_of_payment, + withhold, + billing_information, + leadership, + leadership_time, + contract_path + from pw_buying_requisition_two + + + + + + + + insert into pw_buying_requisition_two + + create_time, + code, + name, + purpose, + total_prices, + demand_date, + proposer, + auditor, + status, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + seller_name, + appoint_time, + big_total_prices, + agreement, + contract_status, + tax_rate, + delivery_type, + payer, + mode_of_payment, + withhold, + billing_information, + leadership, + leadership_time, + + + #{createTime}, + #{code}, + #{name}, + #{purpose}, + #{totalPrices}, + #{demandDate}, + #{proposer}, + #{auditor}, + #{status}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{sellerName}, + #{appointTime}, + #{bigTotalPrices}, + #{agreement}, + #{contractStatus}, + #{taxRate}, + #{deliveryType}, + #{payer}, + #{modeOfPayment}, + #{withhold}, + #{billingInformation}, + #{leadership}, + #{leadershipTime}, + #{contractPath}, + + + + + update pw_buying_requisition_two + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + purpose = #{purpose}, + total_prices = #{totalPrices}, + demand_date = #{demandDate}, + proposer = #{proposer}, + auditor = #{auditor}, + auditor = null, + status = #{status}, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{proceedsAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + seller_name = #{sellerName}, + appoint_time = #{appointTime}, + big_total_prices = #{bigTotalPrices}, + agreement = #{agreement}, + contract_status = #{contractStatus}, + tax_rate = #{taxRate}, + delivery_type = #{deliveryType}, + payer = #{payer}, + mode_of_payment = #{modeOfPayment}, + withhold = #{withhold}, + billing_information = #{billingInformation}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + contract_path = #{contractPath}, + + where id = #{id} + + + + delete from pw_buying_requisition_two where id = #{id} + + + + delete from pw_buying_requisition_two where id in + + #{id} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwCompletionNoticeMapper.xml b/evo/src/main/resources/mybatis/management/PwCompletionNoticeMapper.xml new file mode 100644 index 0000000..2eea76f --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCompletionNoticeMapper.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code, project_name, bill_date, pd_audit, pd_audit_user, quality_inspector_audit, quality_inspector_audit_user, authorized_strength_user, spared_one, spared_two, spared_three, spared_four, del_flag from pw_completion_notice + + + + + + + + insert into pw_completion_notice + + create_time, + production_code, + project_name, + bill_date, + pd_audit, + pd_audit_user, + quality_inspector_audit, + quality_inspector_audit_user, + authorized_strength_user, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productionCode}, + #{projectName}, + #{billDate}, + #{pdAudit}, + #{pdAuditUser}, + #{qualityInspectorAudit}, + #{qualityInspectorAuditUser}, + #{authorizedStrengthUser}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_completion_notice + + create_time = #{createTime}, + production_code = #{productionCode}, + project_name = #{projectName}, + bill_date = #{billDate}, + pd_audit = #{pdAudit}, + pd_audit_user = #{pdAuditUser}, + quality_inspector_audit = #{qualityInspectorAudit}, + quality_inspector_audit_user = #{qualityInspectorAuditUser}, + authorized_strength_user = #{authorizedStrengthUser}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_completion_notice where id = #{id} + + + + delete from pw_completion_notice where id in + + #{id} + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwCompletionNoticeProductMapper.xml b/evo/src/main/resources/mybatis/management/PwCompletionNoticeProductMapper.xml new file mode 100644 index 0000000..8e8b09d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCompletionNoticeProductMapper.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, completion_notice_id, product_receipt_material_id,code,figure_number,product_name,materials,piece_weight,picture,receivable_quantity, quantity,actual_quantity,concession_quantity,repair_quantity,remake_quantity, godown_entry,preferential_origin_name,user_name,checkout_status, checkout_date, inspector, spared_one, spared_two, spared_three, spared_four, del_flag from pw_completion_notice_product + + + + + + + + insert into pw_completion_notice_product + + create_time, + completion_notice_id, + product_receipt_material_id, + code, + figure_number, + product_name, + materials, + piece_weight, + picture, + receivable_quantity, + quantity, + actual_quantity, + concession_quantity, + repair_quantity, + remake_quantity, + godown_entry, + preferential_origin_name, + user_name, + checkout_status, + checkout_date, + inspector, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{completionNoticeId}, + #{productReceiptMaterialId}, + #{code}, + #{figureNumber}, + #{productName}, + #{materials}, + #{pieceWeight}, + #{picture}, + #{receivableQuantity}, + #{quantity}, + #{actualQuantity}, + #{concessionQuantity}, + #{repairQuantity}, + #{remakeQuantity}, + #{godownEntry}, + #{preferentialOriginName}, + #{userName}, + #{checkoutStatus}, + #{checkoutDate}, + #{inspector}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_completion_notice_product + + create_time = #{createTime}, + completion_notice_id = #{completionNoticeId}, + product_receipt_material_id = #{productReceiptMaterialId}, + code = #{code}, + figure_number = #{figureNumber}, + product_name = #{productName}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + picture = #{picture}, + receivable_quantity = #{receivableQuantity}, + quantity = #{quantity}, + actual_quantity = #{actualQuantity}, + concession_quantity = #{concessionQuantity}, + repair_quantity = #{repairQuantity}, + remake_quantity = #{remakeQuantity}, + godown_entry = #{godownEntry}, + preferential_origin_name = #{preferentialOriginName}, + user_name = #{userName}, + checkout_status = #{checkoutStatus}, + checkout_date = #{checkoutDate}, + inspector = #{inspector}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + completion_notice_id is null, + + where id = #{id} + + + + delete from pw_completion_notice_product where id = #{id} + + + + delete from pw_completion_notice_product where id in + + #{id} + + + + + + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwContractInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwContractInfoMapper.xml new file mode 100644 index 0000000..f101653 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwContractInfoMapper.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, contract_id, product_type, product_classify, product_name, type_name,material_code, figure_number, material_name, unit, number, univalence, total, production_order, remarks, spared_one, spared_two, spared_three, spared_four from pw_contract_info + + + + + + + + insert into pw_contract_info + + create_time, + contract_id, + product_type, + product_classify, + product_name, + type_name, + figure_number, + material_name, + unit, + number, + univalence, + total, + production_order, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + material_code, + + + #{createTime}, + #{contractId}, + #{productType}, + #{productClassify}, + #{productName}, + #{typeName}, + #{figureNumber}, + #{materialName}, + #{unit}, + #{number}, + #{univalence}, + #{total}, + #{productionOrder}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{materialCode}, + + + + + update pw_contract_info + + create_time = #{createTime}, + contract_id = #{contractId}, + product_type = #{productType}, + product_classify = #{productClassify}, + product_name = #{productName}, + type_name = #{typeName}, + figure_number = #{figureNumber}, + material_name = #{materialName}, + unit = #{unit}, + number = #{number}, + univalence = #{univalence}, + total = #{total}, + production_order = #{productionOrder}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from pw_contract_info where id = #{id} + + + + delete from pw_contract_info where id in + + #{id} + + + + diff --git a/evo/src/main/resources/mybatis/management/PwContractMapper.xml b/evo/src/main/resources/mybatis/management/PwContractMapper.xml new file mode 100644 index 0000000..710868b --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwContractMapper.xml @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + create_time, + contract_code, + item_name, + purchaser, + seller, + quotation_id, + delivery_points, + consignee, + delivery_time, + payment_method, + freight_payer, + contract_agreement, + purchaser_address, + purchaser_phone, + purchaser_fax, + purchaser_tln, + purchaser_opening_bank, + purchaser_account_number, + seller_address, + seller_phone, + seller_fax, + seller_tln, + seller_opening_bank, + seller_acctount_number, + audit_status, + contract_status, + money, + currency_name, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + leadership, + leadership_time, + remark, + user_id, + salesman, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + contract_path, + tax_rate + from pw_contract c + + + + + + + + insert into pw_contract + + create_time, + contract_code, + item_name, + purchaser, + seller, + quotation_id, + delivery_points, + consignee, + delivery_time, + payment_method, + freight_payer, + contract_agreement, + purchaser_address, + purchaser_phone, + purchaser_fax, + purchaser_tln, + purchaser_opening_bank, + purchaser_account_number, + seller_address, + seller_phone, + seller_fax, + seller_tln, + seller_opening_bank, + seller_acctount_number, + audit_status, + contract_status, + money, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + leadership, + leadership_time, + remark, + user_id, + salesman, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + contract_path, + currency_name, + tax_rate, + + + #{createTime}, + #{contractCode}, + #{itemName}, + #{purchaser}, + #{seller}, + #{quotationId}, + #{deliveryPoints}, + #{consignee}, + #{deliveryTime}, + #{paymentMethod}, + #{freightPayer}, + #{contractAgreement}, + #{purchaserAddress}, + #{purchaserPhone}, + #{purchaserFax}, + #{purchaserTln}, + #{purchaserOpeningBank}, + #{purchaserAccountNumber}, + #{sellerAddress}, + #{sellerPhone}, + #{sellerFax}, + #{sellerTln}, + #{sellerOpeningBank}, + #{sellerAcctountNumber}, + #{auditStatus}, + #{contractStatus}, + #{money}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{leadership}, + #{leadershipTime}, + #{remark}, + #{userId}, + #{salesman}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{contractPath}, + #{currencyName}, + #{taxRate}, + + + + + update pw_contract + + create_time = #{createTime}, + contract_code = #{contractCode}, + item_name = #{itemName}, + purchaser = #{purchaser}, + seller = #{seller}, + quotation_id = #{quotationId}, + delivery_points = #{deliveryPoints}, + consignee = #{consignee}, + delivery_time = #{deliveryTime}, + payment_method = #{paymentMethod}, + freight_payer = #{freightPayer}, + contract_agreement = #{contractAgreement}, + purchaser_address = #{purchaserAddress}, + purchaser_phone = #{purchaserPhone}, + purchaser_fax = #{purchaserFax}, + purchaser_tln = #{purchaserTln}, + purchaser_opening_bank = #{purchaserOpeningBank}, + purchaser_account_number = #{purchaserAccountNumber}, + seller_address = #{sellerAddress}, + seller_phone = #{sellerPhone}, + seller_fax = #{sellerFax}, + seller_tln = #{sellerTln}, + seller_opening_bank = #{sellerOpeningBank}, + seller_acctount_number = #{sellerAcctountNumber}, + audit_status = #{auditStatus}, + contract_status = #{contractStatus}, + money = #{money}, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{proceedsAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + salesman = #{salesman}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + contract_path = #{contractPath}, + currency_name = #{currencyName}, + tax_rate = #{taxRate}, + + where id = #{id} + + + + delete from pw_contract where id = #{id} + + + + delete from pw_contract where id in + + #{id} + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolApplyDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolApplyDetailMapper.xml new file mode 100644 index 0000000..2277b8d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolApplyDetailMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, apply_id, name, brand, type, unit, supplier, manufacturer, quantity,unit_price,total_prices,status, remarks, del_flag, spared_one, sapred_two, sapred_three, spared_four from pw_cutting_tool_apply_detail + + + + + + + + insert into pw_cutting_tool_apply_detail + + create_time, + apply_id, + name, + brand, + type, + unit, + supplier, + manufacturer, + quantity, + unit_price, + total_prices, + status, + remarks, + del_flag, + spared_one, + sapred_two, + sapred_three, + spared_four, + + + #{createTime}, + #{applyId}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{supplier}, + #{manufacturer}, + #{quantity}, + #{unitPrice}, + #{totalPrices}, + #{status}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sapredTwo}, + #{sapredThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_apply_detail + + create_time = #{createTime}, + apply_id = #{applyId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + quantity = #{quantity}, + unit_price = #{unitPrice}, + total_prices = #{totalPrices}, + status = #{status}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + sapred_two = #{sapredTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_apply_detail where id = #{id} + + + + delete from pw_cutting_tool_apply_detail where id in + + #{id} + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolApplyMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolApplyMapper.xml new file mode 100644 index 0000000..e8429fa --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolApplyMapper.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + select id, cerate_time, code, user_name,auditor, apply_date, apply_status, remarks, del_flag, spared_one, spared_two, spared_three, spared_four from pw_cutting_tool_apply + + + + + + + + insert into pw_cutting_tool_apply + + cerate_time, + code, + user_name, + auditor, + apply_date, + apply_status, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{cerateTime}, + #{code}, + #{userName}, + #{auditor}, + #{applyDate}, + #{applyStatus}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_apply + + cerate_time = #{cerateTime}, + code = #{code}, + user_name = #{userName}, + auditor = #{auditor}, + apply_date = #{applyDate}, + apply_status = #{applyStatus}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_apply where id = #{id} + + + + delete from pw_cutting_tool_apply where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolDeliveryDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolDeliveryDetailMapper.xml new file mode 100644 index 0000000..86dd5e4 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolDeliveryDetailMapper.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, delivery_id, name, brand, type, unit, supplier, manufacturer, unit_price,total_prices, quantity, user_name, delivery_status, delivery_date, remarks, del_flag, sapred_one, spared_two, sapred_three, spared_four from pw_cutting_tool_delivery_detail + + + + + + + + insert into pw_cutting_tool_delivery_detail + + create_time, + delivery_id, + name, + brand, + type, + unit, + supplier, + manufacturer, + unit_price, + total_prices, + quantity, + user_name, + delivery_status, + delivery_date, + remarks, + del_flag, + sapred_one, + spared_two, + sapred_three, + spared_four, + + + #{createTime}, + #{deliveryId}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{supplier}, + #{manufacturer}, + #{unitPrice}, + #{totalPrices}, + #{quantity}, + #{userName}, + #{deliveryStatus}, + #{deliveryDate}, + #{remarks}, + #{delFlag}, + #{sapredOne}, + #{sparedTwo}, + #{sapredThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_delivery_detail + + create_time = #{createTime}, + delivery_id = #{deliveryId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + unit_price = #{unitPrice}, + total_prices = #{totalPrices}, + quantity = #{quantity}, + user_name = #{userName}, + delivery_status = #{deliveryStatus}, + delivery_date = #{deliveryDate}, + remarks = #{remarks}, + del_flag = #{delFlag}, + sapred_one = #{sapredOne}, + spared_two = #{sparedTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_delivery_detail where id = #{id} + + + + delete from pw_cutting_tool_delivery_detail where id in + + #{id} + + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolDeliveryMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolDeliveryMapper.xml new file mode 100644 index 0000000..25cefb7 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolDeliveryMapper.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + select id, create_time, code,user_name, status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_cutting_tool_delivery + + + + + + + + insert into pw_cutting_tool_delivery + + create_time, + code, + user_name, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{userName}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_cutting_tool_delivery + + create_time = #{createTime}, + code = #{code}, + user_name = #{userName}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_cutting_tool_delivery where id = #{id} + + + + delete from pw_cutting_tool_delivery where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolGodownEntryDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolGodownEntryDetailMapper.xml new file mode 100644 index 0000000..bf70e41 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolGodownEntryDetailMapper.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, gosown_entry_id, name, brand, type, unit, supplier, manufacturer, unit_price, quantity, total_price, user_name, godown_entry_status, godown_entry_date, remarks, del_flag, spared_one, spared_two, spared_three, spared_four from pw_cutting_tool_godown_entry_detail + + + + + + + + insert into pw_cutting_tool_godown_entry_detail + + create_time, + gosown_entry_id, + name, + brand, + type, + unit, + supplier, + manufacturer, + unit_price, + quantity, + total_price, + user_name, + godown_entry_status, + godown_entry_date, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{gosownEntryId}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{supplier}, + #{manufacturer}, + #{unitPrice}, + #{quantity}, + #{totalPrice}, + #{userName}, + #{godownEntryStatus}, + #{godownEntryDate}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_godown_entry_detail + + create_time = #{createTime}, + gosown_entry_id = #{gosownEntryId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + unit_price = #{unitPrice}, + quantity = #{quantity}, + total_price = #{totalPrice}, + user_name = #{userName}, + godown_entry_status = #{godownEntryStatus}, + godown_entry_date = #{godownEntryDate}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_godown_entry_detail where id = #{id} + + + + delete from pw_cutting_tool_godown_entry_detail where id in + + #{id} + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolGodownEntryMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolGodownEntryMapper.xml new file mode 100644 index 0000000..48d85f7 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolGodownEntryMapper.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + select id, cerate_time, contract_code, seller, inventory_status, remarks, del_flag, spared_one, spared_two, spared_three, sapred_four from pw_cutting_tool_godown_entry + + + + + + + + insert into pw_cutting_tool_godown_entry + + cerate_time, + contract_code, + seller, + inventory_status, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + sapred_four, + + + #{cerateTime}, + #{contractCode}, + #{seller}, + #{inventoryStatus}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sapredFour}, + + + + + update pw_cutting_tool_godown_entry + + cerate_time = #{cerateTime}, + contract_code = #{contractCode}, + seller = #{seller}, + inventory_status = #{inventoryStatus}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + sapred_four = #{sapredFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_godown_entry where id = #{id} + + + + delete from pw_cutting_tool_godown_entry where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolInventoryDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolInventoryDetailMapper.xml new file mode 100644 index 0000000..f53f782 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolInventoryDetailMapper.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, brand, type, unit, warehouse_name, supplier, manufacturer, unit_price, untaxed_price,quantity,number, on_passage, remarks, maintain, scrap, spared_one, spared_two, spared_three, spared_four, del_flag from pw_cutting_tool_inventory_detail + + + + + + + + insert into pw_cutting_tool_inventory_detail + + create_time, + name, + brand, + type, + unit, + warehouse_name, + supplier, + manufacturer, + unit_price, + quantity, + number, + on_passage, + remarks, + maintain, + scrap, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + untaxed_price, + + + #{createTime}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{warehouseName}, + #{supplier}, + #{manufacturer}, + #{unitPrice}, + #{quantity}, + #{number}, + #{onPassage}, + #{remarks}, + #{maintain}, + #{scrap}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{untaxedPrice}, + + + + + update pw_cutting_tool_inventory_detail + + create_time = #{createTime}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + warehouse_name = #{warehouseName}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + unit_price = #{unitPrice}, + quantity = #{quantity}, + number = #{number}, + on_passage = #{onPassage}, + remarks = #{remarks}, + maintain = #{maintain}, + scrap = #{scrap}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + untaxed_price = #{untaxedPrice}, + + where id = #{id} + + + + delete from pw_cutting_tool_inventory_detail where id = #{id} + + + + delete from pw_cutting_tool_inventory_detail where id in + + #{id} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolMaintainDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolMaintainDetailMapper.xml new file mode 100644 index 0000000..f819778 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolMaintainDetailMapper.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, maintain_id, name, brand, type,new_name,new_brand,new_type, unit, supplier, manufacturer, unit_price, quantity, total_price, status, remarks, del_flag, spared_one, spared_two, spared_three, spared_four from pw_cutting_tool_maintain_detail + + + + + + + + insert into pw_cutting_tool_maintain_detail + + create_time, + maintain_id, + name, + brand, + type, + new_name, + new_brand, + new_type, + unit, + supplier, + manufacturer, + unit_price, + quantity, + total_price, + status, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{maintainId}, + #{name}, + #{brand}, + #{type}, + #{newName}, + #{newBrand}, + #{newType}, + #{unit}, + #{supplier}, + #{manufacturer}, + #{unitPrice}, + #{quantity}, + #{totalPrice}, + #{status}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_maintain_detail + + create_time = #{createTime}, + maintain_id = #{maintainId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + new_name = #{newName}, + new_brand = #{newBrand}, + new_type = #{newType}, + unit = #{unit}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + unit_price = #{unitPrice}, + quantity = #{quantity}, + total_price = #{totalPrice}, + status = #{status}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_maintain_detail where id = #{id} + + + + delete from pw_cutting_tool_maintain_detail where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolMaintainMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolMaintainMapper.xml new file mode 100644 index 0000000..67fa982 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolMaintainMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, date, total_prices, user_name, auditor, status, remarks, del_flag, spared_one, sapred_two, sapred_three, spared_four from pw_cutting_tool_maintain + + + + + + + + insert into pw_cutting_tool_maintain + + create_time, + code, + date, + total_prices, + user_name, + auditor, + status, + remarks, + del_flag, + spared_one, + sapred_two, + sapred_three, + spared_four, + + + #{createTime}, + #{code}, + #{date}, + #{totalPrices}, + #{userName}, + #{auditor}, + #{status}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sapredTwo}, + #{sapredThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_maintain + + create_time = #{createTime}, + code = #{code}, + date = #{date}, + total_prices = #{totalPrices}, + user_name = #{userName}, + auditor = #{auditor}, + status = #{status}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + sapred_two = #{sapredTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_maintain where id = #{id} + + + + delete from pw_cutting_tool_maintain where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolMapper.xml new file mode 100644 index 0000000..9edce1e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolMapper.xml @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select ct.id, ct.create_time, ct.name, ct.brand, ct.type, ct.unit,ct.untaxed_price,ct.material_code,ct.warehouse_name,ct.unit_price, ct.minimum_number, ct.height_number, ct.supplier, ct.manufacturer, ct.use_the_equipment, ct.processed_products, ct.expiration_date,ct.period,ct.maintain_number,ct.blacklist,ct.remarks, ct.spared_one, ct.spared_two, ct.spared_three, ct.spared_four, ct.del_flag,cti.quantity from pw_cutting_tool ct LEFT JOIN pw_cutting_tool_inventory_detail cti on ct.name = cti.name and ct.type = cti.type + + + + + + + + insert into pw_cutting_tool + + create_time, + name, + brand, + type, + unit, + warehouse_name, + unit_price, + minimum_number, + height_number, + supplier, + manufacturer, + use_the_equipment, + processed_products, + expiration_date, + period, + maintain_number, + blacklist, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + untaxed_price, + material_code, + + + #{createTime}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{warehouseName}, + #{unitPrice}, + #{minimumNumber}, + #{heightNumber}, + #{supplier}, + #{manufacturer}, + #{useTheEquipment}, + #{processedProducts}, + #{expirationDate}, + #{period}, + #{maintainNumber}, + #{blacklist}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{untaxedPrice}, + #{materialCode}, + + + + + update pw_cutting_tool + + create_time = #{createTime}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + warehouse_name = #{warehouseName}, + unit_price = #{unitPrice}, + minimum_number = #{minimumNumber}, + height_number = #{heightNumber}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + use_the_equipment = #{useTheEquipment}, + processed_products = #{processedProducts}, + expiration_date = #{expirationDate}, + period = #{period}, + maintain_number = #{maintainNumber}, + blacklist = #{blacklist}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + untaxed_price = #{untaxedPrice}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from pw_cutting_tool where id = #{id} + + + + delete from pw_cutting_tool where id in + + #{id} + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolPurchaseDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolPurchaseDetailMapper.xml new file mode 100644 index 0000000..80078d4 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolPurchaseDetailMapper.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id,purchase_id, create_time, name, brand, type, unit, supplier, manufacturer, unit_price, quantity, untaxed_price,material_code,total_price,status, remarks, del_flag, spared_one, spared_two, spared_three, spared_four from pw_cutting_tool_purchase_detail + + + + + + + + insert into pw_cutting_tool_purchase_detail + + create_time, + purchase_id, + name, + brand, + type, + unit, + supplier, + manufacturer, + unit_price, + quantity, + total_price, + status, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + spared_four, + untaxed_price, + material_code, + + + #{createTime}, + #{purchaseId}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{supplier}, + #{manufacturer}, + #{unitPrice}, + #{quantity}, + #{totalPrice}, + #{status}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{untaxedPrice}, + #{materialCode}, + + + + + update pw_cutting_tool_purchase_detail + + create_time = #{createTime}, + purchase_id = #{purchaseId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + unit_price = #{unitPrice}, + quantity = #{quantity}, + total_price = #{totalPrice}, + status = #{status}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + purchase_id = null, + untaxed_price = #{untaxedPrice}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from pw_cutting_tool_purchase_detail where id = #{id} + + + + delete from pw_cutting_tool_purchase_detail where id in + + #{id} + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolPurchaseMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolPurchaseMapper.xml new file mode 100644 index 0000000..4e0d9e4 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolPurchaseMapper.xml @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + create_time, + code, date, total_prices, user_name, auditor, status, not_invoice_amount, invoice_amount, not_proceeds_amount, proceeds_amount, settlement_ratio, remarks, del_flag, spared_one, sapred_two, sapred_three, spared_four, seller_name, appoint_time, big_total_prices, agreement, contract_status, tax_rate, delivery_type, payer, mode_of_payment, withhold, billing_information, leadership, leadership_time, contract_path + from pw_cutting_tool_purchase + + + + + + + + insert into pw_cutting_tool_purchase + + create_time, + code, + date, + total_prices, + user_name, + auditor, + status, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + remarks, + del_flag, + spared_one, + sapred_two, + sapred_three, + spared_four, + seller_name, + appoint_time, + big_total_prices, + agreement, + contract_status, + tax_rate, + delivery_type, + payer, + mode_of_payment, + withhold, + billing_information, + leadership, + leadership_time, + contract_path, + + + #{createTime}, + #{code}, + #{date}, + #{totalPrices}, + #{userName}, + #{auditor}, + #{status}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sapredTwo}, + #{sapredThree}, + #{sparedFour}, + #{sellerName}, + #{appointTime}, + #{bigTotalPrices}, + #{agreement}, + #{contractStatus}, + #{taxRate}, + #{deliveryType}, + #{payer}, + #{modeOfPayment}, + #{withhold}, + #{billingInformation}, + #{leadership}, + #{leadershipTime}, + #{contractPath}, + + + + + update pw_cutting_tool_purchase + + create_time = #{createTime}, + code = #{code}, + date = #{date}, + total_prices = #{totalPrices}, + user_name = #{userName}, + auditor = #{auditor}, + status = #{status}, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{proceedsAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + sapred_two = #{sapredTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + auditor = null, + seller_name = #{sellerName}, + appoint_time = #{appointTime}, + big_total_prices = #{bigTotalPrices}, + agreement = #{agreement}, + contract_status = #{contractStatus}, + tax_rate = #{taxRate}, + delivery_type = #{deliveryType}, + payer = #{payer}, + mode_of_payment = #{modeOfPayment}, + withhold = #{withhold}, + billing_information = #{billingInformation}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + contract_path = #{contractPath}, + + where id = #{id} + + + + delete from pw_cutting_tool_purchase where id = #{id} + + + + delete from pw_cutting_tool_purchase where id in + + #{id} + + + + + update pw_cutting_tool_purchase + + date = #{date}, + total_prices = #{totalPrices}, + user_name = #{userName}, + auditor = #{auditor}, + status = #{status}, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{proceedsAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + sapred_two = #{sapredTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + auditor = null, + seller_name = #{sellerName}, + appoint_time = #{appointTime}, + big_total_prices = #{bigTotalPrices}, + agreement = #{agreement}, + contract_status = #{contractStatus}, + tax_rate = #{taxRate}, + delivery_type = #{deliveryType}, + payer = #{payer}, + mode_of_payment = #{modeOfPayment}, + withhold = #{withhold}, + billing_information = #{billingInformation}, + + where code = #{code} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolScrapDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapDetailMapper.xml new file mode 100644 index 0000000..419df18 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapDetailMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, scrap_id, name, brand, type, unit, supplier, manufacturer, quantity, status, remarks, del_flag, spared_one, spared_two, spared_three, spared_four from pw_cutting_tool_scrap_detail + + + + + + + + insert into pw_cutting_tool_scrap_detail + + create_time, + scrap_id, + name, + brand, + type, + unit, + supplier, + manufacturer, + quantity, + status, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{scrapId}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{supplier}, + #{manufacturer}, + #{quantity}, + #{status}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_scrap_detail + + create_time = #{createTime}, + scrap_id = #{scrapId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + quantity = #{quantity}, + status = #{status}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_scrap_detail where id = #{id} + + + + delete from pw_cutting_tool_scrap_detail where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolScrapGodownEntryDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapGodownEntryDetailMapper.xml new file mode 100644 index 0000000..49816bd --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapGodownEntryDetailMapper.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, gosown_entry_id, name, brand, type, unit, supplier, manufacturer, unit_price, quantity, total_price, user_name, godown_entry_status, godown_entry_date, remarks, del_flag, spared_one, spared_two, spared_three, spared_four from pw_cutting_tool_scrap_godown_entry_detail + + + + + + + + insert into pw_cutting_tool_scrap_godown_entry_detail + + create_time, + gosown_entry_id, + name, + brand, + type, + unit, + supplier, + manufacturer, + unit_price, + quantity, + total_price, + user_name, + godown_entry_status, + godown_entry_date, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{gosownEntryId}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{supplier}, + #{manufacturer}, + #{unitPrice}, + #{quantity}, + #{totalPrice}, + #{userName}, + #{godownEntryStatus}, + #{godownEntryDate}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_scrap_godown_entry_detail + + create_time = #{createTime}, + gosown_entry_id = #{gosownEntryId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + supplier = #{supplier}, + manufacturer = #{manufacturer}, + unit_price = #{unitPrice}, + quantity = #{quantity}, + total_price = #{totalPrice}, + user_name = #{userName}, + godown_entry_status = #{godownEntryStatus}, + godown_entry_date = #{godownEntryDate}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_scrap_godown_entry_detail where id = #{id} + + + + delete from pw_cutting_tool_scrap_godown_entry_detail where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolScrapGodownEntryMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapGodownEntryMapper.xml new file mode 100644 index 0000000..6ab67d0 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapGodownEntryMapper.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + select id, cerate_time, contract_code, seller, inventory_status, remarks, del_flag, spared_one, spared_two, spared_three, sapred_four from pw_cutting_tool_scrap_godown_entry + + + + + + + + insert into pw_cutting_tool_scrap_godown_entry + + cerate_time, + contract_code, + seller, + inventory_status, + remarks, + del_flag, + spared_one, + spared_two, + spared_three, + sapred_four, + + + #{cerateTime}, + #{contractCode}, + #{seller}, + #{inventoryStatus}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sapredFour}, + + + + + update pw_cutting_tool_scrap_godown_entry + + cerate_time = #{cerateTime}, + contract_code = #{contractCode}, + seller = #{seller}, + inventory_status = #{inventoryStatus}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + sapred_four = #{sapredFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_scrap_godown_entry where id = #{id} + + + + delete from pw_cutting_tool_scrap_godown_entry where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwCuttingToolScrapMapper.xml b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapMapper.xml new file mode 100644 index 0000000..f8c145a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwCuttingToolScrapMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, date, user_name, auditor, status, remarks, del_flag, spared_one, sapred_two, sapred_three, spared_four from pw_cutting_tool_scrap + + + + + + + + insert into pw_cutting_tool_scrap + + create_time, + code, + date, + user_name, + auditor, + status, + remarks, + del_flag, + spared_one, + sapred_two, + sapred_three, + spared_four, + + + #{createTime}, + #{code}, + #{date}, + #{userName}, + #{auditor}, + #{status}, + #{remarks}, + #{delFlag}, + #{sparedOne}, + #{sapredTwo}, + #{sapredThree}, + #{sparedFour}, + + + + + update pw_cutting_tool_scrap + + create_time = #{createTime}, + code = #{code}, + date = #{date}, + user_name = #{userName}, + auditor = #{auditor}, + status = #{status}, + remarks = #{remarks}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + sapred_two = #{sapredTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_cutting_tool_scrap where id = #{id} + + + + delete from pw_cutting_tool_scrap where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwDanceNotStandardMapper.xml b/evo/src/main/resources/mybatis/management/PwDanceNotStandardMapper.xml new file mode 100644 index 0000000..7c5b12f --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwDanceNotStandardMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + select id, create_time, type_name, name,univalent, spared_one,material_code, spared_two, spared_three, spared_four, del_flag from pw_dance_not_standard + + + + + + + + insert into pw_dance_not_standard + + create_time, + type_name, + name, + univalent, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + material_code, + + + #{createTime}, + #{typeName}, + #{name}, + #{univalent}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{materialCode}, + + + + + update pw_dance_not_standard + + create_time = #{createTime}, + type_name = #{typeName}, + name = #{name}, + univalent = #{univalent}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + material_code = #{materialCode}, + + where id = #{id} + + + + delete from pw_dance_not_standard where id = #{id} + + + + delete from pw_dance_not_standard where id in + + #{id} + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwDefectiveMaterialMapper.xml b/evo/src/main/resources/mybatis/management/PwDefectiveMaterialMapper.xml new file mode 100644 index 0000000..09523b5 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwDefectiveMaterialMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, materials_name, materials_figure_number, materials_unit, len, number, remarks, spared_one, spared_two, spared_three, spared_four from pw_defective_material + + + + + + + + insert into pw_defective_material + + create_time, + materials_name, + materials_figure_number, + materials_unit, + len, + number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{materialsName}, + #{materialsFigureNumber}, + #{materialsUnit}, + #{len}, + #{number}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_defective_material + + create_time = #{createTime}, + materials_name = #{materialsName}, + materials_figure_number = #{materialsFigureNumber}, + materials_unit = #{materialsUnit}, + len = #{len}, + number = #{number}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_defective_material where id = #{id} + + + + delete from pw_defective_material where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwEquipmentInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwEquipmentInfoMapper.xml new file mode 100644 index 0000000..dd2a2ad --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwEquipmentInfoMapper.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, property_code, name, type, specification,dept_name, production_mark, leave_factory_code, manufacture_date, install_date, use_date, power, weight, status, manufacturer, linkman, phone, principal, remarks, spared_one, spared_two, spared_three, spared_four from pw_equipment_info + + + + + + + + insert into pw_equipment_info + + create_time, + code, + property_code, + name, + type, + specification, + dept_name, + production_mark, + leave_factory_code, + manufacture_date, + install_date, + use_date, + power, + weight, + status, + manufacturer, + linkman, + phone, + principal, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{propertyCode}, + #{name}, + #{type}, + #{specification}, + #{deptName}, + #{productionMark}, + #{leaveFactoryCode}, + #{manufactureDate}, + #{installDate}, + #{useDate}, + #{power}, + #{weight}, + #{status}, + #{manufacturer}, + #{linkman}, + #{phone}, + #{principal}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_equipment_info + + create_time = #{createTime}, + code = #{code}, + property_code = #{propertyCode}, + name = #{name}, + type = #{type}, + specification = #{specification}, + dept_name = #{deptName}, + production_mark = #{productionMark}, + leave_factory_code = #{leaveFactoryCode}, + manufacture_date = #{manufactureDate}, + install_date = #{installDate}, + use_date = #{useDate}, + power = #{power}, + weight = #{weight}, + status = #{status}, + manufacturer = #{manufacturer}, + linkman = #{linkman}, + phone = #{phone}, + principal = #{principal}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_equipment_info where id = #{id} + + + + delete from pw_equipment_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwFuturesOrdersDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwFuturesOrdersDetailMapper.xml new file mode 100644 index 0000000..2b7e543 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwFuturesOrdersDetailMapper.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, orders_id, code, name, figure_number, materials, piece_weight, measure, workblank, number, unit, quantity, unit_two,reference_number, inventory_quantity,preliminary_inventory,lock_number, status,remarks, spared_one, spared_two, spared_three, sapred_four, del_flag from pw_futures_orders_detail + + + + + + + + + + + + insert into pw_futures_orders_detail + + create_time, + orders_id, + code, + name, + figure_number, + materials, + piece_weight, + measure, + workblank, + number, + unit, + quantity, + unit_two, + reference_number, + inventory_quantity, + preliminary_inventory, + lock_number, + status, + remarks, + spared_one, + spared_two, + spared_three, + sapred_four, + del_flag, + + + #{createTime}, + #{ordersId}, + #{code}, + #{name}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{measure}, + #{workblank}, + #{number}, + #{unit}, + #{quantity}, + #{unitTwo}, + #{referenceNumber}, + #{inventoryQuantity}, + #{preliminaryInventory}, + #{lockNumber}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sapredFour}, + #{delFlag}, + + + + + update pw_futures_orders_detail + + create_time = #{createTime}, + orders_id = #{ordersId}, + code = #{code}, + name = #{name}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + measure = #{measure}, + workblank = #{workblank}, + number = #{number}, + unit = #{unit}, + quantity = #{quantity}, + unit_two = #{unitTwo}, + reference_number = #{referenceNumber}, + inventory_quantity = #{inventoryQuantity}, + preliminary_inventory = #{preliminaryInventory}, + lock_number = #{lockNumber}, + status = #{status}, + status = null, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + sapred_four = #{sapredFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_futures_orders_detail where id = #{id} + + + + delete from pw_futures_orders_detail where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwFuturesOrdersDetailTwoMapper.xml b/evo/src/main/resources/mybatis/management/PwFuturesOrdersDetailTwoMapper.xml new file mode 100644 index 0000000..d9d58b2 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwFuturesOrdersDetailTwoMapper.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, orders_detail_id, code,matenais_id, name, figure_number, materials, piece_weight, measure, workblank, number, unit, quantity, unit_two, reference_number, inventory_quantity, remarks, spared_one, spared_two, spared_three, sapred_four, del_flag from pw_futures_orders_detail_two + + + + + + + + + + + + + + + + insert into pw_futures_orders_detail_two + + create_time, + orders_detail_id, + code, + matenais_id, + name, + figure_number, + materials, + piece_weight, + measure, + workblank, + number, + unit, + quantity, + unit_two, + reference_number, + inventory_quantity, + remarks, + spared_one, + spared_two, + spared_three, + sapred_four, + del_flag, + + + #{createTime}, + #{ordersDetailId}, + #{code}, + #{matenaisId}, + #{name}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{measure}, + #{workblank}, + #{number}, + #{unit}, + #{quantity}, + #{unitTwo}, + #{referenceNumber}, + #{inventoryQuantity}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sapredFour}, + #{delFlag}, + + + + + update pw_futures_orders_detail_two + + create_time = #{createTime}, + orders_detail_id = #{ordersDetailId}, + code = #{code}, + matenais_id = #{matenaisId}, + name = #{name}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + measure = #{measure}, + workblank = #{workblank}, + number = #{number}, + unit = #{unit}, + quantity = #{quantity}, + unit_two = #{unitTwo}, + reference_number = #{referenceNumber}, + inventory_quantity = #{inventoryQuantity}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + sapred_four = #{sapredFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_futures_orders_detail_two where id = #{id} + + + + delete from pw_futures_orders_detail_two where orders_detail_id = #{ordersDetailId} + + + + delete from pw_futures_orders_detail_two where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwFuturesOrdersMapper.xml b/evo/src/main/resources/mybatis/management/PwFuturesOrdersMapper.xml new file mode 100644 index 0000000..2644168 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwFuturesOrdersMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, user, time, status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_futures_orders + + + + + + + + insert into pw_futures_orders + + create_time, + code, + user, + time, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{user}, + #{time}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_futures_orders + + create_time = #{createTime}, + code = #{code}, + user = #{user}, + time = #{time}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_futures_orders where id = #{id} + + + + delete from pw_futures_orders where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwGxProcessMapper.xml b/evo/src/main/resources/mybatis/management/PwGxProcessMapper.xml new file mode 100644 index 0000000..8b7d382 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwGxProcessMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + select id, parent_id, figure_number, name, materials, dispatching_dept, workblank, serial_time, del_flag, create_time,remarks from pw_material_process + + + + + + + + insert into pw_material_process + + parent_id, + figure_number, + name, + materials, + dispatching_dept, + workblank, + serial_time, + del_flag, + create_time, + remarks, + + + #{parentId}, + #{figureNumber}, + #{name}, + #{materials}, + #{dispatchingDept}, + #{workblank}, + #{serialTime}, + #{delFlag}, + #{createTime}, + #{remarks}, + + + + + update pw_material_process + + parent_id = #{parentId}, + figure_number = #{figureNumber}, + name = #{name}, + materials = #{materials}, + dispatching_dept = #{dispatchingDept}, + workblank = #{workblank}, + serial_time = #{serialTime}, + del_flag = #{delFlag}, + create_time = #{createTime}, + remarks = #{remarks}, + + where id = #{id} + + + + delete from pw_material_process where id = #{id} + + + + delete from pw_material_process where id in + + #{id} + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwHeightPermittedInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwHeightPermittedInfoMapper.xml new file mode 100644 index 0000000..f6625cf --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwHeightPermittedInfoMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, materials, piece_weight, minimum, highest, highest_number, produced, need_make, height_permitted, remarks, spared_one, spared_two, spared_three, spared_four from pw_height_permitted_info + + + + + + + + insert into pw_height_permitted_info + + create_time, + name, + figure_number, + materials, + piece_weight, + minimum, + highest, + highest_number, + produced, + need_make, + height_permitted, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{minimum}, + #{highest}, + #{highestNumber}, + #{produced}, + #{needMake}, + #{heightPermitted}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_height_permitted_info + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + minimum = #{minimum}, + highest = #{highest}, + highest_number = #{highestNumber}, + produced = #{produced}, + need_make = #{needMake}, + height_permitted = #{heightPermitted}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_height_permitted_info where id = #{id} + + + + delete from pw_height_permitted_info where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwInspectionCardDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwInspectionCardDetailMapper.xml new file mode 100644 index 0000000..0dccd2a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwInspectionCardDetailMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, card_id,create_time, name, brand, type, unit, manufacturer, need_date, checkout_date, quantity, unit_price, total_prices, status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_inspection_card_detail + + + + + + + + insert into pw_inspection_card_detail + + create_time, + card_id, + name, + brand, + type, + unit, + manufacturer, + need_date, + checkout_date, + quantity, + unit_price, + total_prices, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{cardId}, + #{name}, + #{brand}, + #{type}, + #{unit}, + #{manufacturer}, + #{needDate}, + #{checkoutDate}, + #{quantity}, + #{unitPrice}, + #{totalPrices}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_inspection_card_detail + + create_time = #{createTime}, + card_id = #{cardId}, + name = #{name}, + brand = #{brand}, + type = #{type}, + unit = #{unit}, + manufacturer = #{manufacturer}, + need_date = #{needDate}, + checkout_date = #{checkoutDate}, + quantity = #{quantity}, + unit_price = #{unitPrice}, + total_prices = #{totalPrices}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_inspection_card_detail where id = #{id} + + + + delete from pw_inspection_card_detail where id in + + #{id} + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwInspectionCardMapper.xml b/evo/src/main/resources/mybatis/management/PwInspectionCardMapper.xml new file mode 100644 index 0000000..a0def4b --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwInspectionCardMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, receipts_date, name, total_prices, status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_inspection_card + + + + + + + + insert into pw_inspection_card + + create_time, + code, + receipts_date, + name, + total_prices, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{receiptsDate}, + #{name}, + #{totalPrices}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_inspection_card + + create_time = #{createTime}, + code = #{code}, + receipts_date = #{receiptsDate}, + name = #{name}, + total_prices = #{totalPrices}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_inspection_card where id = #{id} + + + + delete from pw_inspection_card where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwInventoryComparisonMapper.xml b/evo/src/main/resources/mybatis/management/PwInventoryComparisonMapper.xml new file mode 100644 index 0000000..e713754 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwInventoryComparisonMapper.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + select id, figure_number, name, inventory_date, erp_num, inventory_num, differences, profit_and_loss, create_by, create_time, update_by, update_time from pw_inventory_comparison + + + + + + insert into pw_inventory_comparison + + figure_number, + name, + inventory_date, + erp_num, + inventory_num, + differences, + profit_and_loss, + create_by, + create_time, + update_by, + update_time, + + + #{figureNumber}, + #{name}, + #{inventoryDate}, + #{erpNum}, + #{inventoryNum}, + #{differences}, + #{profitAndLoss}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + diff --git a/evo/src/main/resources/mybatis/management/PwInventoryDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwInventoryDetailMapper.xml new file mode 100644 index 0000000..fc60a25 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwInventoryDetailMapper.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name,material_code, type_name,figure_number,type,materials,piece_weight,len,wid,wid_two,altitude,thickness,thickness_two,outer_diameter,internal_diameter,colour,category, warehouse_id, warehouse_name, unit,univalence,unit_price,unit_univalence, quantity,theory_quantity,preliminary_inventory,lock_number,available_number,minimum,highest,remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_inventory_detail + + + + + + + + + + insert into pw_inventory_detail + + create_time, + material_code, + name, + type_name, + figure_number, + type, + materials, + piece_weight, + len, + wid, + wid_two, + altitude, + thickness, + thickness_two + outer_diameter, + internal_diameter, + colour, + category, + warehouse_id, + warehouse_name, + unit, + univalence, + unit_price, + unit_univalence, + quantity, + theory_quantity, + preliminary_inventory, + lock_number, + available_number, + minimum, + highest, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{materialCode}, + #{name}, + #{typeName}, + #{figureNumber}, + #{type}, + #{materials}, + #{pieceWeight}, + #{len}, + #{wid}, + #{widTwo}, + #{altitude}, + #{thickness}, + #{thicknessTwo}, + #{outerDiameter}, + #{internalDiameter}, + #{colour}, + #{category}, + #{warehouseId}, + #{warehouseName}, + #{unit}, + #{univalence}, + #{unitPrice}, + #{unitUnivalence}, + #{quantity}, + #{theoryQuantity}, + #{preliminaryInventory}, + #{lockNumber}, + #{availableNumber}, + #{minimum}, + #{highest}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_inventory_detail + + create_time = #{createTime}, + material_code = #{materialCode}, + name = #{name}, + type_name = #{typeName}, + figure_number = #{figureNumber}, + type = #{type}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + len = #{len}, + wid = #{wid}, + wid_two = #{widTwo}, + altitude = #{altitude}, + thickness = #{thickness}, + thickness_two = #{thicknessTwo}, + outer_diameter = #{outerDiameter}, + internal_diameter = #{internalDiameter}, + colour = #{colour}, + category = #{category}, + category = null, + warehouse_id = #{warehouseId}, + warehouse_name = #{warehouseName}, + unit = #{unit}, + univalence = #{univalence}, + unit_price = #{unitPrice}, + unit_univalence = #{unitUnivalence}, + quantity = #{quantity}, + theory_quantity = #{theoryQuantity}, + preliminary_inventory = #{preliminaryInventory}, + lock_number = #{lockNumber}, + available_number = #{availableNumber}, + minimum = #{minimum}, + highest = #{highest}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_inventory_detail where id = #{id} + + + + delete from pw_inventory_detail where id in + + #{id} + + + + + + + + + + + + + + + truncate table pw_inventory_detail + + + + + + insert into pw_inventory_detail(material_code,name, type_name,figure_number,type,materials,piece_weight,len,wid,wid_two,altitude,thickness,thickness_two,outer_diameter,internal_diameter,colour,category,warehouse_id, warehouse_name, unit,univalence,unit_price,unit_univalence, quantity,theory_quantity,preliminary_inventory,lock_number,available_number,minimum,highest,remarks, spared_one, spared_two, spared_three, spared_four, del_flag) + VALUES + + ( + #{item.materialCode}, + #{item.name}, + #{item.typeName}, + #{item.figureNumber}, + #{item.type}, + #{item.materials}, + #{item.pieceWeight}, + #{item.len}, + #{item.wid}, + #{item.widTwo}, + #{item.altitude}, + #{item.thickness}, + #{item.thicknessTwo}, + #{item.outerDiameter}, + #{item.internalDiameter}, + #{item.colour}, + #{item.category}, + #{item.warehouseId}, + #{item.warehouseName}, + #{item.unit}, + #{item.univalence}, + #{item.unitPrice}, + #{item.unitUnivalence}, + #{item.quantity}, + #{item.theoryQuantity}, + #{item.preliminaryInventory}, + #{item.parentLevelName}, + #{item.lockNumber}, + #{item.availableNumber}, + #{item.minimum}, + #{item.highest}, + #{item.remarks}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.delFlag}) + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwInvoiceInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwInvoiceInfoMapper.xml new file mode 100644 index 0000000..4dc0618 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwInvoiceInfoMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, supplier_name, url, payment,money, payment_info_id,source, remarks, spared_one, spared_two, spared_three, spared_four from pw_invoice_info + + + + + + + + insert into pw_invoice_info + + create_time, + code, + supplier_name, + url, + payment, + money, + payment_info_id, + source, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{supplierName}, + #{url}, + #{payment}, + #{money}, + #{paymentInfoId}, + #{source}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_invoice_info + + create_time = #{createTime}, + code = #{code}, + supplier_name = #{supplierName}, + url = #{url}, + payment = #{payment}, + money = #{money}, + payment_info_id = #{paymentInfoId}, + source = #{source}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_invoice_info where id = #{id} + + + + delete from pw_invoice_info where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwLetterOfAdviceDetailsMapper.xml b/evo/src/main/resources/mybatis/management/PwLetterOfAdviceDetailsMapper.xml new file mode 100644 index 0000000..234a8cd --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwLetterOfAdviceDetailsMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, letter_of_advice_id, production_bill_code, product_type, number, equipment_number, sent_number, apply_number, quantity, spared_one, spared_two, spared_three, spared_four, del_flag from pw_letter_of_advice_details + + + + + + + + insert into pw_letter_of_advice_details + + create_time, + letter_of_advice_id, + production_bill_code, + product_type, + number, + equipment_number, + sent_number, + apply_number, + quantity, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{letterOfAdviceId}, + #{productionBillCode}, + #{productType}, + #{number}, + #{equipmentNumber}, + #{sentNumber}, + #{applyNumber}, + #{quantity}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_letter_of_advice_details + + create_time = #{createTime}, + letter_of_advice_id = #{letterOfAdviceId}, + production_bill_code = #{productionBillCode}, + product_type = #{productType}, + number = #{number}, + equipment_number = #{equipmentNumber}, + sent_number = #{sentNumber}, + apply_number = #{applyNumber}, + quantity = #{quantity}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_letter_of_advice_details where id = #{id} + + + + delete from pw_letter_of_advice_details where id in + + #{id} + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwLetterOfAdviceMapper.xml b/evo/src/main/resources/mybatis/management/PwLetterOfAdviceMapper.xml new file mode 100644 index 0000000..7d7651e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwLetterOfAdviceMapper.xml @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, contract_code, freight_payer, purchaser_unit_name, consignee, shipping_address, purchaser_unit_phone, carrier_unit_name, haulier,tracking_number, carrier_car, haulier_phone, financial_audit, financial_audit_time,financial_audit_suggest,ratify_name, ratify, ratify_time, status,proposer, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_letter_of_advice + + + + + + + + insert into pw_letter_of_advice + + create_time, + contract_code, + freight_payer, + purchaser_unit_name, + consignee, + shipping_address, + purchaser_unit_phone, + carrier_unit_name, + haulier, + carrier_car, + haulier_phone, + tracking_number, + financial_audit, + financial_audit_time, + financial_audit_suggest, + ratify_name, + ratify, + ratify_time, + status, + proposer, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{contractCode}, + #{freightPayer}, + #{purchaserUnitName}, + #{consignee}, + #{shippingAddress}, + #{purchaserUnitPhone}, + #{carrierUnitName}, + #{haulier}, + #{carrierCar}, + #{haulierPhone}, + #{trackingNumber}, + #{financialAudit}, + #{financialAuditTime}, + #{financialAuditSuggest}, + #{ratifyName}, + #{ratify}, + #{ratifyTime}, + #{status}, + #{proposer}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_letter_of_advice + + create_time = #{createTime}, + contract_code = #{contractCode}, + freight_payer = #{freightPayer}, + purchaser_unit_name = #{purchaserUnitName}, + consignee = #{consignee}, + shipping_address = #{shippingAddress}, + purchaser_unit_phone = #{purchaserUnitPhone}, + carrier_unit_name = #{carrierUnitName}, + haulier = #{haulier}, + carrier_car = #{carrierCar}, + haulier_phone = #{haulierPhone}, + tracking_number = #{trackingNumber}, + financial_audit = #{financialAudit}, + financial_audit_time = #{financialAuditTime}, + financial_audit_suggest = #{financialAuditSuggest}, + ratify_name = #{ratifyName}, + ratify = #{ratify}, + ratify_time = #{ratifyTime}, + status = #{status}, + proposer = #{proposer}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_letter_of_advice where id = #{id} + + + + delete from pw_letter_of_advice where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwLetterOfAdviceProductMapper.xml b/evo/src/main/resources/mybatis/management/PwLetterOfAdviceProductMapper.xml new file mode 100644 index 0000000..d1d7f24 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwLetterOfAdviceProductMapper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, letter_of_advice_id, production_bill_code, product_type, number, equipment_number, sent_number,apply_number,quantity, spared_one, spared_two, spared_three, spared_four, del_flag from pw_letter_of_advice_product + + + + + + + + + + insert into pw_letter_of_advice_product + + create_time, + letter_of_advice_id, + production_bill_code, + product_type, + number, + equipment_number, + sent_number, + apply_number, + quantity, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{letterOfAdviceId}, + #{productionBillCode}, + #{productType}, + #{number}, + #{equipmentNumber}, + #{sentNumber}, + #{applyNumber}, + #{quantity}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_letter_of_advice_product + + create_time = #{createTime}, + letter_of_advice_id = #{letterOfAdviceId}, + production_bill_code = #{productionBillCode}, + product_type = #{productType}, + number = #{number}, + equipment_number = #{equipmentNumber}, + sent_number = #{sentNumber}, + apply_number = #{applyNumber}, + quantity = #{quantity}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_letter_of_advice_product where id = #{id} + + + + delete from pw_letter_of_advice_product where id in + + #{id} + + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwMakeDocumentsDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwMakeDocumentsDetailMapper.xml new file mode 100644 index 0000000..e34d3b3 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwMakeDocumentsDetailMapper.xml @@ -0,0 +1,503 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, make_documents_code, name, figure_number, material_type, quantity,usable_quantity,inventory_status,process_name,godown_entry, remark,completion_date,department_name,material_id,materials_name,materials_specification,measure,len,wid,specification,workblank,finished,receive_number,materials_date,xu_describe,date_describe,xu_time,material_id_two,materials_name_two,materials_specification_two,measure_two,len_two,wid_two,specification_two,workblank_two,finished_two,superior_id,parent_level_name,parent_level_figure_number,outsource_contrat_detail_id, spared_one, spared_two, spared_three, spared_four, weight,del_flag from pw_make_documents_detail + + + + + + + + + + + + + + insert into pw_make_documents_detail + + create_time, + make_documents_code, + name, + figure_number, + material_type, + quantity, + usable_quantity, + inventory_status, + process_name, + godown_entry, + remark, + completion_date, + department_name, + material_id, + materials_name, + materials_specification, + measure, + len, + wid, + specification, + workblank, + finished, + receive_number, + materials_date, + xu_describe, + date_describe, + xu_time, + material_id_two, + materials_name_two, + materials_specification_two, + measure_two, + len_two, + wid_two, + specification_two, + workblank_two, + finished_two, + superior_id, + parent_level_name, + parent_level_figure_number, + outsource_contrat_detail_id, + spared_one, + spared_two, + spared_three, + spared_four, + weight, + del_flag, + + + #{createTime}, + #{makeDocumentsCode}, + #{name}, + #{figureNumber}, + #{materialType}, + #{quantity}, + #{usableQuantity}, + #{inventoryStatus}, + #{processName}, + #{godownEntry}, + #{remark}, + #{completionDate}, + #{departmentName}, + #{materialId}, + #{materialsName}, + #{materialsSpecification}, + #{measure}, + #{len}, + #{wid}, + #{specification}, + #{workblank}, + #{finished}, + #{receiveNumber}, + #{materialsDate}, + #{xuDescribe}, + #{dateDescribe}, + #{xuTime}, + #{materialIdTwo}, + #{materialsNameTwo}, + #{materialsSpecificationTwo}, + #{measureTwo}, + #{lenTwo}, + #{widTwo}, + #{specificationTwo}, + #{workblankTwo}, + #{finishedTwo}, + #{superiorId}, + #{parentLevelName}, + #{parentLevelFigureNumber}, + #{outsourceContratDetailId}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{weight}, + #{delFlag}, + + + + + update pw_make_documents_detail + + create_time = #{createTime}, + make_documents_code = #{makeDocumentsCode}, + name = #{name}, + figure_number = #{figureNumber}, + material_type = #{materialType}, + quantity = #{quantity}, + usable_quantity = #{usableQuantity}, + inventory_status = #{inventoryStatus}, + process_name = #{processName}, + godown_entry = #{godownEntry}, + remark = #{remark}, + completion_date = #{completionDate}, + department_name = #{departmentName}, + material_id = #{materialId}, + material_id = null, + + materials_name = #{materialsName}, + materials_name = null, + + materials_specification = #{materialsSpecification}, + materials_specification = null, + + measure = #{measure}, + measure = null, + + len = #{len}, + len = null, + + wid = #{wid}, + wid = null, + + specification = #{specification}, + specification = null, + + workblank = #{workblank}, + workblank = null, + + finished = #{finished}, + finished = null, + + receive_number = #{receiveNumber}, + receive_number = null, + materials_date = #{materialsDate}, + xu_describe = #{xuDescribe}, + date_describe = #{dateDescribe}, + xu_time = #{xuTime}, + material_id_two = #{materialIdTwo}, + materials_name_two = #{materialsNameTwo}, + materials_specification_two = #{materialsSpecificationTwo}, + measure_two = #{measureTwo}, + len_two = #{lenTwo}, + wid_two = #{widTwo}, + specification_two = #{specificationTwo}, + workblank_two = #{workblankTwo}, + finished_two = #{finishedTwo}, + superior_id = #{superiorId}, + parent_level_name = #{parentLevelName}, + parent_level_figure_number = #{parentLevelFigureNumber}, + outsource_contrat_detail_id = #{outsourceContratDetailId}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + weight = #{weight}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_make_documents_detail where id = #{id} + + + + delete from pw_make_documents_detail where id in + + #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwMakeDocumentsMapper.xml b/evo/src/main/resources/mybatis/management/PwMakeDocumentsMapper.xml new file mode 100644 index 0000000..f9b9be9 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwMakeDocumentsMapper.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, name,declares, date, prepared, approver, pass, status,remark, hid,overtime, spared_one, spared_two, spared_three, spared_four, del_flag from pw_make_documents + + + + + + + + + insert into pw_make_documents + + create_time, + code, + name, + declares, + date, + prepared, + approver, + pass, + status, + remark, + hid, + overtime, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{name}, + #{declares}, + #{date}, + #{prepared}, + #{approver}, + #{pass}, + #{status}, + #{remark}, + #{hid}, + #{overtime}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_make_documents + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + declares = #{declares}, + date = #{date}, + prepared = #{prepared}, + approver = #{approver}, + pass = #{pass}, + status = #{status}, + remark = #{remark}, + hid = #{hid}, + overtime = #{overtime}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_make_documents where id = #{id} + + + + delete from pw_make_documents where id in + + #{id} + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwMaterialBorrowInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwMaterialBorrowInfoMapper.xml new file mode 100644 index 0000000..e64146a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwMaterialBorrowInfoMapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, name, figure_number, number, cause, approver, approver_time, status, remarks, spared_one, spared_two, spared_three, spared_four from pw_material_borrow_info + + + + + + + + insert into pw_material_borrow_info + + create_time, + code, + name, + figure_number, + number, + cause, + approver, + approver_time, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{name}, + #{figureNumber}, + #{number}, + #{cause}, + #{approver}, + #{approverTime}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_material_borrow_info + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + figure_number = #{figureNumber}, + number = #{number}, + cause = #{cause}, + approver = #{approver}, + approver_time = #{approverTime}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_material_borrow_info where id = #{id} + + + + delete from pw_material_borrow_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwMaterialMaterialsMapper.xml b/evo/src/main/resources/mybatis/management/PwMaterialMaterialsMapper.xml new file mode 100644 index 0000000..4a5d3e8 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwMaterialMaterialsMapper.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, material_id, material_name, material_figure_number, materials_id, materials_name, materials_figure_number, materials_unit, measure, len, wid, specification, workblank, finished,quantity, remainder_len, remainder_number, defective_material, remainder_len_two, remainder_number_two, defective_material_two, remarks, spared_one, spared_two, spared_three, spared_four from pw_material_materials + + + + + + + + insert into pw_material_materials + + create_time, + code, + material_id, + material_name, + material_figure_number, + materials_id, + materials_name, + materials_figure_number, + materials_unit, + measure, + len, + wid, + specification, + workblank, + finished, + quantity, + remainder_len, + remainder_number, + defective_material, + remainder_len_two, + remainder_number_two, + defective_material_two, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{materialId}, + #{materialName}, + #{materialFigureNumber}, + #{materialsId}, + #{materialsName}, + #{materialsFigureNumber}, + #{materialsUnit}, + #{measure}, + #{len}, + #{wid}, + #{specification}, + #{workblank}, + #{finished}, + #{quantity}, + #{remainderLen}, + #{remainderNumber}, + #{defectiveMaterial}, + #{remainderLenTwo}, + #{remainderNumberTwo}, + #{defectiveMaterialTwo}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_material_materials + + create_time = #{createTime}, + code = #{code}, + material_id = #{materialId}, + material_name = #{materialName}, + material_figure_number = #{materialFigureNumber}, + materials_id = #{materialsId}, + materials_name = #{materialsName}, + materials_figure_number = #{materialsFigureNumber}, + materials_unit = #{materialsUnit}, + measure = #{measure}, + len = #{len}, + wid = #{wid}, + specification = #{specification}, + workblank = #{workblank}, + finished = #{finished}, + quantity = #{quantity}, + remainder_len = #{remainderLen}, + remainder_number = #{remainderNumber}, + defective_material = #{defectiveMaterial}, + remainder_len_two = #{remainderLenTwo}, + remainder_number_two = #{remainderNumberTwo}, + defective_material_two = #{defectiveMaterialTwo}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_material_materials where id = #{id} + + + + delete from pw_material_materials where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwMaterialParamsMapper.xml b/evo/src/main/resources/mybatis/management/PwMaterialParamsMapper.xml new file mode 100644 index 0000000..9ed9b5d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwMaterialParamsMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + select id, param_value, param_name, param_flag from pw_material_params + + + + + + + + insert into pw_material_params + + param_value, + param_name, + param_flag, + + + #{paramValue}, + #{paramName}, + #{paramFlag}, + + + + + update pw_material_params + + param_value = #{paramValue}, + param_name = #{paramName}, + param_flag = #{paramFlag}, + + where id = #{id} + + + + delete from pw_material_params where id = #{id} + + + + delete from pw_material_params where id in + + #{id} + + + + + + + delete from pw_material_params where param_flag = #{value} + + + diff --git a/evo/src/main/resources/mybatis/management/PwMaterialPriceMapper.xml b/evo/src/main/resources/mybatis/management/PwMaterialPriceMapper.xml new file mode 100644 index 0000000..d96d73a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwMaterialPriceMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, type, unit_price, remarks, spared_one, spared_two, spared_three, spared_four from pw_material_price + + + + + + + + insert into pw_material_price + + create_time, + name, + figure_number, + type, + unit_price, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{type}, + #{unitPrice}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_material_price + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + type = #{type}, + unit_price = #{unitPrice}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_material_price where id = #{id} + + + + delete from pw_material_price where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwMaterialProcessMapper.xml b/evo/src/main/resources/mybatis/management/PwMaterialProcessMapper.xml new file mode 100644 index 0000000..5128d16 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwMaterialProcessMapper.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, serial_number, process, dispatching_dept, storage,materials_id, materials_name, materials_specification, len, wid, workblank, serial_time, del_flag, spared_one, spared_two, spared_three, spared_four from pw_material_process + + + + + + + + insert into pw_material_process + + create_time, + name, + figure_number, + serial_number, + process, + dispatching_dept, + storage, + materials_id, + materials_name, + materials_specification, + len, + wid, + workblank, + serial_time, + del_flag, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{serialNumber}, + #{process}, + #{dispatchingDept}, + #{storage}, + #{materialsId}, + #{materialsName}, + #{materialsSpecification}, + #{len}, + #{wid}, + #{workblank}, + #{serialTime}, + #{delFlag}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_material_process + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + serial_number = #{serialNumber}, + process = #{process}, + dispatching_dept = #{dispatchingDept}, + storage = #{storage}, + materials_id = #{materialsId}, + materials_name = #{materialsName}, + materials_specification = #{materialsSpecification}, + len = #{len}, + wid = #{wid}, + workblank = #{workblank}, + serial_time = #{serialTime}, + del_flag = #{delFlag}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_material_process where process = #{id} + + + + delete from pw_material_process where id in + + #{id} + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwModulePartMapper.xml b/evo/src/main/resources/mybatis/management/PwModulePartMapper.xml new file mode 100644 index 0000000..caeb5ff --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwModulePartMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, material_id, material_name, figure_number, part_id, name, specification, number, remarks, spared_one, spared_two, spared_three, spared_four from pw_module_part + + + + + + + + insert into pw_module_part + + create_time, + material_id, + material_name, + figure_number, + part_id, + name, + specification, + number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{materialId}, + #{materialName}, + #{figureNumber}, + #{partId}, + #{name}, + #{specification}, + #{number}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_module_part + + create_time = #{createTime}, + material_id = #{materialId}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + part_id = #{partId}, + name = #{name}, + specification = #{specification}, + number = #{number}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_module_part where id = #{id} + + + + delete from pw_module_part where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwOtherCorrespondentMapper.xml b/evo/src/main/resources/mybatis/management/PwOtherCorrespondentMapper.xml new file mode 100644 index 0000000..2080258 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwOtherCorrespondentMapper.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, phone, address, contacts, fax, zip_code, email_address,bank_address, account_number,interbank_number,swift_code, duty_paragraph, opening_bank, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_other_correspondent + + + + + + + + insert into pw_other_correspondent + + create_time, + name, + phone, + address, + contacts, + fax, + zip_code, + email_address, + account_number, + duty_paragraph, + opening_bank, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + interbank_number, + swift_code, + bank_address, + + + #{createTime}, + #{name}, + #{phone}, + #{address}, + #{contacts}, + #{fax}, + #{zipCode}, + #{emailAddress}, + #{accountNumber}, + #{dutyParagraph}, + #{openingBank}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{interbankNumber}, + #{swiftCode}, + #{bankAddress}, + + + + + update pw_other_correspondent + + create_time = #{createTime}, + name = #{name}, + phone = #{phone}, + address = #{address}, + contacts = #{contacts}, + fax = #{fax}, + zip_code = #{zipCode}, + email_address = #{emailAddress}, + account_number = #{accountNumber}, + duty_paragraph = #{dutyParagraph}, + opening_bank = #{openingBank}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + interbank_number = #{interbankNumber}, + swift_code = #{swiftCode}, + bank_address = #{bankAddress}, + + where id = #{id} + + + + delete from pw_other_correspondent where id = #{id} + + + + delete from pw_other_correspondent where id in + + #{id} + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwOutsourceContractDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwOutsourceContractDetailMapper.xml new file mode 100644 index 0000000..9656e72 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwOutsourceContractDetailMapper.xml @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, outsource_contract_id, code, name, figure_number, type, piece_weight, unit,quantity, unit_price, total_prices, remarks, accomplish_status, accomplish_quantity, spared_one, spared_two, spared_three, spared_four from pw_outsource_contract_detail + + + + + + + + + + + insert into pw_outsource_contract_detail + + create_time, + outsource_contract_id, + code, + name, + figure_number, + type, + piece_weight, + unit, + quantity, + unit_price, + total_prices, + remarks, + accomplish_status, + accomplish_quantity, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{outsourceContractId}, + #{code}, + #{name}, + #{figureNumber}, + #{type}, + #{pieceWeight}, + #{unit}, + #{quantity}, + #{unitPrice}, + #{totalPrices}, + #{remarks}, + #{accomplishStatus}, + #{accomplishQuantity}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_outsource_contract_detail + + create_time = #{createTime}, + outsource_contract_id = #{outsourceContractId}, + outsource_contract_id = null, + code = #{code}, + name = #{name}, + figure_number = #{figureNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + unit = #{unit}, + quantity = #{quantity}, + unit_price = #{unitPrice}, + total_prices = #{totalPrices}, + remarks = #{remarks}, + accomplish_status = #{accomplishStatus}, + accomplish_status = null, + accomplish_quantity = #{accomplishQuantity}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_outsource_contract_detail where id = #{id} + + + + delete from pw_outsource_contract_detail where id in + + #{id} + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwOutsourceContractMapper.xml b/evo/src/main/resources/mybatis/management/PwOutsourceContractMapper.xml new file mode 100644 index 0000000..56f6fcd --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwOutsourceContractMapper.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, contract_code, production_code, supplier, total_prices_small, total_prices_big, tax_rate, delivery_type, payer, delivery_address, mode_of_payment, sign_date, contract_status, remarks, withhold, billing_information, invoice,not_invoice_amount,invoice_amount,not_proceeds_amount,proceeds_amount,settlement_ratio,leadership, leadership_time, spared_one, spared_two, spared_three, spared_four,contract_path from pw_outsource_contract + + + + + + + + insert into pw_outsource_contract + + create_time, + contract_code, + production_code, + supplier, + total_prices_small, + total_prices_big, + tax_rate, + delivery_type, + payer, + delivery_address, + mode_of_payment, + sign_date, + contract_status, + remarks, + withhold, + billing_information, + invoice, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + leadership, + leadership_time, + spared_one, + spared_two, + spared_three, + spared_four, + contract_path, + + + #{createTime}, + #{contractCode}, + #{productionCode}, + #{supplier}, + #{totalPricesSmall}, + #{totalPricesBig}, + #{taxRate}, + #{deliveryType}, + #{payer}, + #{deliveryAddress}, + #{modeOfPayment}, + #{signDate}, + #{contractStatus}, + #{remarks}, + #{withhold}, + #{billingInformation}, + #{invoice}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{leadership}, + #{leadershipTime}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{contract_path}, + + + + + update pw_outsource_contract + + create_time = #{createTime}, + contract_code = #{contractCode}, + production_code = #{productionCode}, + supplier = #{supplier}, + total_prices_small = #{totalPricesSmall}, + total_prices_big = #{totalPricesBig}, + tax_rate = #{taxRate}, + delivery_type = #{deliveryType}, + payer = #{payer}, + delivery_address = #{deliveryAddress}, + mode_of_payment = #{modeOfPayment}, + sign_date = #{signDate}, + contract_status = #{contractStatus}, + remarks = #{remarks}, + withhold = #{withhold}, + billing_information = #{billingInformation}, + billing_information = null, + invoice = #{invoice}, + invoice = null, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{proceedsAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + contract_path = #{contractPath}, + + where id = #{id} + + + + delete from pw_outsource_contract where id = #{id} + + + + delete from pw_outsource_contract where id in + + #{id} + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwOutsourcingContractMapper.xml b/evo/src/main/resources/mybatis/management/PwOutsourcingContractMapper.xml new file mode 100644 index 0000000..4735f6a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwOutsourcingContractMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, purchaser_name, seller_name, contract_code, appoint_time, total_prices_small, total_prices_big, complete_time, agreement, remark, purchaser_phone, purchaser_fax, purchaser_address, purchaser_account, purchaser_duty_paragraph, purchaser_bank_of_deposit, seller_phone, seller_fax, seller_address, seller_account, seller_duct_paragraph, seller_bank_of_deposit, contract_status, spared_one, spared_two, spared_three, spared_four, del_flag from pw_outsourcing_contract + + + + + + + + insert into pw_outsourcing_contract + + create_time, + purchaser_name, + seller_name, + contract_code, + appoint_time, + total_prices_small, + total_prices_big, + complete_time, + agreement, + remark, + purchaser_phone, + purchaser_fax, + purchaser_address, + purchaser_account, + purchaser_duty_paragraph, + purchaser_bank_of_deposit, + seller_phone, + seller_fax, + seller_address, + seller_account, + seller_duct_paragraph, + seller_bank_of_deposit, + contract_status, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{purchaserName}, + #{sellerName}, + #{contractCode}, + #{appointTime}, + #{totalPricesSmall}, + #{totalPricesBig}, + #{completeTime}, + #{agreement}, + #{remark}, + #{purchaserPhone}, + #{purchaserFax}, + #{purchaserAddress}, + #{purchaserAccount}, + #{purchaserDutyParagraph}, + #{purchaserBankOfDeposit}, + #{sellerPhone}, + #{sellerFax}, + #{sellerAddress}, + #{sellerAccount}, + #{sellerDuctParagraph}, + #{sellerBankOfDeposit}, + #{contractStatus}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_outsourcing_contract + + create_time = #{createTime}, + purchaser_name = #{purchaserName}, + seller_name = #{sellerName}, + contract_code = #{contractCode}, + appoint_time = #{appointTime}, + total_prices_small = #{totalPricesSmall}, + total_prices_big = #{totalPricesBig}, + complete_time = #{completeTime}, + agreement = #{agreement}, + remark = #{remark}, + purchaser_phone = #{purchaserPhone}, + purchaser_fax = #{purchaserFax}, + purchaser_address = #{purchaserAddress}, + purchaser_account = #{purchaserAccount}, + purchaser_duty_paragraph = #{purchaserDutyParagraph}, + purchaser_bank_of_deposit = #{purchaserBankOfDeposit}, + seller_phone = #{sellerPhone}, + seller_fax = #{sellerFax}, + seller_address = #{sellerAddress}, + seller_account = #{sellerAccount}, + seller_duct_paragraph = #{sellerDuctParagraph}, + seller_bank_of_deposit = #{sellerBankOfDeposit}, + contract_status = #{contractStatus}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_outsourcing_contract where id = #{id} + + + + delete from pw_outsourcing_contract where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwOutsourcingContractMaterialMapper.xml b/evo/src/main/resources/mybatis/management/PwOutsourcingContractMaterialMapper.xml new file mode 100644 index 0000000..78c2c1b --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwOutsourcingContractMaterialMapper.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, outsourcing_contract_id,material_id, material_name,type_name, figure_number, unit, quantity, univalence, summation, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_outsourcing_contract_material + + + + + + + + insert into pw_outsourcing_contract_material + + create_time, + outsourcing_contract_id, + material_id, + material_name, + type_name, + figure_number, + unit, + quantity, + univalence, + summation, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{outsourcingContractId}, + #{materialId}, + #{materialName}, + #{typeName}, + #{figureNumber}, + #{unit}, + #{quantity}, + #{univalence}, + #{summation}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_outsourcing_contract_material + + create_time = #{createTime}, + outsourcing_contract_id = #{outsourcingContractId}, + material_id = #{materialId}, + material_name = #{materialName}, + type_name = #{typeName}, + figure_number = #{figureNumber}, + unit = #{unit}, + quantity = #{quantity}, + univalence = #{univalence}, + summation = #{summation}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_outsourcing_contract_material where id = #{id} + + + + delete from pw_outsourcing_contract_material where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwPankuRecordMapper.xml b/evo/src/main/resources/mybatis/management/PwPankuRecordMapper.xml new file mode 100644 index 0000000..4acf806 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwPankuRecordMapper.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, type_name, warehouse_name, unit, quantity, practical_quantity, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_panku_record + + + + + + + + insert into pw_panku_record + + create_time, + name, + type_name, + warehouse_name, + unit, + quantity, + practical_quantity, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{name}, + #{typeName}, + #{warehouseName}, + #{unit}, + #{quantity}, + #{practicalQuantity}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_panku_record + + create_time = #{createTime}, + name = #{name}, + type_name = #{typeName}, + warehouse_name = #{warehouseName}, + unit = #{unit}, + quantity = #{quantity}, + practical_quantity = #{practicalQuantity}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_panku_record where id = #{id} + + + + delete from pw_panku_record where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwPredictPurchaseMapper.xml b/evo/src/main/resources/mybatis/management/PwPredictPurchaseMapper.xml new file mode 100644 index 0000000..3e6b8c0 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwPredictPurchaseMapper.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + create_time, + code, + name, + purpose, + total_prices, + demand_date, + proposer, + auditor, + status, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + seller_name, + appoint_time, + big_total_prices, + agreement, + contract_status, + tax_rate, + delivery_type, + payer, + mode_of_payment, + withhold, + billing_information, + leadership, + leadership_time, + contract_path + from pw_predict_purchase + + + + + + + + insert into pw_predict_purchase + + id, + create_time, + code, + name, + purpose, + total_prices, + demand_date, + proposer, + auditor, + status, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + seller_name, + appoint_time, + big_total_prices, + agreement, + contract_status, + tax_rate, + delivery_type, + payer, + mode_of_payment, + withhold, + billing_information, + leadership, + leadership_time, + contract_path, + + + #{id}, + #{createTime}, + #{code}, + #{name}, + #{purpose}, + #{totalPrices}, + #{demandDate}, + #{proposer}, + #{auditor}, + #{status}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{sellerName}, + #{appointTime}, + #{bigTotalPrices}, + #{agreement}, + #{contractStatus}, + #{taxRate}, + #{deliveryType}, + #{payer}, + #{modeOfPayment}, + #{withhold}, + #{billingInformation}, + #{leadership}, + #{leadershipTime}, + #{contractPath}, + + + + + update pw_predict_purchase + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + purpose = #{purpose}, + total_prices = #{totalPrices}, + demand_date = #{demandDate}, + proposer = #{proposer}, + proposer = null, + auditor = #{auditor}, + status = #{status}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + seller_name = #{sellerName}, + appoint_time = #{appointTime}, + big_total_prices = #{bigTotalPrices}, + agreement = #{agreement}, + contract_status = #{contractStatus}, + tax_rate = #{taxRate}, + delivery_type = #{deliveryType}, + payer = #{payer}, + mode_of_payment = #{modeOfPayment}, + withhold = #{withhold}, + billing_information = #{billingInformation}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + contract_path = #{contractPath}, + + where id = #{id} + + + + delete from pw_predict_purchase where id = #{id} + + + + delete from pw_predict_purchase where id in + + #{id} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwPredictPurchaseTwoMapper.xml b/evo/src/main/resources/mybatis/management/PwPredictPurchaseTwoMapper.xml new file mode 100644 index 0000000..07a3060 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwPredictPurchaseTwoMapper.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, predict_purchase_id, material_id, material_name, figure_number, materials, piece_weight, unit_of_measurement_name, number, univalence, totalprice, reference_number, practical_number, preferential_origin_name, inventory_status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_predict_purchase_two + + + + + + + + insert into pw_predict_purchase_two + + id, + create_time, + predict_purchase_id, + material_id, + material_name, + figure_number, + materials, + piece_weight, + unit_of_measurement_name, + number, + univalence, + totalprice, + reference_number, + practical_number, + preferential_origin_name, + inventory_status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{id}, + #{createTime}, + #{predictPurchaseId}, + #{materialId}, + #{materialName}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{unitOfMeasurementName}, + #{number}, + #{univalence}, + #{totalprice}, + #{referenceNumber}, + #{practicalNumber}, + #{preferentialOriginName}, + #{inventoryStatus}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_predict_purchase_two + + create_time = #{createTime}, + predict_purchase_id = #{predictPurchaseId}, + material_id = #{materialId}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + unit_of_measurement_name = #{unitOfMeasurementName}, + number = #{number}, + univalence = #{univalence}, + totalprice = #{totalprice}, + reference_number = #{referenceNumber}, + practical_number = #{practicalNumber}, + preferential_origin_name = #{preferentialOriginName}, + inventory_status = #{inventoryStatus}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_predict_purchase_two where id = #{id} + + + + delete from pw_predict_purchase_two where id in + + #{id} + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwProcessMapper.xml b/evo/src/main/resources/mybatis/management/PwProcessMapper.xml new file mode 100644 index 0000000..0199766 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProcessMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + select id,serial, create_time, process_name,checkout,godown_entry, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_process + + + + + + + + insert into pw_process + + id, + serial, + create_time, + process_name, + checkout, + godown_entry, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{id}, + #{serial}, + #{createTime}, + #{processName}, + #{checkout}, + #{godownEntry}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_process + + create_time = #{createTime}, + serial = #{serial}, + process_name = #{processName}, + checkout = #{checkout}, + godown_entry = #{godownEntry}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_process where id = #{id} + + + + delete from pw_process where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwProcessOrDeptMapper.xml b/evo/src/main/resources/mybatis/management/PwProcessOrDeptMapper.xml new file mode 100644 index 0000000..3a367ca --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProcessOrDeptMapper.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + select id, process_name, dept_name, attr_flag, abbreviation, remarks,xu_time,time_unit, create_time, create_by from pw_process_or_dept + + + + + + + + insert into pw_process_or_dept + + process_name, + dept_name, + attr_flag, + abbreviation, + remarks, + create_time, + create_by, + xu_time, + time_unit, + + + #{processName}, + #{deptName}, + #{attrFlag}, + #{abbreviation}, + #{remarks}, + #{createTime}, + #{createBy}, + #{xuTime}, + #{timeUnit}, + + + + + update pw_process_or_dept + + process_name = #{processName}, + dept_name = #{deptName}, + attr_flag = #{attrFlag}, + abbreviation = #{abbreviation}, + remarks = #{remarks}, + create_time = #{createTime}, + create_by = #{createBy}, + xu_time = #{xuTime}, + time_unit = #{timeUnit}, + + where id = #{id} + + + + delete from pw_process_or_dept where id = #{id} + + + + delete from pw_process_or_dept where id in + + #{id} + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwProductBillBomMapper.xml b/evo/src/main/resources/mybatis/management/PwProductBillBomMapper.xml new file mode 100644 index 0000000..54da829 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductBillBomMapper.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, single_quantity, type, piece_weight, total_quantity, parent_level_figure_number, parent_level_name, production_bill_product_id, inventory, prestore_quantity, lock_quantity, available_quantity, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_product_bill_bom + + + + + + + + insert into pw_product_bill_bom + + create_time, + name, + figure_number, + single_quantity, + type, + piece_weight, + total_quantity, + parent_level_figure_number, + parent_level_name, + production_bill_product_id, + inventory, + prestore_quantity, + lock_quantity, + available_quantity, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{singleQuantity}, + #{type}, + #{pieceWeight}, + #{totalQuantity}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{productionBillProductId}, + #{inventory}, + #{prestoreQuantity}, + #{lockQuantity}, + #{availableQuantity}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_product_bill_bom + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + single_quantity = #{singleQuantity}, + type = #{type}, + piece_weight = #{pieceWeight}, + total_quantity = #{totalQuantity}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + production_bill_product_id = #{productionBillProductId}, + inventory = #{inventory}, + prestore_quantity = #{prestoreQuantity}, + lock_quantity = #{lockQuantity}, + available_quantity = #{availableQuantity}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_product_bill_bom where id = #{id} + + + + delete from pw_product_bill_bom where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwProductDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwProductDetailMapper.xml new file mode 100644 index 0000000..0d33471 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductDetailMapper.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + select id, product_code, figure_number, product_name, unit, number, remarks, create_time from pw_product_detail + + + + + + + + insert into pw_product_detail + + product_code, + figure_number, + product_name, + unit, + number, + remarks, + create_time, + + + #{productCode}, + #{figureNumber}, + #{productName}, + #{unit}, + #{number}, + #{remarks}, + #{createTime}, + + + + + update pw_product_detail + + product_code = #{productCode}, + figure_number = #{figureNumber}, + product_name = #{productName}, + unit = #{unit}, + number = #{number}, + remarks = #{remarks}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from pw_product_detail where id = #{id} + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwProductMapper.xml b/evo/src/main/resources/mybatis/management/PwProductMapper.xml new file mode 100644 index 0000000..755609d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, field_of_employment, standard, picture, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_product + + + + + + + + insert into pw_product + + create_time, + name, + field_of_employment, + standard, + picture, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{name}, + #{fieldOfEmployment}, + #{standard}, + #{picture}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_product + + create_time = #{createTime}, + name = #{name}, + field_of_employment = #{fieldOfEmployment}, + standard = #{standard}, + picture = #{picture}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_product where id = #{id} + + + + update pw_product set del_flag = 1 where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwProductQuotationMapper.xml b/evo/src/main/resources/mybatis/management/PwProductQuotationMapper.xml new file mode 100644 index 0000000..c113584 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductQuotationMapper.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, quotation_id,product_type,product_classify,product_id, product_name, type_id, type_name,figure_number,material_name, unit,spline, number, univalence, total, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_product_quotation + + + + + + + + insert into pw_product_quotation + + create_time, + quotation_id, + product_type, + product_classify, + product_id, + product_name, + type_id, + type_name, + figure_number, + material_name, + unit, + spline, + number, + univalence, + total, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{quotationId}, + #{productType}, + #{productClassify}, + #{productId}, + #{productName}, + #{typeId}, + #{typeName}, + #{figureNumber}, + #{materialName}, + #{unit}, + #{spline}, + #{number}, + #{univalence}, + #{total}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_product_quotation + + create_time = #{createTime}, + quotation_id = #{quotationId}, + product_type = #{productType}, + product_classify = #{productClassify}, + product_id = #{productId}, + product_name = #{productName}, + type_id = #{typeId}, + type_name = #{typeName}, + figure_number = #{figureNumber}, + material_name = #{materialName}, + unit = #{unit}, + spline = #{spline}, + number = #{number}, + univalence = #{univalence}, + total = #{total}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_product_quotation where id = #{id} + + + + delete from pw_product_quotation where id in + + #{id} + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwProductionBillMapper.xml b/evo/src/main/resources/mybatis/management/PwProductionBillMapper.xml new file mode 100644 index 0000000..dbe392b --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductionBillMapper.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, project_name, purchaser, contract_code, illustrate, transport_type, bill_date,production_image, status_id,commit_flag, status_name,status,overtime,designer,salesman, spared_one, spared_two, spared_three, spared_four, del_flag from pw_production_bill + + + + + + + + insert into pw_production_bill + + create_time, + code, + project_name, + purchaser, + contract_code, + illustrate, + transport_type, + bill_date, + production_image, + status_id, + status_name, + status, + overtime, + designer, + salesman, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + commit_flag, + + + #{createTime}, + #{code}, + #{projectName}, + #{purchaser}, + #{contractCode}, + #{illustrate}, + #{transportType}, + #{billDate}, + #{productionImage}, + #{statusId}, + #{statusName}, + #{status}, + #{overtime}, + #{designer}, + #{salesman}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{commitFlag}, + + + + + update pw_production_bill + + create_time = #{createTime}, + code = #{code}, + project_name = #{projectName}, + purchaser = #{purchaser}, + contract_code = #{contractCode}, + illustrate = #{illustrate}, + transport_type = #{transportType}, + bill_date = #{billDate}, + production_image = #{productionImage}, + status_id = #{statusId}, + status_name = #{statusName}, + status = #{status}, + overtime = #{overtime}, + designer = #{designer}, + salesman = #{salesman}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + commit_flag = #{commitFlag}, + + where id = #{id} + + + + delete from pw_production_bill where id = #{id} + + + + delete from pw_production_bill where id in + + #{id} + + + + + + + + + + update pw_production_bill set commit_flag = #{commitFlag} + where code = #{code} + + + diff --git a/evo/src/main/resources/mybatis/management/PwProductionBillNonstandardMapper.xml b/evo/src/main/resources/mybatis/management/PwProductionBillNonstandardMapper.xml new file mode 100644 index 0000000..07e20d2 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductionBillNonstandardMapper.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, product_id, product_name, product_type_id, product_type, unit, one_quantity, cage_assembly_quantity, mesa_specifications, mesa_area, rigid_chain_type, dynamic_load, dead_load, lifter_speed, lifter_journey, motor_power, spared_one, spared_two, spared_three, spared_four, del_flag from pw_production_bill_nonstandard + + + + + + + + insert into pw_production_bill_nonstandard + + create_time, + product_id, + product_name, + product_type_id, + product_type, + unit, + one_quantity, + cage_assembly_quantity, + mesa_specifications, + mesa_area, + rigid_chain_type, + dynamic_load, + dead_load, + lifter_speed, + lifter_journey, + motor_power, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productId}, + #{productName}, + #{productTypeId}, + #{productType}, + #{unit}, + #{oneQuantity}, + #{cageAssemblyQuantity}, + #{mesaSpecifications}, + #{mesaArea}, + #{rigidChainType}, + #{dynamicLoad}, + #{deadLoad}, + #{lifterSpeed}, + #{lifterJourney}, + #{motorPower}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_production_bill_nonstandard + + create_time = #{createTime}, + product_id = #{productId}, + product_name = #{productName}, + product_type_id = #{productTypeId}, + product_type = #{productType}, + unit = #{unit}, + one_quantity = #{oneQuantity}, + cage_assembly_quantity = #{cageAssemblyQuantity}, + mesa_specifications = #{mesaSpecifications}, + mesa_area = #{mesaArea}, + rigid_chain_type = #{rigidChainType}, + dynamic_load = #{dynamicLoad}, + dead_load = #{deadLoad}, + lifter_speed = #{lifterSpeed}, + lifter_journey = #{lifterJourney}, + motor_power = #{motorPower}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_production_bill_nonstandard where id = #{id} + + + + delete from pw_production_bill_nonstandard where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwProductionBillProductMapper.xml b/evo/src/main/resources/mybatis/management/PwProductionBillProductMapper.xml new file mode 100644 index 0000000..9d83b10 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductionBillProductMapper.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_bill_id, product_id, product_name, product_type_id, product_type, quantity, equipment_code, complete_date, pack_type,general_assembly_drawing,production_drawing,bom_url, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_production_bill_product + + + + + + + + + insert into pw_production_bill_product + + create_time, + production_bill_id, + product_id, + product_name, + product_type_id, + product_type, + quantity, + equipment_code, + complete_date, + pack_type, + general_assembly_drawing, + production_drawing, + bom_url, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productionBillId}, + #{productId}, + #{productName}, + #{productTypeId}, + #{productType}, + #{quantity}, + #{equipmentCode}, + #{completeDate}, + #{packType}, + #{generalAssemblyDrawing}, + #{productionDrawing}, + #{bomUrl}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_production_bill_product + + create_time = #{createTime}, + production_bill_id = #{productionBillId}, + product_id = #{productId}, + product_name = #{productName}, + product_type_id = #{productTypeId}, + product_type = #{productType}, + quantity = #{quantity}, + equipment_code = #{equipmentCode}, + complete_date = #{completeDate}, + pack_type = #{packType}, + general_assembly_drawing = #{generalAssemblyDrawing}, + production_drawing = #{productionDrawing}, + bom_url = #{bomUrl}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_production_bill_product where id = #{id} + + + + delete from pw_production_bill_product where id in + + #{id} + + + + + + delete from pw_production_bill_product where production_bill_id = #{id} + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwProductionOrderInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwProductionOrderInfoMapper.xml new file mode 100644 index 0000000..c38b004 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductionOrderInfoMapper.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_order_id, product_type, product_classify, product_name, type_name, figure_number, material_name, unit, number, status, remarks, spared_one, spared_two, spared_three, spared_four from pw_production_order_info + + + + + + + + insert into pw_production_order_info + + create_time, + production_order_id, + product_type, + product_classify, + product_name, + type_name, + figure_number, + material_name, + unit, + number, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{productionOrderId}, + #{productType}, + #{productClassify}, + #{productName}, + #{typeName}, + #{figureNumber}, + #{materialName}, + #{unit}, + #{number}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_production_order_info + + create_time = #{createTime}, + production_order_id = #{productionOrderId}, + product_type = #{productType}, + product_classify = #{productClassify}, + product_name = #{productName}, + type_name = #{typeName}, + figure_number = #{figureNumber}, + material_name = #{materialName}, + unit = #{unit}, + number = #{number}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_production_order_info where id = #{id} + + + + delete from pw_production_order_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwProductionOrderMapper.xml b/evo/src/main/resources/mybatis/management/PwProductionOrderMapper.xml new file mode 100644 index 0000000..14b0f3b --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductionOrderMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, product_bill_code, item_name, unit_name, illustrate, status, remarks, spared_one, spared_two, sapred_three, spared_four from pw_production_order + + + + + + + + insert into pw_production_order + + create_time, + code, + product_bill_code, + item_name, + unit_name, + illustrate, + status, + remarks, + spared_one, + spared_two, + sapred_three, + spared_four, + + + #{createTime}, + #{code}, + #{productBillCode}, + #{itemName}, + #{unitName}, + #{illustrate}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sapredThree}, + #{sparedFour}, + + + + + update pw_production_order + + create_time = #{createTime}, + code = #{code}, + product_bill_code = #{productBillCode}, + item_name = #{itemName}, + unit_name = #{unitName}, + illustrate = #{illustrate}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_production_order where id = #{id} + + + + delete from pw_production_order where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwProductionSchedulingMapper.xml b/evo/src/main/resources/mybatis/management/PwProductionSchedulingMapper.xml new file mode 100644 index 0000000..fffd215 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductionSchedulingMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, type_name, quantity, require_date, practical_date, remarks, spared_one, spared_two, spared_three, spared_four from pw_production_scheduling + + + + + + + + insert into pw_production_scheduling + + create_time, + code, + type_name, + quantity, + require_date, + practical_date, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{typeName}, + #{quantity}, + #{requireDate}, + #{practicalDate}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_production_scheduling + + create_time = #{createTime}, + code = #{code}, + type_name = #{typeName}, + quantity = #{quantity}, + require_date = #{requireDate}, + practical_date = #{practicalDate}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_production_scheduling where id = #{id} + + + + delete from pw_production_scheduling where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwProductionSchedulingNumberMapper.xml b/evo/src/main/resources/mybatis/management/PwProductionSchedulingNumberMapper.xml new file mode 100644 index 0000000..46646ac --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwProductionSchedulingNumberMapper.xml @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, figure_number, name, quantity, dept_name, inspection_number, stock_pending_number, one_number, two_number, three_number, four_number, five_number, six_number, seven_number, eight_number, nine_number, ten_number, eleven, twelve, thirteen, fourteen, fifteen,sixteen,seventeen,eighteen,nineteen,twenty,twenty_one,twenty_two,twenty_three,twenty_four,twenty_five,twenty_six,twenty_seven,twenty_eight,twenty_nine,thirty, spared_one, spared_two, spared_three, spared_four from pw_production_scheduling_number + + + + + + + + + + + insert into pw_production_scheduling_number + + create_time, + figure_number, + name, + quantity, + dept_name, + inspection_number, + stock_pending_number, + one_number, + two_number, + three_number, + four_number, + five_number, + six_number, + seven_number, + eight_number, + nine_number, + ten_number, + eleven, + twelve, + thirteen, + fourteen, + fifteen, + sixteen, + seventeen, + eighteen, + nineteen, + twenty, + twenty_one, + twenty_two, + twenty_three, + twenty_four, + twenty_five, + twenty_six, + twenty_seven, + twenty_eight, + twenty_nine, + thirty, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{figureNumber}, + #{name}, + #{quantity}, + #{deptName}, + #{inspectionNumber}, + #{stockPendingNumber}, + #{oneNumber}, + #{twoNumber}, + #{threeNumber}, + #{fourNumber}, + #{fiveNumber}, + #{sixNumber}, + #{sevenNumber}, + #{eightNumber}, + #{nineNumber}, + #{tenNumber}, + #{eleven}, + #{twelve}, + #{thirteen}, + #{fourteen}, + #{fifteen}, + #{sixteen}, + #{seventeen}, + #{eighteen}, + #{nineteen}, + #{twenty}, + #{twentyOne}, + #{twentyTwo}, + #{twentyThree}, + #{twentyFour}, + #{twentyFive}, + #{twentySix}, + #{twentySeven}, + #{twentyEight}, + #{twentyNine}, + #{thirty}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + + insert into pw_inventory_detail(figure_number, name) + VALUES + + (#{item.figureNumber}, + #{item.name}, + + + + + + update pw_production_scheduling_number + + create_time = #{createTime}, + figure_number = #{figureNumber}, + name = #{name}, + quantity = #{quantity}, + dept_name = #{deptName}, + inspection_number = #{inspectionNumber}, + stock_pending_number = #{stockPendingNumber}, + one_number = #{oneNumber}, + two_number = #{twoNumber}, + three_number = #{threeNumber}, + four_number = #{fourNumber}, + five_number = #{fiveNumber}, + six_number = #{sixNumber}, + seven_number = #{sevenNumber}, + eight_number = #{eightNumber}, + nine_number = #{nineNumber}, + ten_number = #{tenNumber}, + eleven = #{eleven}, + twelve = #{twelve}, + thirteen = #{thirteen}, + fourteen = #{fourteen}, + fifteen = #{fifteen}, + sixteen = #{sixteen}, + seventeen = #{seventeen}, + eighteen = #{eighteen}, + nineteen = #{nineteen}, + twenty = #{twenty}, + twenty_one = #{twentyOne}, + twenty_two = #{twentyTwo}, + twenty_three = #{twentyThree}, + twenty_four = #{twentyFour}, + twenty_five = #{twentyFive}, + twenty_six = #{twentySix}, + twenty_seven = #{twentySeven}, + twenty_eight = #{twentyEight}, + twenty_nine = #{twentyNine}, + thirty = #{thirty}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_production_scheduling_number where id = #{id} + + + + delete from pw_production_scheduling_number where id in + + #{id} + + + + + + truncate table pw_production_scheduling_number + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwPurchaseContractMapper.xml b/evo/src/main/resources/mybatis/management/PwPurchaseContractMapper.xml new file mode 100644 index 0000000..730551e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwPurchaseContractMapper.xml @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + cerate_time, + contract_code, + code, + purchaser_name, + seller_name, + appoint_time, + total_prices, + big_total_prices, + complete_time, + agreement, + purchaser_phone, + purchaser_fax, + purchaser_address, + purchaser_account, + purchaser_duty_paragraph, + purchaser_bank_of_deposit, + seller_phone, + seller_fax, + seller_address, + seller_account, + seller_duct_paragraph, + seller_bank_of_deposit, + remark, + contract_status, + tax_rate, + delivery_type, + payer, + delivery_address, + mode_of_payment, + withhold, + billing_information, + invoice, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + leadership, + leadership_time, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + contract_path + from pw_purchase_contract + + + + + + + + insert into pw_purchase_contract + + cerate_time, + contract_code, + code, + purchaser_name, + seller_name, + appoint_time, + total_prices, + big_total_prices, + complete_time, + agreement, + purchaser_phone, + purchaser_fax, + purchaser_address, + purchaser_account, + purchaser_duty_paragraph, + purchaser_bank_of_deposit, + seller_phone, + seller_fax, + seller_address, + seller_account, + seller_duct_paragraph, + seller_bank_of_deposit, + remark, + contract_status, + tax_rate, + delivery_type, + payer, + delivery_address, + mode_of_payment, + withhold, + billing_information, + invoice, + not_invoice_amount, + invoice_amount, + not_proceeds_amount, + proceeds_amount, + settlement_ratio, + leadership, + leadership_time, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + contract_path, + + + #{cerateTime}, + #{contractCode}, + #{code}, + #{purchaserName}, + #{sellerName}, + #{appointTime}, + #{totalPrices}, + #{bigTotalPrices}, + #{completeTime}, + #{agreement}, + #{purchaserPhone}, + #{purchaserFax}, + #{purchaserAddress}, + #{purchaserAccount}, + #{purchaserDutyParagraph}, + #{purchaserBankOfDeposit}, + #{sellerPhone}, + #{sellerFax}, + #{sellerAddress}, + #{sellerAccount}, + #{sellerDuctParagraph}, + #{sellerBankOfDeposit}, + #{remark}, + #{contractStatus}, + #{taxRate}, + #{deliveryType}, + #{payer}, + #{deliveryAddress}, + #{modeOfPayment}, + #{withhold}, + #{billingInformation}, + #{invoice}, + #{notInvoiceAmount}, + #{invoiceAmount}, + #{notProceedsAmount}, + #{proceedsAmount}, + #{settlementRatio}, + #{leadership}, + #{leadershipTime}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + #{contractPath}, + + + + + update pw_purchase_contract + + cerate_time = #{cerateTime}, + contract_code = #{contractCode}, + code = #{code}, + purchaser_name = #{purchaserName}, + seller_name = #{sellerName}, + appoint_time = #{appointTime}, + total_prices = #{totalPrices}, + big_total_prices = #{bigTotalPrices}, + complete_time = #{completeTime}, + agreement = #{agreement}, + purchaser_phone = #{purchaserPhone}, + purchaser_fax = #{purchaserFax}, + purchaser_address = #{purchaserAddress}, + purchaser_account = #{purchaserAccount}, + purchaser_duty_paragraph = #{purchaserDutyParagraph}, + purchaser_bank_of_deposit = #{purchaserBankOfDeposit}, + seller_phone = #{sellerPhone}, + seller_fax = #{sellerFax}, + seller_address = #{sellerAddress}, + seller_account = #{sellerAccount}, + seller_duct_paragraph = #{sellerDuctParagraph}, + seller_bank_of_deposit = #{sellerBankOfDeposit}, + remark = #{remark}, + contract_status = #{contractStatus}, + tax_rate = #{taxRate}, + delivery_type = #{deliveryType}, + payer = #{payer}, + delivery_address = #{deliveryAddress}, + mode_of_payment = #{modeOfPayment}, + withhold = #{withhold}, + billing_information = #{billingInformation}, + billing_information = null, + invoice = #{invoice}, + invoice = null, + not_invoice_amount = #{notInvoiceAmount}, + invoice_amount = #{proceedsAmount}, + not_proceeds_amount = #{notProceedsAmount}, + proceeds_amount = #{proceedsAmount}, + settlement_ratio = #{settlementRatio}, + leadership = #{leadership}, + leadership = null, + leadership_time = #{leadershipTime}, + leadership_time = null, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + contract_path = #{contractPath}, + + where id = #{id} + + + + delete from pw_purchase_contract where id = #{id} + + + + delete from pw_purchase_contract where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwPurchaseContractMaterialMapper.xml b/evo/src/main/resources/mybatis/management/PwPurchaseContractMaterialMapper.xml new file mode 100644 index 0000000..28849ee --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwPurchaseContractMaterialMapper.xml @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, purchase_contract_id,code, material_id, material_name,figure_number,materials, amount, unit,complete_date, univalence, total_prices,inventory_status,quantity,preliminary_inventory,lock_number, spared_one, spared_two, spared_three, spared_four, del_flag from pw_purchase_contract_material + + + + + + + + insert into pw_purchase_contract_material + + create_time, + purchase_contract_id, + code, + material_id, + material_name, + figure_number, + materials, + amount, + unit, + complete_date, + univalence, + total_prices, + inventory_status, + quantity, + preliminary_inventory, + lock_number, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{purchaseContractId}, + #{code}, + #{materialId}, + #{materialName}, + #{figureNumber}, + #{materials}, + #{amount}, + #{unit}, + #{completeDate}, + #{univalence}, + #{totalPrices}, + #{inventoryStatus}, + #{quantity}, + #{preliminaryInventory}, + #{lockNumber}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_purchase_contract_material + + create_time = #{createTime}, + purchase_contract_id = #{purchaseContractId}, + code = #{code}, + material_id = #{materialId}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + amount = #{amount}, + unit = #{unit}, + complete_date = #{completeDate}, + univalence = #{univalence}, + total_prices = #{totalPrices}, + inventory_status = #{inventoryStatus}, + quantity = #{quantity}, + preliminary_inventory = #{preliminaryInventory}, + lock_number = #{lockNumber}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + purchase_contract_id = null, + + where id = #{id} + + + + delete from pw_purchase_contract_material where id = #{id} + + + + delete from pw_purchase_contract_material where id in + + #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/management/PwPurchaseMapper.xml b/evo/src/main/resources/mybatis/management/PwPurchaseMapper.xml new file mode 100644 index 0000000..5d9c6bc --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwPurchaseMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, part_name, figure_number, picture, univalence, manufacturers, common, now_inventory, minimum, highest, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_purchase + + + + + + + + insert into pw_purchase + + create_time, + part_name, + figure_number, + picture, + univalence, + manufacturers, + common, + now_inventory, + minimum, + highest, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{partName}, + #{figureNumber}, + #{picture}, + #{univalence}, + #{manufacturers}, + #{common}, + #{nowInventory}, + #{minimum}, + #{highest}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_purchase + + create_time = #{createTime}, + part_name = #{partName}, + figure_number = #{figureNumber}, + picture = #{picture}, + univalence = #{univalence}, + manufacturers = #{manufacturers}, + common = #{common}, + now_inventory = #{nowInventory}, + minimum = #{minimum}, + highest = #{highest}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_purchase where id = #{id} + + + + delete from pw_purchase where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwQrcodeMapper.xml b/evo/src/main/resources/mybatis/management/PwQrcodeMapper.xml new file mode 100644 index 0000000..ad04dce --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwQrcodeMapper.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, url, code, name, figure_number, type, piece_weight, quantity, completion_date, department_name, lose_efficacy, remarks, spared_one, spared_two, spared_three, spared_four from pw_qrcode + + + + + + + + insert into pw_qrcode + + create_time, + url, + code, + name, + figure_number, + type, + piece_weight, + quantity, + completion_date, + department_name, + lose_efficacy, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{url}, + #{code}, + #{name}, + #{figureNumber}, + #{type}, + #{pieceWeight}, + #{quantity}, + #{completionDate}, + #{departmentName}, + #{loseEfficacy}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_qrcode + + create_time = #{createTime}, + url = #{url}, + code = #{code}, + name = #{name}, + figure_number = #{figureNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + quantity = #{quantity}, + completion_date = #{completionDate}, + department_name = #{departmentName}, + lose_efficacy = #{loseEfficacy}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_qrcode where id = #{id} + + + + delete from pw_qrcode where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwQuotationMapper.xml b/evo/src/main/resources/mybatis/management/PwQuotationMapper.xml new file mode 100644 index 0000000..7045b2b --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwQuotationMapper.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, unit_name, inquirer, phone, e_mail, item_name, item_address, mode_of_trade, mode_of_packing, mode_of_transportation, make_out_an_invoice, offerer, discount_rate, product_id, product_name, total_prices, remark, user_id,create_contract_sign,spared_one, spared_two, spared_three, spared_four, del_flag from pw_quotation q + + + + + + + + insert into pw_quotation + + create_time, + unit_name, + inquirer, + phone, + e_mail, + item_name, + item_address, + mode_of_trade, + mode_of_packing, + mode_of_transportation, + make_out_an_invoice, + offerer, + discount_rate, + product_id, + product_name, + total_prices, + remark, + user_id, + create_contract_sign, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{unitName}, + #{inquirer}, + #{phone}, + #{eMail}, + #{itemName}, + #{itemAddress}, + #{modeOfTrade}, + #{modeOfPacking}, + #{modeOfTransportation}, + #{makeOutAnInvoice}, + #{offerer}, + #{discountRate}, + #{productId}, + #{productName}, + #{totalPrices}, + #{remark}, + #{userId}, + #{createContractSign}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_quotation + + create_time = #{createTime}, + unit_name = #{unitName}, + inquirer = #{inquirer}, + phone = #{phone}, + e_mail = #{eMail}, + item_name = #{itemName}, + item_address = #{itemAddress}, + mode_of_trade = #{modeOfTrade}, + mode_of_packing = #{modeOfPacking}, + mode_of_transportation = #{modeOfTransportation}, + make_out_an_invoice = #{makeOutAnInvoice}, + offerer = #{offerer}, + discount_rate = #{discountRate}, + product_id = #{productId}, + product_name = #{productName}, + total_prices = #{totalPrices}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_quotation where id = #{id} + + + + delete from pw_quotation where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwSafetyInventoryMapper.xml b/evo/src/main/resources/mybatis/management/PwSafetyInventoryMapper.xml new file mode 100644 index 0000000..0df451c --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwSafetyInventoryMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, materials, piece_weight, minimum, highest, quantity, preliminary_inventory, lock_number, proportion, spared_one, spared_two, spared_three, spared_four from pw_safety_inventory + + + + + + + + insert into pw_safety_inventory + + create_time, + name, + figure_number, + materials, + piece_weight, + minimum, + highest, + quantity, + preliminary_inventory, + lock_number, + proportion, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{minimum}, + #{highest}, + #{quantity}, + #{preliminaryInventory}, + #{lockNumber}, + #{proportion}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_safety_inventory + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + minimum = #{minimum}, + highest = #{highest}, + quantity = #{quantity}, + preliminary_inventory = #{preliminaryInventory}, + lock_number = #{lockNumber}, + proportion = #{proportion}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_safety_inventory where id = #{id} + + + + delete from pw_safety_inventory where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwSchemeMapper.xml b/evo/src/main/resources/mybatis/management/PwSchemeMapper.xml new file mode 100644 index 0000000..3922d72 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwSchemeMapper.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, quotation_id, installation_site, foundation_trench, journey, lifting_platform_long, lifting_platform_wide, lifting_platform_diameter, lifting_platform_area, dynamic_load, dead_load, speed,steel_structure,picture, technical_parameters, total_price, spared_one, spared_two, spared_three, spared_four, del_flag from pw_scheme + + + + + + + + insert into pw_scheme + + create_time, + quotation_id, + installation_site, + foundation_trench, + journey, + lifting_platform_long, + lifting_platform_wide, + lifting_platform_diameter, + lifting_platform_area, + dynamic_load, + dead_load, + speed, + steel_structure, + picture, + technical_parameters, + total_price, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{quotationId}, + #{installationSite}, + #{foundationTrench}, + #{journey}, + #{liftingPlatformLong}, + #{liftingPlatformWide}, + #{liftingPlatformDiameter}, + #{liftingPlatformArea}, + #{dynamicLoad}, + #{deadLoad}, + #{speed}, + #{steelStructure}, + #{picture}, + #{technicalParameters}, + #{totalPrice}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_scheme + + create_time = #{createTime}, + quotation_id = #{quotationId}, + installation_site = #{installationSite}, + foundation_trench = #{foundationTrench}, + journey = #{journey}, + lifting_platform_long = #{liftingPlatformLong}, + lifting_platform_wide = #{liftingPlatformWide}, + lifting_platform_diameter = #{liftingPlatformDiameter}, + lifting_platform_area = #{liftingPlatformArea}, + dynamic_load = #{dynamicLoad}, + dead_load = #{deadLoad}, + speed = #{speed}, + steel_structure = #{steelStructure}, + picture = #{picture}, + technical_parameters = #{technicalParameters}, + total_price = #{totalPrice}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_scheme where id = #{id} + + + + delete from pw_scheme where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwScrapInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwScrapInfoMapper.xml new file mode 100644 index 0000000..d4e463e --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwScrapInfoMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, name, figure_number, materials, piece_weight, quantity, number, residue_number, user_name, cause, remarks, spared_one, spared_two, spared_three, spared_four from pw_scrap_info + + + + + + + + insert into pw_scrap_info + + create_time, + name, + figure_number, + materials, + piece_weight, + quantity, + number, + residue_number, + user_name, + cause, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{name}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{quantity}, + #{number}, + #{residueNumber}, + #{userName}, + #{cause}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_scrap_info + + create_time = #{createTime}, + name = #{name}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + quantity = #{quantity}, + number = #{number}, + residue_number = #{residueNumber}, + user_name = #{userName}, + cause = #{cause}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_scrap_info where id = #{id} + + + + delete from pw_scrap_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwSpectacularsInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwSpectacularsInfoMapper.xml new file mode 100644 index 0000000..225a525 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwSpectacularsInfoMapper.xml @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, product_name, num, figure_number, name, one_number, type, piece_weight, sum_number, remarks, process_name_one, inspector_info_one, godown_entry_one, process_name_two, inspector_info_two, godown_entry_two, process_name_three, inspector_info_three, godown_entry_three, process_name_four, inspector_info_four, godown_entry_four, process_name_five, inspector_info_five, godown_entry_five, process_name_six, inspector_info_six, godown_entry_six, process_name_seven, inspector_info_seven, godown_entry_seven, process_name_eight, inspector_info_eight, godown_entry_eight, process_name_nine, inspector_info_nine, godown_entry_nine, process_name_ten, inspector_info_ten, godown_entry_ten, materials_name, materials_specification, specification, workblank, finished, xu_describe, over_time, analysis, spared_one, spared_two, spared_three, spared_four from pw_spectaculars_info + + + + + + + + insert into pw_spectaculars_info + + create_time, + code, + product_name, + num, + figure_number, + name, + one_number, + type, + piece_weight, + sum_number, + remarks, + process_name_one, + inspector_info_one, + godown_entry_one, + process_name_two, + inspector_info_two, + godown_entry_two, + process_name_three, + inspector_info_three, + godown_entry_three, + process_name_four, + inspector_info_four, + godown_entry_four, + process_name_five, + inspector_info_five, + godown_entry_five, + process_name_six, + inspector_info_six, + godown_entry_six, + process_name_seven, + inspector_info_seven, + godown_entry_seven, + process_name_eight, + inspector_info_eight, + godown_entry_eight, + process_name_nine, + inspector_info_nine, + godown_entry_nine, + process_name_ten, + inspector_info_ten, + godown_entry_ten, + materials_name, + materials_specification, + specification, + workblank, + finished, + xu_describe, + over_time, + analysis, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{productName}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{sumNumber}, + #{remarks}, + #{processNameOne}, + #{inspectorInfoOne}, + #{godownEntryOne}, + #{processNameTwo}, + #{inspectorInfoTwo}, + #{godownEntryTwo}, + #{processNameThree}, + #{inspectorInfoThree}, + #{godownEntryThree}, + #{processNameFour}, + #{inspectorInfoFour}, + #{godownEntryFour}, + #{processNameFive}, + #{inspectorInfoFive}, + #{godownEntryFive}, + #{processNameSix}, + #{inspectorInfoSix}, + #{godownEntrySix}, + #{processNameSeven}, + #{inspectorInfoSeven}, + #{godownEntrySeven}, + #{processNameEight}, + #{inspectorInfoEight}, + #{godownEntryEight}, + #{processNameNine}, + #{inspectorInfoNine}, + #{godownEntryNine}, + #{processNameTen}, + #{inspectorInfoTen}, + #{godownEntryTen}, + #{materialsName}, + #{materialsSpecification}, + #{specification}, + #{workblank}, + #{finished}, + #{xuDescribe}, + #{overTime}, + #{analysis}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_spectaculars_info + + create_time = #{createTime}, + code = #{code}, + product_name = #{productName}, + num = #{num}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + sum_number = #{sumNumber}, + remarks = #{remarks}, + process_name_one = #{processNameOne}, + inspector_info_one = #{inspectorInfoOne}, + godown_entry_one = #{godownEntryOne}, + process_name_two = #{processNameTwo}, + inspector_info_two = #{inspectorInfoTwo}, + godown_entry_two = #{godownEntryTwo}, + process_name_three = #{processNameThree}, + inspector_info_three = #{inspectorInfoThree}, + godown_entry_three = #{godownEntryThree}, + process_name_four = #{processNameFour}, + inspector_info_four = #{inspectorInfoFour}, + godown_entry_four = #{godownEntryFour}, + process_name_five = #{processNameFive}, + inspector_info_five = #{inspectorInfoFive}, + godown_entry_five = #{godownEntryFive}, + process_name_six = #{processNameSix}, + inspector_info_six = #{inspectorInfoSix}, + godown_entry_six = #{godownEntrySix}, + process_name_seven = #{processNameSeven}, + inspector_info_seven = #{inspectorInfoSeven}, + godown_entry_seven = #{godownEntrySeven}, + process_name_eight = #{processNameEight}, + inspector_info_eight = #{inspectorInfoEight}, + godown_entry_eight = #{godownEntryEight}, + process_name_nine = #{processNameNine}, + inspector_info_nine = #{inspectorInfoNine}, + godown_entry_nine = #{godownEntryNine}, + process_name_ten = #{processNameTen}, + inspector_info_ten = #{inspectorInfoTen}, + godown_entry_ten = #{godownEntryTen}, + materials_name = #{materialsName}, + materials_specification = #{materialsSpecification}, + specification = #{specification}, + workblank = #{workblank}, + finished = #{finished}, + xu_describe = #{xuDescribe}, + over_time = #{overTime}, + analysis = #{analysis}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_spectaculars_info where id = #{id} + + + + delete from pw_spectaculars_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwSpectacularsMapper.xml b/evo/src/main/resources/mybatis/management/PwSpectacularsMapper.xml new file mode 100644 index 0000000..233540a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwSpectacularsMapper.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, num, figure_number, name, one_number, type, piece_weight, sum_number, remarks, dept_name, completion_date, godown_entry, pdf_url, materials_name, materials_specification, specification, workblank, finished, receive_number, xu_describe, status, status_date, quantity,over_time from pw_spectaculars + + + + + + + + insert into pw_spectaculars + + create_time, + num, + figure_number, + name, + one_number, + type, + piece_weight, + sum_number, + remarks, + dept_name, + completion_date, + godown_entry, + pdf_url, + materials_name, + materials_specification, + specification, + workblank, + finished, + receive_number, + xu_describe, + status, + status_date, + quantity, + over_time, + + + #{createTime}, + #{num}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{sumNumber}, + #{remarks}, + #{deptName}, + #{completionDate}, + #{godownEntry}, + #{pdfUrl}, + #{materialsName}, + #{materialsSpecification}, + #{specification}, + #{workblank}, + #{finished}, + #{receiveNumber}, + #{xuDescribe}, + #{status}, + #{statusDate}, + #{quantity}, + #{overTime}, + + + + + update pw_spectaculars + + create_time = #{createTime}, + num = #{num}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + sum_number = #{sumNumber}, + remarks = #{remarks}, + dept_name = #{deptName}, + completion_date = #{completionDate}, + godown_entry = #{godownEntry}, + pdf_url = #{pdfUrl}, + materials_name = #{materialsName}, + materials_specification = #{materialsSpecification}, + specification = #{specification}, + workblank = #{workblank}, + finished = #{finished}, + receive_number = #{receiveNumber}, + xu_describe = #{xuDescribe}, + status = #{status}, + status_date = #{statusDate}, + quantity = #{quantity}, + over_time = #{overTime}, + + where id = #{id} + + + + delete from pw_spectaculars where id = #{id} + + + + delete from pw_spectaculars where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwStoresRequisitionMapper.xml b/evo/src/main/resources/mybatis/management/PwStoresRequisitionMapper.xml new file mode 100644 index 0000000..aa2b27d --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwStoresRequisitionMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, name, purpose, demand_date, proposer, auditor, status, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_stores_requisition + + + + + + + + insert into pw_stores_requisition + + create_time, + code, + name, + purpose, + demand_date, + proposer, + auditor, + status, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{code}, + #{name}, + #{purpose}, + #{demandDate}, + #{proposer}, + #{auditor}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_stores_requisition + + create_time = #{createTime}, + code = #{code}, + name = #{name}, + purpose = #{purpose}, + demand_date = #{demandDate}, + proposer = #{proposer}, + auditor = #{auditor}, + auditor = null, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_one = null, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_stores_requisition where id = #{id} + + + + delete from pw_stores_requisition where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwStoresRequistionDetailMapper.xml b/evo/src/main/resources/mybatis/management/PwStoresRequistionDetailMapper.xml new file mode 100644 index 0000000..335c1bb --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwStoresRequistionDetailMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, stores_requisition_id,material_id, material_name, figure_number, materials, piece_weight, unit_of_measurement_name, number, univalence, totalprice, preferential_origin_name, status, remarks, spared_one, spared_two, sapred_three, spared_four, del_flag from pw_stores_requistion_detail + + + + + + + + insert into pw_stores_requistion_detail + + create_time, + stores_requisition_id, + material_id, + material_name, + figure_number, + materials, + piece_weight, + unit_of_measurement_name, + number, + univalence, + totalprice, + preferential_origin_name, + status, + remarks, + spared_one, + spared_two, + sapred_three, + spared_four, + del_flag, + + + #{createTime}, + #{storesRequisitionId}, + #{materialId}, + #{materialName}, + #{figureNumber}, + #{materials}, + #{pieceWeight}, + #{unitOfMeasurementName}, + #{number}, + #{univalence}, + #{totalprice}, + #{preferentialOriginName}, + #{status}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sapredThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_stores_requistion_detail + + create_time = #{createTime}, + stores_requisition_id = #{storesRequisitionId}, + material_id = #{materialId}, + material_name = #{materialName}, + figure_number = #{figureNumber}, + materials = #{materials}, + piece_weight = #{pieceWeight}, + unit_of_measurement_name = #{unitOfMeasurementName}, + number = #{number}, + univalence = #{univalence}, + totalprice = #{totalprice}, + preferential_origin_name = #{preferentialOriginName}, + status = #{status}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + sapred_three = #{sapredThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_stores_requistion_detail where id = #{id} + + + + delete from pw_stores_requistion_detail where id in + + #{id} + + + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwTaskBomMapper.xml b/evo/src/main/resources/mybatis/management/PwTaskBomMapper.xml new file mode 100644 index 0000000..2f28c5a --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwTaskBomMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, task_id, material, figure_number, quantity, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_task_bom + + + + + + + + insert into pw_task_bom + + create_time, + task_id, + material, + figure_number, + quantity, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{taskId}, + #{material}, + #{figureNumber}, + #{quantity}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_task_bom + + create_time = #{createTime}, + task_id = #{taskId}, + material = #{material}, + figure_number = #{figureNumber}, + quantity = #{quantity}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_task_bom where id = #{id} + + + + delete from pw_task_bom where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwTaskMapper.xml b/evo/src/main/resources/mybatis/management/PwTaskMapper.xml new file mode 100644 index 0000000..b9a252b --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwTaskMapper.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_bill_produce_id, parent_level_task_id, task_code, task_name,quantity, task_promulgator_name, completion_time, begin_times, reality_completion_time, working_time, user_name, user_id, task_status, part_gather, drawing, remark, spared_one, spared_two, spared_three, spared_four, del_flag from pw_task + + + + + + + + insert into pw_task + + create_time, + production_bill_produce_id, + parent_level_task_id, + task_code, + task_name, + quantity, + task_promulgator_name, + completion_time, + begin_times, + reality_completion_time, + working_time, + user_name, + user_id, + task_status, + part_gather, + drawing, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productionBillProduceId}, + #{parentLevelTaskId}, + #{taskCode}, + #{taskName}, + #{quantity}, + #{taskPromulgatorName}, + #{completionTime}, + #{beginTimes}, + #{realityCompletionTime}, + #{workingTime}, + #{userName}, + #{userId}, + #{taskStatus}, + #{partGather}, + #{drawing}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_task + + create_time = #{createTime}, + production_bill_produce_id = #{productionBillProduceId}, + parent_level_task_id = #{parentLevelTaskId}, + task_code = #{taskCode}, + task_name = #{taskName}, + quantity = #{quantity}, + task_promulgator_name = #{taskPromulgatorName}, + completion_time = #{completionTime}, + begin_times = #{beginTimes}, + reality_completion_time = #{realityCompletionTime}, + working_time = #{workingTime}, + user_name = #{userName}, + user_id = #{userId}, + task_status = #{taskStatus}, + part_gather = #{partGather}, + drawing = #{drawing}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_task where id = #{id} + + + + delete from pw_task where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwTaskOverTimeInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwTaskOverTimeInfoMapper.xml new file mode 100644 index 0000000..2526589 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwTaskOverTimeInfoMapper.xml @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, product_name, name, figure_number, sum_number, order_time, process_name, department_name, completion_date, timeout_days, material_requisition_quantity, apply_for_quantity, checkout_quantity, storage_quantity, remarks, spared_one, spared_two, spared_three, spared_four, spared_five, spared_six from pw_task_over_time_info + + + + + + + + insert into pw_task_over_time_info + + create_time, + code, + product_name, + name, + figure_number, + sum_number, + order_time, + process_name, + department_name, + completion_date, + timeout_days, + material_requisition_quantity, + apply_for_quantity, + checkout_quantity, + storage_quantity, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + spared_five, + spared_six, + + + #{createTime}, + #{code}, + #{productName}, + #{name}, + #{figureNumber}, + #{sumNumber}, + #{orderTime}, + #{processName}, + #{departmentName}, + #{completionDate}, + #{timeoutDays}, + #{materialRequisitionQuantity}, + #{applyForQuantity}, + #{checkoutQuantity}, + #{storageQuantity}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{sparedFive}, + #{sparedSix}, + + + + + update pw_task_over_time_info + + create_time = #{createTime}, + code = #{code}, + product_name = #{productName}, + name = #{name}, + figure_number = #{figureNumber}, + sum_number = #{sumNumber}, + order_time = #{orderTime}, + process_name = #{processName}, + department_name = #{departmentName}, + completion_date = #{completionDate}, + timeout_days = #{timeoutDays}, + material_requisition_quantity = #{materialRequisitionQuantity}, + apply_for_quantity = #{applyForQuantity}, + checkout_quantity = #{checkoutQuantity}, + storage_quantity = #{storageQuantity}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + spared_five = #{sparedFive}, + spared_six = #{sparedSix}, + + where id = #{id} + + + + delete from pw_task_over_time_info where id = #{id} + + + + delete from pw_task_over_time_info where id in + + #{id} + + + + + + + insert into pw_task_over_time_info(code, product_name, name, figure_number, sum_number, order_time, process_name, department_name, completion_date, timeout_days, material_requisition_quantity, apply_for_quantity, checkout_quantity, storage_quantity, remarks, spared_one, spared_two, spared_three, spared_four, spared_five, spared_six) + VALUES + + (#{item.code}, + #{item.productName}, + #{item.name}, + #{item.figureNumber}, + #{item.sumNumber}, + #{item.orderTime}, + #{item.processName}, + #{item.departmentName}, + #{item.completionDate}, + #{item.timeoutDays}, + #{item.materialRequisitionQuantity}, + #{item.applyForQuantity}, + #{item.checkoutQuantity}, + #{item.storageQuantity}, + #{item.remarks}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}, + #{item.sparedFive}, + #{item.sparedSix}) + + + + + + + truncate table pw_task_over_time_info + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwTicketInfoMapper.xml b/evo/src/main/resources/mybatis/management/PwTicketInfoMapper.xml new file mode 100644 index 0000000..90630c0 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwTicketInfoMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, code, contract_code, money, money_big, punish_reason, invoice, invoice_img_url, proceeds, proceeds_img_url, remakes, spared_one, spared_two, spared_three, spared_four from pw_ticket_info + + + + + + + + insert into pw_ticket_info + + create_time, + code, + contract_code, + money, + money_big, + punish_reason, + invoice, + invoice_img_url, + proceeds, + proceeds_img_url, + remakes, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{code}, + #{contractCode}, + #{money}, + #{moneyBig}, + #{punishReason}, + #{invoice}, + #{invoiceImgUrl}, + #{proceeds}, + #{proceedsImgUrl}, + #{remakes}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update pw_ticket_info + + create_time = #{createTime}, + code = #{code}, + contract_code = #{contractCode}, + money = #{money}, + money_big = #{moneyBig}, + punish_reason = #{punishReason}, + invoice = #{invoice}, + invoice_img_url = #{invoiceImgUrl}, + proceeds = #{proceeds}, + proceeds_img_url = #{proceedsImgUrl}, + remakes = #{remakes}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from pw_ticket_info where id = #{id} + + + + delete from pw_ticket_info where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/PwUserEmailMapper.xml b/evo/src/main/resources/mybatis/management/PwUserEmailMapper.xml new file mode 100644 index 0000000..f700964 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/PwUserEmailMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + select id, create_time, name, email, remarks, spared_one, spared_two, spared_three, spared_four, del_flag from pw_user_email + + + + + + + + insert into pw_user_email + + create_time, + name, + email, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{name}, + #{email}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update pw_user_email + + create_time = #{createTime}, + name = #{name}, + email = #{email}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from pw_user_email where id = #{id} + + + + delete from pw_user_email where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/SysConfigIniMapper.xml b/evo/src/main/resources/mybatis/management/SysConfigIniMapper.xml new file mode 100644 index 0000000..11126ab --- /dev/null +++ b/evo/src/main/resources/mybatis/management/SysConfigIniMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + select id, create_time, dir, url, product_dir, file_type, file_url, remark, spared_one, spared_two, spared_three, spared_four, del_flag from sys_config_ini + + + + + + + + insert into sys_config_ini + + create_time, + dir, + url, + product_dir, + file_type, + file_url, + remark, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{dir}, + #{url}, + #{productDir}, + #{fileType}, + #{fileUrl}, + #{remark}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update sys_config_ini + + create_time = #{createTime}, + dir = #{dir}, + url = #{url}, + product_dir = #{productDir}, + file_type = #{fileType}, + file_url = #{fileUrl}, + remark = #{remark}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from sys_config_ini where id = #{id} + + + + delete from sys_config_ini where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/YcBomNumberPreliminaryInquiryMapper.xml b/evo/src/main/resources/mybatis/management/YcBomNumberPreliminaryInquiryMapper.xml new file mode 100644 index 0000000..94e1a15 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/YcBomNumberPreliminaryInquiryMapper.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code, type_name, figure_number, name, one_number, type, piece_weight, parent_level_figure_number, parent_level_name, sum_number, remarks, spared_one, spared_two, spared_three, spared_four from yc_bom_number_preliminary_inquiry + + + + + + + + insert into yc_bom_number_preliminary_inquiry + + create_time, + production_code, + type_name, + figure_number, + name, + one_number, + type, + piece_weight, + parent_level_figure_number, + parent_level_name, + sum_number, + remarks, + spared_one, + spared_two, + spared_three, + spared_four, + + + #{createTime}, + #{productionCode}, + #{typeName}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{sumNumber}, + #{remarks}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + + + + + update yc_bom_number_preliminary_inquiry + + create_time = #{createTime}, + production_code = #{productionCode}, + type_name = #{typeName}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + sum_number = #{sumNumber}, + remarks = #{remarks}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + + where id = #{id} + + + + delete from yc_bom_number_preliminary_inquiry where id = #{id} + + + + delete from yc_bom_number_preliminary_inquiry where id in + + #{id} + + + + + + insert into yc_bom_number_preliminary_inquiry(production_code,type_name, figure_number, name, one_number,type,piece_weight, parent_level_figure_number, parent_level_name, sum_number,remarks, spared_one, spared_two, spared_three, spared_four) + VALUES + + (#{item.productionCode}, + #{item.typeName}, + #{item.figureNumber}, + #{item.name}, + #{item.oneNumber}, + #{item.type}, + #{item.pieceWeight}, + #{item.parentLevelFigureNumber}, + #{item.parentLevelName}, + #{item.sumNumber}, + #{item.remarks}, + #{item.sparedOne}, + #{item.sparedTwo}, + #{item.sparedThree}, + #{item.sparedFour}) + + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/YcBomNumberTwoPreliminaryInquiryMapper.xml b/evo/src/main/resources/mybatis/management/YcBomNumberTwoPreliminaryInquiryMapper.xml new file mode 100644 index 0000000..6ab3184 --- /dev/null +++ b/evo/src/main/resources/mybatis/management/YcBomNumberTwoPreliminaryInquiryMapper.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, create_time, production_code, figure_number, name, one_number, type, piece_weight, parent_level_figure_number, parent_level_name, sum_number, spared_one, spared_two, process_name, inventory_status, superior_id, remarks, completion_date, department_name, spared_three, spared_four, del_flag from yc_bom_number_two_preliminary_inquiry + + + + + + + + insert into yc_bom_number_two_preliminary_inquiry + + create_time, + production_code, + figure_number, + name, + one_number, + type, + piece_weight, + parent_level_figure_number, + parent_level_name, + sum_number, + spared_one, + spared_two, + process_name, + inventory_status, + superior_id, + remarks, + completion_date, + department_name, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productionCode}, + #{figureNumber}, + #{name}, + #{oneNumber}, + #{type}, + #{pieceWeight}, + #{parentLevelFigureNumber}, + #{parentLevelName}, + #{sumNumber}, + #{sparedOne}, + #{sparedTwo}, + #{processName}, + #{inventoryStatus}, + #{superiorId}, + #{remarks}, + #{completionDate}, + #{departmentName}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update yc_bom_number_two_preliminary_inquiry + + create_time = #{createTime}, + production_code = #{productionCode}, + figure_number = #{figureNumber}, + name = #{name}, + one_number = #{oneNumber}, + type = #{type}, + piece_weight = #{pieceWeight}, + parent_level_figure_number = #{parentLevelFigureNumber}, + parent_level_name = #{parentLevelName}, + sum_number = #{sumNumber}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + process_name = #{processName}, + inventory_status = #{inventoryStatus}, + superior_id = #{superiorId}, + remarks = #{remarks}, + completion_date = #{completionDate}, + department_name = #{departmentName}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from yc_bom_number_two_preliminary_inquiry where id = #{id} + + + + delete from yc_bom_number_two_preliminary_inquiry where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/management/YcProductMapper.xml b/evo/src/main/resources/mybatis/management/YcProductMapper.xml new file mode 100644 index 0000000..e0448bf --- /dev/null +++ b/evo/src/main/resources/mybatis/management/YcProductMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + select id, create_time, product_type, number, spared_one, spared_two, spared_three, spared_four, del_flag from yc_product + + + + + + + + insert into yc_product + + create_time, + product_type, + number, + spared_one, + spared_two, + spared_three, + spared_four, + del_flag, + + + #{createTime}, + #{productType}, + #{number}, + #{sparedOne}, + #{sparedTwo}, + #{sparedThree}, + #{sparedFour}, + #{delFlag}, + + + + + update yc_product + + create_time = #{createTime}, + product_type = #{productType}, + number = #{number}, + spared_one = #{sparedOne}, + spared_two = #{sparedTwo}, + spared_three = #{sparedThree}, + spared_four = #{sparedFour}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from yc_product where id = #{id} + + + + delete from yc_product where id in + + #{id} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/monitor/SysLogininforMapper.xml b/evo/src/main/resources/mybatis/monitor/SysLogininforMapper.xml new file mode 100644 index 0000000..eace3f6 --- /dev/null +++ b/evo/src/main/resources/mybatis/monitor/SysLogininforMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) + values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) + + + + + + delete from sys_logininfor where info_id in + + #{infoId} + + + + + truncate table sys_logininfor + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/monitor/SysOperLogMapper.xml b/evo/src/main/resources/mybatis/monitor/SysOperLogMapper.xml new file mode 100644 index 0000000..53cb94f --- /dev/null +++ b/evo/src/main/resources/mybatis/monitor/SysOperLogMapper.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time + from sys_oper_log + + + + insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time) + values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) + + + + + + delete from sys_oper_log where oper_id in + + #{operId} + + + + + + + truncate table sys_oper_log + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/mybatis-config.xml b/evo/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 0000000..e8b52be --- /dev/null +++ b/evo/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/evo/src/main/resources/mybatis/product/ProdHandlingMethodMapper.xml b/evo/src/main/resources/mybatis/product/ProdHandlingMethodMapper.xml new file mode 100644 index 0000000..1d3d57c --- /dev/null +++ b/evo/src/main/resources/mybatis/product/ProdHandlingMethodMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + select id, code, name, remark, del_flag, create_by, create_time, update_by, update_time from prod_handling_method + + + + + + + + insert into prod_handling_method + + code, + name, + remark, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{code}, + #{name}, + #{remark}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update prod_handling_method + + code = #{code}, + name = #{name}, + remark = #{remark}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + diff --git a/evo/src/main/resources/mybatis/product/ProdMaterialCategoryMapper.xml b/evo/src/main/resources/mybatis/product/ProdMaterialCategoryMapper.xml new file mode 100644 index 0000000..e9d3ed3 --- /dev/null +++ b/evo/src/main/resources/mybatis/product/ProdMaterialCategoryMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + select id, code, name, remark, del_flag, create_by, create_time, update_by, update_time from prod_material_category + + + + + + + + insert into prod_material_category + + code, + name, + remark, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{code}, + #{name}, + #{remark}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update prod_material_category + + code = #{code}, + name = #{name}, + remark = #{remark}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + insert into prod_material_category(code,name,del_flag) + VALUES + + (#{item.code}, + #{item.name}, + #{item.delFlag}) + + + + + + diff --git a/evo/src/main/resources/mybatis/product/ProdMaterialMapper.xml b/evo/src/main/resources/mybatis/product/ProdMaterialMapper.xml new file mode 100644 index 0000000..b735405 --- /dev/null +++ b/evo/src/main/resources/mybatis/product/ProdMaterialMapper.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, code, name, type, flag,specifications, brand, materials, attribute, remark, del_flag, create_by, create_time, update_by, update_time from prod_material + + + + + + + + insert into prod_material + + code, + name, + type, + specifications, + brand, + materials, + attribute, + remark, + flag, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{code}, + #{name}, + #{type}, + #{specifications}, + #{brand}, + #{materials}, + #{attribute}, + #{remark}, + #{flag}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update prod_material + + code = #{code}, + name = #{name}, + type = #{type}, + specifications = #{specifications}, + brand = #{brand}, + materials = #{materials}, + attribute = #{attribute}, + remark = #{remark}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + + + + + + + + + insert into prod_material(code, name, type, specifications, brand, materials, attribute, remark, del_flag, create_time) + VALUES + + (#{item.code},#{item.name},#{item.type},#{item.specifications},#{item.brand},#{item.materials},#{item.attribute},#{item.remark},#{item.delFlag},#{item.createTime}) + + + diff --git a/evo/src/main/resources/mybatis/product/ProdMaterialMaterialsMapper.xml b/evo/src/main/resources/mybatis/product/ProdMaterialMaterialsMapper.xml new file mode 100644 index 0000000..b258fe4 --- /dev/null +++ b/evo/src/main/resources/mybatis/product/ProdMaterialMaterialsMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + select id, code, name, remark, del_flag, create_by, create_time, update_by, update_time from prod_material_materials + + + + + + + + insert into prod_material_materials + + code, + name, + remark, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{code}, + #{name}, + #{remark}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update prod_material_materials + + code = #{code}, + name = #{name}, + remark = #{remark}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + insert into prod_material_materials(code,name,del_flag) + VALUES + + (#{item.code}, + #{item.name}, + #{item.delFlag}) + + + + + diff --git a/evo/src/main/resources/mybatis/product/ProdMaterialTypeMapper.xml b/evo/src/main/resources/mybatis/product/ProdMaterialTypeMapper.xml new file mode 100644 index 0000000..2554d4a --- /dev/null +++ b/evo/src/main/resources/mybatis/product/ProdMaterialTypeMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + select id,category_id, code, name, remark, del_flag, create_by, create_time, update_by, update_time from prod_material_type + + + + + + + + insert into prod_material_type + + category_id, + code, + name, + remark, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{categoryId}, + #{code}, + #{name}, + #{remark}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update prod_material_type + + category_id = #{categoryId}, + code = #{code}, + name = #{name}, + remark = #{remark}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + insert into prod_material_type(category_id,code,name,del_flag) + VALUES + + (#{item.categoryId},#{item.code},#{item.name},#{item.delFlag}) + + + + diff --git a/evo/src/main/resources/mybatis/product/ProdNumberMapper.xml b/evo/src/main/resources/mybatis/product/ProdNumberMapper.xml new file mode 100644 index 0000000..9d2b3ec --- /dev/null +++ b/evo/src/main/resources/mybatis/product/ProdNumberMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + select id, code, len, width, remark, del_flag, create_by, create_time, update_by, update_time from prod_number + + + + + + + + insert into prod_number + + code, + len, + width, + remark, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{code}, + #{len}, + #{width}, + #{remark}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update prod_number + + code = #{code}, + len = #{len}, + width = #{width}, + remark = #{remark}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + insert into prod_number(code,len,width,del_flag) + VALUES + + (#{item.code},#{item.len}, + #{item.width}, + #{item.delFlag}) + + + + diff --git a/evo/src/main/resources/mybatis/system/SysConfigMapper.xml b/evo/src/main/resources/mybatis/system/SysConfigMapper.xml new file mode 100644 index 0000000..30ae39f --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysConfigMapper.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark + from sys_config + + + + + + + and config_id = #{configId} + + + and config_key = #{configKey} + + + + + + + + + + + + insert into sys_config ( + config_name, + config_key, + config_value, + config_type, + create_by, + remark, + create_time + )values( + #{configName}, + #{configKey}, + #{configValue}, + #{configType}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_config + + config_name = #{configName}, + config_key = #{configKey}, + config_value = #{configValue}, + config_type = #{configType}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where config_id = #{configId} + + + + delete from sys_config where config_id = #{configId} + + + + delete from sys_config where config_id in + + #{configId} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysDeptMapper.xml b/evo/src/main/resources/mybatis/system/SysDeptMapper.xml new file mode 100644 index 0000000..ac52729 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysDeptMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select d.dept_id, + d.parent_id, + d.ancestors, + d.dept_name, + d.order_num, + d.leader, + d.phone, + d.email, + d.status, + d.tag, + d.del_flag, + d.create_by, + d.create_time, + d.dep_attributes + from sys_dept d + + + + + + + + + + + + + + + + + + + + insert into sys_dept( + dept_id, + parent_id, + dept_name, + ancestors, + order_num, + leader, + phone, + email, + status, + tag, + dep_attributes, + create_by, + create_time + )values( + #{deptId}, + #{parentId}, + #{deptName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{tag}, + #{depAttributes}, + #{createBy}, + sysdate() + ) + + + + update sys_dept + + parent_id = #{parentId}, + dept_name = #{deptName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + tag = #{tag}, + dep_attributes = #{depAttributes}, + update_by = #{updateBy}, + update_time = sysdate() + + where dept_id = #{deptId} + + + + update sys_dept set ancestors = + + when #{item.deptId} then #{item.ancestors} + + where dept_id in + + #{item.deptId} + + + + + update sys_dept + + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where dept_id in (${ancestors}) + + + + update sys_dept set del_flag = '2' where dept_id = #{deptId} + + + + + + + diff --git a/evo/src/main/resources/mybatis/system/SysDictDataMapper.xml b/evo/src/main/resources/mybatis/system/SysDictDataMapper.xml new file mode 100644 index 0000000..8221d6e --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysDictDataMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark + from sys_dict_data + + + + + + + + + + + + + + delete from sys_dict_data where dict_code = #{dictCode} + + + + delete from sys_dict_data where dict_code in + + #{dictCode} + + + + + update sys_dict_data + + dict_sort = #{dictSort}, + dict_label = #{dictLabel}, + dict_value = #{dictValue}, + dict_type = #{dictType}, + css_class = #{cssClass}, + list_class = #{listClass}, + is_default = #{isDefault}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_code = #{dictCode} + + + + update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} + + + + insert into sys_dict_data( + dict_sort, + dict_label, + dict_value, + dict_type, + css_class, + list_class, + is_default, + status, + remark, + create_by, + create_time + )values( + #{dictSort}, + #{dictLabel}, + #{dictValue}, + #{dictType}, + #{cssClass}, + #{listClass}, + #{isDefault}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysDictTypeMapper.xml b/evo/src/main/resources/mybatis/system/SysDictTypeMapper.xml new file mode 100644 index 0000000..3b6c5c6 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysDictTypeMapper.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + select dict_id, dict_name, dict_type, status, create_by, create_time, remark + from sys_dict_type + + + + + + + + + + + + + + delete from sys_dict_type where dict_id = #{dictId} + + + + delete from sys_dict_type where dict_id in + + #{dictId} + + + + + update sys_dict_type + + dict_name = #{dictName}, + dict_type = #{dictType}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_id = #{dictId} + + + + insert into sys_dict_type( + dict_name, + dict_type, + status, + remark, + create_by, + create_time + )values( + #{dictName}, + #{dictType}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysJobLogMapper.xml b/evo/src/main/resources/mybatis/system/SysJobLogMapper.xml new file mode 100644 index 0000000..bf81575 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysJobLogMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time + from sys_job_log + + + + + + + + + + delete from sys_job_log where job_log_id = #{jobLogId} + + + + delete from sys_job_log where job_log_id in + + #{jobLogId} + + + + + truncate table sys_job_log + + + + insert into sys_job_log( + job_log_id, + job_name, + job_group, + invoke_target, + job_message, + status, + exception_info, + create_time + )values( + #{jobLogId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{jobMessage}, + #{status}, + #{exceptionInfo}, + sysdate() + ) + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysJobMapper.xml b/evo/src/main/resources/mybatis/system/SysJobMapper.xml new file mode 100644 index 0000000..47f61c9 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysJobMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark + from sys_job + + + + + + + + + + delete from sys_job where job_id = #{jobId} + + + + delete from sys_job where job_id in + + #{jobId} + + + + + update sys_job + + job_name = #{jobName}, + job_group = #{jobGroup}, + invoke_target = #{invokeTarget}, + cron_expression = #{cronExpression}, + misfire_policy = #{misfirePolicy}, + concurrent = #{concurrent}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where job_id = #{jobId} + + + + insert into sys_job( + job_id, + job_name, + job_group, + invoke_target, + cron_expression, + misfire_policy, + concurrent, + status, + remark, + create_by, + create_time + )values( + #{jobId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{cronExpression}, + #{misfirePolicy}, + #{concurrent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysMenuMapper.xml b/evo/src/main/resources/mybatis/system/SysMenuMapper.xml new file mode 100644 index 0000000..8bdb816 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysMenuMapper.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select menu_id, menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time + from sys_menu + + + + + + + + + + + + + + + + + + + + + + + + update sys_menu + + menu_name = #{menuName}, + parent_id = #{parentId}, + order_num = #{orderNum}, + path = #{path}, + component = #{component}, + is_frame = #{isFrame}, + menu_type = #{menuType}, + visible = #{visible}, + status = #{status}, + perms = #{perms}, + icon = #{icon}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where menu_id = #{menuId} + + + + insert into sys_menu( + menu_id, + parent_id, + menu_name, + order_num, + path, + component, + is_frame, + menu_type, + visible, + status, + perms, + icon, + remark, + create_by, + create_time + )values( + #{menuId}, + #{parentId}, + #{menuName}, + #{orderNum}, + #{path}, + #{component}, + #{isFrame}, + #{menuType}, + #{visible}, + #{status}, + #{perms}, + #{icon}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + delete from sys_menu where menu_id = #{menuId} + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysNoticeMapper.xml b/evo/src/main/resources/mybatis/system/SysNoticeMapper.xml new file mode 100644 index 0000000..a0c9b20 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysNoticeMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark + from sys_notice + + + + + + + + insert into sys_notice ( + notice_title, + notice_type, + notice_content, + status, + remark, + create_by, + create_time + )values( + #{noticeTitle}, + #{noticeType}, + #{noticeContent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update sys_notice + + notice_title = #{noticeTitle}, + notice_type = #{noticeType}, + notice_content = #{noticeContent}, + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where notice_id = #{noticeId} + + + + delete from sys_notice where notice_id = #{noticeId} + + + + delete from sys_notice where notice_id in + + #{noticeId} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysPostMapper.xml b/evo/src/main/resources/mybatis/system/SysPostMapper.xml new file mode 100644 index 0000000..ffad7ef --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysPostMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + select post_id, post_code,dept_id, post_name, post_sort, status, create_by, create_time, remark + from sys_post + + + + + + + + + + + + + + + + + + update sys_post + + post_code = #{postCode}, + post_name = #{postName}, + post_sort = #{postSort}, + status = #{status}, + remark = #{remark}, + dept_id = #{deptId}, + update_by = #{updateBy}, + update_time = sysdate() + + where post_id = #{postId} + + + + insert into sys_post( + post_id, + post_code, + post_name, + post_sort, + status, + remark, + create_by, + dept_id, + create_time + )values( + #{postId}, + #{postCode}, + #{postName}, + #{postSort}, + #{status}, + #{remark}, + #{createBy}, + #{deptId}, + sysdate() + ) + + + + delete from sys_post where post_id = #{postId} + + + + delete from sys_post where post_id in + + #{postId} + + + + + + diff --git a/evo/src/main/resources/mybatis/system/SysRoleDeptMapper.xml b/evo/src/main/resources/mybatis/system/SysRoleDeptMapper.xml new file mode 100644 index 0000000..23d2cb5 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysRoleDeptMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + delete from sys_role_dept where role_id=#{roleId} + + + + + + delete from sys_role_dept where role_id in + + #{roleId} + + + + + insert into sys_role_dept(role_id, dept_id) values + + (#{item.roleId},#{item.deptId}) + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysRoleMapper.xml b/evo/src/main/resources/mybatis/system/SysRoleMapper.xml new file mode 100644 index 0000000..e396eac --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysRoleMapper.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, + r.status, r.del_flag, r.create_time, r.remark + from sys_role r + left join sys_user_role ur on ur.role_id = r.role_id + left join sys_user u on u.user_id = ur.user_id + left join sys_dept d on u.dept_id = d.dept_id + + + + + + + + + + + + + + + + + + + + insert into sys_role( + role_id, + role_name, + role_key, + role_sort, + data_scope, + status, + remark, + create_by, + create_time + )values( + #{roleId}, + #{roleName}, + #{roleKey}, + #{roleSort}, + #{dataScope}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update sys_role + + role_name = #{roleName}, + role_key = #{roleKey}, + role_sort = #{roleSort}, + data_scope = #{dataScope}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where role_id = #{roleId} + + + + update sys_user set status = #{status} where user_id = #{userId} + + + + delete from sys_role where role_id = #{roleId} + + + + update sys_role set del_flag = '2' where role_id in + + #{roleId} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysRoleMenuMapper.xml b/evo/src/main/resources/mybatis/system/SysRoleMenuMapper.xml new file mode 100644 index 0000000..0e2e3d8 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysRoleMenuMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + delete from sys_role_menu where role_id=#{roleId} + + + + insert into sys_role_menu(role_id, menu_id) values + + (#{item.roleId},#{item.menuId}) + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysUserMapper.xml b/evo/src/main/resources/mybatis/system/SysUserMapper.xml new file mode 100644 index 0000000..deb133d --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysUserMapper.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select u.user_id, + u.dept_id, + u.user_name, + u.nick_name, + u.email, + u.avatar, + u.phonenumber, + u.password, + u.vip_level, + u.sex, + u.status, + u.del_flag, + u.login_ip, + u.login_date, + u.create_by, + u.create_time, + u.remark, + u.operator_type, + d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, + r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status + from sys_user u + left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role ur on u.user_id = ur.user_id + left join sys_role r on r.role_id = ur.role_id + + + + + + + + + + + + + + + + insert into sys_user( + user_id, + dept_id, + user_name, + nick_name, + email, + avatar, + phonenumber, + sex, + password, + vip_level, + status, + create_by, + remark, + operator_type, + create_time + )values( + #{userId}, + #{deptId}, + #{userName}, + #{nickName}, + #{email}, + #{avatar}, + #{phonenumber}, + #{sex}, + #{password}, + #{vipLevel}, + #{status}, + #{createBy}, + #{remark}, + #{operatorType}, + sysdate() + ) + + + + update sys_user + + dept_id = #{deptId}, + user_name = #{userName}, + nick_name = #{nickName}, + email = #{email}, + phonenumber = #{phonenumber}, + sex = #{sex}, + avatar = #{avatar}, + password = #{password}, + vip_level = #{vipLevel}, + status = #{status}, + login_ip = #{loginIp}, + login_date = #{loginDate}, + update_by = #{updateBy}, + remark = #{remark}, + operator_type = #{operatorType}, + update_time = sysdate() + + where user_id = #{userId} + + + + update sys_user set status = #{status} where user_id = #{userId} + + + + update sys_user set avatar = #{avatar} where user_name = #{userName} + + + + update sys_user set password = #{password} where user_name = #{userName} + + + + delete from sys_user where user_id = #{userId} + + + + update sys_user set del_flag = '2' where user_id in + + #{userId} + + + + + + diff --git a/evo/src/main/resources/mybatis/system/SysUserPostMapper.xml b/evo/src/main/resources/mybatis/system/SysUserPostMapper.xml new file mode 100644 index 0000000..d048078 --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysUserPostMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + delete from sys_user_post where user_id=#{userId} + + + + + + delete from sys_user_post where user_id in + + #{userId} + + + + + insert into sys_user_post(user_id, post_id) values + + (#{item.userId},#{item.postId}) + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/system/SysUserRoleMapper.xml b/evo/src/main/resources/mybatis/system/SysUserRoleMapper.xml new file mode 100644 index 0000000..d7324eb --- /dev/null +++ b/evo/src/main/resources/mybatis/system/SysUserRoleMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + delete from sys_user_role where user_id=#{userId} + + + + + + delete from sys_user_role where user_id in + + #{userId} + + + + + insert into sys_user_role(user_id, role_id) values + + (#{item.userId},#{item.roleId}) + + + + + delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} + + + + delete from sys_user_role where role_id=#{roleId} and user_id in + + #{userId} + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/tool/GenTableColumnMapper.xml b/evo/src/main/resources/mybatis/tool/GenTableColumnMapper.xml new file mode 100644 index 0000000..77d9e7d --- /dev/null +++ b/evo/src/main/resources/mybatis/tool/GenTableColumnMapper.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + + + + + + insert into gen_table_column ( + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) + + + + update gen_table_column + + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, + update_time = sysdate() + + where column_id = #{columnId} + + + + delete from gen_table_column where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/tool/GenTableMapper.xml b/evo/src/main/resources/mybatis/tool/GenTableMapper.xml new file mode 100644 index 0000000..16d9e75 --- /dev/null +++ b/evo/src/main/resources/mybatis/tool/GenTableMapper.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, options, create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + insert into gen_table ( + table_name, + table_comment, + class_name, + tpl_category, + package_name, + module_name, + business_name, + function_name, + function_author, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update gen_table + + table_name = #{tableName}, + table_comment = #{tableComment}, + class_name = #{className}, + function_author = #{functionAuthor}, + tpl_category = #{tplCategory}, + package_name = #{packageName}, + module_name = #{moduleName}, + business_name = #{businessName}, + function_name = #{functionName}, + options = #{options}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where table_id = #{tableId} + + + + delete from gen_table where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/evo/src/main/resources/mybatis/tool/ImportMapper.xml b/evo/src/main/resources/mybatis/tool/ImportMapper.xml new file mode 100644 index 0000000..80470ae --- /dev/null +++ b/evo/src/main/resources/mybatis/tool/ImportMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + insert into base_data + + figure_number, + name, + materials, + weight, + unit, + shuxing, + cunhuo, + kucun, + zuidikucun, + zuigaokucun, + weishuidanjia, + remark, + xiaoji, + price, + + + #{figureNumber}, + #{name}, + #{materials}, + #{weight}, + #{unit}, + #{shuxing}, + #{cunhuo}, + #{kucun}, + #{zuidikucun}, + #{zuigaokucun}, + #{weishuidanjia}, + #{remark}, + #{xiaoji}, + #{price}, + + + + + update base_data + + figure_number = #{figureNumber}, + name = #{name}, + materials = #{materials}, + weight = #{weight}, + unit = #{unit}, + shuxing = #{shuxing}, + cunhuo = #{cunhuo}, + kucun = #{kucun}, + zuidikucun = #{zuidikucun}, + zuigaokucun = #{zuigaokucun}, + weishuidanjia = #{weishuidanjia}, + remark = #{remark}, + xiaoji = #{xiaoji}, + price = #{price}, + + where id = #{id} + + + diff --git a/evo/src/main/resources/vm/java/controller.java.vm b/evo/src/main/resources/vm/java/controller.java.vm new file mode 100644 index 0000000..3cd1be1 --- /dev/null +++ b/evo/src/main/resources/vm/java/controller.java.vm @@ -0,0 +1,114 @@ +package ${packageName}.controller; + +import java.util.List; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +#if($table.crud) +import com.ruoyi.framework.web.page.TableDataInfo; +#elseif($table.tree) +#end + +/** + * ${functionName}Controller + * + * @author ${author} + * @date ${datetime} + */ +@RestController +@RequestMapping("/${moduleName}/${businessName}") +public class ${ClassName}Controller extends BaseController +{ + @Autowired + private I${ClassName}Service ${className}Service; + + /** + * 查询${functionName}列表 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") + @GetMapping("/list") +#if($table.crud) + public TableDataInfo list(${ClassName} ${className}) + { + startPage(); + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return getDataTable(list); + } +#elseif($table.tree) + public AjaxResult list(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return AjaxResult.success(list); + } +#end + + /** + * 导出${functionName}列表 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") + @Log(title = "${functionName}", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); + return util.exportExcel(list, "${businessName}"); + } + + /** + * 获取${functionName}详细信息 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") + @GetMapping(value = "/{${pkColumn.javaField}}") + public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) + { + return AjaxResult.success(${className}Service.select${ClassName}ById(${pkColumn.javaField})); + } + + /** + * 新增${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") + @Log(title = "${functionName}", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ${ClassName} ${className}) + { + return toAjax(${className}Service.insert${ClassName}(${className})); + } + + /** + * 修改${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") + @Log(title = "${functionName}", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ${ClassName} ${className}) + { + return toAjax(${className}Service.update${ClassName}(${className})); + } + + /** + * 删除${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @DeleteMapping("/{${pkColumn.javaField}s}") + public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) + { + return toAjax(${className}Service.delete${ClassName}ByIds(${pkColumn.javaField}s)); + } +} diff --git a/evo/src/main/resources/vm/java/domain.java.vm b/evo/src/main/resources/vm/java/domain.java.vm new file mode 100644 index 0000000..81c3eb7 --- /dev/null +++ b/evo/src/main/resources/vm/java/domain.java.vm @@ -0,0 +1,85 @@ +package ${packageName}.domain; + +#foreach ($import in $importList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +#if($table.crud) +import com.ruoyi.framework.web.domain.BaseEntity; +#elseif($table.tree) +import com.ruoyi.framework.web.domain.TreeEntity; +#end + +/** + * ${functionName}对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($table.crud) +#set($Entity="BaseEntity") +#elseif($table.tree) +#set($Entity="TreeEntity") +#end +public class ${ClassName} extends ${Entity} +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end + .toString(); + } +} diff --git a/evo/src/main/resources/vm/java/mapper.java.vm b/evo/src/main/resources/vm/java/mapper.java.vm new file mode 100644 index 0000000..172eb59 --- /dev/null +++ b/evo/src/main/resources/vm/java/mapper.java.vm @@ -0,0 +1,61 @@ +package ${packageName}.mapper; + +import java.util.List; +import ${packageName}.domain.${ClassName}; + +/** + * ${functionName}Mapper接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface ${ClassName}Mapper +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return ${functionName} + */ + public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 删除${functionName} + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return 结果 + */ + public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的数据ID + * @return 结果 + */ + public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s); +} diff --git a/evo/src/main/resources/vm/java/service.java.vm b/evo/src/main/resources/vm/java/service.java.vm new file mode 100644 index 0000000..1217d53 --- /dev/null +++ b/evo/src/main/resources/vm/java/service.java.vm @@ -0,0 +1,61 @@ +package ${packageName}.service; + +import java.util.List; +import ${packageName}.domain.${ClassName}; + +/** + * ${functionName}Service接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface I${ClassName}Service +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return ${functionName} + */ + public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}ID + * @return 结果 + */ + public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s); + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return 结果 + */ + public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}); +} diff --git a/evo/src/main/resources/vm/java/serviceImpl.java.vm b/evo/src/main/resources/vm/java/serviceImpl.java.vm new file mode 100644 index 0000000..9f8c53f --- /dev/null +++ b/evo/src/main/resources/vm/java/serviceImpl.java.vm @@ -0,0 +1,109 @@ +package ${packageName}.service.impl; + +import java.util.List; +#foreach ($column in $columns) +#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') +import com.ruoyi.common.utils.DateUtils; +#break +#end +#end +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import ${packageName}.mapper.${ClassName}Mapper; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; + +/** + * ${functionName}Service业务层处理 + * + * @author ${author} + * @date ${datetime} + */ +@Service +public class ${ClassName}ServiceImpl implements I${ClassName}Service +{ + @Autowired + private ${ClassName}Mapper ${className}Mapper; + + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return ${functionName} + */ + @Override + public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) + { + return ${className}Mapper.select${ClassName}ById(${pkColumn.javaField}); + } + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName} + */ + @Override + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) + { + return ${className}Mapper.select${ClassName}List(${className}); + } + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + @Override + public int insert${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'createTime') + ${className}.setCreateTime(DateUtils.getNowDate()); +#end +#end + return ${className}Mapper.insert${ClassName}(${className}); + } + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + @Override + public int update${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'updateTime') + ${className}.setUpdateTime(DateUtils.getNowDate()); +#end +#end + return ${className}Mapper.update${ClassName}(${className}); + } + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}ID + * @return 结果 + */ + @Override + public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s) + { + return ${className}Mapper.delete${ClassName}ByIds(${pkColumn.javaField}s); + } + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return 结果 + */ + @Override + public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) + { + return ${className}Mapper.delete${ClassName}ById(${pkColumn.javaField}); + } +} diff --git a/evo/src/main/resources/vm/js/api.js.vm b/evo/src/main/resources/vm/js/api.js.vm new file mode 100644 index 0000000..296d41a --- /dev/null +++ b/evo/src/main/resources/vm/js/api.js.vm @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询${functionName}列表 +export function list${BusinessName}(query) { + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }) +} + +// 查询${functionName}详细 +export function get${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }) +} + +// 新增${functionName} +export function add${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }) +} + +// 修改${functionName} +export function update${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }) +} + +// 删除${functionName} +export function del${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }) +} + +// 导出${functionName} +export function export${BusinessName}(query) { + return request({ + url: '/${moduleName}/${businessName}/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/evo/src/main/resources/vm/sql/sql.vm b/evo/src/main/resources/vm/sql/sql.vm new file mode 100644 index 0000000..5ceea08 --- /dev/null +++ b/evo/src/main/resources/vm/sql/sql.vm @@ -0,0 +1,22 @@ +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}', '3', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '${functionName}菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}查询', @parentId, '1', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}新增', @parentId, '2', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}修改', @parentId, '3', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}删除', @parentId, '4', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}导出', @parentId, '5', '#', '', 1, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', ''); \ No newline at end of file diff --git a/evo/src/main/resources/vm/vue/index-tree.vue.vm b/evo/src/main/resources/vm/vue/index-tree.vue.vm new file mode 100644 index 0000000..6201fdb --- /dev/null +++ b/evo/src/main/resources/vm/vue/index-tree.vue.vm @@ -0,0 +1,407 @@ + + + \ No newline at end of file diff --git a/evo/src/main/resources/vm/vue/index.vue.vm b/evo/src/main/resources/vm/vue/index.vue.vm new file mode 100644 index 0000000..273135f --- /dev/null +++ b/evo/src/main/resources/vm/vue/index.vue.vm @@ -0,0 +1,438 @@ + + + \ No newline at end of file diff --git a/evo/src/main/resources/vm/xml/mapper.xml.vm b/evo/src/main/resources/vm/xml/mapper.xml.vm new file mode 100644 index 0000000..f2d7b4b --- /dev/null +++ b/evo/src/main/resources/vm/xml/mapper.xml.vm @@ -0,0 +1,95 @@ + + + + + +#foreach ($column in $columns) + +#end + + + + select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end from ${tableName} + + + + + + + + insert into ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + $column.columnName, +#end +#end + + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + #{$column.javaField}, +#end +#end + + + + + update ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName) + $column.columnName = #{$column.javaField}, +#end +#end + + where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} in + + #{${pkColumn.javaField}} + + + + \ No newline at end of file diff --git a/evo/src/main/webapp/lib/Spire.Xls.jar b/evo/src/main/webapp/lib/Spire.Xls.jar new file mode 100644 index 0000000..4d68580 Binary files /dev/null and b/evo/src/main/webapp/lib/Spire.Xls.jar differ diff --git a/evo/src/main/webapp/lib/gson-2.8.0.jar b/evo/src/main/webapp/lib/gson-2.8.0.jar new file mode 100644 index 0000000..1235f63 Binary files /dev/null and b/evo/src/main/webapp/lib/gson-2.8.0.jar differ diff --git a/evo/src/main/webapp/lib/jacob-1.18.jar.jar b/evo/src/main/webapp/lib/jacob-1.18.jar.jar new file mode 100644 index 0000000..d2ab201 Binary files /dev/null and b/evo/src/main/webapp/lib/jacob-1.18.jar.jar differ diff --git a/evo/src/main/webapp/lib/k3cloud-webapi-sdk8.0.6.jar b/evo/src/main/webapp/lib/k3cloud-webapi-sdk8.0.6.jar new file mode 100644 index 0000000..d1677b5 Binary files /dev/null and b/evo/src/main/webapp/lib/k3cloud-webapi-sdk8.0.6.jar differ